@font-face {
  font-family: "Lingua Sans";
  src: url("/assets/fonts/nunito-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}
@font-face {
  font-family: "Lingua Sans";
  src: url("/assets/fonts/nunito-latin-variable-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 1000;
  font-display: swap;
}
@font-face {
  font-family: "Ops Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

/* ============================================================
   DAILY CHINESE — Language Training Console
   Dark-first ops aesthetic. Light theme = lab variant.
   ============================================================ */
:root {
  color-scheme: dark light;
  --bg: #0a0e13;
  --bg-glow: rgba(34, 211, 238, 0.05);
  --panel: #10161e;
  --panel-soft: rgba(148, 178, 205, 0.05);
  --line: #1e2937;
  --line-strong: #2c3b4e;
  --ink: #dbe7f1;
  --muted: #8298ab;
  --accent: #22d3ee;        /* system cyan */
  --accent-ink: #06171c;
  --accent-soft: rgba(34, 211, 238, 0.10);
  --ok: #34d399;            /* progress / reached */
  --ok-soft: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;          /* next milestone */
  --warn-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --blue: #7ba1e8;
  --blue-soft: rgba(123, 161, 232, 0.14);
  --tone1: #ff7a6e;
  --tone2: #3ddc84;
  --tone3: #6aa5ff;
  --tone4: #c77dff;
  --tone5: #7d8a94;
  --font-ui: "Lingua Sans", "Avenir Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Ops Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-hanzi: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --r: 15px;
  --r-lg: 24px;
  --panel-raised: #131d28;
  --navy-deep: #07131d;
  --jade: #37c98b;
  --jade-deep: #17845c;
  --amber: #f3b744;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f7f9;
    --bg-glow: rgba(8, 145, 178, 0.05);
    --panel: #ffffff;
    --panel-soft: rgba(15, 40, 60, 0.04);
    --line: #dbe3ea;
    --line-strong: #c2cfda;
    --ink: #0f1c26;
    --muted: #5b7185;
    --accent: #05758b;
    --accent-ink: #ffffff;
    --accent-soft: rgba(5, 117, 139, 0.10);
    --ok: #0e9f6e;
    --ok-soft: rgba(14, 159, 110, 0.11);
    --warn: #b45309;
    --warn-soft: rgba(180, 83, 9, 0.10);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.09);
    --blue: #2d5fb8;
    --blue-soft: rgba(45, 95, 184, 0.10);
    --tone1: #d0342c;
    --tone2: #117a3b;
    --tone3: #2b63c9;
    --tone4: #8d2fc2;
    --tone5: #596773;
    --panel-raised: #ffffff;
    --navy-deep: #eaf0f4;
    --jade: #0e9f6e;
    --jade-deep: #087552;
    --amber: #b45309;
    --shadow: 0 18px 55px rgba(31, 54, 70, 0.13);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 50% -140px, var(--bg-glow), transparent),
    radial-gradient(rgba(130, 152, 171, 0.07) 1px, transparent 1.5px),
    var(--bg);
  background-size: auto, 26px 26px, auto;
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button, select, input { font: inherit; }
button {
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--ink);
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
button:hover { border-color: var(--accent); }
button:active { transform: translateY(1px); }

.app-shell { width: min(960px, calc(100vw - 32px)); margin: 0 auto; padding: 0 0 64px; }

/* ---------- Console top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand .eyebrow { margin-bottom: 1px; }
h1 { margin: 0; font-size: 1.3rem; line-height: 1.1; white-space: nowrap; letter-spacing: -0.01em; }
h1::after { content: " ▮"; color: var(--accent); animation: blink 2.4s steps(1) infinite; font-size: 0.9em; }
@keyframes blink { 50% { opacity: 0; } }

.tabs { display: flex; flex: 1 1 auto; min-width: 0; gap: 2px; align-items: center; flex-wrap: nowrap; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.tab {
  border: none; background: transparent; border-radius: 999px;
  padding: 6px 13px; font-size: 0.88rem; min-height: 32px;
  color: var(--muted); white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.status-panel {
  display: grid; gap: 1px; padding-left: 12px;
  border-left: 2px solid var(--accent);
  color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem;
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em;
}
.status-panel strong { color: var(--ink); font-size: 0.92rem; }
.auth-button {
  min-height: 24px; padding: 2px 7px; border-radius: 5px;
  color: var(--accent); border-color: var(--line-strong); background: transparent;
  font: 650 0.64rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.03em;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}

h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 10px; font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.1; letter-spacing: -0.015em; }
h3 { margin-bottom: 0; font-size: 1.05rem; }

.page-head { padding: 30px 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.lede { color: var(--muted); font-size: 1rem; line-height: 1.65; max-width: 68ch; margin-bottom: 0; }

/* ---------- Panels: HUD cards ---------- */
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.panel::before {
  content: "";
  position: absolute; inset: 0 auto auto 0;
  width: 26px; height: 2px; border-radius: 2px;
  background: var(--accent);
  opacity: 0.85;
}
.stack { display: grid; gap: 12px; min-width: 0; }
.stack > * { min-width: 0; max-width: 100%; }

.section-heading {
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 11px; margin-bottom: 14px;
}
.section-heading .idx {
  flex: 0 0 auto;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
  border-radius: 6px; padding: 3px 8px;
}
.section-heading h3 small { color: var(--muted); font-weight: 500; font-size: 0.82rem; margin-left: 8px; }

label { color: var(--muted); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
select, input[type="search"] {
  min-height: 42px; width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--panel); color: var(--ink); padding: 0 10px;
}
select:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.primary-action { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.primary-action:hover { filter: brightness(1.12); border-color: var(--accent); }
.body-copy { color: var(--muted); line-height: 1.65; }

/* ---------- Stat strip: mission telemetry ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-tile {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel-soft), transparent), var(--panel);
  padding: 13px 15px 11px; display: grid; gap: 2px;
}
.stat-tile::before { content: ""; position: absolute; top: 0; left: 0; width: 26px; height: 2px; background: var(--ok); border-radius: 2px; }
.stat-tile strong {
  font-family: var(--font-mono); font-size: 1.9rem; line-height: 1.05;
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}
.stat-tile span {
  color: var(--muted); font-family: var(--font-mono);
  font-size: 0.68rem; line-height: 1.45; text-transform: uppercase; letter-spacing: 0.07em;
}
@media (max-width: 760px) { .stat-strip { grid-template-columns: 1fr 1fr; } }

/* ---------- Program: mission objectives ---------- */
.program { display: grid; gap: 6px; }
.program-step {
  display: grid; grid-template-columns: 40px 1fr 44px; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 9px 12px; background: var(--panel-soft);
  transition: border-color 0.15s;
}
.program-step:hover { border-color: var(--line-strong); }
.program-step .check {
  width: 30px; min-height: 30px; padding: 0; border-radius: 8px;
  border: 1.5px solid var(--line-strong); background: transparent;
  font-weight: 800; color: var(--ok); font-size: 0.9rem;
}
.program-step.done { border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.program-step.done .check { border-color: var(--ok); background: var(--ok-soft); }
.program-step.done .program-text { opacity: 0.5; }
.program-step.done .program-text strong { text-decoration: line-through; }
.program-text { display: grid; gap: 1px; }
.program-text strong { font-size: 0.95rem; }
.program-text span { color: var(--muted); font-size: 0.85rem; }
.program-step .go { min-height: 32px; padding: 0 12px; border-radius: 8px; color: var(--muted); background: transparent; border-color: var(--line); font-family: var(--font-mono); }
.program-step .go:hover { color: var(--accent); border-color: var(--accent); }
.program-done { margin: 8px 0 0; color: var(--ok); font-weight: 700; font-family: var(--font-mono); font-size: 0.9rem; }
.sync-status { margin: 9px 0 0; color: var(--muted); font: 0.76rem/1.4 var(--font-mono); }
.sync-status.failed { color: var(--danger); }

.auth-dialog {
  width: min(460px, calc(100vw - 28px)); padding: 22px;
  color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--r); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.auth-dialog::backdrop { background: rgba(3, 8, 13, 0.72); backdrop-filter: blur(3px); }
.auth-dialog form { display: grid; gap: 14px; }
.auth-dialog .body-copy, .auth-dialog .sync-status { margin-bottom: 0; }
.auth-field { display: grid; gap: 6px; color: var(--muted); font-size: 0.84rem; }
.auth-field input {
  width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; color: var(--ink); background: var(--bg);
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ---------- Public landing + verification wall ---------- */
.landing-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 18% 10%, rgba(34, 211, 238, 0.09), transparent 62%),
    radial-gradient(700px 420px at 86% 74%, rgba(52, 211, 153, 0.05), transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.015), transparent 55%),
    var(--bg);
}
.landing-shell { width: min(1160px, calc(100vw - 40px)); min-height: 100vh; margin: 0 auto; display: grid; grid-template-rows: auto 1fr auto; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.landing-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.landing-brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 10px; color: var(--accent); background: var(--accent-soft);
  font: 800 1.25rem/1 var(--font-hanzi);
}
.landing-brand span:last-child { display: grid; gap: 2px; }
.landing-brand small { color: var(--muted); font: 650 0.62rem/1 var(--font-mono); letter-spacing: 0.13em; }
.landing-brand strong { font-size: 1.05rem; letter-spacing: -0.01em; }
.private-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 650 0.68rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.private-pill span { color: var(--ok); font-size: 0.65rem; filter: drop-shadow(0 0 6px var(--ok)); }

.landing-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr); gap: clamp(42px, 7vw, 94px); align-items: center; padding: clamp(54px, 9vh, 100px) 0; }
.landing-hero { min-width: 0; }
.landing-hero h1 {
  max-width: 760px; margin: 0 0 22px; color: var(--ink);
  font-size: clamp(2.7rem, 6vw, 5.5rem); line-height: 0.98; letter-spacing: -0.055em;
  white-space: normal;
}
.landing-hero h1::after { content: none; }
.landing-lede { max-width: 660px; margin: 0; color: var(--muted); font-size: clamp(1.02rem, 1.8vw, 1.22rem); line-height: 1.7; }
.landing-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 660px; margin: 38px 0 34px; border-block: 1px solid var(--line); }
.landing-metrics div { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: center; padding: 18px 14px 18px 0; }
.landing-metrics div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.landing-metrics strong { color: var(--accent); font: 800 clamp(1.35rem, 2.6vw, 2rem)/1 var(--font-mono); letter-spacing: -0.05em; }
.landing-metrics span { color: var(--muted); font: 0.67rem/1.45 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.landing-principles { display: grid; gap: 12px; max-width: 660px; }
.landing-principles article { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.landing-principles article > span { color: var(--accent); font: 700 0.68rem/1.6 var(--font-mono); }
.landing-principles strong { display: block; margin-bottom: 2px; }
.landing-principles p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }

.access-card {
  position: relative; overflow: hidden; padding: clamp(26px, 4vw, 38px);
  border: 1px solid var(--line-strong); border-radius: 16px;
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.055), transparent 46%), var(--panel);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.28);
}
.access-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--accent), var(--ok), transparent 82%); }
.access-lock { position: absolute; top: 22px; right: 24px; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font-family: var(--font-hanzi); }
.access-card h2 { max-width: 85%; margin: 0 0 12px; font-size: clamp(1.65rem, 3vw, 2.25rem); }
.access-card > p:not(.eyebrow):not(.access-feedback) { margin-bottom: 26px; color: var(--muted); line-height: 1.65; }
.landing-auth-form { display: grid; gap: 10px; }
.landing-auth-form label { margin-bottom: 1px; }
.landing-auth-form input {
  width: 100%; min-height: 50px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  color: var(--ink); background: color-mix(in srgb, var(--bg) 72%, transparent);
}
.landing-auth-form input::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); }
.landing-auth-form button { min-height: 50px; margin-top: 3px; }
.landing-auth-form button:disabled { cursor: wait; opacity: 0.5; }
.access-feedback { min-height: 38px; margin: 13px 0 0; color: var(--muted); font: 0.75rem/1.5 var(--font-mono); }
.access-feedback[data-state="success"] { color: var(--ok); }
.access-feedback[data-state="error"] { color: var(--danger); }
.local-preview { display: inline-block; margin-top: 4px; color: var(--accent); font: 0.76rem/1.4 var(--font-mono); }
.local-preview[hidden] { display: none; }
.access-assurance { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.access-assurance > span { color: var(--ok); font-weight: 800; }
.access-assurance p { margin: 0; color: var(--muted); font-size: 0.75rem; line-height: 1.55; }
.access-assurance strong { color: var(--ink); }
.landing-footer { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font: 0.65rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }

@media (max-width: 880px) {
  .landing-main { grid-template-columns: 1fr; align-items: start; }
  .landing-hero h1 { max-width: 800px; }
  .access-card { width: min(100%, 620px); }
}
@media (max-width: 560px) {
  .landing-shell { width: min(100% - 28px, 1160px); }
  .landing-nav { padding: 16px 0; }
  .private-pill { font-size: 0; gap: 0; }
  .private-pill span { font-size: 0.7rem; }
  .landing-main { gap: 40px; padding: 42px 0 52px; }
  .landing-hero h1 { font-size: clamp(2.45rem, 14vw, 4rem); }
  .landing-metrics { grid-template-columns: 1fr; }
  .landing-metrics div { grid-template-columns: 62px 1fr; padding: 14px 0; }
  .landing-metrics div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .landing-footer { display: grid; }
}

/* ---------- Voice toolbar ---------- */
.voice-toolbar { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) auto; gap: 14px; align-items: end; padding: 14px 16px 12px; }
.voice-toolbar .tone-legend { grid-column: 1 / -1; margin: 0; }
.voice-row { display: grid; gap: 6px; }
.voice-row.compact { grid-template-columns: 52px 1fr 52px; align-items: center; }
.voice-row.compact label { grid-column: 1; }
.voice-row.compact input { grid-column: 2; }
.voice-row.compact span { grid-column: 3; color: var(--muted); font-family: var(--font-mono); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--accent); }
.tone-legend { display: inline-flex; gap: 14px; align-items: baseline; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
@media (max-width: 760px) { .voice-toolbar { grid-template-columns: 1fr; } }

/* ---------- Tones ---------- */
.t1 { color: var(--tone1); }
.t2 { color: var(--tone2); }
.t3 { color: var(--tone3); }
.t4 { color: var(--tone4); }
.t5 { color: var(--tone5); }

/* ---------- Dictionary rows ---------- */
.dict-list { display: grid; }
.dict-row {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.dict-row:last-child { border-bottom: none; }
.dict-row:hover { background: var(--panel-soft); }
.dict-main { display: grid; gap: 6px; min-width: 0; }
.dict-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.dict-hanzi { font-family: var(--font-hanzi); font-size: 1.7rem; font-weight: 600; line-height: 1.25; }
.dict-pinyin { font-weight: 650; font-size: 1rem; }
.dict-meaning { color: var(--muted); }
.dict-src { margin-left: auto; color: var(--muted); font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; opacity: 0.8; }
.dict-example { border-left: 2px solid var(--line-strong); padding: 2px 0 2px 12px; display: grid; gap: 2px; }
.dict-example .zh { font-family: var(--font-hanzi); font-size: 1.12rem; color: var(--ink); }
.dict-example .py { font-size: 0.9rem; }
.tiny-play {
  display: inline-grid; place-items: center;
  flex: 0 0 36px; width: 36px; min-height: 36px; padding: 0;
  border-radius: 8px; color: var(--accent); background: var(--accent-soft);
  border-color: transparent; font-size: 0.8rem;
}
.tiny-play:hover { border-color: var(--accent); }

/* ---------- Drill cards / read panel ---------- */
.drill-card { border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; background: var(--panel-soft); }
.drill-card summary { cursor: pointer; font-weight: 650; }
.answer { margin: 10px 0 0; color: var(--ok); font-weight: 650; font-family: var(--font-hanzi); }
.read-text { color: var(--ink); font-family: var(--font-hanzi); font-size: 1.45rem; line-height: 2.05; }
.read-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Study: simulator ---------- */
.session-setup { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; }
@media (max-width: 620px) { .session-setup { grid-template-columns: 1fr; } }
.study-area { text-align: center; }
.study-bar { height: 6px; border-radius: 999px; background: var(--panel-soft); border: 1px solid var(--line); overflow: hidden; max-width: 460px; margin: 0 auto 8px; }
.study-bar-fill { height: 100%; background: var(--ok); border-radius: 999px; transition: width 0.25s ease; box-shadow: 0 0 12px color-mix(in srgb, var(--ok) 60%, transparent); }
.study-progress { color: var(--muted); margin-bottom: 8px; font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.08em; }
.study-card {
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-soft), transparent), var(--panel);
  padding: 30px 20px; max-width: 560px; margin: 0 auto;
}
.study-hanzi { font-family: var(--font-hanzi); font-size: clamp(4rem, 10vw, 6rem); font-weight: 700; margin: 6px 0 10px; line-height: 1.15; }
.study-pinyin { font-size: 1.6rem; margin: 4px 0; font-weight: 650; }
.study-meaning { font-size: 1.15rem; color: var(--muted); }
.study-actions { display: flex; gap: 8px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.grade {
  min-width: 64px; padding: 9px 8px; border-radius: 10px; font-weight: 800;
  font-family: var(--font-mono); background: var(--panel-soft);
}
.grade small { display: block; font-weight: 500; color: var(--muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; }
.grade.g0, .grade.g1 { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.grade.g2 { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.grade.g4, .grade.g5 { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.grade.g0:hover, .grade.g1:hover { background: var(--danger-soft); border-color: var(--danger); }
.grade.g2:hover, .grade.g3:hover { background: var(--warn-soft); border-color: var(--warn); }
.grade.g4:hover, .grade.g5:hover { background: var(--ok-soft); border-color: var(--ok); }
.study-hint { color: var(--muted); font-size: 0.82rem; margin-top: 14px; font-family: var(--font-mono); }
kbd {
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  padding: 1px 6px; font-size: 0.78rem; font-family: var(--font-mono); background: var(--panel-soft);
}
.grade-lines { background: var(--panel-soft); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.85rem; }

/* ---------- Vocabulary browser ---------- */
.vocab-controls { display: grid; grid-template-columns: 1fr 150px 150px auto; gap: 10px; align-items: center; padding: 12px 14px; position: sticky; top: 62px; z-index: 10; }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 760px) { .vocab-controls { grid-template-columns: 1fr 1fr; position: static; } .vocab-controls input[type="search"] { grid-column: 1 / -1; } }
.vocab-table { display: grid; gap: 1px; }
.vocab-row {
  display: grid; grid-template-columns: 40px 120px 165px 1fr 155px 72px;
  gap: 12px; align-items: center; padding: 9px 8px; border-radius: 8px;
}
.vocab-row:nth-child(odd) { background: var(--panel-soft); }
.vocab-row:hover { outline: 1px solid var(--line-strong); }
.v-hanzi { font-family: var(--font-hanzi); font-size: 1.5rem; font-weight: 600; }
.v-pinyin { font-weight: 600; font-size: 0.95rem; }
.v-meaning { color: var(--muted); font-size: 0.95rem; }
.v-meta { color: var(--muted); font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.v-meta em { font-style: normal; }
.blurred { filter: blur(7px); cursor: pointer; }
.v-badge {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 6px; text-align: center; white-space: nowrap;
  border: 1px solid var(--line);
}
.badge-new { background: var(--panel-soft); color: var(--muted); }
.badge-learning { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-mature { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-struggling { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-queued { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.badge-reference { background: transparent; color: var(--muted); }
@media (max-width: 760px) { .vocab-row { grid-template-columns: 36px 1fr 1fr; } .v-meta, .v-badge { display: none; } }

/* ---------- Archives ---------- */
.lesson-entry, .practice-entry, .phase-entry { min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 14px 16px; }
.lesson-entry summary, .practice-entry summary, .phase-entry summary { display: flex; gap: 14px; align-items: baseline; cursor: pointer; list-style: none; }
.lesson-entry summary::-webkit-details-marker, .practice-entry summary::-webkit-details-marker, .phase-entry summary::-webkit-details-marker { display: none; }
.lesson-num { font-family: var(--font-mono); font-weight: 700; color: var(--accent); white-space: nowrap; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.lesson-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.lesson-date { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; font-size: 0.82rem; }
.lesson-body { margin-top: 14px; display: grid; gap: 14px; }
.lesson-body h4 { margin: 0; font-size: 0.95rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); font-weight: 600; }
.lesson-grammar p { margin: 6px 0; color: var(--muted); }
.lesson-grammar strong { color: var(--ink); }
.lesson-grammar .example { color: var(--muted); font-family: var(--font-hanzi); }
.practice-body { margin-top: 12px; overflow-wrap: anywhere; line-height: 1.7; color: var(--muted); }
.spoiler {
  display: inline; min-height: 0; padding: 0 4px; border: 0; border-radius: 4px;
  background: currentColor; color: inherit; line-height: inherit; cursor: pointer;
}
.spoiler.revealed { background: var(--accent-soft); color: var(--ink); }
.blurred:focus-visible { filter: blur(4px); }
@media (max-width: 620px) {
  .lesson-entry summary, .practice-entry summary, .phase-entry summary { flex-wrap: wrap; gap: 6px 10px; }
  .phase-entry .phase-status { flex: 1 0 100%; margin-left: 0; white-space: normal; }
}

/* ---------- Progress: telemetry ---------- */
.hsk-row { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 14px 16px; }
.hsk-row-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.hsk-row-head strong { font-family: var(--font-mono); }
.hsk-row-head span { color: var(--muted); font-family: var(--font-mono); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.hsk-bar { height: 10px; border-radius: 999px; background: var(--panel-soft); border: 1px solid var(--line); overflow: hidden; }
.hsk-bar-fill { height: 100%; border-radius: 999px; background: var(--ok); transition: width 0.4s ease; box-shadow: 0 0 10px color-mix(in srgb, var(--ok) 50%, transparent); }
.hsk-bar-fill.done { background: var(--ok); }
.hsk-missing { margin-top: 8px; }
.hsk-missing summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.hsk-missing p { font-family: var(--font-hanzi); font-size: 1.1rem; line-height: 2; color: var(--muted); }
.phase-status { margin-left: auto; white-space: nowrap; font-weight: 700; color: var(--warn); font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.phase-status.done { color: var(--ok); }
.curriculum-framing { color: var(--muted); width: 100%; max-width: 72ch; overflow-wrap: anywhere; line-height: 1.65; }

/* ---------- ILR ladder ---------- */
.ilr-ladder { display: flex; align-items: flex-start; gap: 0; max-width: 100%; overflow-x: auto; padding: 8px 0 4px; }
.ilr-step { display: grid; gap: 3px; justify-items: center; text-align: center; min-width: 106px; }
.ilr-step b { font-size: 0.9rem; font-family: var(--font-mono); }
.ilr-step span:not(.ilr-dot) { color: var(--muted); font-size: 0.76rem; }
.ilr-step em { color: var(--warn); font-family: var(--font-mono); font-size: 0.76rem; font-style: normal; font-weight: 700; }
.ilr-dot {
  width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center;
  border: 2px solid var(--line-strong); background: var(--panel); font-weight: 800; color: var(--accent-ink); font-size: 0.85rem;
}
.ilr-step.reached .ilr-dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 12px color-mix(in srgb, var(--ok) 55%, transparent); }
.ilr-step.next .ilr-dot { border-color: var(--warn); box-shadow: 0 0 10px color-mix(in srgb, var(--warn) 40%, transparent); }
.ilr-link { flex: 1 1 24px; height: 2px; background: var(--line-strong); margin-top: 14px; min-width: 16px; }

/* ---------- Guide ---------- */
.guide { line-height: 1.65; }
.guide-list { margin: 0 0 14px; padding-left: 20px; color: var(--muted); display: grid; gap: 10px; }
.guide-list li strong { color: var(--ink); }
.guide code { background: var(--panel-soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-family: var(--font-mono); font-size: 0.85em; }
.grade-table, .ilr-table { display: grid; gap: 8px; margin: 12px 0; }
.grade-table > div, .ilr-table > div {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: baseline;
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; background: var(--panel-soft);
}
.grade-table > div { grid-template-columns: 56px 1fr; }
.grade-table b, .ilr-table b { color: var(--accent); font-family: var(--font-mono); }
.grade-table span, .ilr-table span { color: var(--muted); }
.ilr-table em { color: var(--muted); font-style: normal; font-family: var(--font-mono); font-size: 0.8rem; }
.faq { border-bottom: 1px solid var(--line); padding: 12px 2px; }
.faq:last-child { border-bottom: none; }
.faq summary { cursor: pointer; font-weight: 650; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--accent); font-weight: 800; font-family: var(--font-mono); }
.faq[open] summary::before { content: "− "; }
.faq p { margin: 10px 0 0; color: var(--muted); }
@media (max-width: 760px) { .grade-table > div, .ilr-table > div { grid-template-columns: 56px 1fr; } .ilr-table em { grid-column: 2; } }

/* ---------- Responsive header ---------- */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 980px) {
  .topbar { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; }
  .brand { grid-column: 1; }
  .status-panel { grid-column: 2; grid-row: 1; border-left: none; border-right: 2px solid var(--accent); padding: 0 12px 0 0; text-align: right; }
  .tabs { grid-column: 1 / -1; flex-wrap: nowrap; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.15rem; }
  .brand .eyebrow { display: none; }
  .status-panel { font-size: 0.7rem; }
  .app-shell { width: min(100vw - 20px, 960px); }
}

@media (prefers-reduced-motion: reduce) {
  h1::after { animation: none; }
  * { transition: none !important; }
}

/* ---------- Category chips + vocab meta ---------- */
.chip-bar { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.chip-bar::-webkit-scrollbar { display: none; }
.chip {
  min-height: 30px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  color: var(--muted); font-size: 0.82rem; white-space: nowrap;
}
.chip b { font-family: var(--font-mono); font-weight: 700; color: var(--muted); margin-left: 4px; font-size: 0.75rem; }
.chip:hover { color: var(--ink); border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.chip.active b { color: var(--accent-ink); }
.vocab-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.result-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
#flashcardsBtn:disabled { opacity: 0.4; cursor: default; }
.badge-locked { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); opacity: 0.75; }
.dict-row.locked, .vocab-row.locked { opacity: 0.65; }

/* neural-only toolbar: legend promoted */
.voice-toolbar { grid-template-columns: 1fr minmax(200px, 260px) auto; align-items: center; }
.voice-toolbar .tone-legend { grid-column: auto; }
.tone-legend.big { font-size: 0.95rem; gap: 16px; }
.tone-legend.big b { font-size: 1.05rem; font-weight: 750; }
.legend-label { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.12em; margin-right: 2px; }
@media (max-width: 760px) { .voice-toolbar { grid-template-columns: 1fr; } }

/* legend strip + speed beside read-aloud */
.legend-strip { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); display: flex; }
.read-actions { align-items: center; }
.speed-group { display: inline-flex; gap: 10px; align-items: center; margin-left: auto; min-width: 220px; }
.speed-group input { flex: 1; }
.speed-group span { color: var(--muted); font-family: var(--font-mono); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .speed-group { margin-left: 0; width: 100%; } }

/* ruby pinyin above read-aloud text */
.read-text { line-height: 2.6; }
.read-text ruby { ruby-position: over; margin: 0 1px; }
.read-text rt {
  font-family: var(--font-ui);
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.01em; padding-bottom: 3px;
}

/* lesson dialogues: line-by-line reader */
.lesson-dialogues { display: grid; gap: 12px; }
.dialogue { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--panel-soft); }
.dlg-line { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; padding: 5px 0; }
.dlg-text p { margin: 0; }
.dlg-text .zh { font-family: var(--font-hanzi); font-size: 1.25rem; line-height: 1.6; }
.dlg-text .py { font-size: 0.88rem; }
.dlg-text .en { color: var(--muted); font-size: 0.88rem; }

/* ============================================================
   FIELD SCHOOL VISUAL SYSTEM — friendly rigor, briefing-room calm
   ============================================================ */
html { scroll-behavior: smooth; }
body { font-weight: 520; }
button, input, select { letter-spacing: -0.005em; }
button {
  border-radius: var(--r);
  font-weight: 760;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--line-strong) 82%, black);
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(2px); box-shadow: none; }
button:disabled { transform: none; box-shadow: none; }
.primary-action {
  border-color: color-mix(in srgb, var(--accent) 70%, white);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, white), var(--accent));
  box-shadow: 0 5px 0 color-mix(in srgb, var(--accent) 48%, black), 0 14px 30px color-mix(in srgb, var(--accent) 16%, transparent);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
}
.primary-action:hover { transform: translateY(-1px); filter: saturate(1.08) brightness(1.06); }
.primary-action:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 48%, black); }
.eyebrow { font-size: 0.69rem; font-weight: 760; letter-spacing: 0.13em; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft), 0 0 14px var(--ok); }

/* ---------- Field console shell ---------- */
body:not(.landing-body) {
  background:
    radial-gradient(900px 440px at 70% -110px, rgba(34, 211, 238, 0.09), transparent 62%),
    linear-gradient(rgba(130, 152, 171, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 152, 171, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 32px 32px, 32px 32px, auto;
}
.app-shell { width: min(1160px, calc(100vw - 34px)); padding-bottom: 80px; }
.topbar {
  top: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 84%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 174px; }
.brand-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  overflow: hidden;
  flex: 0 0 46px;
  border: 1px solid color-mix(in srgb, var(--jade) 52%, transparent);
  border-radius: 15px;
  background: radial-gradient(circle at 50% 30%, rgba(55, 201, 139, 0.24), transparent 68%), var(--navy-deep);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--bg) 70%, transparent), 0 7px 18px rgba(0, 0, 0, 0.24);
}
.brand-avatar img { position: absolute; width: 66px; max-width: none; height: auto; left: -10px; top: -6px; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy small { color: var(--muted); font: 720 0.56rem/1.1 var(--font-mono); letter-spacing: 0.1em; }
.brand-copy strong { color: var(--ink); font-size: 1.03rem; line-height: 1.1; letter-spacing: -0.025em; }
.brand h1::after { content: none; }
.tabs {
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 750;
  box-shadow: none;
}
.tab:hover { transform: none; border-color: var(--line); background: var(--panel-soft); }
.tab:active { transform: translateY(1px); }
.tab-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 8%, transparent);
  font: 760 0.82rem/1 var(--font-hanzi);
}
.tab.active {
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, var(--panel)), color-mix(in srgb, var(--accent) 8%, var(--panel)));
  color: var(--ink);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--accent) 45%, transparent);
}
.tab.active .tab-icon { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 24%, transparent); }
.status-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px 0 12px;
  border: 0;
  border-left: 1px solid var(--line);
  text-align: left;
}
.status-panel > span:nth-child(2) { display: grid; gap: 1px; }
.status-panel b { color: var(--muted); font: 650 0.57rem/1.2 var(--font-mono); letter-spacing: 0.07em; }
.status-panel strong { color: var(--ink); font: 760 0.72rem/1.2 var(--font-mono); }
.clearance-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--ok) 24%, var(--line));
  border-radius: 999px;
  color: var(--ok);
  background: var(--ok-soft);
  font: 760 0.55rem/1 var(--font-mono);
}
.clearance-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.auth-button { min-height: 32px; padding: 3px 9px; border-radius: 10px; box-shadow: none; }

