/* =========================================================
   译本 · 翻译理论与实践复习室
   Author: JammyHuang
   ========================================================= */
:root {
  --bg: #f3efe6;
  --bg-deep: #e9e2d4;
  --bg-glow: #fbf8f0;
  --surface: rgba(255, 252, 245, 0.78);
  --surface-strong: #fffdf8;
  --surface-soft: rgba(251, 247, 238, 0.72);
  --surface-muted: rgba(237, 231, 219, 0.7);
  --ink: #1d2824;
  --ink-strong: #111a17;
  --ink-2: #4e5b55;
  --ink-3: #7c8881;
  --ink-faint: #9ba49e;
  --line: rgba(29, 40, 36, 0.12);
  --line-strong: rgba(29, 40, 36, 0.2);
  --accent: #22675b;
  --accent-strong: #174f46;
  --accent-soft: rgba(34, 103, 91, 0.1);
  --accent-softer: rgba(34, 103, 91, 0.055);
  --amber: #a8752e;
  --amber-soft: rgba(168, 117, 46, 0.12);
  --clay: #ab5a42;
  --clay-soft: rgba(171, 90, 66, 0.11);
  --gold: #b4955f;
  --danger: #a84f43;
  --success: #2c7562;
  --shadow-xs: 0 1px 2px rgba(27, 38, 33, 0.04);
  --shadow-sm: 0 8px 24px -16px rgba(27, 38, 33, 0.25);
  --shadow-md: 0 22px 60px -32px rgba(27, 38, 33, 0.36);
  --shadow-lg: 0 36px 90px -40px rgba(20, 31, 27, 0.4);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --en: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --header-h: 82px;
  --max-w: 1380px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0f1614;
  --bg-deep: #0a100e;
  --bg-glow: #17211d;
  --surface: rgba(24, 34, 30, 0.78);
  --surface-strong: #18221e;
  --surface-soft: rgba(25, 36, 31, 0.7);
  --surface-muted: rgba(35, 47, 41, 0.7);
  --ink: #e8e3d7;
  --ink-strong: #f7f3e9;
  --ink-2: #bdc4bc;
  --ink-3: #8d9a92;
  --ink-faint: #6d7972;
  --line: rgba(231, 225, 211, 0.12);
  --line-strong: rgba(231, 225, 211, 0.22);
  --accent: #78bead;
  --accent-strong: #9ad5c5;
  --accent-soft: rgba(120, 190, 173, 0.13);
  --accent-softer: rgba(120, 190, 173, 0.065);
  --amber: #d7ae70;
  --amber-soft: rgba(215, 174, 112, 0.13);
  --clay: #d58972;
  --clay-soft: rgba(213, 137, 114, 0.13);
  --gold: #c3a46c;
  --danger: #dd8a7d;
  --success: #82c5ae;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 10px 28px -18px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 26px 70px -36px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 100px -44px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  background:
    radial-gradient(1100px 700px at 12% -10%, rgba(178, 148, 95, 0.13), transparent 60%),
    radial-gradient(900px 650px at 92% 4%, rgba(34, 103, 91, 0.09), transparent 56%),
    linear-gradient(180deg, var(--bg-glow), var(--bg) 42%, var(--bg-deep));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
html[data-theme="dark"] body::before { opacity: 0.16; mix-blend-mode: soft-light; }

::selection { background: rgba(34, 103, 91, 0.22); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 5px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 1000;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- boot ---------- */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background:
    radial-gradient(620px 420px at 50% 38%, var(--bg-glow), transparent 72%),
    var(--bg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.boot-screen.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-mark {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  color: #f7f1e5;
  background: var(--accent);
  font-family: var(--serif);
  font-size: 32px;
  box-shadow: 0 20px 50px -20px rgba(34, 103, 91, 0.65);
  animation: breathe 2.8s ease-in-out infinite;
}
.boot-title { font-family: var(--serif); font-size: 22px; letter-spacing: 0.14em; color: var(--ink-strong); }
.boot-line { width: 180px; height: 1px; overflow: hidden; background: var(--line); }
.boot-line span { display: block; width: 42%; height: 100%; background: var(--accent); animation: scan 1.5s ease-in-out infinite; }
.boot-copy { font-size: 12px; letter-spacing: 0.16em; color: var(--ink-3); }
@keyframes breathe { 50% { transform: translateY(-3px) scale(1.03); } }
@keyframes scan { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }

/* ---------- shell / header ---------- */
.app-shell {
  width: min(100%, var(--max-w));
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 42px) 56px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
  padding: 12px 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 72%, transparent));
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 15px 40px -34px rgba(20, 30, 26, 0.5);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  flex: 0 0 auto;
  border: 0;
  background: none;
  padding: 4px;
  text-align: left;
  color: var(--ink);
}
.brand-seal {
  position: relative;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  border-radius: 14px;
  color: #f7f1e5;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  font-family: var(--serif);
  font-size: 23px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 22px -12px rgba(20, 60, 52, 0.65);
}
.brand-seal::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(250, 246, 236, 0.36);
  border-radius: 10px;
}
.brand-text { display: grid; gap: 0; }
.brand-en {
  font-family: var(--en);
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.brand-cn {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0.12em;
  color: var(--ink-strong);
  font-weight: 600;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: var(--shadow-xs);
}
.nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.nav-btn svg { width: 16px; height: 16px; opacity: 0.8; }
.nav-btn:hover { color: var(--ink-strong); background: var(--accent-softer); }
.nav-btn.is-active {
  color: color-mix(in srgb, var(--accent-strong) 92%, var(--ink));
  background: var(--surface-strong);
  box-shadow: 0 3px 12px -6px rgba(28, 45, 38, 0.3), inset 0 0 0 1px var(--line);
}
html[data-theme="dark"] .nav-btn.is-active { color: var(--accent-strong); }
.nav-badge {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--clay-soft);
  color: var(--clay);
  font-family: var(--en);
  font-size: 10px;
  line-height: 17px;
  text-align: center;
}
.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  color: var(--ink-2);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { transform: translateY(-1px); background: var(--surface-strong); color: var(--ink-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: block; }
.header-progress {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  color: var(--ink-2);
  font-size: 12px;
}
.mini-ring {
  --p: 0;
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0);
}
.mini-ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--bg);
}
.header-progress strong { font-family: var(--en); font-size: 13px; color: var(--ink); font-weight: 600; }

