/* ==========================================================================
   真题完形补文词汇文库 · 主样式
   设计语言：纸本文库 / 朱砂印章 / 宋体标题 / 克制的动效
   ========================================================================== */

/* ---------- 1. 变量 ---------- */
:root {
  --bg: #f4efe4;
  --bg-deep: #ece4d3;
  --panel: #fffdf8;
  --panel-2: #faf5e9;
  --ink: #211f1b;
  --ink-2: #4b463d;
  --muted: #847a6b;
  --faint: #a99e8c;
  --line: #e3dac8;
  --line-2: #d2c5ad;
  --accent: #a8432c;
  --accent-2: #c05a3e;
  --accent-wash: #f8ece6;
  --accent-line: #ecd2c7;
  --green: #3c5f4d;
  --green-wash: #e7efe8;

  --shadow: 0 1px 2px rgba(60, 45, 25, .05), 0 18px 40px -28px rgba(60, 45, 25, .45);
  --shadow-pop: 0 18px 50px -24px rgba(40, 30, 15, .45);

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --en: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --r: 16px;
  --topbar-h: 70px;
  --side-w: 286px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

[data-theme="dark"] {
  --bg: #131519;
  --bg-deep: #0e1013;
  --panel: #1b1e24;
  --panel-2: #171a1f;
  --ink: #ece6d9;
  --ink-2: #c3bcae;
  --muted: #988f80;
  --faint: #6f695d;
  --line: #2b2f36;
  --line-2: #3b404a;
  --accent: #e0795c;
  --accent-2: #ef9277;
  --accent-wash: #2a1c18;
  --accent-line: #4a2d25;
  --green: #9cc2ac;
  --green-wash: #1c2a23;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -28px rgba(0, 0, 0, .7);
  --shadow-pop: 0 18px 50px -20px rgba(0, 0, 0, .75);
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1200px 620px at 12% -12%, rgba(255, 255, 255, .55), transparent 62%),
    radial-gradient(900px 520px at 102% 0%, rgba(168, 67, 44, .055), transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

[data-theme="dark"] body {
  background:
    radial-gradient(1200px 620px at 12% -12%, rgba(255, 255, 255, .035), transparent 62%),
    radial-gradient(900px 520px at 102% 0%, rgba(224, 121, 92, .05), transparent 58%),
    var(--bg);
}

h1, h2, h3, h4, p, figure { margin: 0; }

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

button, input { font: inherit; color: inherit; }

button { padding: 0; background: none; border: 0; }

button, a, select, input { touch-action: manipulation; }

[hidden] { display: none !important; }

::selection { background: var(--accent); color: #fff; }

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

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

.noscript {
  margin: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 13px;
}

/* ---------- 3. 布局 ---------- */
.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}

.main { min-width: 0; }

.view {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 40px 96px;
  outline: none;
}

/* ---------- 4. 侧栏 ---------- */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding-top: var(--safe-top);
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 55%, var(--panel-2));
  border-right: 1px solid var(--line);
}

.brand { padding: 26px 22px 18px; }

.brand-link { display: flex; align-items: center; gap: 12px; }

.seal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 9px;
  background: var(--accent);
  color: #fff8f1;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 8px 18px -10px rgba(168, 67, 44, .9);
}
.seal-sm { width: 30px; height: 30px; font-size: 17px; border-radius: 7px; }

.brand-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-text strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
}
.brand-text small {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .15em;
  color: var(--faint);
  white-space: nowrap;
}

.side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  padding: 4px 14px 18px;
}
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background-color .15s, color .15s;
}
.side-link .icon { width: 16px; height: 16px; opacity: .72; }
.side-link:hover { background: var(--bg-deep); color: var(--ink); }
.side-link.is-active { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.side-link.is-active .icon { opacity: 1; }

.side-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 12px 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  color: var(--faint);
}
.side-label span { letter-spacing: 0; }

.paper-nav { display: flex; flex-direction: column; gap: 1px; }

.side-year {
  display: flex;
  justify-content: space-between;
  padding: 14px 12px 5px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--faint);
}
.side-year em { font-style: normal; opacity: .7; }

.side-paper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  transition: background-color .15s, color .15s;
}
.side-paper:hover { background: var(--bg-deep); color: var(--ink); }
.side-paper.is-active {
  background: var(--panel);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line), 0 6px 14px -12px rgba(60, 45, 25, .6);
}
.side-count {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--faint);
}
.side-paper.is-complete .side-count { color: var(--green); }