/* ---------- Briefings, cards, and reward surfaces ---------- */
.page-head {
  position: relative;
  margin: 22px 0 16px;
  padding: 26px 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, var(--panel)), var(--panel) 52%);
  box-shadow: var(--shadow);
}
.page-head::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 60%, rgba(34, 211, 238, 0.035));
}
.page-head h2 { position: relative; z-index: 1; margin-bottom: 9px; font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 880; letter-spacing: -0.045em; }
.page-head .lede { position: relative; z-index: 1; font-weight: 540; }
.mission-head { display: grid; grid-template-columns: minmax(0, 1fr) 220px; min-height: 258px; align-items: center; }
.mission-head::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -78px;
  top: -70px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 50%;
  box-shadow: inset 0 0 0 48px color-mix(in srgb, var(--accent) 2%, transparent), inset 0 0 0 96px color-mix(in srgb, var(--accent) 3%, transparent);
}
.mission-head-copy { position: relative; z-index: 2; max-width: 730px; }
.briefing-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.briefing-meta span, .mission-tags span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-soft) 80%, transparent);
  font: 670 0.58rem/1 var(--font-mono);
  letter-spacing: 0.075em;
}
.mission-companion { position: absolute; z-index: 2; right: 22px; bottom: 0; width: 230px; height: 250px; }
.mission-companion img { position: absolute; right: -2px; bottom: -175px; width: 220px; height: auto; filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.24)); }
.companion-message {
  position: absolute;
  z-index: 3;
  right: 124px;
  top: 26px;
  display: grid;
  min-width: 108px;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 15px 15px 4px 15px;
  background: color-mix(in srgb, var(--panel-raised) 94%, transparent);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}