/* ---------- common ---------- */
.main { display: block; padding-top: 18px; }
.view { animation: viewIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--en);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gold); }
.eyebrow.no-rule::before { display: none; }
.serif { font-family: var(--serif); }
.en { font-family: var(--en); }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  color: #f8f3e8;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  box-shadow: 0 12px 28px -16px rgba(23, 79, 70, 0.7);
}
.btn-primary:hover { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent-strong)); }
html[data-theme="dark"] .btn-primary { color: #0e1a16; font-weight: 600; }
.btn-ghost { border-color: var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-strong); color: var(--ink-strong); }
.btn-soft { background: var(--accent-soft); color: var(--accent-strong); }
.btn-soft:hover { background: color-mix(in srgb, var(--accent-soft) 75%, var(--accent) 10%); }
.btn-warm { background: var(--clay-soft); color: var(--clay); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.btn-lg { min-height: 50px; padding: 12px 26px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn[disabled] { transform: none; }
.text-btn {
  border: 0;
  background: none;
  padding: 4px 2px;
  color: var(--ink-3);
  font-size: 12.5px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}
.text-btn:hover { color: var(--accent); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: nowrap;
}
.chip-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.chip-clay { color: var(--clay); border-color: color-mix(in srgb, var(--clay) 26%, transparent); background: var(--clay-soft); }
.chip-amber { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 26%, transparent); background: var(--amber-soft); }
.kicker { font-size: 11px; letter-spacing: 0.16em; color: var(--ink-3); text-transform: uppercase; font-family: var(--en); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 18px 0 24px;
  flex-wrap: wrap;
}
.view-head h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.04em;
  color: var(--ink-strong);
  margin: 8px 0 6px;
}
.view-head p { max-width: 620px; color: var(--ink-2); font-size: 13.5px; }
.view-head-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- home / hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 22px;
  min-height: 390px;
  margin: 12px 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--surface-strong) 88%, transparent), color-mix(in srgb, var(--surface) 62%, transparent));
  box-shadow: var(--shadow-md);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 90% 0%, rgba(34, 103, 91, 0.16), transparent 65%),
    radial-gradient(500px 380px at 6% 100%, rgba(180, 149, 95, 0.15), transparent 70%);
}
.hero::after {
  content: "信 · 达 · 雅";
  position: absolute;
  right: 30px;
  bottom: 18px;
  font-family: var(--serif);
  font-size: clamp(52px, 7vw, 100px);
  line-height: 1;
  letter-spacing: 0.18em;
  color: var(--ink);
  opacity: 0.035;
  pointer-events: none;
  white-space: nowrap;
}
.hero-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(28px, 4.5vw, 58px);
}
.hero h1 {
  margin: 18px 0 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 5.1vw, 66px);
  line-height: 1.18;
  letter-spacing: 0.045em;
  color: var(--ink-strong);
}
.hero h1 em {
  position: relative;
  font-style: normal;
  color: var(--accent);
}
.hero h1 em::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 5px;
  height: 7px;
  background: color-mix(in srgb, var(--gold) 38%, transparent);
  z-index: -1;
  border-radius: 3px;
}
.hero-desc {
  max-width: 500px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.9;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 24px;
  color: var(--ink-3);
  font-size: 11.5px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 13px; height: 13px; opacity: 0.7; }