.side-foot {
  flex: none;
  padding: 16px 22px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.side-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.side-progress-top b { font-family: var(--mono); font-size: 12px; color: var(--ink); font-weight: 500; }

.track { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.track-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .4s ease;
}

.text-btn {
  margin-top: 12px;
  font-size: 10.5px;
  color: var(--faint);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-2);
}
.text-btn:hover { color: var(--accent); }

/* ---------- 5. 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: 0 34px;
  padding-top: var(--safe-top);
  padding-left: max(34px, var(--safe-left));
  padding-right: max(34px, var(--safe-right));
  border-bottom: 1px solid var(--line);
  background: rgba(244, 239, 228, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
[data-theme="dark"] .topbar { background: rgba(19, 21, 25, .84); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 9px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-deep); color: var(--ink); }

.menu-btn, .mini-brand { display: none; }

.mini-brand { align-items: center; gap: 9px; font-family: var(--serif); font-size: 15px; font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.voice-wrap { position: relative; display: flex; }

.voice-btn.is-open { background: var(--accent-wash); color: var(--accent); }

.voice-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  width: 322px;
  max-height: calc(100vh - var(--topbar-h) - var(--safe-top) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-pop);
}

.voice-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.voice-pop-head strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .04em;
}
.mini-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
}
.mini-close:hover { background: var(--bg-deep); color: var(--ink); }
.mini-close .icon { width: 16px; height: 16px; }

.voice-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.voice-field select {
  width: 202px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.voice-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.voice-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.voice-switch input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}
.switch-ui {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: var(--line);
  transition: background-color .18s;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform .18s;
}
.voice-switch input:checked + .switch-ui { background: var(--accent); }
.voice-switch input:checked + .switch-ui::after { transform: translateX(16px); }
.voice-switch input:focus-visible + .switch-ui {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.voice-test {
  width: 100%;
  margin-top: 16px;
  justify-content: center;
}
.voice-test.is-loading { opacity: .6; pointer-events: none; }
.voice-test.is-playing {
  border-color: var(--accent-line);
  background: var(--accent-wash);
  color: var(--accent);
}

.voice-note {
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.65;
  color: var(--faint);
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ---------- 6. 搜索 ---------- */
.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 430px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.search-icon { width: 16px; height: 16px; color: var(--muted); }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 13px;
  color: var(--ink);
}
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd {
  flex: none;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--faint);
}

.search-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: -1px;
  right: -1px;
  max-height: min(66vh, 520px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-pop);
  z-index: 60;
}

.pop-head {
  padding: 7px 10px 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  color: var(--faint);
}

.pop-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color .12s;
}
.pop-row:hover, .pop-row:focus-visible { background: var(--accent-wash); }
.pop-row .pop-paper { grid-row: span 2; font-family: var(--mono); font-size: 9.5px; color: var(--faint); padding-top: 2px; }
.pop-word { font-family: var(--en); font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-word i { font-style: normal; color: var(--faint); margin: 0 5px; }
.pop-word b { color: var(--accent); font-weight: 600; }
.pop-gloss { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pop-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 10px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.pop-all:hover { background: var(--accent-wash); }
.pop-empty { padding: 20px 14px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---------- 7. 首页 · 头图 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 54px;
  align-items: end;
  padding: 28px 0 54px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent); }

.hero h1 {
  margin: 20px 0 22px;
  font-family: var(--serif);
  font-size: clamp(42px, 5.6vw, 72px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.012em;
  color: var(--ink);
}
.hero h1 span { display: block; color: var(--accent); }

.lede {
  max-width: 540px;
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--ink-2);
}
.lede b { font-weight: 600; color: var(--ink); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s, border-color .18s, color .18s, transform .18s;
}
.btn .icon { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent);
  color: #fff8f1;
  box-shadow: 0 12px 24px -16px rgba(168, 67, 44, .95);
}
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-2); color: var(--ink-2); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 12px; border-radius: 8px; }

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.hero-card::before {
  content: "文";
  position: absolute;
  right: -12px;
  bottom: -58px;
  font-family: var(--serif);
  font-size: 180px;
  line-height: 1;
  color: var(--ink);
  opacity: .035;
  pointer-events: none;
}
.hero-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .16em;
  color: var(--faint);
}
.hero-card-head b { color: var(--accent); font-weight: 500; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.stat {
  padding: 13px 0 13px 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--ink);
}
.stat span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); }

