/* HSK Mastery — xuan paper, pine-soot ink, an indigo seal.
   Sibling identity to VerticalChinese: same paper/ink palette,
   new accent (--azure deep blue) replacing cinnabar. */

:root {
  --paper:        #F4ECD8;
  --paper-raised: #FBF5E6;
  --paper-sunken: #E7DCC2;
  --ink:          #1F1B16;
  --ink-faded:    #6E6253;
  --ink-whisper:  #A89A82;
  --azure:        #A8322A;   /* accent = VC cinnabar (Carson: same scheme as Vertical Chinese) */
  --azure-2:      #CB5C49;   /* = VC cinnabar-2 */
  --azure-dark:   #7E241E;
  --cinnabar:     #A8322A;
  --accent:       #A8322A;   /* canonical name for the cinnabar accent; prefer over --azure */
  --accent-2:     #CB5C49;
  --accent-dark:  #7E241E;
  --hairline:     rgba(31, 27, 22, 0.12);
  --gold:         #B08A3E;

  /* Canonical HSK level palette — single source of truth for funnel, graph,
     dashboard, legends. Mirrored in assets/palette.js (keep in sync). */
  --hsk0: #6B7A5E;   /* sage ink — foundations */
  --hsk1: #4A7C2F;   /* deep green */
  --hsk2: #1D7A5F;   /* teal ink */
  --hsk3: #8A5A1A;   /* amber ink */
  --hsk4: #A8322A;   /* cinnabar */
  --hsk5: #5B3A8A;   /* violet ink */
  --hsk6: #1E5C99;   /* azure ink */

  /* Verdict colors — correct is ALWAYS green, wrong is ALWAYS cinnabar. */
  --correct:    #2E7D32;
  --correct-bg: rgba(46, 125, 50, 0.12);
  --wrong:      #A8322A;
  --wrong-bg:   rgba(168, 50, 42, 0.10);

  --serif-display: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --serif-body:    "Spectral", Georgia, "Times New Roman", serif;
  --han:           "Noto Serif SC", "Songti SC", serif;

  --maxw: 1100px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(30,92,153,0.05), transparent 60%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(176,138,62,0.06), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
img { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.eyebrow {
  font-family: var(--serif-body);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 12px;
  font-weight: 600;
  color: var(--azure);
}

/* ---------- seal logo ---------- */
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: var(--azure);
  color: var(--paper-raised);
  font-family: var(--han); font-weight: 700; font-size: 22px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 2px rgba(251,245,230,0.3), 0 2px 0 rgba(31,27,22,0.18);
  line-height: 1;
}

/* ---------- nav ---------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(244,236,216,0.82);
  border-bottom: 1px solid var(--hairline);
}
/* Mobile-first: brand + actions on the top row, reading-control strip below.
   Both live inside the sticky header, so the pinyin/script toggles stay
   reachable no matter how far down the page you scroll. */
.nav-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 56px; padding: 7px 0; }
.brand { flex: 1 1 auto; min-width: 0; order: 1; display: flex; align-items: center; gap: 9px;
  font-family: var(--serif-display); font-size: 19px; font-weight: 600;
  letter-spacing: 0.01em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand .seal { flex: none; }
.nav-actions { order: 2; margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-actions .nav-login { font-size: 14px; color: var(--ink-faded); background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav-actions .nav-login:hover { color: var(--ink); }
.nav-buy { padding: 8px 15px; font-size: 14px; }
.nav-buy-lg { display: none; }
.nav-buy-sm { display: inline; }
/* Reading controls: full-width slim strip on its own row (mobile) */
.reader-ctl { order: 3; flex: 1 0 100%; display: flex; gap: 8px; align-items: center;
  padding-top: 7px; border-top: 1px solid var(--hairline); }

/* App nav: toggles | page links | account, each group separated by a hairline */
.nav-links { order: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
.nav-link { font-size: 15px; color: var(--ink-faded); text-decoration: none; white-space: nowrap;
  padding: 4px 0; transition: color .15s ease; }
.nav-link:hover { color: var(--ink); }

@media (min-width: 760px) {
  .nav-inner { flex-wrap: nowrap; min-height: 68px; gap: 18px; }
  .brand { flex: none; font-size: 22px; gap: 12px; }
  .nav-links { flex-wrap: nowrap; gap: 8px 22px; }
  .nav-links .script-toggle { margin-right: 12px; }
  .nav-links .nav-account { margin-left: 6px; padding-left: 22px; border-left: 1px solid var(--hairline); }
  .reader-ctl { order: 2; flex: none; margin-left: auto; padding-top: 0; border-top: 0; }
  .nav-actions { order: 3; margin-left: 18px; }
  .nav-buy { padding: 8px 16px; }
  .nav-buy-lg { display: inline; }
  .nav-buy-sm { display: none; }
}
@media (max-width: 379px) {
  .nav-actions .nav-login { display: none; }
}

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif-body); font-size: 16px; font-weight: 600;
  padding: 12px 22px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, box-shadow .2s, background .2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--azure); color: #fff;
  box-shadow: 0 2px 0 var(--azure-dark), 0 6px 18px rgba(30,92,153,0.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--azure-dark), 0 10px 26px rgba(30,92,153,0.34); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--azure-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-lg { font-size: 18px; padding: 16px 30px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- hero ---------- */
.hero { padding: 22px 0 14px; }
.hero-inner { max-width: 780px; }
.hero h1 {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.hero h1 .hl { color: var(--azure); }
.hero .lede { font-size: 17px; color: var(--ink-faded); max-width: 42em; margin: 14px 0 0; line-height: 1.6; }
.hero-cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* ---------- demo exercise card ---------- */
.demo-wrap { margin: 56px 0 0; max-width: 680px; }
.demo-card {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(251,245,230,0.9) inset, 0 22px 50px -28px rgba(31,27,22,0.4);
  overflow: hidden;
}
.demo-top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--hairline);
  background: linear-gradient(var(--paper-raised), var(--paper-sunken));
}
.demo-top .badge {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-whisper); font-family: var(--serif-body);
}
.demo-top .topic {
  margin-left: auto; font-size: 12px; color: var(--azure); font-weight: 600;
  font-family: var(--serif-body);
}
.demo-body { padding: 28px 28px 24px; }
.demo-type { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--azure); font-weight: 600; margin-bottom: 14px; font-family: var(--serif-body); }
.demo-sentence {
  font-family: var(--han); font-size: clamp(22px, 3.5vw, 30px);
  color: var(--ink); line-height: 1.6; margin: 0 0 8px;
}
.demo-sentence .blank {
  display: inline-block; min-width: 2em; border-bottom: 2px solid var(--azure);
  vertical-align: bottom; text-align: center; color: var(--azure);
  font-weight: 700;
}
.demo-pinyin { font-family: var(--serif-display); font-style: italic;
  font-size: 16px; color: var(--ink-whisper); margin: 0 0 22px; }