.companion-message b { font-family: var(--font-hanzi); font-size: 0.95rem; }
.companion-message small { color: var(--accent); font: 620 0.58rem/1.3 var(--font-mono); }
.panel {
  border-color: color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 20px;
  padding: 21px 22px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--panel-soft) 70%, transparent), transparent 38%), var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.panel::before { width: 42px; height: 3px; left: 22px; border-radius: 0 0 5px 5px; background: linear-gradient(90deg, var(--accent), var(--ok)); }
.section-heading { padding-bottom: 14px; margin-bottom: 15px; }
.section-heading .idx {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 32px;
  padding: 3px 9px;
  border-radius: 11px;
  font-size: 0.7rem;
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--accent) 22%, transparent);
}
.section-heading h3 { font-size: 1.13rem; font-weight: 830; letter-spacing: -0.018em; }
.section-heading h3 small { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.02em; }
.stat-strip { gap: 12px; }
.stat-tile {
  min-height: 118px;
  padding: 17px 54px 15px 17px;
  overflow: hidden;
  border-color: var(--line);
  border-radius: 18px;
  box-shadow: 0 7px 0 color-mix(in srgb, var(--line) 60%, transparent), 0 15px 30px rgba(0, 0, 0, 0.1);
}
.stat-tile::before { width: 100%; height: 3px; background: var(--accent); }
.stat-tile::after {
  content: attr(data-glyph);
  position: absolute;
  right: 12px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  font: 790 1rem/1 var(--font-hanzi);
}
.stat-tile:nth-child(2)::before { background: var(--blue); }
.stat-tile:nth-child(2)::after { color: var(--blue); background: var(--blue-soft); }
.stat-tile:nth-child(3)::before { background: var(--warn); }
.stat-tile:nth-child(3)::after { color: var(--warn); background: var(--warn-soft); }
.stat-tile:nth-child(4)::before { background: var(--ok); }
.stat-tile:nth-child(4)::after { color: var(--ok); background: var(--ok-soft); }
.stat-tile strong { font-size: 2.25rem; font-weight: 820; }
.stat-tile span { font-size: 0.64rem; font-weight: 620; }
.program { gap: 9px; }
.program-step {
  grid-template-columns: 44px 1fr auto;
  gap: 13px;
  padding: 12px 13px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-soft) 75%, transparent);
}
.program-step:hover { transform: translateX(2px); border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); }
.program-step .check {
  width: 36px;
  min-height: 36px;
  border-width: 2px;
  border-radius: 12px;
  box-shadow: none;
}
.program-step.done { background: linear-gradient(90deg, var(--ok-soft), color-mix(in srgb, var(--panel-soft) 70%, transparent)); }
.program-step.done .check { color: var(--accent-ink); background: var(--ok); box-shadow: 0 3px 0 color-mix(in srgb, var(--ok) 45%, black); }
.program-step .go { min-height: 36px; border-radius: 11px; box-shadow: none; font-size: 0.69rem; }
.program-text strong { font-size: 1rem; font-weight: 790; }
.legend-strip { padding: 13px 16px; border-radius: 17px; box-shadow: 0 7px 0 color-mix(in srgb, var(--line) 55%, transparent); }
.dict-row { padding: 14px 8px; border-radius: 13px; transition: background 0.15s, transform 0.15s; }
.dict-row:hover { transform: translateX(2px); }
.drill-card, .dialogue, .lesson-entry, .practice-entry, .phase-entry, .hsk-row { border-radius: 16px; }
.study-card {
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 58%),
    var(--panel-raised);
  box-shadow: 0 9px 0 color-mix(in srgb, var(--line) 62%, transparent), 0 24px 60px rgba(0, 0, 0, 0.2);
}
.study-bar { height: 12px; border: 0; background: color-mix(in srgb, var(--line) 80%, transparent); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2); }
.study-bar-fill { background: linear-gradient(90deg, var(--jade), var(--accent)); }
.grade { min-width: 68px; border-radius: 14px; box-shadow: 0 4px 0 color-mix(in srgb, var(--line-strong) 78%, black); }
.grade:hover { transform: translateY(-1px); }
.chip { min-height: 34px; border-radius: 12px; box-shadow: none; }
.chip.active { box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 45%, black); }
.tiny-play { border-radius: 12px; box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 18%, var(--line)); }