.hero-side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 24px clamp(20px, 2.5vw, 32px) 24px 0;
}
.progress-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
  box-shadow: var(--shadow-sm);
}
.progress-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.progress-card h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: 0.08em; }
.progress-card .kicker { margin-top: 3px; font-size: 9.5px; }
.progress-orb {
  --p: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin: 18px auto 14px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), color-mix(in srgb, var(--line) 72%, transparent) 0);
  transition: background 0.8s ease;
}
.progress-orb::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}
.progress-orb-inner { position: relative; display: grid; place-items: center; gap: 0; }
.progress-orb strong { font-family: var(--en); font-size: 34px; font-weight: 500; line-height: 1; color: var(--ink-strong); }
.progress-orb strong small { font-size: 14px; color: var(--ink-3); }
.progress-orb span { font-size: 10px; letter-spacing: 0.14em; color: var(--ink-3); margin-top: 7px; }
.progress-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.progress-mini-grid div { text-align: center; }
.progress-mini-grid strong { display: block; font-family: var(--en); font-size: 18px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.progress-mini-grid span { font-size: 10px; color: var(--ink-3); }
.hero-quote {
  padding: 2px 4px;
  color: var(--ink-3);
  font-family: var(--serif);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-align: center;
}
.hero-quote b { color: var(--ink-2); font-weight: 500; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0 26px; }
.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 84px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow-xs);
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.stat-icon.warm { background: var(--clay-soft); color: var(--clay); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon svg { width: 18px; height: 18px; }
.stat-card strong { display: block; font-family: var(--en); font-size: 25px; font-weight: 500; line-height: 1.1; color: var(--ink-strong); }
.stat-card span { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.stat-card .stat-unit { font-size: 11px; color: var(--ink-3); margin-left: 3px; }

.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 28px 0 14px; }
.section-title-row h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: 0.06em; }
.section-title-row p { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.section-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.section-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 244px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.section-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.section-card::after {
  content: attr(data-num);
  position: absolute;
  right: 14px;
  top: 4px;
  font-family: var(--en);
  font-size: 64px;
  line-height: 1;
  color: var(--ink);
  opacity: 0.04;
  pointer-events: none;
}
.section-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-no {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--en);
  font-size: 13px;
  font-weight: 600;
}
.section-card h3 { margin: 20px 0 4px; font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-strong); }
.section-card .section-en { font-family: var(--en); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.section-card p { margin-top: 12px; color: var(--ink-2); font-size: 12.5px; line-height: 1.8; flex: 1; }
.section-card-foot { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.bar { flex: 1; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--accent); transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.bar.warm > i { background: var(--clay); }
.bar.amber > i { background: var(--amber); }
.section-card-foot span { font-family: var(--en); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.section-go {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  border: 0;
  background: none;
  padding: 0;
}
.section-go svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.section-go:hover svg { transform: translateX(3px); }
.home-lower { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 14px; margin-top: 26px; }
.lower-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface) 82%, transparent); box-shadow: var(--shadow-xs); }
.lower-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lower-card h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: 0.05em; }
.history-list { display: grid; gap: 2px; }
.history-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-date { font-family: var(--en); font-size: 11px; color: var(--ink-3); min-width: 84px; }
.history-score { font-family: var(--en); font-size: 18px; color: var(--ink-strong); margin-left: auto; }
.history-score small { font-size: 10px; color: var(--ink-3); }
.empty-state { padding: 26px 8px; text-align: center; color: var(--ink-3); font-size: 12px; }
.quote-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: #f2ecdf;
  background: linear-gradient(150deg, #1e544a, #173e37 60%, #112e29);
  box-shadow: var(--shadow-md);
}
.quote-card::before {
  content: "“";
  position: absolute;
  right: 14px;
  top: -22px;
  font-family: var(--serif);
  font-size: 150px;
  line-height: 1;
  color: rgba(244, 236, 220, 0.08);
}
.quote-card blockquote { margin: 0; font-family: var(--serif); font-size: clamp(18px, 2vw, 24px); line-height: 1.65; letter-spacing: 0.05em; }
.quote-card cite { display: block; margin-top: 14px; font-style: normal; font-size: 11px; letter-spacing: 0.16em; color: rgba(242, 236, 223, 0.6); }
.continue-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 0;
  padding: 13px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--accent-softer);
}
.continue-strip .continue-copy { flex: 1; min-width: 0; }
.continue-strip strong { display: block; font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-strip span { font-size: 11px; color: var(--ink-3); }

/* ---------- study layout ---------- */
.study-shell {
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.study-side {
  position: sticky;
  top: calc(var(--header-h) + 14px);
  max-height: calc(100vh - var(--header-h) - 30px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: var(--shadow-xs);
}
.side-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.side-head-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.side-head h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: 0.05em; }
.side-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface-muted); }
.side-tab {
  padding: 6px 2px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  white-space: nowrap;
}
.side-tab.is-active { background: var(--surface-strong); color: var(--accent-strong); box-shadow: var(--shadow-xs); font-weight: 600; }
.side-scroll { overflow: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.side-scroll::-webkit-scrollbar { width: 5px; }
.side-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.chapter-block { margin-bottom: 3px; }
.chapter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 9px 6px;
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.chapter-label::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--gold); }
.set-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
  transition: background 0.18s ease, color 0.18s ease;
}
.set-link:hover { background: var(--accent-softer); color: var(--ink); }
.set-link.is-active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.set-link-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-link-count { font-family: var(--en); font-size: 10px; color: var(--ink-3); flex: 0 0 auto; }
.set-check { display: grid; place-items: center; width: 13px; height: 13px; flex: 0 0 13px; border: 1px solid var(--line-strong); border-radius: 50%; color: transparent; }
.set-check.is-done { border-color: var(--accent); background: var(--accent); color: #fff; }
.set-check svg { width: 8px; height: 8px; }
.side-foot { padding: 12px 14px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.side-progress { display: flex; align-items: center; gap: 9px; }
.side-progress .bar { height: 3px; }
.side-progress span { font-family: var(--en); font-size: 10px; color: var(--ink-3); white-space: nowrap; }

.mobile-set-bar { display: none; }
.study-main { min-width: 0; }
.study-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 6px; }
.study-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
}
.study-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--gold) 80%, var(--accent)));
  opacity: 0.8;
}
.study-card-inner { padding: clamp(22px, 3.5vw, 42px); }
.study-meta-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.study-meta-row .spacer { flex: 1; }
.item-index { font-family: var(--en); font-size: 12px; color: var(--ink-3); }
.item-index strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.prompt-block { position: relative; }
.prompt-label { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; font-size: 10px; letter-spacing: 0.16em; color: var(--ink-3); text-transform: uppercase; font-family: var(--en); }
.prompt-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.prompt {
  font-family: var(--en);
  font-size: clamp(21px, 2.5vw, 30px);
  line-height: 1.65;
  letter-spacing: 0.005em;
  color: var(--ink-strong);
  text-wrap: pretty;
}
.prompt.is-zh {
  font-family: var(--serif);
  font-size: clamp(22px, 2.7vw, 31px);
  line-height: 1.85;
  letter-spacing: 0.045em;
}
.prompt.is-long { font-size: clamp(17px, 2vw, 22px); line-height: 1.85; }
.prompt.is-zh.is-long { font-size: clamp(18px, 2.15vw, 23px); line-height: 2; }
.instruction {
  margin: 8px 0 24px;
  padding: 10px 13px;
  border-left: 2px solid var(--gold);
  background: linear-gradient(90deg, var(--amber-soft), transparent);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.8;
  border-radius: 0 8px 8px 0;
}
.hint-line { display: flex; align-items: center; gap: 7px; margin-top: 20px; color: var(--ink-3); font-size: 11.5px; }
.hint-line svg { width: 14px; height: 14px; opacity: 0.7; }
.reveal-wrap { margin-top: 24px; }
.reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 19px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  transition: all 0.2s ease;
}
.reveal-btn:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-softer); }
.reveal-btn svg { width: 15px; height: 15px; }
.answer-panel {
  position: relative;
  margin-top: 22px;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 58%, transparent), transparent 60%),
    var(--surface-soft);
  animation: answerIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes answerIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.answer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.answer-head .answer-label { display: flex; align-items: center; gap: 7px; font-family: var(--en); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-strong); }