.demo-choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.demo-choice {
  font-family: var(--han); font-size: 22px; padding: 10px 22px;
  background: var(--paper); border: 1.5px solid var(--hairline); border-radius: 10px;
  cursor: pointer; color: var(--ink); transition: all .15s; min-width: 64px; text-align: center;
}
.demo-choice:hover:not(:disabled) { border-color: var(--azure); color: var(--azure); }
.demo-choice.correct { background: var(--correct-bg); border-color: var(--correct); color: var(--correct); }
.demo-choice.wrong   { background: var(--wrong-bg); border-color: var(--wrong); color: var(--wrong); }
.demo-choice:disabled { cursor: default; }
.demo-result { display: none; padding: 16px; background: var(--paper-sunken); border-radius: 10px;
  border-left: 3px solid var(--correct); }
.demo-result.wrong { border-left-color: var(--wrong); }
.demo-result.show { display: block; }
.demo-result .res-verdict { font-family: var(--serif-body); font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--correct); margin-bottom: 6px; }
.demo-result.wrong .res-verdict { color: var(--wrong); }
.demo-result .res-pinyin { font-family: var(--serif-display); font-style: italic;
  font-size: 17px; color: var(--cinnabar); margin-bottom: 4px; }
.demo-result .res-exp { font-size: 15px; color: var(--ink-faded); line-height: 1.6; margin: 0; }
.demo-result .res-retry { margin-top: 12px; }
.demo-foot { padding: 12px 16px; border-top: 1px solid var(--hairline);
  background: var(--paper-sunken); font-size: 13px; color: var(--ink-faded);
  display: flex; align-items: center; gap: 10px; }
.xp-pip { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--azure); margin-right: 4px; }

/* ---------- generic section ---------- */
section { padding: 76px 0; }
.section-head { max-width: 38em; margin-bottom: 44px; }
.section-head h2 { font-family: var(--serif-display); font-weight: 600;
  font-size: clamp(34px, 4.4vw, 50px); line-height: 1.05; letter-spacing: -0.01em; margin: 10px 0 12px; }
.section-head p { font-size: 19px; color: var(--ink-faded); margin: 0; }

.rule { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* ---------- how it works steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
@media (max-width: 780px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 26px; border-top: 2px solid var(--ink); }
.step .no { font-family: var(--han); position: absolute; top: -0.1em; right: 0;
  font-size: 40px; color: var(--paper-sunken); }
.step .day { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--azure); font-weight: 600; }
.step h3 { font-family: var(--serif-display); font-size: 24px; font-weight: 600; margin: 6px 0 8px; }
.step p { font-size: 15.5px; color: var(--ink-faded); margin: 0; }
.mastery-rule {
  margin-top: 10px; padding: 10px 12px; background: rgba(30,92,153,0.07);
  border-radius: 7px; border-left: 2px solid var(--azure);
  font-size: 13px; color: var(--azure); line-height: 1.5;
}

/* ---------- feature grid ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--hairline); border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden; }
@media (max-width: 680px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--paper-raised); padding: 28px 26px; }
.feature .fhan { font-family: var(--han); font-size: 28px; color: var(--azure); }
.feature h3 { font-family: var(--serif-display); font-size: 22px; font-weight: 600; margin: 10px 0 7px; }
.feature p { font-size: 15px; color: var(--ink-faded); margin: 0; }

/* ---------- pricing ---------- */
.price-wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 50px; align-items: center; }
@media (max-width: 720px) { .price-wrap { grid-template-columns: 1fr; gap: 30px; } }
.price-card {
  background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 18px;
  padding: 38px 36px; box-shadow: 0 24px 60px -34px rgba(31,27,22,0.5);
  position: relative; overflow: hidden;
}
.price-card .stamp {
  position: absolute; top: 18px; right: 18px; transform: rotate(8deg);
  border: 2px solid var(--azure); color: var(--azure); border-radius: 8px;
  font-family: var(--han); font-size: 13px; letter-spacing: 0.1em; padding: 6px 8px; opacity: 0.85;
}
.price-card .label { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--azure); font-weight: 600; margin-bottom: 6px; }
.price-card .amount { font-family: var(--serif-display); font-size: 76px; font-weight: 600; line-height: 1; }
.price-card .amount sup { font-size: 30px; vertical-align: super; color: var(--ink-faded); }
.price-card .amount .was { font-size: 30px; font-weight: 400; color: var(--ink-whisper); text-decoration: line-through; margin-right: 12px; vertical-align: super; }
.price-card .cadence { color: var(--ink-faded); font-size: 15px; margin-bottom: 6px; }
.price-card .alt-price { color: var(--ink-whisper); font-size: 13px; margin-bottom: 22px; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 26px; }
.price-card li { padding: 9px 0 9px 28px; position: relative;
  border-bottom: 1px solid var(--hairline); font-size: 16px; }