.hero-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.ring {
  --pct: 0;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--line) 0);
}
.ring-inner {
  display: grid;
  place-items: center;
  width: 51px;
  height: 51px;
  border-radius: 50%;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
}
.hero-progress-text { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.hero-progress-text b { font-size: 13px; font-weight: 600; color: var(--ink); }

/* ---------- 8. 首页 · 年份与试卷 ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 54px 0 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .04em;
}
.section-head h2 small {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .16em;
  color: var(--faint);
}
.section-head p { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--faint); text-align: right; }

.year-block {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 26px;
  padding: 26px 0;
  border-bottom: 1px dashed var(--line);
}
.year-block:last-of-type { border-bottom: 0; }

.year-label {
  position: sticky;
  top: calc(var(--topbar-h) + var(--safe-top) + 20px);
  align-self: start;
  padding-top: 4px;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  letter-spacing: .01em;
}
.year-label small {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--faint);
  white-space: nowrap;
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}

.paper-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 17px 17px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.paper-card::after {
  content: "";
  position: absolute;
  left: 17px;
  right: 17px;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.paper-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.paper-card:hover::after { transform: scaleX(1); }

.paper-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.paper-date {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--accent);
}
.paper-count { font-family: var(--mono); font-size: 9.5px; color: var(--faint); }

.paper-card h3 {
  margin: 12px 0 5px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.paper-zh {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paper-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 15px;
}
.mini-track { flex: 1; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.mini-fill { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--accent); transition: width .3s; }
.mini-text { font-family: var(--mono); font-size: 9.5px; color: var(--faint); }
.paper-card.is-complete .mini-fill { background: var(--green); }

/* ---------- 9. 考点分布 ---------- */
.dist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 40px;
  padding: 18px 0 6px;
}
.dist-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 14px;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--line);
  border-radius: 4px;
  transition: background-color .15s;
}
.dist-row:hover { background: var(--panel); }
.dist-name { font-size: 12px; color: var(--ink-2); }
.dist-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.dist-bar span { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.dist-count { font-family: var(--mono); font-size: 10px; color: var(--faint); text-align: right; }

.source-note {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.8;
  color: var(--faint);
}
.source-note b { color: var(--muted); font-weight: 500; }
.source-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-line);
}
.source-note a:hover { text-decoration-color: var(--accent); }

