/* Tianzhi Project Flip Pages · mobile-first */
:root {
  --tz-bg: #f5efe4;
  --tz-paper: #fffdf6;
  --tz-paper-soft: #fff8ea;
  --tz-ink: #241b12;
  --tz-text: #4f463d;
  --tz-muted: #74695d;
  --tz-green: #2e6b47;
  --tz-green-deep: #123f2a;
  --tz-gold: #c79a45;
  --tz-gold-soft: #f5e1aa;
  --tz-line: rgba(78, 56, 32, .15);
  --tz-shadow: 0 18px 44px rgba(59, 43, 24, .12);
  --tz-radius: 24px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.tz-flip-body {
  margin: 0;
  min-height: 100svh;
  color: var(--tz-ink);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(199, 154, 69, .15), transparent 28rem),
    linear-gradient(180deg, #fffaf1 0%, var(--tz-bg) 50%, #f0e7db 100%);
  font-family: ui-serif, "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

a { color: inherit; text-decoration: none; }

.flip-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  border-bottom: 1px solid rgba(78, 56, 32, .10);
  background: rgba(255, 250, 240, .94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.flip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--tz-line);
  border-radius: 999px;
  background: rgba(255, 253, 246, .78);
  color: var(--tz-ink);
  font: inherit;
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
}

.flip-center-title {
  min-width: 0;
  text-align: center;
  font-weight: 900;
  font-size: 16px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flip-reader {
  position: fixed;
  inset: calc(58px + env(safe-area-inset-top)) 0 calc(64px + env(safe-area-inset-bottom)) 0;
  display: grid;
  place-items: center;
  padding: 14px 14px 12px;
}

.flip-page {
  display: none;
  width: min(920px, 100%);
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 22px 112px;
  border: 1px solid var(--tz-line);
  border-radius: 26px;
  background:
    radial-gradient(circle at 92% 5%, rgba(199, 154, 69, .12), transparent 14rem),
    linear-gradient(145deg, rgba(255, 253, 246, .97), rgba(255, 248, 232, .82));
  box-shadow: var(--tz-shadow);
}

.flip-page.is-active {
  display: block;
  animation: pageIn .18s ease-out;
}

@keyframes pageIn {
  from { opacity: .25; transform: translateY(8px) scale(.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.flip-page--cover {
  color: #fffaf0;
  background:
    radial-gradient(circle at 88% 0%, rgba(199, 154, 69, .24), transparent 18rem),
    linear-gradient(145deg, #2e6b47, #123f2a 82%);
}

.flip-page--dark {
  color: #fffaf0;
  background:
    radial-gradient(circle at 88% 0%, rgba(199, 154, 69, .22), transparent 16rem),
    linear-gradient(145deg, #27315b, #14203d 82%);
}

.page-kicker {
  margin: 0 0 10px;
  color: var(--tz-green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.flip-page--cover .page-kicker,
.flip-page--dark .page-kicker {
  color: #f3d28a;
}

.page-title {
  margin: 0;
  font-size: clamp(30px, 8.2vw, 50px);
  line-height: 1.1;
  letter-spacing: -.07em;
}

.page-subtitle {
  margin: 12px 0 0;
  font-size: clamp(20px, 5.2vw, 30px);
  line-height: 1.32;
  letter-spacing: -.04em;
}

.page-lead {
  margin: 16px 0 0;
  color: var(--tz-text);
  font-size: 18.5px;
  line-height: 1.92;
}

.flip-page--cover .page-lead,
.flip-page--dark .page-lead {
  color: rgba(255, 250, 240, .88);
}

.page-text {
  margin: 12px 0 0;
  color: var(--tz-text);
  font-size: 18px;
  line-height: 1.92;
}

.flip-page h3 {
  margin: 22px 0 8px;
  font-size: clamp(20px, 5.2vw, 28px);
  line-height: 1.3;
  letter-spacing: -.035em;
}

.cover-mark {
  display: inline-grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 4px 0 18px;
  border-radius: 24px;
  background: rgba(255, 250, 240, .14);
  color: #fffaf0;
  border: 1px solid rgba(255, 250, 240, .24);
  font-size: 28px;
  font-weight: 900;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.info-card {
  padding: 17px;
  border: 1px solid rgba(78, 56, 32, .13);
  border-radius: 20px;
  background: rgba(255, 253, 246, .78);
  box-shadow: 0 8px 22px rgba(59, 43, 24, .055);
}

.flip-page--cover .info-card,
.flip-page--dark .info-card {
  background: rgba(255, 250, 240, .10);
  border-color: rgba(255, 250, 240, .20);
}

.info-card .icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 15px;
  background: rgba(46, 107, 71, .09);
  font-size: 21px;
}

.flip-page--cover .info-card .icon,
.flip-page--dark .info-card .icon {
  background: rgba(255, 250, 240, .13);
}

.info-card h4 {
  margin: 0;
  color: var(--tz-green);
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -.03em;
}

.flip-page--cover .info-card h4,
.flip-page--dark .info-card h4 {
  color: #fffaf0;
}

.info-card p {
  margin: 8px 0 0;
  color: var(--tz-text);
  font-size: 17px;
  line-height: 1.82;
}

.flip-page--cover .info-card p,
.flip-page--dark .info-card p {
  color: rgba(255, 250, 240, .82);
}

.quote-block {
  margin-top: 18px;
  padding: 15px 16px;
  border-left: 5px solid var(--tz-green);
  border-radius: 16px;
  background: rgba(46, 107, 71, .07);
  color: var(--tz-ink);
  font-size: 17px;
  line-height: 1.85;
}

.flip-page--cover .quote-block,
.flip-page--dark .quote-block {
  border-left-color: #f3d28a;
  background: rgba(255, 250, 240, .12);
  color: #fffaf0;
}

.flow {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.flow-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(46, 107, 71, .16);
  border-radius: 16px;
  background: rgba(255, 255, 255, .50);
  color: var(--tz-text);
  font-size: 17px;
  line-height: 1.58;
}

.flip-page--cover .flow-step,
.flip-page--dark .flow-step {
  color: rgba(255, 250, 240, .88);
  border-color: rgba(255, 250, 240, .16);
  background: rgba(255, 250, 240, .10);
}

.flow-num {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tz-green);
  color: #fffaf0;
  font-weight: 900;
}

.flip-page--cover .flow-num,
.flip-page--dark .flow-num {
  background: #f3d28a;
  color: #241b12;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid rgba(78, 56, 32, .14);
  border-radius: 18px;
  background: rgba(255, 255, 255, .52);
}

table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(78, 56, 32, .12);
  text-align: left;
  vertical-align: top;
  color: var(--tz-text);
  font-size: 16px;
  line-height: 1.68;
}

th {
  color: #fffaf0;
  background: var(--tz-green);
  font-weight: 900;
}

tr:last-child td { border-bottom: 0; }

.masked {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid rgba(199, 154, 69, .34);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 253, 246, .95), rgba(255, 248, 232, .78));
}

.masked-body {
  padding: 16px;
  filter: blur(2px);
  opacity: .56;
  user-select: none;
  pointer-events: none;
}

.masked-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 253, 246, .48), rgba(255, 248, 232, .76));
  text-align: center;
}

.mask-box {
  max-width: 340px;
  padding: 17px;
  border: 1px solid rgba(199, 154, 69, .38);
  border-radius: 18px;
  background: rgba(255, 253, 246, .94);
  box-shadow: 0 14px 34px rgba(59, 43, 24, .12);
}

.mask-box strong {
  display: block;
  color: var(--tz-green);
  font-size: 18px;
  margin-bottom: 7px;
}

.mask-box p {
  margin: 0;
  color: var(--tz-text);
  font-size: 15.5px;
  line-height: 1.72;
}

.data-pill {
  display: inline-block;
  min-width: 86px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(46, 107, 71, .10);
  color: var(--tz-green);
  font-weight: 900;
  white-space: nowrap;
}

.contact-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.contact-list span {
  display: block;
  padding: 13px;
  border: 1px solid rgba(255, 250, 240, .18);
  border-radius: 14px;
  background: rgba(255, 250, 240, .10);
  color: #fffaf0;
  font-weight: 900;
  font-size: 16px;
}

.flip-footer {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 80;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(78, 56, 32, .10);
  background: rgba(255, 250, 240, .94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.page-status {
  min-width: 0;
  text-align: center;
  color: var(--tz-muted);
  font-size: 14px;
  line-height: 1.35;
}

.page-status strong {
  display: block;
  color: var(--tz-ink);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flip-zone {
  position: fixed;
  top: calc(58px + env(safe-area-inset-top));
  bottom: calc(64px + env(safe-area-inset-bottom));
  z-index: 30;
  pointer-events: none;
}

.flip-zone--left { left: 0; width: 24%; }
.flip-zone--right { right: 0; width: 24%; }
.flip-zone--center { left: 24%; right: 24%; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  background: rgba(36, 27, 18, .35);
  padding: calc(70px + env(safe-area-inset-top)) 14px calc(76px + env(safe-area-inset-bottom));
}

.drawer.is-open {
  display: block;
}

.drawer-panel {
  width: min(760px, 100%);
  max-height: 100%;
  margin: 0 auto;
  overflow: auto;
  border: 1px solid var(--tz-line);
  border-radius: 24px;
  background: rgba(255, 253, 246, .96);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .18);
}

.drawer-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--tz-line);
  background: rgba(255, 253, 246, .96);
}

.drawer-title {
  margin: 0;
  font-size: 20px;
}

.drawer-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.drawer-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(78, 56, 32, .12);
  border-radius: 16px;
  background: rgba(255, 248, 232, .54);
}

.drawer-item strong {
  color: var(--tz-ink);
  font-size: 16px;
}

.drawer-item span {
  color: var(--tz-muted);
  font-size: 13px;
}

/* Layout refinement: keep every page visually organized as a readable card/report page */
.flip-page > .page-kicker,
.flip-page > .page-title,
.flip-page > .page-subtitle,
.flip-page > .page-lead,
.flip-page > .page-text,
.flip-page > h3,
.flip-page > .quote-block,
.flip-page > .card-grid,
.flip-page > .flow,
.flip-page > .table-wrap,
.flip-page > .masked,
.flip-page > .contact-list {
  width: min(100%, 760px);
  margin-left: auto;
  margin-right: auto;
}

.flip-page--cover > .cover-mark {
  margin-left: max(0px, calc((100% - 760px) / 2));
}

.flip-page--cover .page-title,
.flip-page--dark .page-title {
  max-width: 760px;
}

.flip-page .page-title + .page-subtitle,
.flip-page .page-title + .page-lead {
  margin-top: 12px;
}

.flip-page .page-lead + .card-grid,
.flip-page .page-text + .card-grid,
.flip-page .page-lead + .flow,
.flip-page .page-text + .flow {
  margin-top: 20px;
}

.flip-page .card-grid + .quote-block,
.flip-page .flow + .quote-block {
  margin-top: 20px;
}

.flip-page h3:first-of-type {
  margin-top: 20px;
}

.info-card {
  min-height: 0;
}

.info-card h4 {
  text-wrap: balance;
}

.page-title,
.page-subtitle,
.flip-page h3 {
  text-wrap: balance;
}

.flip-page .page-lead,
.flip-page .page-text,
.info-card p {
  text-align: left;
}

/* Compact pages still feel like a designed slide/report sheet */
.flip-page.is-active {
  overscroll-behavior: contain;
}



@media (min-width: 760px) {
  .flip-reader {
    padding: 22px 22px 16px;
  }

  .flip-page {
    padding: 40px 46px 116px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* Scroll fix: page content may exceed one screen; allow comfortable inner-page scrolling */
.flip-page {
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.flip-page::after {
  content: "";
  display: block;
  height: 72px;
}

.flip-reader {
  touch-action: pan-y;
}

/* On pages with more content, leave breathing room above the footer controls */
.card-grid,
.flow,
.table-wrap,
.masked {
  margin-bottom: 2px;
}