.answer-head .answer-label::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.answer-text {
  font-family: var(--en);
  font-size: clamp(18px, 2.15vw, 24px);
  line-height: 1.75;
  color: var(--ink-strong);
  white-space: pre-wrap;
  text-wrap: pretty;
}
.answer-text.is-zh { font-family: var(--serif); font-size: clamp(18px, 2.2vw, 25px); line-height: 1.9; letter-spacing: 0.035em; }
.answer-text.is-long { font-size: clamp(15px, 1.75vw, 18px); line-height: 1.9; }
.note-box { margin-top: 15px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--ink-2); font-size: 12px; line-height: 1.85; }
.note-box strong { color: var(--ink); font-weight: 600; }
.answer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.study-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}
.study-footer-mid { display: flex; align-items: center; gap: 8px; }
.study-footer .key-hint { color: var(--ink-3); font-size: 10.5px; }
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-strong);
  color: var(--ink-3);
  font-family: var(--en);
  font-size: 10px;
  line-height: 1;
}
.study-empty { display: grid; place-items: center; min-height: 340px; padding: 30px; text-align: center; color: var(--ink-3); }

/* practice */
.practice-input-wrap { margin-top: 26px; }
.practice-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.practice-label { font-size: 10px; letter-spacing: 0.16em; color: var(--ink-3); text-transform: uppercase; font-family: var(--en); }
.char-count { font-family: var(--en); font-size: 10.5px; color: var(--ink-3); }
.practice-textarea {
  display: block;
  width: 100%;
  min-height: 178px;
  resize: vertical;
  padding: 17px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink-strong);
  font-family: var(--en);
  font-size: 18px;
  line-height: 1.8;
  box-shadow: inset 0 1px 3px rgba(20, 30, 26, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.practice-textarea.is-zh { font-family: var(--serif); font-size: 18px; line-height: 1.95; letter-spacing: 0.03em; }
.practice-textarea::placeholder { color: var(--ink-faint); font-family: var(--sans); font-size: 13px; letter-spacing: 0; }
.practice-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.practice-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.rating-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.rating-label { font-size: 11px; color: var(--ink-3); margin-right: 3px; }
.rating-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
}
.rating-btn:hover { border-color: var(--line-strong); background: var(--surface-strong); }
.rating-btn.is-good.is-selected { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.rating-btn.is-again.is-selected { border-color: var(--clay); color: var(--clay); background: var(--clay-soft); }
.practice-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.7;
}
.practice-tip svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 3px; }