/* ---------- 10. 试卷页 ---------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  font-size: 11.5px;
  color: var(--muted);
}
.crumbs a:hover { color: var(--accent); }
.crumbs span.sep { color: var(--faint); }

.paper-head { padding-bottom: 26px; border-bottom: 1px solid var(--line); }

.paper-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--accent);
}
.paper-kicker::before { content: ""; width: 22px; height: 1px; background: var(--accent); }

.paper-head h1 {
  max-width: 920px;
  margin: 15px 0 10px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 45px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.005em;
}
.paper-zh { font-size: 13.5px; color: var(--muted); }
.paper-zh b { font-weight: 500; color: var(--ink-2); }

.paper-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}
.progress-box { display: flex; align-items: center; gap: 11px; }
.p-track { width: 150px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.p-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .35s ease;
}
.progress-text { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.progress-text b { color: var(--ink); font-weight: 500; }

.tool-actions { display: flex; gap: 8px; margin-left: auto; }

.tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 7px 13px;
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 11px;
  color: var(--muted);
}
.tip .icon { width: 14px; height: 14px; color: var(--accent); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(338px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.term-card {
  position: relative;
  padding: 15px 17px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  transition: border-color .2s, box-shadow .2s, background .25s;
}
.term-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.term-card.is-revealed {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--panel) 15%, var(--accent-wash));
}
.term-card.is-target { animation: card-pulse 1.9s ease; }
@keyframes card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  18% { box-shadow: 0 0 0 3px var(--accent-wash), 0 0 0 1px var(--accent); }
}

.term-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.term-no {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--faint);
}
.term-card.is-revealed .term-no { color: var(--green); }
.term-card.is-revealed .term-no::after { content: " ✓"; opacity: .8; }

.tag {
  --tag-bg: var(--bg);
  --tag-fg: var(--muted);
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
}
.tag[data-tone="noun"] { --tag-bg: #e9eef7; --tag-fg: #365d8a; }
.tag[data-tone="verb"] { --tag-bg: #f7ece3; --tag-fg: #95552f; }
.tag[data-tone="adj"]  { --tag-bg: #eaf0e2; --tag-fg: #4f6c3c; }
.tag[data-tone="adv"]  { --tag-bg: #f0eaf6; --tag-fg: #654a86; }
.tag[data-tone="comp"] { --tag-bg: #f8f0da; --tag-fg: #8a681f; }
.tag[data-tone="neg"]  { --tag-bg: #f7e6e2; --tag-fg: #9c3a2c; }
[data-theme="dark"] .tag[data-tone="noun"] { --tag-bg: #1b2837; --tag-fg: #9cc0e8; }
[data-theme="dark"] .tag[data-tone="verb"] { --tag-bg: #2f2117; --tag-fg: #e0a97e; }
[data-theme="dark"] .tag[data-tone="adj"]  { --tag-bg: #202b1c; --tag-fg: #a7c796; }
[data-theme="dark"] .tag[data-tone="adv"]  { --tag-bg: #261f31; --tag-fg: #c0a6dd; }
[data-theme="dark"] .tag[data-tone="comp"] { --tag-bg: #2c2615; --tag-fg: #d9bd76; }
[data-theme="dark"] .tag[data-tone="neg"]  { --tag-bg: #331d18; --tag-fg: #e79b8b; }

.term-base { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 10px; }
.term-base .en {
  font-family: var(--en);
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink);
}
.term-base .pos {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  font-size: 10px;
  color: var(--muted);
}
.term-base .gloss { font-size: 12.5px; color: var(--ink-2); }

.speak-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: color .16s, border-color .16s, background-color .16s, transform .12s;
}
.speak-btn .icon { width: 15px; height: 15px; }
.speak-btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-wash);
}
.speak-btn:active { transform: scale(.94); }
.speak-btn.is-loading {
  color: var(--accent);
  border-color: var(--accent-line);
  pointer-events: none;
}
.speak-btn.is-loading .icon { opacity: 0; }
.speak-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid var(--accent-line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: speak-spin .7s linear infinite;
}
.speak-btn.is-playing {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-wash);
}
.speak-btn.is-playing .icon { animation: speak-pulse .9s ease-in-out infinite; }

@keyframes speak-spin { to { transform: rotate(360deg); } }
@keyframes speak-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
@keyframes speak-in {
  from { opacity: 0; transform: scale(.82); }
  to { opacity: 1; transform: none; }
}

.speak-base { align-self: center; }
.speak-lg { width: 38px; height: 38px; }
.speak-lg .icon { width: 18px; height: 18px; }
.quiz-prompt .speak-btn { align-self: center; }
.quiz-answer-meta .speak-btn { margin-left: 2px; }

.speak-answer { display: none; }
.term-card.is-revealed .speak-answer {
  display: inline-flex;
  animation: speak-in .22s ease;
}

.term-answer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin-top: 8px;
}
.arrow { color: var(--line-2); font-size: 13px; line-height: 1; }

.blank {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  height: 2.25rem;
  padding: 0 .58rem;
  border: 1px dashed var(--line-2);
  border-radius: 6px;
  background: var(--panel-2);
  font-family: var(--en);
  font-size: 1.24rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .18s, border-color .18s;
  -webkit-tap-highlight-color: transparent;
}
.blank:hover, .blank:focus-visible {
  background: var(--accent-wash);
  border-color: var(--accent);
}
.blank-text {
  opacity: 0;
  filter: blur(7px);
  transform: translateY(3px);
  transition: opacity .28s ease, filter .28s ease, transform .28s ease;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}
.blank.is-revealed {
  background: var(--accent-wash);
  border-style: solid;
  border-color: var(--accent-line);
}
.blank.is-revealed .blank-text {
  opacity: 1;
  filter: none;
  transform: none;
  color: var(--accent);
  font-weight: 600;
}
.blank-hint { display: none; }

.apos {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  font-size: 9.5px;
  color: var(--muted);
}
.agloss { font-size: 11.5px; color: var(--ink-2); }

.paper-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  transition: border-color .18s, background-color .18s;
}
.pager-card:hover { border-color: var(--accent-line); background: var(--accent-wash); }
.pager-card.next { text-align: right; align-items: flex-end; }
.pager-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--faint);
}
.pager-label .icon { width: 13px; height: 13px; }
.pager-title { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.pager-sub {
  max-width: 100%;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 11. 检索页 ---------- */
