/* ============================================================
   文言 · 实虚词  —  灰白纸本，朱砂一点
   ============================================================ */

:root {
  --paper: #f4f3ef;
  --paper-2: #eceae4;
  --paper-3: #e3e0d7;
  --surface: #fffefa;
  --surface-2: #faf9f5;
  --ink: #1b1a18;
  --ink-2: #59564f;
  --ink-3: #969188;
  --line: #e4e1d9;
  --line-strong: #d2cec4;
  --seal: #a3402f;
  --seal-2: #8b3426;
  --seal-soft: #f3e5e0;
  --good: #47604f;
  --good-soft: #e7ece7;
  --hard: #80643a;
  --hard-soft: #f1e9d8;
  --easy: #4c5e72;
  --easy-soft: #e6eaef;
  --shadow-sm: 0 1px 2px rgba(27, 26, 24, .035);
  --shadow: 0 1px 2px rgba(27, 26, 24, .04), 0 18px 48px -18px rgba(27, 26, 24, .16);
  --shadow-lift: 0 2px 4px rgba(27, 26, 24, .05), 0 28px 60px -24px rgba(27, 26, 24, .22);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, "Courier New", monospace;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --max: 1080px;
  --tab-h: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  scroll-behavior: smooth;
}
html.is-locked, html.is-locked body { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1000px 520px at 18% -12%, #fffdf7 0%, rgba(255, 253, 247, 0) 62%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #ecd9d2; color: var(--ink); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; }
textarea { resize: vertical; }

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---------- 基本排版 ---------- */
.kicker {
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.muted { color: var(--ink-3); }
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }

/* ---------- 应用骨架 ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  border-bottom: 1px solid rgba(210, 206, 196, .55);
  background: rgba(244, 243, 239, .82);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
}
.topbar-inner {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.seal {
  width: 28px; height: 28px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--seal);
  color: #fff8f2;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(80, 20, 12, .18), 0 1px 2px rgba(80, 20, 12, .12);
}
.brand-text { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.brand-name {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: .16em;
  white-space: nowrap;
}
.brand-sub {
  font-size: 9.5px;
  letter-spacing: .2em;
  color: var(--ink-3);
  white-space: nowrap;
}
.nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.nav-link:hover { color: var(--ink); background: rgba(27, 26, 24, .04); }
.nav-link.is-active { color: var(--ink); background: rgba(27, 26, 24, .055); }

.main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 42px 24px 96px;
}
.page { animation: page-in .32s cubic-bezier(.2, .7, .25, 1) both; }
.page.is-narrow { max-width: 780px; margin: 0 auto; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: .03em;
}
.page-sub { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }

/* ---------- 按钮 ---------- */
.btn {
  height: 42px;
  padding: 0 17px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1;
  border: 1px solid transparent;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease, box-shadow .16s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-ink { background: var(--ink); color: #fbfaf6; box-shadow: var(--shadow-sm); }
.btn-ink:hover { background: #2c2a26; }
.btn-ghost { border-color: var(--line-strong); color: var(--ink-2); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); background: rgba(255, 255, 255, .45); }
.btn-quiet { color: var(--ink-2); padding: 0 10px; }
.btn-quiet:hover { color: var(--ink); background: rgba(27, 26, 24, .045); }
.btn-danger { background: #8d3327; color: #fff8f4; }
.btn-danger:hover { background: #7c2b21; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .38; }
.btn .icon { display: inline-flex; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: rgba(27, 26, 24, .055); color: var(--ink); }
.icon-btn:active { background: rgba(27, 26, 24, .08); }

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  line-height: 1;
}

/* ---------- 面板 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.panel-pad { padding: 24px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 22px 0; }

/* ---------- 首页 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 36px 30px;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "温故";
  position: absolute;
  right: -6px;
  bottom: -30px;
  font-family: var(--serif);
  font-size: 120px;
  line-height: 1;
  color: rgba(27, 26, 24, .028);
  letter-spacing: .06em;
  pointer-events: none;
  user-select: none;
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.hero-date { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 11.5px; letter-spacing: .08em; }
.hero-date .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.hero-body { display: flex; align-items: flex-end; gap: 26px; margin-top: 20px; flex-wrap: wrap; }
.hero-number { display: flex; align-items: baseline; gap: 10px; }
.hero-num {
  font-family: var(--serif);
  font-size: 86px;
  line-height: .82;
  letter-spacing: -.035em;
  font-variant-numeric: lining-nums tabular-nums;
}
.hero-unit { font-size: 13px; color: var(--ink-3); letter-spacing: .06em; }
.hero-split { width: 1px; align-self: stretch; background: var(--line); margin: 2px 0 6px; }
.hero-facts { display: flex; gap: 28px; padding-bottom: 6px; flex-wrap: wrap; }
.fact b {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
  font-variant-numeric: lining-nums;
}
.fact span { display: block; margin-top: 5px; font-size: 11px; color: var(--ink-3); letter-spacing: .08em; }
.hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.hero-actions .btn-ink { min-width: 168px; height: 46px; }
.hero-note { margin-top: 14px; font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.hero-note .sep { color: var(--line-strong); }

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.quick-stat { padding: 18px 22px; border-right: 1px solid var(--line); }
.quick-stat:last-child { border-right: 0; }
.quick-stat b { font-family: var(--serif); font-size: 26px; font-weight: 400; line-height: 1.1; }
.quick-stat span { display: block; margin-top: 4px; font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 40px 0 15px;
}
.section-title { font-size: 13px; letter-spacing: .12em; color: var(--ink-2); font-weight: 500; }
.section-hint { font-size: 11.5px; color: var(--ink-3); }
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-3);
  transition: color .15s ease, gap .15s ease;
}
.link-arrow:hover { color: var(--ink); gap: 8px; }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  min-height: 158px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s ease, transform .18s ease, box-shadow .18s ease;
}
.mode-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.mode-card .mode-top { display: flex; align-items: center; justify-content: space-between; }
.mode-icon { color: var(--ink-3); }
.mode-title { font-family: var(--serif); font-size: 21px; letter-spacing: .05em; }
.mode-desc { font-size: 12px; line-height: 1.75; color: var(--ink-3); max-width: 28em; }
.mode-meta { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; }
.mode-card .arrow { color: var(--ink-3); transition: transform .16s ease, color .16s ease; }
.mode-card:hover .arrow { transform: translateX(3px); color: var(--seal); }

.bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 92px;
  padding-top: 8px;
}
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.bar-track { width: 100%; height: 64px; display: flex; align-items: flex-end; border-radius: 3px; }
.bar-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 2px 2px;
  background: var(--line-strong);
  transition: height .35s cubic-bezier(.2, .7, .25, 1);
}
.bar-col.is-today .bar-fill { background: var(--seal); opacity: .82; }
.bar-label { font-size: 9px; color: var(--ink-3); letter-spacing: .02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-col.is-today .bar-label { color: var(--seal); }
.bar-count { font-size: 9px; color: var(--ink-3); height: 11px; font-variant-numeric: tabular-nums; }

.forecast-wrap { padding: 20px 22px 16px; }
.forecast-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.forecast-title { font-size: 12px; color: var(--ink-2); letter-spacing: .06em; }
.forecast-sum { font-size: 11px; color: var(--ink-3); }

/* ---------- 学习：外壳 ---------- */
.study { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--paper); }
.study-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 243, 239, .9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(210, 206, 196, .5);
}
.study-top-inner {
  width: 100%;
  max-width: 880px;
  height: 60px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.study-close { margin-left: -6px; }
.study-counter {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  min-width: 54px;
}
.study-counter b { color: var(--ink); font-weight: 500; }
.study-mode {
  flex: 1;
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .14em;
  color: var(--ink-2);
}
.study-actions { display: flex; align-items: center; gap: 2px; margin-right: -4px; }
.study-progress { height: 2px; background: rgba(210, 206, 196, .5); }
.study-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--seal);
  transition: width .35s cubic-bezier(.2, .7, .25, 1);
}
.study-main {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 26px 20px 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---------- 速记卡 ---------- */
.study-card {
  position: relative;
  width: min(660px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 34px 38px 26px;
  box-shadow: var(--shadow);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: box-shadow .2s ease, transform .2s ease;
}
.study-card.is-pressed { transform: scale(.996); box-shadow: var(--shadow-lift); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 22px; }
.deck-tag {
  font-size: 9.5px;
  letter-spacing: .16em;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.deck-tag::before { content: ""; width: 12px; height: 1px; background: var(--line-strong); }
.card-count { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); letter-spacing: .06em; }
.card-pinyin { font-size: 12px; color: var(--ink-3); letter-spacing: .14em; font-family: var(--mono); min-height: 16px; }

.term-wrap { position: relative; margin: 12px 0 4px; padding: 6px 0; }
.term {
  font-family: var(--serif);
  font-size: clamp(76px, 15vw, 104px);
  line-height: 1.1;
  letter-spacing: .09em;
  text-align: center;
  text-indent: .09em;
  color: var(--ink);
  transition: opacity .18s ease, filter .18s ease;
}
.term.is-long { font-size: clamp(44px, 9vw, 62px); letter-spacing: .05em; }
.mask { position: relative; border-radius: 12px; cursor: pointer; }
.mask.is-hidden > .mask-content { opacity: 0; visibility: hidden; }
.mask-veil {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(250, 249, 245, .62);
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: .18em;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  z-index: 2;
}
.mask-veil:hover { background: rgba(250, 249, 245, .9); color: var(--ink-2); border-color: var(--ink-3); }
.mask-veil .veil-mark { font-family: var(--serif); font-size: 20px; letter-spacing: 0; opacity: .38; }
.mask:not(.is-hidden) > .mask-veil { display: none; }

.card-example {
  margin: 6px auto 0;
  max-width: 36em;
  text-align: center;
  padding: 0 4px;
}
.example {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 2;
  color: var(--ink-2);
  letter-spacing: .02em;
}
.example .hit {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(163, 64, 47, .7);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.example .blank {
  display: inline-block;
  width: 1.25em;
  height: 1em;
  margin: 0 .12em;
  border-bottom: 1.5px solid rgba(163, 64, 47, .62);
  vertical-align: -.08em;
}
.source { margin-top: 7px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .1em; }
.source::before { content: "—— "; opacity: .5; }

.card-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--line-strong);
}
.card-rule::before, .card-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.card-rule span { font-size: 9.5px; letter-spacing: .2em; color: var(--ink-3); }

.def-block { position: relative; min-height: 78px; padding: 8px 12px 4px; }
.def-label { font-size: 9.5px; letter-spacing: .22em; color: var(--ink-3); text-align: center; margin-bottom: 7px; }
.def-text {
  font-size: 19px;
  line-height: 1.8;
  text-align: center;
  letter-spacing: .01em;
  color: var(--ink);
}
.def-text .sense-no-sm { color: var(--ink-3); font-family: var(--mono); font-size: 10px; margin-right: 6px; vertical-align: 2px; }

.card-actions { display: flex; gap: 10px; margin-top: 10px; }
.card-actions .btn { flex: 1; }
.card-hint {
  margin-top: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: .06em;
}
.card-hint .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.grade {
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: background .14s ease, border-color .14s ease, transform .1s ease;
}
.grade:active { transform: translateY(1px); }
.grade .v { font-size: 13.5px; color: var(--ink); letter-spacing: .04em; }
.grade .k { font-family: var(--mono); font-size: 9px; color: var(--ink-3); letter-spacing: .04em; }
.grade[data-tone="again"]:hover { background: var(--seal-soft); border-color: #dcbeb5; }
.grade[data-tone="hard"]:hover { background: var(--hard-soft); border-color: #dbc9a6; }
.grade[data-tone="good"]:hover { background: var(--good-soft); border-color: #c2d0c4; }
.grade[data-tone="easy"]:hover { background: var(--easy-soft); border-color: #c2cdda; }

/* ---------- 选择题 / 听写 ---------- */
.prompt-label { text-align: center; font-size: 9.5px; letter-spacing: .22em; color: var(--ink-3); margin-bottom: 8px; }
.choice-def {
  font-size: 21px;
  line-height: 1.75;
  text-align: center;
  max-width: 30em;
  margin: 4px auto 0;
  letter-spacing: .01em;
}
.options { display: grid; gap: 9px; margin-top: 24px; }
.option {
  width: 100%;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 10px;
  text-align: left;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  transition: border-color .14s ease, background .14s ease;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
}
.option:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); }
.option .option-key {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  padding-top: 4px;
}
.option.is-correct { border-color: #a9bdac; background: var(--good-soft); color: var(--ink); }
.option.is-wrong { border-color: #d8b3a5; background: var(--seal-soft); color: var(--ink); }
.option.is-correct .option-key { color: var(--good); }
.option.is-wrong .option-key { color: var(--seal); }

.dictation { margin-top: 20px; }
.dictation-row { display: flex; gap: 8px; }
.dictation-input {
  flex: 1;
  height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  text-align: center;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: .1em;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dictation-input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(27, 26, 24, .04); }
.dictation-input::placeholder { font-family: var(--sans); font-size: 12px; letter-spacing: .06em; color: var(--ink-3); }
.feedback {
  margin-top: 14px;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.feedback.is-good { background: var(--good-soft); color: #33483a; }
.feedback.is-bad { background: var(--seal-soft); color: #7a3023; }
.feedback b { font-weight: 600; }

/* ---------- 整页精读 ---------- */
.immersive {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 34px 28px 140px;
}
.immersive-head { text-align: center; padding: 8px 0 26px; }
.immersive-term {
  font-family: var(--serif);
  font-size: clamp(96px, 20vw, 142px);
  line-height: 1.05;
  letter-spacing: .08em;
  text-indent: .08em;
}
.immersive-term.is-long { font-size: clamp(52px, 11vw, 76px); }
.immersive-pinyin { margin-top: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .22em; color: var(--ink-3); }
.pos-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--ink-3);
}
.chip-seal { border-color: #dcc2b9; color: var(--seal); background: var(--seal-soft); }

.gate { position: relative; margin-top: 8px; }
.gate-inner { transition: filter .3s ease, opacity .3s ease; }
.gate.is-closed .gate-inner { filter: blur(8px); opacity: .28; pointer-events: none; user-select: none; }
.gate-cover {
  position: absolute;
  inset: -10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 54px;
  gap: 12px;
  background: linear-gradient(180deg, rgba(244, 243, 239, 0) 0%, rgba(244, 243, 239, .55) 34%, rgba(244, 243, 239, .8) 100%);
  border-radius: 14px;
  z-index: 2;
}
.gate-cover .btn { backdrop-filter: blur(6px); }
.gate-cover p { font-size: 10.5px; color: var(--ink-3); letter-spacing: .1em; }

.sense {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.sense:first-child { border-top: 0; }
.sense-no { font-family: var(--mono); font-size: 10px; color: var(--ink-3); padding-top: 7px; letter-spacing: .06em; }
.sense-def { font-size: 17px; line-height: 1.85; letter-spacing: .01em; }
.sense-ex {
  margin-top: 11px;
  padding-left: 14px;
  border-left: 2px solid var(--line-strong);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 2;
  color: var(--ink-2);
}
.sense-ex .hit { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(163, 64, 47, .65); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.sense-source { margin-top: 4px; font-size: 10px; color: var(--ink-3); letter-spacing: .08em; }
.sense-source::before { content: "—— "; opacity: .5; }

.note-box {
  margin-top: 6px;
  padding: 18px 20px;
  background: var(--paper-2);
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-2);
}
.note-box .note-label { display: flex; align-items: center; gap: 7px; font-size: 9.5px; letter-spacing: .18em; color: var(--ink-3); margin-bottom: 8px; }
.note-box .note-label::before { content: ""; width: 12px; height: 1px; background: var(--ink-3); opacity: .5; }

.immersive-bottom {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 35;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  background: rgba(244, 243, 239, .88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(210, 206, 196, .6);
}
.immersive-bottom-inner { max-width: 660px; margin: 0 auto; }
.immersive-bottom .grades { margin-top: 0; }

/* ---------- 会话小结 ---------- */
.summary { max-width: 560px; margin: 6vh auto 0; text-align: center; animation: page-in .3s ease both; }
.summary-mark {
  width: 62px; height: 62px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border: 1px solid #d8b9ae;
  border-radius: 50%;
  color: var(--seal);
  font-family: var(--serif);
  font-size: 26px;
  background: var(--seal-soft);
}
.summary h2 { font-family: var(--serif); font-size: 30px; font-weight: 400; letter-spacing: .06em; }
.summary-sub { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 30px 0 26px; }
.summary-stat { padding: 18px 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.summary-stat b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1.1; font-variant-numeric: lining-nums; }
.summary-stat span { display: block; margin-top: 5px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; }
.summary-actions { display: flex; gap: 10px; justify-content: center; }

/* ---------- 词库 ---------- */
.library-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.search { position: relative; flex: 1 1 240px; }
.search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(27, 26, 24, .035); }
.search input::placeholder { color: var(--ink-3); }

.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--paper-2);
  border: 1px solid rgba(210, 206, 196, .5);
  flex-wrap: wrap;
}
.seg button {
  height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(27, 26, 24, .06);
}
.lib-count { font-size: 11.5px; color: var(--ink-3); margin: 0 0 10px 2px; font-variant-numeric: tabular-nums; }
.lib-count b { color: var(--ink-2); font-weight: 500; }

.word-list { border-top: 1px solid var(--line); }
.word-row {
  width: 100%;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: background .14s ease;
}
.word-row:hover { background: rgba(255, 255, 255, .52); }
.word-side { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.word-term { font-family: var(--serif); font-size: 26px; line-height: 1.15; letter-spacing: .04em; }
.word-py { font-family: var(--mono); font-size: 9px; color: var(--ink-3); letter-spacing: .04em; min-height: 11px; }
.word-main { min-width: 0; }
.word-def {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.word-sub { margin-top: 4px; font-size: 10px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.word-meta { display: flex; align-items: center; gap: 9px; justify-self: end; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 9.5px;
  letter-spacing: .05em;
  color: var(--ink-3);
  white-space: nowrap;
}
.badge-seal { color: var(--seal); border-color: #dfc4ba; background: var(--seal-soft); }
.badge-good { color: var(--good); border-color: #c9d6ca; background: var(--good-soft); }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.dot.seal { background: var(--seal); }
.dot.good { background: var(--good); }

/* ---------- 统计 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-value { font-family: var(--serif); font-size: 34px; line-height: 1.05; font-weight: 400; font-variant-numeric: lining-nums tabular-nums; }
.stat-value small { font-family: var(--sans); font-size: 12px; color: var(--ink-3); margin-left: 3px; }
.stat-label { margin-top: 7px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .08em; }
.stat-note { margin-top: 10px; font-size: 10px; color: var(--ink-3); }

.chart { padding: 22px 22px 16px; }
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 116px; margin-top: 14px; }
.chart-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.chart-bar { width: 100%; min-height: 2px; background: var(--paper-3); border-radius: 2px 2px 0 0; }
.chart-col.is-today .chart-bar { background: var(--seal); opacity: .8; }
.chart-x { font-size: 8.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; align-items: center; gap: 14px; margin-top: 4px; font-size: 10px; color: var(--ink-3); }

.dist-bar { display: flex; height: 10px; border-radius: 4px; overflow: hidden; background: var(--paper-2); margin-top: 14px; }
.dist-seg { height: 100%; min-width: 2px; }
.dist-seg[data-k="new"] { background: var(--paper-3); }
.dist-seg[data-k="learning"] { background: #d9b9ae; }
.dist-seg[data-k="review"] { background: #a9a49a; }
.dist-seg[data-k="mastered"] { background: var(--good); }
.dist-seg[data-k="suspended"] { background: #cfcac0; }
.dist-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 10.5px; color: var(--ink-3); }
.dist-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

.log-list { margin-top: 4px; }
.log-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 12px; }
.log-row:last-child { border-bottom: 0; }
.log-word { font-family: var(--serif); font-size: 18px; min-width: 30px; }
.log-def { flex: 1; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-grade { font-size: 10px; letter-spacing: .04em; }
.log-grade.again { color: var(--seal); }
.log-grade.good { color: var(--good); }
.log-time { font-family: var(--mono); font-size: 9px; color: var(--ink-3); }

/* ---------- 设置 ---------- */
.settings { max-width: 780px; margin: 0 auto; }
.settings-section { margin-top: 38px; }
.settings-section:first-of-type { margin-top: 8px; }
.section-cap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.section-cap::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: 0; }
.setting-info { min-width: 0; }
.setting-name { font-size: 13.5px; color: var(--ink); }
.setting-desc { margin-top: 3px; font-size: 10.5px; line-height: 1.6; color: var(--ink-3); max-width: 34em; }
.setting-control { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
}
.stepper button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-2); }
.stepper button:hover { background: rgba(27, 26, 24, .045); }
.stepper span { min-width: 34px; text-align: center; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }

.select, .input, .date-input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  color: var(--ink);
  outline: none;
}
.select:focus, .input:focus, .date-input:focus { border-color: var(--ink-3); }
.select { padding-right: 26px; }
.date-input { font-family: var(--mono); font-size: 11px; }

.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--paper-3);
  transition: background .18s ease;
  pointer-events: none;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  transition: transform .18s ease;
}
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--seal); outline-offset: 2px; }

.type-grid { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.type-toggle {
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 11.5px;
  color: var(--ink-3);
  transition: all .14s ease;
}
.type-toggle.is-on { border-color: var(--ink); color: var(--ink); background: var(--surface-2); }
.type-toggle:hover { border-color: var(--ink-3); }

.plan-note {
  margin-top: 12px;
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--paper-2);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-2);
}
.plan-note b { color: var(--ink); font-weight: 500; }
.plan-note.warn { background: var(--seal-soft); color: #783226; }

.data-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.sync-line { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--ink-3); margin-top: 9px; }
.sync-line .dot { width: 5px; height: 5px; }

.deck-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.deck-line:last-child { border-bottom: 0; }
.deck-file { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); }

.warn-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid #e0c8bf;
  border-radius: 11px;
  background: var(--seal-soft);
  color: #733226;
  font-size: 12px;
  line-height: 1.7;
}
.warn-banner b { font-weight: 600; }

/* ---------- 抽屉 / 对话框 ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(24, 23, 21, .38); opacity: 0; transition: opacity .2s ease; }
.overlay.is-open .overlay-backdrop { opacity: 1; }
.overlay.is-closing .overlay-backdrop { opacity: 0; }
.sheet {
  position: relative;
  width: min(640px, 100%);
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-lift);
  transform: translateY(26px);
  opacity: 0;
  transition: transform .24s cubic-bezier(.2, .7, .25, 1), opacity .2s ease;
  overflow: hidden;
}
.overlay.is-open .sheet { transform: none; opacity: 1; }
.overlay.is-closing .sheet { transform: translateY(30px); opacity: 0; }
.sheet-grip { width: 34px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 9px auto 0; flex: 0 0 auto; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 15px 24px 14px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.sheet-title-wrap { min-width: 0; }
.sheet-title { font-family: var(--serif); font-size: 22px; font-weight: 400; line-height: 1.35; letter-spacing: .03em; }
.sheet-sub { margin-top: 2px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; }
.sheet-close { flex: 0 0 auto; margin: -4px -6px 0 0; }
.sheet-close:focus-visible { outline: 1px solid var(--line-strong); outline-offset: 2px; }
.sheet-body { padding: 20px 24px calc(26px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

.overlay-center { align-items: center; padding: 20px; }
.dialog {
  position: relative;
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-lift);
  transform: scale(.98);
  opacity: 0;
  transition: transform .18s ease, opacity .16s ease;
}
.overlay.is-open .dialog { transform: none; opacity: 1; }
.dialog-title { font-family: var(--serif); font-size: 20px; font-weight: 400; }
.dialog-body { margin-top: 9px; font-size: 12.5px; line-height: 1.8; color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

/* ---------- 详情 ---------- */
.detail-hero { text-align: center; padding: 4px 0 22px; }
.detail-term { font-family: var(--serif); font-size: 64px; line-height: 1.1; letter-spacing: .06em; text-indent: .06em; }
.detail-py { margin-top: 4px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .16em; min-height: 14px; }
.detail-senses { margin-top: 4px; }
.detail-sense { padding: 15px 0; border-top: 1px solid var(--line); }
.detail-sense:first-child { border-top: 0; }
.detail-sense-head { display: flex; align-items: baseline; gap: 8px; }
.detail-sense-no { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); }
.detail-def { font-size: 15px; line-height: 1.8; }
.detail-ex { margin-top: 7px; font-family: var(--serif); font-size: 13.5px; line-height: 1.9; color: var(--ink-2); padding-left: 12px; border-left: 2px solid var(--line); }
.detail-source { margin-top: 3px; font-size: 9.5px; color: var(--ink-3); padding-left: 12px; letter-spacing: .06em; }
.detail-note { margin-top: 18px; padding: 15px 17px; border-radius: 11px; background: var(--paper-2); font-size: 12.5px; line-height: 1.85; color: var(--ink-2); }
.detail-note .note-label { font-size: 9px; letter-spacing: .18em; color: var(--ink-3); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.detail-subhead { margin: 24px 0 8px; font-size: 9.5px; letter-spacing: .2em; color: var(--ink-3); }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail-stat { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.detail-stat b { display: block; font-family: var(--mono); font-size: 13px; font-weight: 500; }
.detail-stat span { display: block; margin-top: 3px; font-size: 9px; color: var(--ink-3); letter-spacing: .05em; }
.detail-notes { width: 100%; min-height: 84px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 12.5px; line-height: 1.7; outline: none; }
.detail-notes:focus { border-color: var(--ink-3); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.detail-other { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-other button { padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 10.5px; color: var(--ink-2); background: var(--surface); }
.detail-other button:hover { border-color: var(--ink-3); }
.detail-other button.is-current { border-color: var(--seal); color: var(--seal); background: var(--seal-soft); }

/* ---------- 空态 / 加载 ---------- */
.empty { text-align: center; padding: 64px 20px; }
.empty-mark {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink-3);
  background: var(--surface);
}
.empty-title { font-family: var(--serif); font-size: 20px; letter-spacing: .05em; }
.empty-text { margin: 8px auto 0; max-width: 28em; font-size: 12px; line-height: 1.8; color: var(--ink-3); }
.empty-actions { margin-top: 20px; display: flex; gap: 9px; justify-content: center; }

.boot { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--ink-3); }
.boot-seal {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 9px; background: var(--seal); color: #fff8f2;
  font-family: var(--serif); font-size: 26px;
  animation: breathe 1.8s ease-in-out infinite;
}
.boot p { font-size: 11px; letter-spacing: .18em; }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.noscript { padding: 40px; text-align: center; }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  padding: 10px 16px;
  border-radius: 9px;
  background: rgba(27, 26, 24, .92);
  color: #f9f7f1;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .02em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  text-align: center;
}
.toast.is-in { opacity: 1; transform: none; }

/* ---------- 底部导航 ---------- */
.tabbar { display: none; }

/* ---------- 响应式 ---------- */
@media (min-width: 720px) {
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); max-height: 86dvh; }
  .overlay { align-items: center; padding: 20px; }
}