/* collapsible long instructions? */
details.instruction-details { margin: 0 0 12px; }
details.instruction-details summary { cursor: pointer; color: var(--ink-3); font-size: 11px; }

/* ---------- exam ---------- */
.exam-intro-wrap { max-width: 1000px; margin: 26px auto 0; }
.exam-intro {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(720px 440px at 100% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 65%),
    var(--surface-strong);
  box-shadow: var(--shadow-lg);
}
.exam-intro::after {
  content: "EXAM";
  position: absolute;
  right: 26px;
  bottom: -14px;
  font-family: var(--en);
  font-size: clamp(70px, 13vw, 160px);
  letter-spacing: 0.04em;
  color: var(--ink);
  opacity: 0.035;
  line-height: 1;
  pointer-events: none;
}
.exam-intro h1 { margin: 18px 0 14px; font-family: var(--serif); font-size: clamp(32px, 4.6vw, 54px); font-weight: 600; line-height: 1.25; letter-spacing: 0.03em; color: var(--ink-strong); }
.exam-intro .lead { max-width: 630px; color: var(--ink-2); font-size: 14px; line-height: 1.9; }
.exam-composition { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px 0; }
.comp-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.comp-card .comp-no { font-family: var(--en); font-size: 10px; letter-spacing: 0.14em; color: var(--ink-3); }
.comp-card strong { display: block; margin: 5px 0 1px; font-family: var(--serif); font-size: 18px; font-weight: 600; }
.comp-card span { display: block; color: var(--ink-3); font-size: 11px; }
.exam-notice { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 13px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-2); font-size: 11.5px; margin-bottom: 26px; }
.exam-notice span { display: inline-flex; align-items: center; gap: 6px; }
.exam-notice svg { width: 13px; height: 13px; color: var(--accent); }
.exam-start-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.exam-history-note { color: var(--ink-3); font-size: 11px; }
.exam-shell { max-width: 1000px; margin: 0 auto; }
.exam-topbar {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}
.exam-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.exam-topbar-left strong { font-family: var(--serif); font-size: 14px; letter-spacing: 0.05em; white-space: nowrap; }
.exam-topbar-left span { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-timer { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; color: var(--ink); }
.exam-timer svg { width: 14px; height: 14px; color: var(--ink-3); }
.exam-timer.is-urgent { color: var(--danger); }
.exam-progress { flex: 1; max-width: 180px; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.exam-progress i { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); transition: width 0.3s ease; }
.exam-section { margin-bottom: 20px; }
.exam-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 10px;
  padding: 0 4px;
}
.exam-section-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: 0.05em; }
.exam-section-head .section-note { font-size: 11px; color: var(--ink-3); }
.exam-q {
  margin-bottom: 12px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s ease;
}
.exam-q:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.exam-q-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.q-no { display: inline-grid; place-items: center; min-width: 27px; height: 27px; padding: 0 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); font-family: var(--en); font-size: 12px; font-weight: 600; }
.q-points { margin-left: auto; font-family: var(--en); font-size: 10px; color: var(--ink-3); }
.exam-prompt { font-family: var(--en); font-size: 18px; line-height: 1.7; color: var(--ink-strong); }
.exam-prompt.is-zh { font-family: var(--serif); font-size: 19px; line-height: 1.85; letter-spacing: 0.03em; }
.exam-prompt.is-long { font-size: 15px; line-height: 1.85; }
.exam-q textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  margin-top: 12px;
  resize: vertical;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--en);
  font-size: 15px;
  line-height: 1.75;
}
.exam-q textarea::placeholder { color: var(--ink-faint); font-family: var(--sans); font-size: 11.5px; }
.exam-q textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.exam-q.is-submitted textarea { background: var(--surface-muted); }
.ref-solution {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-softer);
  animation: answerIn 0.35s ease both;
}
.ref-solution .ref-label { font-family: var(--en); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-strong); }
.ref-solution p { margin-top: 6px; font-family: var(--en); font-size: 15px; line-height: 1.8; color: var(--ink-strong); white-space: pre-wrap; }
.ref-solution p.is-zh { font-family: var(--serif); font-size: 16px; line-height: 1.9; }
.ref-solution .ref-note { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 7px; color: var(--ink-3); font-size: 11px; font-family: var(--sans); }
.self-score { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); }
.self-score-label { font-size: 10.5px; color: var(--ink-3); }
.score-btns { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.score-btn { min-width: 33px; height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink-3); font-family: var(--en); font-size: 11.5px; }
.score-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.score-btn.is-selected { border-color: var(--accent); background: var(--accent); color: #fff; }
html[data-theme="dark"] .score-btn.is-selected { color: #0e1a16; }
.exam-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 24px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.exam-submit-note { color: var(--ink-3); font-size: 11px; }
.exam-result-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 300px at 100% 0%, var(--accent-soft), transparent 70%),
    var(--surface-strong);
  box-shadow: var(--shadow-md);
}
.exam-result-main { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.score-big { display: flex; align-items: baseline; gap: 2px; font-family: var(--en); color: var(--ink-strong); }
.score-big strong { font-size: clamp(58px, 8vw, 92px); font-weight: 500; line-height: 1; letter-spacing: -0.03em; }
.score-big span { font-size: 19px; color: var(--ink-3); }
.score-summary { flex: 1; min-width: 220px; }
.score-summary h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 6px; }
.score-summary p { color: var(--ink-3); font-size: 12px; }
.score-summary .score-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.result-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 0 10px; padding: 0 4px; }
.result-section-title h3 { font-family: var(--serif); font-size: 19px; letter-spacing: 0.05em; }
.result-sticky-score {
  position: sticky;
  bottom: 14px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}