.page-head { margin-bottom: 26px; }
.page-head h1 {
  margin: 12px 0 8px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.2;
}
.page-head p { font-size: 13px; color: var(--muted); }

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
.search-field .icon { width: 20px; height: 20px; color: var(--muted); }
.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 16px;
  color: var(--ink);
}
.search-field input::placeholder { color: var(--faint); font-size: 14px; }
.search-field .clear-search {
  display: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
}
.search-field .clear-search:hover { background: var(--bg-deep); color: var(--ink); }
.search-field.has-value .clear-search { display: grid; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0 22px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent-line); color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff8f1; }
.chip small { font-family: var(--mono); font-size: 9px; opacity: .65; }

.search-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.search-summary b { color: var(--accent); font-weight: 600; }
.search-summary .clear-filter { font-size: 11px; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.result-list { margin-top: 4px; }
.result-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) minmax(0, .85fr);
  gap: 14px;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  border-radius: 7px;
  transition: background-color .13s;
}
.result-row:hover { background: var(--panel); }
.result-paper { font-family: var(--mono); font-size: 9.5px; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.result-word {
  min-width: 0;
  font-family: var(--en);
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-word .to { color: var(--faint); margin: 0 5px; font-family: var(--sans); font-size: 12px; }
.result-word .ans { color: var(--accent); font-weight: 600; }
.result-gloss {
  min-width: 0;
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

mark { padding: 0 2px; border-radius: 2px; background: var(--accent-wash); color: var(--accent); }

.empty-state {
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state .icon { width: 34px; height: 34px; color: var(--faint); margin-bottom: 12px; }
.empty-state h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.empty-state p { font-size: 12.5px; }

/* ---------- 12. 自测 ---------- */
.quiz-wrap { max-width: 780px; margin: 0 auto; }
.quiz-head { margin-bottom: 26px; }
.quiz-head h1 {
  margin: 12px 0 8px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 600;
}
.quiz-head p { font-size: 13px; color: var(--muted); }

.quiz-card {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.quiz-card::after {
  content: "?";
  position: absolute;
  right: 12px;
  bottom: -74px;
  font-family: var(--serif);
  font-size: 250px;
  line-height: 1;
  color: var(--ink);
  opacity: .028;
  pointer-events: none;
}
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--faint);
}
.quiz-paper { color: var(--accent); }
.quiz-instruction { margin-top: 26px; font-size: 12px; color: var(--muted); }
.quiz-prompt { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; }
.quiz-word {
  font-family: var(--en);
  font-size: clamp(42px, 7vw, 62px);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ink);
}
.quiz-pos { padding: 2px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 10.5px; color: var(--muted); }
.quiz-gloss { font-size: 14px; color: var(--ink-2); }

.quiz-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 72px;
  margin-top: 26px;
  padding: 12px 18px;
  border: 2px dashed var(--line-2);
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color .18s, background-color .18s;
}
.quiz-blank:hover { border-color: var(--accent); background: var(--accent-wash); }
.quiz-blank-label {
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}
.quiz-blank-answer {
  display: none;
  font-family: var(--en);
  font-size: clamp(26px, 4.5vw, 36px);
  font-weight: 600;
  color: var(--accent);
}
.quiz-blank.is-revealed { border-style: solid; border-color: var(--accent-line); background: var(--accent-wash); }
.quiz-blank.is-revealed .quiz-blank-label { display: none; }
.quiz-blank.is-revealed .quiz-blank-answer { display: block; animation: answer-in .32s ease; }
@keyframes answer-in {
  from { opacity: 0; filter: blur(8px); transform: translateY(6px); }
  to { opacity: 1; filter: none; transform: none; }
}

.quiz-answer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-2);
}
.quiz-answer-meta .apos { font-size: 10px; }
.quiz-answer-meta[hidden] { display: none; }

.quiz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.quiz-actions .btn { min-width: 118px; }

.quiz-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--faint);
}
.quiz-foot b { color: var(--ink-2); font-weight: 500; }