.price-card li:last-child { border-bottom: 0; }
.price-card li::before { content: "掌"; font-family: var(--han); position: absolute; left: 0; top: 9px;
  color: var(--azure); font-size: 14px; }
.price-card .btn { width: 100%; justify-content: center; }
.price-card .coming-note { font-size: 12px; color: var(--ink-whisper); text-align: center; margin-top: 10px; }
.price-side h2 { font-family: var(--serif-display); font-weight: 600; font-size: clamp(30px,3.8vw,44px);
  line-height: 1.05; margin: 0 0 14px; }
.price-side p { font-size: 17px; color: var(--ink-faded); }

/* ---------- email capture ---------- */
.capture-card {
  background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 32px; margin: 0 auto; max-width: 520px; text-align: center;
}
.capture-card h3 { font-family: var(--serif-display); font-size: 26px; font-weight: 600; margin: 0 0 8px; }
.capture-card p { font-size: 16px; color: var(--ink-faded); margin: 0 0 18px; }
.capture-form { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.capture-form input[type="email"] {
  flex: 1 1 260px; padding: 14px 16px; font-family: var(--serif-body); font-size: 16px;
  border: 1px solid var(--hairline); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.capture-form input[type="email"]:focus { outline: none; border-color: var(--azure); }
.capture-note { font-size: 13px; color: var(--ink-whisper); margin-top: 10px; }
.capture-ok { font-size: 15px; color: var(--azure); font-weight: 600; margin-top: 12px; display: none; }
.capture-err { font-size: 13px; color: var(--cinnabar); margin-top: 8px; display: none; }

/* ---------- cta band ---------- */
.band {
  background: var(--ink); color: var(--paper); border-radius: 20px;
  padding: 60px 50px; text-align: center; position: relative; overflow: hidden;
}
.band::before { content: "掌"; position: absolute; font-family: var(--han); font-size: 340px;
  color: rgba(244,236,216,0.04); right: -20px; top: -110px; pointer-events: none; }
.band h2 { font-family: var(--serif-display); font-weight: 600;
  font-size: clamp(32px,5vw,54px); margin: 0 0 12px; color: var(--paper); }
.band p { color: var(--ink-whisper); font-size: 18px; margin: 0 0 26px; }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--hairline); padding: 40px 0 64px; margin-top: 30px; }
.foot-inner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  color: var(--ink-faded); font-size: 14px; }
.foot-inner .spacer { margin-left: auto; }