@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 28px; }
}

@media (max-width: 720px) {
  :root { --max: 100%; }
  body { font-size: 14.5px; }
  .topbar { height: 56px; }
  .topbar-inner { padding: 0 16px; }
  .nav { display: none; }
  .brand-sub { display: none; }
  .main { padding: 24px 16px calc(var(--tab-h) + 44px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 25px; }
  .page-head { margin-bottom: 22px; }
  .hero { padding: 22px 20px 20px; border-radius: 19px; }
  .hero::after { font-size: 92px; bottom: -24px; }
  .hero-top { display: block; }
  .hero-date { margin-top: 9px; gap: 8px; font-size: 10.5px; }
  .hero-num { font-size: 66px; }
  .hero-body { display: block; margin-top: 16px; }
  .hero-split { display: none; }
  .hero-facts {
    margin-top: 16px;
    padding-top: 14px;
    padding-bottom: 0;
    border-top: 1px solid var(--line);
    justify-content: space-between;
    gap: 10px;
  }
  .fact b { font-size: 21px; }
  .hero-actions { margin-top: 20px; }
  .hero-actions .btn-ink { flex: 1; min-width: 0; }
  .hero-actions .btn-ghost { flex: 0 0 auto; }
  .hero-note { margin-top: 12px; }
  .quick-stats { grid-template-columns: repeat(3, 1fr); }
  .quick-stat { padding: 14px 12px; }
  .quick-stat b { font-size: 21px; }
  .quick-stat span { font-size: 9.5px; }
  .mode-grid { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { min-height: 0; padding: 19px 20px; }
  .mode-desc { max-width: none; }
  .section-head { margin: 30px 0 12px; }
  .study-main { padding: 16px 13px 106px; justify-content: flex-start; }
  .study-top-inner { height: 54px; padding: 0 10px; gap: 8px; }
  .study-mode { font-size: 13px; }
  .study-card { padding: 24px 20px 18px; border-radius: 21px; }
  .term { font-size: clamp(68px, 22vw, 92px); }
  .term.is-long { font-size: clamp(40px, 11vw, 56px); }
  .card-example { margin-top: 2px; }
  .example { font-size: 15.5px; line-height: 1.95; }
  .def-text { font-size: 17.5px; }
  .card-rule { margin: 16px 0 12px; }
  .def-block { min-height: 66px; padding: 5px 4px 2px; }
  .card-hint { margin-top: 13px; }
  .grades { gap: 6px; }
  .grade { height: 52px; }
  .grade .v { font-size: 12.5px; }
  .immersive { padding: 22px 18px 132px; }
  .immersive-head { padding: 2px 0 18px; }
  .sense { grid-template-columns: 26px 1fr; gap: 10px; padding: 18px 0; }
  .sense-def { font-size: 15.5px; }
  .sense-ex { font-size: 14.5px; }
  .immersive-bottom { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); }
  .summary { margin-top: 4vh; }
  .summary-grid { gap: 8px; }
  .summary-stat { padding: 14px 6px; }
  .summary-stat b { font-size: 26px; }
  .stat-grid { gap: 9px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 28px; }
  .word-row { grid-template-columns: 66px minmax(0, 1fr) auto; gap: 10px; padding: 13px 4px; }
  .word-term { font-size: 23px; }
  .word-meta .badge { display: inline-flex; }
  .word-meta .badge + .badge { display: none; }
  .word-meta .dot { display: none; }
  .setting-row { gap: 12px; padding: 15px 0; align-items: flex-start; }
  .setting-control { padding-top: 2px; }
  .sheet-head { padding: 13px 18px 12px; }
  .sheet-body { padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); }
  .detail-term { font-size: 54px; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(250, 249, 245, .93);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(210, 206, 196, .7);
  }
  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--ink-3);
    font-size: 9.5px;
    letter-spacing: .04em;
    position: relative;
  }
  .tab.is-active { color: var(--ink); }
  .tab.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--seal);
  }
  .tab svg { width: 21px; height: 21px; }
  .toast-root { bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .hero-num { font-size: 56px; }
  .hero-actions .btn-ghost { display: none; }
  .quick-stats { grid-template-columns: 1fr 1fr; }
  .quick-stat:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .study-card { padding: 20px 15px 16px; }
  .grades { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 补充：学习 / 设置 / 错误 ---------- */
.study-main.is-immersive { justify-content: flex-start; padding-top: 0; }
.icon-btn:disabled { opacity: .28; pointer-events: none; }
.option:disabled { cursor: default; }
.setting-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.setting-control .seg { flex-wrap: wrap; justify-content: flex-end; }

.code-block {
  margin: 8px 0 4px;
  padding: 13px 15px;
  background: var(--paper-2);
  border: 1px solid rgba(210, 206, 196, .45);
  border-radius: 9px;
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 1.95;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}
.rule-list { display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.rule-list li { padding-left: 14px; position: relative; }
.rule-list li::before { content: "—"; position: absolute; left: 0; color: var(--ink-3); font-size: 10px; top: 2px; }
.rule-list code, .setting-desc code, .empty-text code {
  font-family: var(--mono);
  font-size: .92em;
  background: rgba(27, 26, 24, .055);
  padding: 1px 4px;
  border-radius: 4px;
  word-break: break-all;
}
.error-list { display: flex; flex-direction: column; }
.error-list li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.error-list li:first-child { padding-top: 0; }
.error-list li:last-child { border-bottom: 0; }
.error-where { font-family: var(--mono); font-size: 10px; color: var(--seal); letter-spacing: .03em; margin-bottom: 4px; }
.error-msg { font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.error-raw {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--paper-2);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ink-3);
}
.detail-notes:focus { box-shadow: 0 0 0 3px rgba(27, 26, 24, .035); }
.detail-sheet .sheet-body { padding-top: 14px; }
.format-sheet .sheet-body { font-size: 13px; }

@media (max-width: 720px) {
  .setting-control .seg { max-width: 100%; }
  .study-main.is-immersive { padding-top: 0; }
  .code-block { font-size: 11.5px; }
}

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