/* ---------- Public field-school landing ---------- */
.landing-body {
  color-scheme: dark;
  --bg: #071019;
  --panel: #0e1924;
  --panel-raised: #142331;
  --line: #1d3040;
  --line-strong: #2b465b;
  --ink: #eef7f4;
  --muted: #8fa8b5;
  --accent: #27d2df;
  --accent-ink: #041719;
  --ok: #42d894;
  --ok-soft: rgba(66, 216, 148, 0.12);
  --warn: #f3b744;
  background:
    radial-gradient(850px 560px at 16% 10%, rgba(39, 210, 223, 0.12), transparent 66%),
    radial-gradient(720px 540px at 86% 68%, rgba(66, 216, 148, 0.09), transparent 66%),
    linear-gradient(rgba(120, 170, 190, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 190, 0.028) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
}
.landing-shell { width: min(1240px, calc(100vw - 44px)); }
.landing-nav { padding: 20px 0; }
.landing-brand { gap: 13px; }
.landing-brand-mark {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(39, 210, 223, 0.48);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(39, 210, 223, 0.18), rgba(66, 216, 148, 0.08));
  box-shadow: inset 0 0 0 4px rgba(7, 16, 25, 0.5), 0 9px 24px rgba(0, 0, 0, 0.25);
}
.landing-brand-mark::after { content: ""; position: absolute; inset: 7px; border: 1px dashed rgba(39, 210, 223, 0.3); border-radius: 10px; }
.landing-brand-mark span { position: relative; z-index: 1; }
.landing-brand small { font-size: 0.58rem; font-weight: 730; }
.landing-brand strong { font-size: 1.14rem; font-weight: 850; }
.private-pill { padding: 8px 11px; border: 1px solid rgba(66, 216, 148, 0.18); border-radius: 999px; background: rgba(66, 216, 148, 0.07); }
.landing-main { grid-template-columns: minmax(0, 1.4fr) minmax(350px, 0.6fr); gap: clamp(34px, 4vw, 58px); padding: clamp(44px, 7vh, 80px) 0; }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1fr) 245px; align-items: center; gap: 24px 18px; }
.landing-hero-copy { min-width: 0; }
.landing-hero h1 { max-width: 700px; margin-bottom: 20px; font-size: clamp(3rem, 5.4vw, 5.4rem); font-weight: 920; line-height: 0.93; letter-spacing: -0.065em; }
.landing-hero h1 em { color: var(--accent); font-style: normal; text-shadow: 0 8px 30px rgba(39, 210, 223, 0.12); }
.landing-lede { max-width: 620px; font-size: clamp(1.02rem, 1.5vw, 1.17rem); font-weight: 540; }
.mission-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 19px; }
.mascot-stage {
  position: relative;
  min-height: 365px;
  overflow: hidden;
  border: 1px solid rgba(39, 210, 223, 0.13);
  border-radius: 120px 120px 26px 26px;
  background:
    radial-gradient(circle at 50% 38%, rgba(66, 216, 148, 0.16), transparent 58%),
    linear-gradient(rgba(39, 210, 223, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 210, 223, 0.04) 1px, transparent 1px),
    rgba(14, 25, 36, 0.62);
  background-size: auto, 24px 24px, 24px 24px, auto;
  box-shadow: inset 0 -70px 80px rgba(7, 16, 25, 0.72), 0 28px 60px rgba(0, 0, 0, 0.22);
}
.mascot-stage::before { content: ""; position: absolute; inset: 12px; border: 1px dashed rgba(39, 210, 223, 0.11); border-radius: inherit; }
.mascot-stage img { position: absolute; z-index: 1; width: 250px; max-width: none; height: auto; left: -4px; bottom: -45px; filter: drop-shadow(0 24px 22px rgba(0, 0, 0, 0.28)); }
.mascot-bubble {
  position: absolute;
  z-index: 3;
  top: 30px;
  left: 18px;
  display: grid;
  gap: 1px;
  padding: 11px 13px;
  border: 1px solid rgba(39, 210, 223, 0.24);
  border-radius: 16px 16px 16px 4px;
  background: rgba(20, 35, 49, 0.92);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}