.result-sticky-score .total-label { font-size: 11.5px; color: var(--ink-3); }
.result-sticky-score .total-label strong { font-family: var(--en); color: var(--ink-strong); font-size: 17px; margin-left: 3px; }
.result-sticky-score .total-label span { font-family: var(--en); font-size: 11px; }
.unanswered-tag { color: var(--clay); font-size: 10px; margin-left: 4px; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 16px; align-items: start; }
.settings-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.settings-card + .settings-card { margin-top: 16px; }
.settings-card h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 0.05em; margin-bottom: 5px; }
.settings-card .settings-desc { color: var(--ink-3); font-size: 12px; line-height: 1.8; margin-bottom: 18px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting-row:first-of-type { border-top: 0; padding-top: 0; }
.setting-row-copy strong { display: block; font-size: 13px; font-weight: 500; }
.setting-row-copy span { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11px; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border-radius: 9px; background: var(--surface-muted); }
.segmented button { border: 0; border-radius: 6px; background: transparent; padding: 6px 11px; color: var(--ink-3); font-size: 11.5px; }
.segmented button.is-active { background: var(--surface-strong); color: var(--accent-strong); box-shadow: var(--shadow-xs); font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 10.5px; background: var(--accent-soft); color: var(--accent-strong); }
.status-pill.warn { background: var(--clay-soft); color: var(--clay); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.progress-detail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.detail-cell { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.detail-cell strong { display: block; font-family: var(--en); font-size: 22px; font-weight: 500; color: var(--ink-strong); }
.detail-cell span { color: var(--ink-3); font-size: 10px; }
.danger-zone { border-color: color-mix(in srgb, var(--clay) 30%, var(--line)); }
.danger-zone h3 { color: var(--clay); }
.about-list { display: grid; gap: 10px; color: var(--ink-2); font-size: 12px; }
.about-list div { display: flex; gap: 14px; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.about-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.about-list span:first-child { color: var(--ink-3); flex: 0 0 auto; }
.about-list span:last-child { text-align: right; }
.author-line { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.author-seal { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(145deg, var(--clay), color-mix(in srgb, var(--clay) 70%, #6b2e22)); color: #fff8ee; font-family: var(--serif); font-size: 16px; }
.author-line strong { display: block; font-size: 13px; }
.author-line span { color: var(--ink-3); font-size: 11px; }
.cookie-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 11px 12px; border-radius: 10px; background: var(--accent-softer); color: var(--ink-3); font-size: 10.5px; line-height: 1.7; }
.cookie-note svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 2px; color: var(--accent); }
.storage-bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.storage-bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); border-radius: inherit; }
.data-source { margin-top: 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: 10.5px; color: var(--ink-3); line-height: 1.8; }

/* ---------- modal / toast ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 20, 17, 0.46);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(100%, 480px);
  max-height: 86vh;
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 0.05em; }
.modal p { margin-top: 8px; color: var(--ink-2); font-size: 12.5px; line-height: 1.85; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.modal-kicker { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; font-family: var(--en); color: var(--ink-3); margin-bottom: 4px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 800;
  max-width: min(92vw, 460px);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: all 0.25s ease;
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.noscript { position: fixed; inset: auto 16px 16px; z-index: 1000; padding: 16px; background: #fff3cd; color: #533f03; border-radius: 10px; font-size: 14px; }

/* ---------- footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 54px;
  padding: 22px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.8;
}
.footer-brand { display: flex; align-items: center; gap: 9px; }
.footer-seal { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-strong); font-family: var(--serif); font-size: 12px; }
.footer-author strong { color: var(--ink-2); font-weight: 500; }
.footer-links { display: flex; align-items: center; gap: 14px; }
.footer-links button { border: 0; background: none; padding: 0; color: var(--ink-3); font-size: 10.5px; text-decoration: underline; text-underline-offset: 3px; }
.footer-links button:hover { color: var(--accent); }
.mobile-nav { display: none; }

/* ---------- utilities ---------- */
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px !important; }
.stack-8 { display: grid; gap: 8px; }
.stack-12 { display: grid; gap: 12px; }
.row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.fade-in { animation: viewIn 0.4s ease both; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .site-header { gap: 14px; }
  .nav-btn { padding: 8px 12px; font-size: 12.5px; }
  .nav-btn svg { display: none; }
  .header-progress { display: none; }
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr); }
  .hero h1 { font-size: clamp(36px, 5vw, 54px); }
}
@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { display: grid; grid-template-columns: 1fr 1fr; padding: 0 clamp(22px, 4.5vw, 46px) clamp(24px, 4vw, 40px); }
  .hero-quote { display: none; }
  .progress-orb { width: 120px; height: 120px; margin: 10px auto; }
  .progress-orb strong { font-size: 28px; }
  .section-grid { grid-template-columns: 1fr 1fr; }
  .section-card:last-child { grid-column: 1 / -1; min-height: 190px; }
  .home-lower { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .study-shell { grid-template-columns: 250px minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 820px) {
  :root { --header-h: 66px; }
  body { font-size: 14px; }
  .app-shell { padding: 0 14px 96px; }
  .site-header { min-height: var(--header-h); padding: 9px 0; }
  .brand-seal { width: 39px; height: 39px; flex-basis: 39px; font-size: 20px; border-radius: 12px; }
  .brand-cn { font-size: 16px; }
  .brand-en { font-size: 8px; }
  .main-nav { display: none; }
  .header-actions { margin-left: auto; }
  .main { padding-top: 8px; }
  .mobile-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
    box-shadow: 0 20px 50px -24px rgba(15, 25, 21, 0.5);
  }
  .mobile-nav .nav-btn { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; font-size: 9.5px; }
  .mobile-nav .nav-btn svg { display: block; width: 18px; height: 18px; }
  .mobile-nav .nav-btn.is-active { background: var(--accent-soft); color: var(--accent-strong); box-shadow: none; }
  .hero { margin-top: 2px; border-radius: 22px; min-height: 0; }
  .hero-main { padding: 26px 22px 24px; }
  .hero h1 { margin: 14px 0; font-size: clamp(34px, 9vw, 46px); line-height: 1.22; }
  .hero-desc { font-size: 12.5px; line-height: 1.85; }
  .hero-actions { margin-top: 20px; }
  .hero-actions .btn { flex: 1; min-width: 108px; }
  .hero-meta { display: none; }
  .hero-side { grid-template-columns: 1fr; padding: 0 16px 18px; }
  .progress-card { padding: 16px; }
  .progress-card-top { align-items: center; }
  .progress-orb { width: 108px; height: 108px; margin: 12px auto; }
  .progress-orb strong { font-size: 25px; }
  .progress-mini-grid { padding-top: 10px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 18px; }
  .stat-card { min-height: 70px; padding: 12px; gap: 9px; border-radius: 13px; }
  .stat-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; }
  .stat-icon svg { width: 16px; height: 16px; }
  .stat-card strong { font-size: 21px; }
  .stat-card span { font-size: 10px; }
  .section-grid { grid-template-columns: 1fr; gap: 10px; }
  .section-card { min-height: 0; padding: 18px; }
  .section-card:last-child { grid-column: auto; min-height: 0; }
  .section-card h3 { margin-top: 14px; font-size: 20px; }
  .section-card p { margin-top: 8px; }
  .section-card-foot { margin-top: 14px; }
  .home-lower { margin-top: 16px; gap: 10px; }
  .lower-card { padding: 17px; }
  .view-head { align-items: flex-start; margin: 12px 0 16px; gap: 12px; }
  .view-head h2 { font-size: 29px; margin-top: 5px; }
  .view-head p { font-size: 12px; }
  .study-shell { display: block; }
  .study-side { display: none; }
  .mobile-set-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }
  .mobile-set-bar svg { width: 15px; height: 15px; color: var(--ink-3); flex: 0 0 15px; }
  .mobile-set-bar select { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: 12px; padding: 2px 0; outline: none; }
  .study-toolbar { margin-bottom: 9px; gap: 7px; }
  .study-toolbar .toolbar-left .chip { font-size: 10px; padding: 3px 8px; }
  .study-card-inner { padding: 20px 17px 18px; }
  .study-meta-row { margin-bottom: 15px; }
  .prompt { font-size: 19px; line-height: 1.7; }
  .prompt.is-zh { font-size: 21px; line-height: 1.85; }
  .prompt.is-long, .prompt.is-zh.is-long { font-size: 16px; line-height: 1.9; }
  .instruction { font-size: 11px; margin-bottom: 18px; }
  .reveal-wrap { margin-top: 18px; }
  .reveal-btn { width: 100%; justify-content: center; }
  .answer-panel { padding: 17px 16px; }
  .answer-text { font-size: 17px; }
  .answer-text.is-zh { font-size: 18px; }
  .answer-text.is-long { font-size: 14.5px; }
  .study-footer { padding: 9px 10px; gap: 6px; }
  .study-footer .btn { min-height: 36px; padding: 6px 10px; font-size: 11.5px; }
  .study-footer .key-hint { display: none; }
  .study-footer-mid .btn { padding: 6px 9px; }
  .practice-textarea { min-height: 150px; font-size: 16px; }
  .practice-textarea.is-zh { font-size: 16.5px; }
  .practice-actions .btn { flex: 1; }
  .rating-row { gap: 5px; }
  .rating-btn { padding: 6px 10px; }
  .exam-intro-wrap { margin-top: 12px; }
  .exam-intro { padding: 24px 19px; border-radius: 22px; }
  .exam-intro h1 { font-size: 34px; }
  .exam-intro .lead { font-size: 12.5px; }
  .exam-composition { grid-template-columns: 1fr; gap: 6px; margin: 18px 0; }
  .comp-card { display: flex; align-items: center; gap: 10px; padding: 11px 12px; }
  .comp-card .comp-no { flex: 0 0 44px; }
  .comp-card strong { margin: 0; font-size: 15px; }
  .comp-card span { margin-left: auto; }
  .exam-notice { font-size: 10.5px; padding: 10px 12px; }
  .exam-start-row { display: grid; grid-template-columns: 1fr; }
  .exam-start-row .btn { width: 100%; }
  .exam-topbar { top: calc(var(--header-h) + 2px); border-radius: 14px; padding: 8px 10px; gap: 8px; flex-wrap: wrap; }
  .exam-topbar-left span { display: none; }
  .exam-progress { order: 3; max-width: none; flex-basis: 100%; }
  .exam-topbar .btn { min-height: 31px; padding: 5px 10px; font-size: 10.5px; }
  .exam-timer { font-size: 12px; margin-left: auto; }
  .exam-section-head h2 { font-size: 17px; }
  .exam-section-head .section-note { display: none; }
  .exam-q { padding: 15px 14px; border-radius: 13px; }
  .exam-prompt { font-size: 16px; }
  .exam-prompt.is-zh { font-size: 17px; }
  .exam-prompt.is-long { font-size: 14px; }
  .exam-q textarea { min-height: 86px; }
  .exam-result-hero { padding: 20px 17px; }
  .exam-result-main { gap: 18px; }
  .score-big strong { font-size: 60px; }
  .result-sticky-score { bottom: max(76px, calc(env(safe-area-inset-bottom) + 70px)); padding: 10px 12px; }
  .result-sticky-score .btn { min-height: 34px; padding: 6px 12px; font-size: 11px; }
  .settings-card { padding: 18px; }
  .setting-row { gap: 10px; }
  .progress-detail { gap: 6px; }
  .detail-cell { padding: 10px; }
  .site-footer { margin-top: 34px; padding: 18px 2px 0; font-size: 9.5px; gap: 8px; }
  .footer-links { gap: 10px; }
  .toast { bottom: 88px; }
  .modal { padding: 21px; border-radius: 18px; }
}
@media (max-width: 420px) {
  .brand-en { display: none; }
  .brand-cn { font-size: 15px; }
  .hero h1 { font-size: 33px; }
  .stat-card { padding: 10px; }
  .stat-card strong { font-size: 19px; }
  .stat-icon { display: none; }
  .exam-result-main { display: block; }
  .score-big { margin-bottom: 8px; }
  .segmented button { padding: 6px 8px; font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* print: clean reference sheet */
@media print {
  .site-header, .mobile-nav, .site-footer, .study-side, .study-toolbar, .study-footer, .reveal-wrap, .practice-actions, .rating-row, .result-actions, .result-sticky-score, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .app-shell { max-width: none; padding: 0; }
  .study-shell { display: block; }
  .study-card { box-shadow: none; border: 0; }
  .answer-panel { display: block !important; box-shadow: none; }
  .exam-q { break-inside: avoid; box-shadow: none; }
}

/* late additions */
.prompt, .exam-prompt, .answer-text, .exam-my-answer p { white-space: pre-wrap; }
.hero h1 em { position: relative; z-index: 0; }
.study-card { scroll-margin-top: calc(var(--header-h) + 22px); }
.exam-my-answer {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}
.exam-my-answer .kicker { display: block; margin-bottom: 4px; }
.exam-my-answer p { color: var(--ink-2); font-family: var(--en); font-size: 13.5px; line-height: 1.8; }
.exam-my-answer p.is-zh { font-family: var(--serif); }
.exam-q.is-submitted { background: var(--surface-strong); }
.exam-q .ref-solution p { max-height: none; }
.result-actions .btn { min-height: 38px; }
.continue-strip + .stat-grid { margin-top: 14px; }
@media (max-width: 820px) {
  .continue-strip { margin-top: 12px; padding: 11px 12px; }
  .continue-strip .continue-copy span { display: block; }
  .exam-my-answer { padding: 10px 12px; }
  .exam-my-answer p { font-size: 12.5px; }
}

/* toast should sit above the sticky self-score bar and mobile nav */
body:has(.result-sticky-score) .toast { bottom: 96px; }
@media (max-width: 820px) {
  body:has(.result-sticky-score) .toast { bottom: 148px; }
}

/* mobile-only section switch: without the desktop sidebar, users still need
   a one-tap way to move between the three source sections */
.mobile-section-tabs { display: none; }
@media (max-width: 820px) {
  .mobile-section-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    padding: 3px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-muted);
  }
  .mobile-section-tab {
    min-height: 31px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-3);
    font-size: 11px;
  }
  .mobile-section-tab.is-active {
    background: var(--surface-strong);
    color: var(--accent-strong);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
  }
}

/* Toast: a compact rounded card reads better than a pill when the message wraps. */
.toast { border-radius: 16px; line-height: 1.6; }