/* ---------- 13. 其他 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  bottom: calc(30px + env(safe-area-inset-bottom));
  z-index: 120;
  max-width: calc(100vw - 40px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.scrim { display: none; }

/* ---------- 14. 响应式 ---------- */
@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; }
  .view { padding: 32px 30px 80px; }
}

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 30px; align-items: start; }
  .hero-card { max-width: 540px; }
  .year-block { grid-template-columns: 70px minmax(0, 1fr); gap: 22px; }
  .dist { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 320px);
    transform: translateX(-102%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 24px 0 60px -30px rgba(0, 0, 0, .5);
  }
  body.nav-open .sidebar { transform: none; }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(18, 14, 8, .42);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .menu-btn { display: inline-flex; }
  .mini-brand { display: flex; }
  .topbar {
    padding: var(--safe-top) 18px 0;
    padding-left: max(18px, var(--safe-left));
    padding-right: max(18px, var(--safe-right));
    gap: 10px;
  }
  .search { max-width: none; }
  .search input { font-size: 16px; }
}

@media (max-width: 760px) {
  .view {
    padding: 24px 18px 70px;
    padding-left: max(18px, var(--safe-left));
    padding-right: max(18px, var(--safe-right));
  }
  .hero { padding: 12px 0 40px; }
  .hero h1 { margin: 16px 0 18px; font-size: clamp(38px, 10vw, 50px); }
  .lede { font-size: 13.5px; }
  .hero-card { padding: 18px; }

  .blank { height: 2.7rem; min-width: 5rem; font-size: 1.32rem; }

  .speak-btn { width: 36px; height: 36px; }
  .speak-btn .icon { width: 17px; height: 17px; }
  .speak-lg { width: 40px; height: 40px; }

  .voice-pop {
    position: fixed;
    top: calc(var(--topbar-h) + var(--safe-top) + 4px);
    left: 12px;
    right: 12px;
    width: auto;
  }
  .voice-field select { width: min(56vw, 220px); font-size: 16px; }

  .tip {
    display: flex;
    width: 100%;
    align-items: flex-start;
    padding: 9px 13px;
    border-radius: 10px;
    line-height: 1.55;
  }
  .tip .icon { margin-top: 2px; }

  .section-head { margin-top: 42px; }
  .section-head p { display: none; }

  .year-block { grid-template-columns: 1fr; gap: 12px; padding: 22px 0; }
  .year-label { position: static; display: flex; align-items: baseline; gap: 10px; font-size: 24px; }
  .year-label small { margin-top: 0; }
  .paper-grid { grid-template-columns: 1fr; }
  .paper-card { min-height: 0; }

  .cards { grid-template-columns: 1fr; }
  .term-base .en { font-size: 25px; }

  .paper-tools { gap: 12px; }
  .tool-actions { margin-left: 0; width: 100%; }
  .tool-actions .btn { flex: 1; }

  .paper-pager { grid-template-columns: 1fr; }

  .result-row { grid-template-columns: 1fr; gap: 3px; padding: 12px 6px; }
  .result-gloss { text-align: left; }

  .search-pop { position: fixed; top: calc(var(--topbar-h) + var(--safe-top) - 4px); left: 12px; right: 12px; }
  .mini-brand span:last-child { display: none; }

  .quiz-blank { min-height: 64px; }
  .quiz-card::after { font-size: 180px; bottom: -50px; }
}

@media (max-width: 520px) {
  .topbar {
    gap: 8px;
    padding: var(--safe-top) 12px 0;
    padding-left: max(12px, var(--safe-left));
    padding-right: max(12px, var(--safe-right));
  }
  .seal-sm { display: none; }
  .mini-brand { display: none; }
  .search { height: 38px; }
  .search kbd { display: none; }
  .stats-grid { margin-top: 14px; }
  .stat b { font-size: 26px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-actions .btn-primary { justify-content: space-between; }
  .dist-row { grid-template-columns: 84px minmax(0, 1fr) 30px; gap: 10px; }
}

@media (hover: none) {
  .blank-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .sidebar, .topbar, .scrim, .toast, .paper-tools, .paper-pager, .tip, .speak-btn { display: none !important; }
  .app { display: block; }
  .view { max-width: none; padding: 0; }
  .term-card { break-inside: avoid; }
  .blank-text { opacity: 1 !important; filter: none !important; color: var(--accent) !important; }
}