.mascot-bubble strong { font-family: var(--font-hanzi); font-size: 0.96rem; }
.mascot-bubble span { color: var(--accent); font: 620 0.56rem/1.3 var(--font-mono); }
.mascot-status { position: absolute; z-index: 4; inset: auto 12px 12px; display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 16, 25, 0.88); backdrop-filter: blur(10px); }
.mascot-status > span { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.mascot-status strong, .mascot-status small { font-family: var(--font-mono); font-size: 0.54rem; letter-spacing: 0.07em; }
.mascot-status small { color: var(--ok); }
.landing-metrics { grid-column: 1 / -1; max-width: none; margin: 10px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: rgba(14, 25, 36, 0.65); box-shadow: 0 8px 0 rgba(29, 48, 64, 0.48); }
.landing-metrics div { grid-template-columns: 34px auto 1fr; padding: 15px 16px; }
.landing-metrics div + div { padding-left: 16px; }
.metric-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font: 760 0.78rem/1 var(--font-hanzi); }
.landing-metrics strong { font-size: clamp(1.25rem, 2vw, 1.75rem); }
.landing-principles { grid-column: 1 / -1; max-width: none; gap: 8px; }
.landing-principles article { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid transparent; border-radius: 14px; }
.landing-principles article:hover { border-color: var(--line); background: rgba(14, 25, 36, 0.58); }
.landing-principles article > span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: var(--accent-soft); }
.landing-principles b { color: var(--muted); font: 630 0.53rem/1 var(--font-mono); letter-spacing: 0.07em; }
.access-card { padding: 0 30px 30px; border-radius: 26px; background: linear-gradient(145deg, rgba(39, 210, 223, 0.075), transparent 42%), var(--panel); box-shadow: 0 10px 0 rgba(29, 48, 64, 0.64), 0 34px 90px rgba(0, 0, 0, 0.34); }
.access-card::before { height: 3px; }
.access-classification { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -30px 27px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: rgba(7, 16, 25, 0.46); font: 650 0.56rem/1 var(--font-mono); letter-spacing: 0.08em; }
.access-classification span { color: var(--muted); }
.access-classification strong { color: var(--warn); font-size: 0.54rem; }
.access-lock { top: 58px; right: 25px; width: 46px; height: 46px; border-radius: 15px; background: rgba(39, 210, 223, 0.07); color: var(--accent); }
.access-card h2 { max-width: 82%; font-size: clamp(2rem, 3vw, 2.7rem); font-weight: 900; letter-spacing: -0.045em; }
.landing-auth-form input { min-height: 54px; border-width: 1.5px; border-radius: 15px; font-weight: 650; }
.landing-auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(39, 210, 223, 0.1); outline: none; }
.landing-auth-form button { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 18px; border-radius: 15px; }
.landing-auth-form button b { font-size: 1.15rem; }
.access-assurance { padding: 14px; margin-top: 18px; border: 1px solid rgba(66, 216, 148, 0.15); border-radius: 15px; background: rgba(66, 216, 148, 0.055); }
.landing-footer { padding-bottom: 24px; }