/* ---------- auth modal ---------- */
.auth-overlay { position: fixed; inset: 0; z-index: 100;
  background: rgba(31,27,22,0.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-overlay[hidden] { display: none; }
.auth-modal { position: relative; width: 100%; max-width: 400px;
  background: var(--paper-raised); border: 1px solid var(--hairline);
  border-radius: 16px; padding: 32px 28px 26px;
  box-shadow: 0 20px 60px rgba(31,27,22,0.35); }
.auth-close { position: absolute; top: 12px; right: 14px; border: 0; background: none;
  font-size: 26px; line-height: 1; color: var(--ink-whisper); cursor: pointer; }
.auth-close:hover { color: var(--ink); }
.auth-seal { font-family: var(--han); font-size: 34px; color: var(--azure); line-height: 1; }
.auth-modal h2 { font-family: var(--serif-display); font-size: 26px; margin: 12px 0 4px; }
.auth-sub { margin: 0 0 18px; font-size: 14px; color: var(--ink-faded); }
.auth-tabs { display: flex; gap: 4px; background: var(--paper-sunken);
  border-radius: 9px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; cursor: pointer;
  font-family: var(--serif-body); font-size: 14px; font-weight: 600; color: var(--ink-faded);
  padding: 8px; border-radius: 6px; transition: background .15s, color .15s; }
.auth-tabs button.on { background: var(--paper-raised); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.auth-field { display: block; margin-bottom: 14px; }
.auth-field span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-faded); margin-bottom: 5px; }
.auth-field input { width: 100%; font-family: var(--serif-body); font-size: 16px;
  padding: 11px 13px; border: 1px solid var(--hairline); border-radius: 8px;
  background: var(--paper); color: var(--ink); }
.auth-field input:focus { outline: none; border-color: var(--azure); }
.auth-modal .btn { width: 100%; justify-content: center; margin-top: 4px; }
.auth-error { margin: 0 0 12px; font-size: 14px; color: var(--cinnabar); }
.auth-foot { margin: 16px 0 0; font-size: 14px; color: var(--ink-faded); text-align: center; }
.linkish { border: 0; background: none; color: var(--azure); cursor: pointer;
  font-family: var(--serif-body); font-size: 14px; font-weight: 600; padding: 0; text-decoration: underline; }
body.modal-open { overflow: hidden; }

/* nav account chip */
.nav-account { display: flex; align-items: center; gap: 10px; }
.nav-account .btn { padding: 8px 14px; font-size: 14px; }
.acct-email { font-size: 13px; color: var(--ink-faded); max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-badge { font-family: var(--serif-body); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; }
.acct-badge.active   { background: var(--azure); color: #fff; }
.acct-badge.past_due { background: var(--gold); color: #fff; }
.acct-badge.none     { background: var(--paper-sunken); color: var(--ink-faded); }

/* ---------- member area (app.php / account.php) ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-main { flex: 1; padding: 48px 0 80px; }
.app-greeting { margin-bottom: 32px; }
.app-greeting h1 { font-family: var(--serif-display); font-size: clamp(30px,4vw,44px);
  font-weight: 600; margin: 0 0 6px; }
.app-greeting p { font-size: 17px; color: var(--ink-faded); margin: 0; }

.tasks-shell {
  background: var(--paper-raised); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 32px; min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.tasks-placeholder { text-align: center; color: var(--ink-faded); }
.tasks-placeholder .big { font-family: var(--han); font-size: 56px;
  color: var(--paper-sunken); display: block; margin-bottom: 10px; }
.tasks-placeholder p { font-size: 16px; max-width: 26em; margin: 0 auto; line-height: 1.6; }

.acct-section { margin-bottom: 32px; }
.acct-section h2 { font-family: var(--serif-display); font-size: 24px; font-weight: 600;
  margin: 0 0 16px; border-bottom: 1px solid var(--hairline); padding-bottom: 10px; }
.acct-row { display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--hairline); font-size: 16px; }
.acct-row:last-child { border-bottom: 0; }
.acct-row .label { color: var(--ink-faded); font-size: 14px; min-width: 130px; }
.acct-row .value { color: var(--ink); font-weight: 500; }
.sub-badge { display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.sub-badge.active   { background: var(--azure); color: #fff; }
.sub-badge.past_due { background: var(--gold); color: #fff; }
.sub-badge.canceled { background: var(--paper-sunken); color: var(--ink-faded); }
.sub-badge.none     { background: var(--paper-sunken); color: var(--ink-faded); }

/* ---------- knowledge graph legend ---------- */
.graph-legend {
  display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-start;
  margin-bottom: 18px; padding: 14px 18px;
  background: var(--paper-raised); border: 1px solid var(--hairline);
  border-radius: 10px; font-size: 13px;
}
.gl-levels { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.gl-item { display: flex; align-items: center; gap: 6px; color: var(--ink-faded); }
.gl-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--lc, #888); flex: none;
}
.gl-dot.gl-featured { width: 14px; height: 14px; box-shadow: 0 0 0 2px var(--lc, #888), 0 0 0 4px rgba(30,92,153,0.2); }
.gl-dot.gl-locked { background: #DEDAD0; border: 1.5px solid var(--lc, #888); }
.gl-status { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.gl-status-item { display: flex; align-items: center; gap: 6px; color: var(--ink-faded); }
.gl-sq { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.gl-mastered { background: #1E5C99; }
.gl-frontier { background: rgba(30,92,153,0.28); border: 1.5px solid #1E5C99; }
.gl-locked-sq { background: #DEDAD0; border: 1px solid #BFB8AC; }
.gl-hint { font-style: italic; color: var(--ink-whisper); margin-left: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .btn-lg { font-size: 16px; padding: 14px 22px; }
  .band { padding: 40px 24px; }
  .price-card { padding: 28px 20px; }
  /* Mobile-first spacing: sections carry heavy inline top padding for desktop
     rhythm — compress it aggressively on phones so content leads, not whitespace. */
  section[style*="padding"] { padding-top: 34px !important; padding-bottom: 14px !important; }
  .hero { padding: 14px 0 10px; }
  .hero .lede { font-size: 15px; margin-top: 8px; }
  .section-head { margin-bottom: 26px; }
  .section-head p { font-size: 16px; }
}

/* ══ Study room (P3) ═══════════════════════════════════════════════════════ */
.subscribe-wall { background: rgba(168,50,42,0.06); border: 1px solid rgba(168,50,42,0.22); border-radius: 12px; padding: 24px; max-width: 560px; }
.subscribe-wall p { margin: 0 0 14px; font-size: 16px; color: var(--ink-faded); }
.subscribe-wall strong { color: var(--azure); }

.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 26px; }
.dash-stats { display: flex; align-items: center; gap: 18px; }
.xp-ring { position: relative; width: 96px; height: 96px; }
.xp-ring svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.xp-ring .ring-bg { fill: none; stroke: var(--paper-sunken); stroke-width: 8; }
.xp-ring .ring-fg { fill: none; stroke: var(--azure); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.xp-ring .ring-fg.done { stroke: var(--gold); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--serif-display); }
.ring-label span { font-size: 26px; font-weight: 600; line-height: 1; }
.ring-label small { font-size: 11px; color: var(--ink-whisper); }
.streak-chip { background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 999px; padding: 8px 16px; font-size: 15px; }

.task-list { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.task-loading { color: var(--ink-whisper); font-style: italic; padding: 30px 0; }
.task-card { display: flex; align-items: center; gap: 16px; text-align: left; background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 12px; padding: 16px 18px; cursor: pointer; font: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.task-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(31,27,22,0.08); }
.task-badge { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--han); font-size: 22px; color: #FBF5E6; background: var(--azure); }
.task-card.review .task-badge { background: var(--gold); }
.task-card.remediation .task-badge { background: var(--ink-faded); }
.task-card.quiz .task-badge { background: var(--ink); }
.task-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.task-zh { font-family: var(--han); font-size: 20px; }
.task-meta { font-size: 13px; color: var(--ink-whisper); }
.task-kind { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; color: var(--ink-faded); }
.task-kind small { color: var(--azure); font-weight: 600; }

.player-top { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.player-topic { flex: 1; display: flex; flex-direction: column; }
.player-zh { font-family: var(--han); font-size: 26px; }
.player-en { font-size: 14px; color: var(--ink-whisper); }
.player-progress { font-size: 14px; color: var(--ink-faded); }
.player-know { font-size: 13px; padding: 7px 12px; white-space: nowrap; opacity: .82; }
.player-know:hover { opacity: 1; }
.quiz-timer { font-family: var(--serif-display); font-size: 28px; font-weight: 600; color: var(--azure); }

.lesson-pane { max-width: 720px; }
.lesson-body { font-size: 17px; line-height: 1.7; }
.lesson-body code { background: var(--paper-sunken); padding: 1px 6px; border-radius: 4px; }
.worked-examples { display: flex; flex-direction: column; gap: 14px; margin: 22px 0 26px; }
.worked-example { background: var(--paper-raised); border-left: 3px solid var(--azure); border-radius: 0 10px 10px 0; padding: 14px 18px; }
.we-zh { font-family: var(--han); font-size: 21px; margin-bottom: 4px; }
.we-pinyin { font-size: 14px; color: var(--azure); font-style: italic; }
.we-en { font-size: 15px; color: var(--ink-faded); margin-top: 4px; }
.we-note { font-size: 13px; color: var(--ink-whisper); margin-top: 6px; }

.exercise-pane { max-width: 720px; }
.ex-card { background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 14px; padding: 26px; }
.ex-prompt { margin: 0 0 14px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-whisper); }
.ex-zh { font-family: var(--han); font-size: 26px; line-height: 1.6; margin-bottom: 6px; }
.ex-pinyin { font-size: 15px; color: var(--ink-whisper); font-style: italic; margin-bottom: 16px; }
.ex-tts { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ex-tts .tts-play { font-size: 18px; padding: 12px 22px; }
.tts-reveal summary { font-size: 12px; color: var(--ink-whisper); cursor: pointer; }
.tts-reveal .ex-zh { font-size: 22px; margin: 4px 0 0; }
.tts-inline { font-size: 16px; padding: 6px 10px; vertical-align: middle; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.choice { font-family: var(--han); font-size: 20px; padding: 14px 10px; background: var(--paper); border: 1.5px solid var(--hairline); border-radius: 10px; cursor: pointer; transition: border-color .12s ease; }
.choice:hover:not(:disabled) { border-color: var(--azure); }
.choice.selected { border-color: var(--azure); background: rgba(168,50,42,0.06); }
.choice.right { border-color: #2E7D32; background: rgba(46,125,50,0.10); }
.choice.wrong { border-color: var(--cinnabar); background: rgba(168,50,42,0.10); }
.choice:disabled { cursor: default; opacity: .85; }
.cloze-row { display: flex; gap: 8px; margin-top: 16px; }
.cloze-input { flex: 1; min-width: 0; font-family: var(--han); font-size: 20px; padding: 12px 14px; background: var(--paper); border: 1.5px solid var(--hairline); border-radius: 10px; color: var(--ink); }
.cloze-input:focus { outline: none; border-color: var(--azure); }
.cloze-input.right { border-color: #2E7D32; background: rgba(46,125,50,0.10); }
.cloze-input.wrong { border-color: var(--cinnabar); background: rgba(168,50,42,0.10); }
.cloze-input:disabled { opacity: .9; }

.ordering-pool, .ordering-picked { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; min-height: 40px; }
.ordering-picked { background: var(--paper); border: 1px dashed var(--hairline); border-radius: 10px; padding: 10px; }
.seg { font-family: var(--han); font-size: 17px; padding: 9px 14px; background: var(--paper); border: 1.5px solid var(--hairline); border-radius: 8px; cursor: pointer; }
.seg:disabled { opacity: .35; cursor: default; }
.seg.picked { background: rgba(168,50,42,0.07); border-color: var(--azure); cursor: default; }
.ex-actions { display: flex; gap: 12px; margin-top: 18px; }

.stuck-link { display: block; margin: 14px 0 0; background: none; border: none; color: var(--ink-whisper); font-size: 13px; text-decoration: underline; cursor: pointer; font-family: inherit; }
.stuck-link:hover { color: var(--ink-faded); }

.ex-feedback { margin-top: 18px; border-radius: 12px; padding: 18px 22px; }
.ex-feedback.ok { background: rgba(46,125,50,0.08); border: 1px solid rgba(46,125,50,0.25); }
.ex-feedback.no { background: rgba(168,50,42,0.07); border: 1px solid rgba(168,50,42,0.25); }
.fb-verdict { font-family: var(--han); font-size: 20px; margin-bottom: 8px; }
.fb-zh { font-family: var(--han); font-size: 19px; }
.fb-pinyin { font-size: 13px; color: var(--ink-whisper); font-style: italic; margin-bottom: 8px; }
.fb-explain { font-size: 15px; color: var(--ink-faded); line-height: 1.6; margin-bottom: 14px; }

.result-pane { max-width: 720px; }
.result-card { background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 14px; padding: 34px; text-align: center; }
.result-xp { font-family: var(--serif-display); font-size: 44px; font-weight: 600; color: var(--azure); }
.result-acc { color: var(--ink-faded); margin: 6px 0 20px; }
.mastered-flash { background: rgba(176,138,62,0.12); border: 1px solid rgba(176,138,62,0.4); color: var(--ink); border-radius: 10px; padding: 12px 16px; margin: 0 0 20px; font-size: 15px; }
.quiz-table { width: 100%; margin: 18px 0 22px; border-collapse: collapse; font-size: 14px; }
.quiz-table th, .quiz-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--hairline); }
.quiz-item { margin-bottom: 16px; }

.graph-shell { background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 14px; padding: 18px; }
.layer-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.layer-label { flex: 0 0 34px; font-size: 12px; color: var(--ink-whisper); }
.node-dot { font-family: var(--han); font-size: 12px; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--paper-sunken); color: var(--ink-whisper); border: 1.5px solid var(--hairline); }
.node-dot.mastered { background: var(--azure); color: #FBF5E6; border-color: var(--azure); }
.node-dot.in_progress { background: rgba(168,50,42,0.18); color: var(--ink); border-color: var(--azure); }
.node-dot.frontier { background: var(--paper); color: var(--ink); border-color: var(--azure); border-style: dashed; }
.lesson-h { font-family: var(--serif-display); font-size: 24px; margin: 4px 0 10px; }

/* ══ Character card (tap any hanzi) ═══════════════════════════════════════ */
.hz { cursor: pointer; border-radius: 3px; transition: background .12s ease; }
.hz:hover { background: rgba(168,50,42,0.12); }
.char-card {
  position: absolute; z-index: 200; width: 340px;
  background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 14px;
  box-shadow: 0 18px 50px -12px rgba(31,27,22,0.35);
  padding: 16px 18px;
}
.char-card.sheet { position: fixed; left: 10px !important; right: 10px; bottom: 10px; top: auto !important; width: auto; }
.cc-head { display: flex; align-items: baseline; gap: 12px; }
.cc-word { flex: 1; display: flex; align-items: baseline; gap: 12px; }
.cc-zh { font-family: var(--han); font-size: 30px; }
.cc-py { font-size: 16px; color: var(--azure); font-style: italic; }
.cc-close { background: none; border: none; font-size: 16px; color: var(--ink-whisper); cursor: pointer; }
.cc-body { display: flex; gap: 14px; margin: 12px 0; }
.cc-glyph-frame { flex: 0 0 110px; width: 110px; height: 110px; background: var(--paper); border: 1px solid var(--hairline); border-radius: 10px; color: var(--ink); }
.cc-glyph { width: 100%; height: 100%; }
.cc-hint path { fill: var(--paper-sunken); }
.cc-reveal { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.cc-right { flex: 1; min-width: 0; }
.cc-defs { max-height: 130px; overflow-y: auto; }
.cc-sense { font-size: 13.5px; line-height: 1.45; color: var(--ink-faded); display: flex; gap: 7px; margin-bottom: 5px; }
.cc-sense span { color: var(--ink-whisper); font-size: 11px; padding-top: 2px; }
.cc-sense.muted { color: var(--ink-whisper); font-style: italic; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cc-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--paper-sunken); border: none; color: var(--ink-faded); }
button.cc-chip { cursor: pointer; font-family: var(--han); font-size: 14px; }
button.cc-chip:hover { background: rgba(168,50,42,0.14); }
.cc-actions { display: flex; gap: 8px; }
.cc-actions .btn { padding: 8px 12px; font-size: 13px; }
.cc-save.on { color: var(--gold); border-color: var(--gold); }

/* ══ Pinyin ruby (toggleable) ═════════════════════════════════════════════ */
.py-on .hz { display: inline-block; text-align: center; vertical-align: bottom; }
.py-on .hz[data-py]::before {
  content: attr(data-py);
  display: block; font-family: var(--serif-body); font-style: italic;
  font-size: 10.5px; line-height: 1.15; color: var(--ink-whisper);
  letter-spacing: -0.01em; white-space: nowrap;
}
/* Ruby-above is the only pinyin surface: ON shows it above each hanzi (rule above),
   OFF shows nothing. The standalone pinyin lines never render on their own — so
   toggling pinyin off hides the pinyin under exercises too. */
.ex-pinyin, .we-pinyin, .fb-pinyin { display: none; }
.py-toggle, .script-toggle { font-size: 13px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--hairline); background: transparent; cursor: pointer; color: var(--ink-faded); font-family: inherit; }
.py-toggle.on { background: rgba(168,50,42,0.10); border-color: var(--azure); color: var(--azure); }
/* Script toggle is a two-segment control: both scripts visible, active one lit. */
.script-toggle { display: inline-flex; align-items: center; gap: 5px; }
.script-toggle .ssep { opacity: 0.4; }
.script-toggle .sseg { opacity: 0.55; }
.script-toggle .sseg.on { opacity: 1; color: var(--azure); font-weight: 700; }

/* One-time pinyin-toggle discovery tip (charcard.js) */
.py-tip { position: fixed; z-index: 320; max-width: 220px; background: var(--ink); color: #FBF5E6;
  font-size: 13px; line-height: 1.45; padding: 10px 13px; border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18); pointer-events: none; }
.py-tip::before { content: ''; position: absolute; top: -5px; left: 24px; width: 10px; height: 10px;
  background: var(--ink); transform: rotate(45deg); }
.py-tip-pulse { animation: pyTipPulse 1.6s ease-in-out 4; }
@keyframes pyTipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168,50,42,0.45); }
  50%      { box-shadow: 0 0 0 7px rgba(168,50,42,0); }
}

/* Account page — daily XP goal editor */
.goal-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.goal-input { width: 92px; padding: 9px 12px; font: inherit; font-size: 15px;
  border: 1px solid var(--hairline); border-radius: 8px; background: transparent; color: var(--ink); }
.goal-input:focus { outline: none; border-color: var(--azure); }
.goal-note { display: block; margin-top: 8px; font-size: 13px; font-weight: 400;
  color: var(--ink-faded); line-height: 1.5; }
.goal-saved { color: #2E7D43; font-size: 13px; font-weight: 500; }
.goal-error { color: var(--azure); font-size: 13px; }

/* ══ Onboarding doors ═════════════════════════════════════════════════════ */
.doors-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(31,27,22,0.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.doors-modal { background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 16px; padding: 34px; max-width: 520px; width: 100%; box-shadow: 0 30px 80px -20px rgba(31,27,22,0.5); }
.doors-modal h2 { font-family: var(--serif-display); font-size: 30px; line-height: 1.15; margin: 10px 0 24px; }
.door { display: flex; gap: 16px; align-items: flex-start; width: 100%; text-align: left; background: var(--paper); border: 1.5px solid var(--hairline); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; cursor: pointer; font: inherit; transition: border-color .15s ease, transform .12s ease; }
.door:hover { border-color: var(--azure); transform: translateY(-1px); }
.door-zh { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 10px; background: var(--azure); color: #FBF5E6; font-family: var(--han); font-size: 24px; display: flex; align-items: center; justify-content: center; }
.door-body { font-size: 15px; line-height: 1.45; }
.door-body small { color: var(--ink-faded); }
.door-level p { margin: 14px 0 8px; font-size: 14px; color: var(--ink-faded); }
.level-picks { display: flex; gap: 8px; flex-wrap: wrap; }
.level-pick { font: inherit; font-size: 15px; padding: 10px 16px; border-radius: 8px; border: 1.5px solid var(--hairline); background: var(--paper); cursor: pointer; }
.level-pick:hover { border-color: var(--azure); color: var(--azure); }
.door-note { font-size: 12.5px !important; color: var(--ink-whisper) !important; }

/* Hero funnel + explorer + node-card styles now live in assets/graph.css. */
.demo-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.demo-tab { font: inherit; font-size: 14px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--hairline); background: var(--paper-raised); cursor: pointer; color: var(--ink-faded); }
.demo-tab.on { background: var(--azure); border-color: var(--azure); color: #FBF5E6; }

/* ── Feedback widget (partials/feedback.php) ─────────────────────────────── */
.vc-fb { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 900; font-family: var(--serif-body, Georgia, serif); }
.vc-fb-tab {
  appearance: none; border: 1px solid var(--hairline); background: var(--paper-raised);
  color: var(--ink-faded); font: inherit; font-size: 13px; letter-spacing: .01em;
  padding: 7px 13px; border-radius: 999px; cursor: pointer; opacity: .55;
  box-shadow: 0 1px 6px rgba(31,27,22,.10); transition: opacity .18s ease, color .18s ease, transform .18s ease;
}
.vc-fb-tab:hover, .vc-fb-tab:focus-visible { opacity: 1; color: var(--azure); transform: translateY(-1px); outline: none; }
.vc-fb-panel {
  position: absolute; right: 0; bottom: calc(100% + 10px); width: 300px; max-width: 82vw;
  background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(31,27,22,.18); padding: 16px; animation: vcFbIn .16s ease;
}
@keyframes vcFbIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.vc-fb-x {
  position: absolute; top: 8px; right: 10px; border: none; background: none; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--ink-whisper);
}
.vc-fb-x:hover { color: var(--ink); }
.vc-fb-types { display: flex; gap: 6px; margin: 2px 0 10px; }
.vc-fb-type {
  flex: 1; appearance: none; border: 1px solid var(--hairline); background: transparent;
  color: var(--ink-faded); font: inherit; font-size: 12px; padding: 6px 4px; border-radius: 8px; cursor: pointer;
}
.vc-fb-type.is-on { border-color: var(--azure); color: var(--azure); background: rgba(168,50,42,.06); }
.vc-fb-msg, .vc-fb-email {
  width: 100%; box-sizing: border-box; border: 1px solid var(--hairline); border-radius: 8px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 16px; padding: 9px 10px; resize: vertical;
}
.vc-fb-msg { min-height: 84px; }
.vc-fb-msg:focus, .vc-fb-email:focus { outline: none; border-color: var(--azure); }
.vc-fb-email { margin-top: 8px; }
.vc-fb-send {
  margin-top: 10px; width: 100%; appearance: none; border: none; cursor: pointer;
  background: var(--azure); color: var(--paper-raised); font: inherit; font-size: 14px;
  padding: 9px; border-radius: 8px;
}
.vc-fb-send:disabled { opacity: .6; cursor: default; }
.vc-fb-note { min-height: 16px; margin-top: 8px; font-size: 12px; color: var(--ink-faded); }
.vc-fb-thanks { text-align: center; padding: 14px 6px; }
.vc-fb-thanks-mark { font-family: var(--han, serif); font-size: 40px; color: var(--azure); line-height: 1; }
.vc-fb-thanks p { margin: 10px 0 2px; color: var(--ink-faded); font-size: 14px; }
@media (max-width: 480px) { .vc-fb { right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); } }

/* ── Character-learning exercises (HelloChinese-style Trace → Write → Reinforce) ── */
.cw-card { text-align: center; }
.cw-intro { display: flex; gap: 22px; align-items: center; justify-content: center; flex-wrap: wrap; }
.cw-facts { text-align: left; min-width: 160px; }
.cw-char { font-family: var(--han); font-size: 68px; line-height: 1; color: var(--ink); }
.cw-char-lg { font-size: 96px; margin: 6px 0 14px; }
.cw-char-ref { font-size: 40px; color: var(--ink-faded); margin-top: 6px; }
.cw-py { font-family: var(--serif-body); font-size: 22px; color: var(--accent); }
.cw-meaning { font-size: 17px; color: var(--ink-faded); margin-top: 2px; }
.cw-meaning-cue { font-size: 14px; color: var(--ink-whisper); margin-top: 8px; max-width: 150px; }
.cw-comps { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.cw-comps-h { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-whisper); }
.cw-comp { display: inline-flex; align-items: baseline; gap: 8px; }
.cw-comp-c { font-family: var(--han); font-size: 24px; color: var(--accent); }
.cw-comp-l { font-size: 14px; color: var(--ink-faded); }
.cw-note { font-size: 14px; color: var(--ink-faded); margin-top: 12px; }
.cw-hint { font-size: 13px; color: var(--ink-whisper); margin-top: 10px; }

.cw-writeface { display: flex; gap: 20px; align-items: center; justify-content: center; flex-wrap: wrap; }
.cw-facts-sm { text-align: left; min-width: 120px; }

/* Stage: hanzi-writer draws its own <svg> in here; keep it square and responsive. */
.cw-stage { width: 240px; max-width: 78vw; aspect-ratio: 1 / 1; margin: 8px auto 0; position: relative; touch-action: none; }
.cw-stage svg { width: 100% !important; height: 100% !important; display: block; }

/* 米字格 practice grid behind the memory-write / trace canvas. */
.cw-grid {
  border: 2px solid var(--accent);
  border-radius: 6px;
  background:
    linear-gradient(to right, transparent calc(50% - 0.5px), rgba(168,50,42,.28) calc(50% - 0.5px), rgba(168,50,42,.28) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(168,50,42,.28) calc(50% - 0.5px), rgba(168,50,42,.28) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom right, transparent calc(50% - 0.5px), rgba(168,50,42,.16) calc(50% - 0.5px), rgba(168,50,42,.16) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom left, transparent calc(50% - 0.5px), rgba(168,50,42,.16) calc(50% - 0.5px), rgba(168,50,42,.16) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  background-color: var(--paper-raised);
}
.cw-demo { background-color: var(--paper-raised); border-radius: 6px; }

@media (max-width: 480px) {
  .cw-intro, .cw-writeface { gap: 14px; }
  .cw-char { font-size: 54px; }
  .cw-char-lg { font-size: 78px; }
}

/* ---------- founder (video + note) ---------- */
.founder-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: #000; border: 1px solid var(--hairline); box-shadow: 0 18px 44px rgba(31,27,22,0.18); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.founder-note p { font-size: 16.5px; line-height: 1.65; color: var(--ink-faded); margin: 0 0 16px; }
.founder-note p strong { color: var(--ink); }
.founder-sign { font-family: var(--serif-display); font-style: italic; font-size: 21px; color: var(--ink); margin-top: 4px; }
@media (max-width: 860px) { .founder-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- speak from day one (comment + question) ---------- */
.convo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.convo-card { background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 24px 28px; box-shadow: 0 10px 30px rgba(31,27,22,0.08); }
.convo-title { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600;
  color: var(--ink-whisper); margin-bottom: 6px; }
.convo-line { padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.convo-line:last-child { border-bottom: 0; padding-bottom: 4px; }
.convo-line .tag { display: block; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: var(--azure); }
.convo-line .zh { display: block; font-family: var(--han); font-size: 23px; line-height: 1.5; margin: 7px 0 3px; color: var(--ink); }
.convo-line .en { display: block; font-family: var(--serif-display); font-style: italic; font-size: 15.5px; color: var(--ink-faded); }
.convo-points { list-style: none; padding: 0; margin: 0; }
.convo-points li { position: relative; padding: 10px 0 10px 26px; font-size: 16px; line-height: 1.6;
  color: var(--ink-faded); border-bottom: 1px solid var(--hairline); }
.convo-points li:last-child { border-bottom: 0; }
.convo-points li::before { content: "问"; position: absolute; left: 0; top: 11px;
  font-family: var(--han); font-size: 14px; color: var(--azure); }
.convo-note { font-size: 14.5px; color: var(--ink-whisper); font-style: italic; margin: 14px 0 0; }
@media (max-width: 860px) { .convo-grid { grid-template-columns: 1fr; gap: 28px; } }