@media (max-width: 1080px) {
  .topbar { grid-template-columns: auto 1fr; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-content: stretch; }
  .tab { flex: 1 1 auto; justify-content: center; }
  .status-panel { grid-column: 2; grid-row: 1; justify-self: end; }
  .landing-main { grid-template-columns: minmax(0, 1fr) 340px; }
  .landing-hero { grid-template-columns: minmax(0, 1fr) 205px; }
  .mascot-stage { min-height: 330px; }
  .mascot-stage img { width: 220px; }
  .landing-principles b { display: none; }
}
@media (max-width: 880px) {
  .landing-main { grid-template-columns: 1fr; gap: 42px; }
  .landing-hero { grid-template-columns: minmax(0, 1fr) 230px; }
  .access-card { width: min(100%, 620px); justify-self: center; }
}
@media (max-width: 760px) {
  .app-shell { width: min(100vw - 22px, 1160px); }
  .topbar { top: 6px; margin-top: 6px; padding: 8px; border-radius: 18px; }
  .tabs { justify-content: flex-start; overflow-x: auto; }
  .tab { flex: 0 0 auto; padding: 5px 9px; }
  .mission-head { grid-template-columns: 1fr; min-height: 300px; padding-bottom: 118px; }
  .mission-companion { right: 4px; width: 190px; height: 170px; }
  .mission-companion img { width: 170px; bottom: -128px; }
  .companion-message { right: 96px; top: 18px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-tile { min-height: 110px; }
  .page-head { padding: 22px; }
}
@media (max-width: 560px) {
  .landing-shell { width: min(100% - 24px, 1240px); }
  .landing-brand small { font-size: 0.51rem; }
  .landing-brand strong { font-size: 1rem; }
  .private-pill { width: 10px; height: 10px; padding: 0; border: 0; background: var(--ok); box-shadow: 0 0 12px var(--ok); }
  .private-pill span { display: none; }
  .landing-main { padding: 34px 0 50px; gap: 34px; }
  .landing-hero { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: clamp(2.8rem, 14vw, 4.2rem); }
  .mascot-stage { width: min(100%, 300px); min-height: 300px; justify-self: center; border-radius: 110px 110px 24px 24px; }
  .mascot-stage img { width: 220px; left: 35px; bottom: -48px; }
  .mascot-bubble { left: 16px; top: 24px; }
  .landing-metrics { grid-template-columns: 1fr; }
  .landing-metrics div { grid-template-columns: 34px 62px 1fr; padding: 13px 14px; }
  .landing-metrics div + div { padding-left: 14px; border-left: 0; border-top: 1px solid var(--line); }
  .landing-principles { display: none; }
  .access-card { padding: 0 22px 24px; }
  .access-classification { margin-inline: -22px; }
  .access-lock { right: 19px; }
  .landing-footer span:last-child { display: none; }
  .brand { min-width: 0; }
  .brand-avatar { width: 42px; height: 42px; flex-basis: 42px; }
  .brand-copy small { display: none; }
  .brand-copy strong { font-size: 0.93rem; }
  .clearance-label { display: none; }
  .status-panel { padding-left: 8px; }
  .status-panel > span:nth-child(2) { display: none; }
  .auth-button { font-size: 0.58rem; }
  .stat-strip { gap: 9px; }
  .stat-tile { min-height: 104px; padding: 14px 43px 12px 14px; box-shadow: 0 5px 0 color-mix(in srgb, var(--line) 60%, transparent); }
  .stat-tile::after { right: 9px; top: 13px; width: 32px; height: 32px; border-radius: 10px; }
  .stat-tile strong { font-size: 1.75rem; }
  .program-step { grid-template-columns: 42px minmax(0, 1fr); }
  .program-step .go { grid-column: 2; justify-self: start; }
  .page-head { margin-top: 14px; }
  .page-head h2 { font-size: 2rem; }
  .mission-head { min-height: 380px; padding-bottom: 170px; }
  .briefing-meta { gap: 5px; }
  .panel { padding: 18px 16px; }
}
