/* 公考成语库 - design tokens
   白底 / 暖石灰中性色 / 单一朱砂强调色 / 宋体成语大字
   形状规则：按钮 pill，卡片 12px，输入框 8px */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --ink: #28241e;
  --ink-soft: #4c473e;
  --muted: #7b756a;
  --faint: #a39c8f;
  --line: #e9e5dc;
  --line-strong: #d9d3c6;
  --accent: #b4362a;
  --accent-deep: #93291f;
  --accent-soft: #f8eeec;
  --accent-line: #e5c6c1;
  --gold: #a9822f;
  --gold-soft: #f7f0df;
  --ok: #3d7a4e;
  --ok-soft: #edf4ee;
  --warn-soft: #faf3e3;
  --serif: "Songti SC", "STSong", "STZhongsong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --radius-card: 12px;
  --radius-input: 8px;
  --shadow-card: 0 1px 2px rgba(60, 50, 35, 0.05), 0 4px 16px rgba(60, 50, 35, 0.05);
  --shadow-pop: 0 8px 32px rgba(60, 50, 35, 0.16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
::selection { background: var(--accent-soft); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-seal { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: 0.06em; }
.mainnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14.5px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.mainnav a:hover { background: var(--accent-soft); color: var(--accent-deep); }
.mainnav a.active { background: var(--accent); color: #fff; }

/* ---------- shell ---------- */
.app-shell {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 20px 28px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
}
.site-footer p { margin: 0; }

/* ---------- boot ---------- */
.boot-loading { text-align: center; padding: 120px 0; color: var(--muted); }
.boot-seal {
  width: 44px; height: 44px; margin: 0 auto 16px;
  border-radius: 10px; background: var(--accent);
  animation: sealPulse 1.2s ease-in-out infinite;
}
@keyframes sealPulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .55; transform: scale(.92);} }

/* ---------- view transitions ---------- */
.view { animation: viewIn 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- home ---------- */
.home-hero { padding: 40px 0 8px; }
.home-hero h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.25;
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}
.home-hero h1 em { font-style: normal; color: var(--accent); }
.home-hero .sub { color: var(--muted); max-width: 56ch; margin: 0 0 26px; }

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 6px 4px 18px;
  box-shadow: var(--shadow-card);
  max-width: 640px;
}
.searchbar svg { flex: none; color: var(--faint); }
.searchbar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 10px 0;
  color: var(--ink);
  min-width: 0;
}
.searchbar input::placeholder { color: var(--faint); }

.search-suggest {
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  margin-top: 8px;
  overflow: hidden;
}
.search-suggest button {
  display: flex;
  width: 100%;
  align-items: baseline;
  gap: 12px;
  padding: 10px 18px;
  border: none;
  background: none;
  text-align: left;
  font-size: 15px;
  color: var(--ink);
}
.search-suggest button:hover { background: var(--accent-soft); }
.search-suggest .term { font-family: var(--serif); font-weight: 700; font-size: 16px; }
.search-suggest .hint { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 34px 0 8px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 18px 20px 14px;
}
.stat-card .num {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}
.stat-card .num em { font-style: normal; color: var(--accent); }
.stat-card .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

.home-section { margin-top: 40px; }
.home-section h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.home-section h2 .more { font-size: 13px; font-weight: 400; }

.daily-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 26px 28px;
  box-shadow: var(--shadow-card);
}
.daily-card .term-big {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.daily-card .def { color: var(--ink-soft); margin: 10px 0 0; max-width: 60ch; }
.daily-card .actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.recent-list { display: grid; gap: 8px; }
.recent-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 12px 18px;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.recent-item:hover { border-color: var(--accent-line); color: var(--ink); }
.recent-item .t { font-family: var(--serif); font-weight: 700; font-size: 17px; flex: none; }
.recent-item .s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .badge { margin-left: auto; flex: none; }

/* ---------- buttons & tags ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  padding: 8px 18px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent-line); color: var(--accent-deep); background: var(--accent-soft); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-sm { padding: 5px 13px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  padding: 1px 10px;
  line-height: 1.7;
  white-space: nowrap;
}
.tag-core { background: var(--accent-soft); color: var(--accent-deep); }
.tag-exam { background: var(--gold-soft); color: var(--gold); }
.tag-new { background: var(--ok-soft); color: var(--ok); }
.tag-plain { background: #f2efe9; color: var(--muted); }
.tag-word { background: #eef1f5; color: #54677f; }

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
}
.status-unlearned { background: #d5cfc2; }
.status-vague { background: var(--gold); }
.status-mastered { background: var(--ok); }

/* ---------- library ---------- */
.lib-head { padding: 14px 0 0; }
.lib-head h1, .page-title {
  font-family: var(--serif);
  font-size: 28px;
  margin: 0 0 18px;
  letter-spacing: 0.02em;
}
.lib-controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 15px;
  font-size: 13.5px;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--accent-line); color: var(--accent-deep); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.lib-count { color: var(--faint); font-size: 13px; margin-left: auto; }

.group-block { margin-bottom: 10px; }
.group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 4px 8px;
  cursor: pointer;
  user-select: none;
}
.group-title h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.group-title .cnt { color: var(--faint); font-size: 12.5px; }
.group-title .caret { color: var(--faint); transition: transform 0.2s ease; font-size: 12px; }
.group-block.open .group-title .caret { transform: rotate(90deg); }
.group-title .gno { color: var(--faint); font-size: 12px; }

.idiom-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.idiom-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 13px 18px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.idiom-row:hover { border-color: var(--accent-line); box-shadow: var(--shadow-card); color: var(--ink); }
.idiom-row .t {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.idiom-row .d {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  min-width: 0;
}
.idiom-row .meta { margin-left: auto; flex: none; display: flex; gap: 6px; align-items: center; }

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}
.empty-state .big { font-family: var(--serif); font-size: 22px; color: var(--ink-soft); margin-bottom: 8px; }

/* ---------- term detail ---------- */
.term-hero { padding: 18px 0 6px; }
.term-hero .term-title {
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 56px);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.15;
  margin: 0;
}
.term-hero .term-sub { color: var(--muted); margin-top: 10px; font-size: 16px; max-width: 62ch; }
.term-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }

.status-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface); }
.status-switch button {
  border: none;
  background: none;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.15s ease;
}
.status-switch button.on-vague { background: var(--gold); color: #fff; }
.status-switch button.on-mastered { background: var(--ok); color: #fff; }
.status-switch button.on-unlearned { background: #e3ded2; color: var(--ink-soft); }

.fav-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.fav-btn:hover { border-color: var(--accent-line); color: var(--accent-deep); }
.fav-btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }

.detail-section { margin-top: 36px; }
.detail-section > h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.detail-section > h2 .cnt { color: var(--faint); font-size: 13px; font-weight: 400; }

.def-block { color: var(--ink-soft); max-width: 68ch; }
.def-block .src { color: var(--faint); font-size: 12.5px; margin-top: 6px; }
.example-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.example-list li {
  border-left: 3px solid var(--line-strong);
  padding: 2px 0 2px 14px;
  color: var(--ink-soft);
  font-size: 14px;
}
.example-list li b { color: var(--accent-deep); font-weight: 600; }

.confuse-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.confuse-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.confuse-card:hover { border-color: var(--accent-line); color: var(--ink); }
.confuse-card .head { display: flex; align-items: center; gap: 10px; }
.confuse-card .vs-term { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.confuse-card .stars { color: var(--gold); font-size: 12px; letter-spacing: 1px; }
.confuse-card .why { color: var(--muted); font-size: 13px; margin-top: 6px; }

.note-box textarea {
  width: 100%;
  min-height: 84px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  resize: vertical;
}
.note-box textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.note-box .save-hint { color: var(--faint); font-size: 12.5px; margin-top: 6px; }

/* ---------- question card ---------- */
.q-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  margin-bottom: 14px;
}
.q-card .q-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--faint);
  font-size: 12.5px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.q-card .q-meta .qno { color: var(--accent-deep); font-weight: 600; font-size: 13px; }
.q-card .stem { color: var(--ink); margin: 0 0 14px; }
.q-card .stem .blank { color: var(--accent); font-weight: 600; letter-spacing: 2px; }
.opt-list { display: grid; gap: 6px; }
.opt-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 7px 12px;
  border-radius: var(--radius-input);
  border: 1px solid transparent;
  font-size: 14.5px;
}
.opt-row .letter { font-weight: 600; color: var(--muted); flex: none; width: 16px; }
.opt-row.correct { background: var(--ok-soft); border-color: #cfe3d3; }
.opt-row.correct .letter { color: var(--ok); }
.opt-row .check { color: var(--ok); font-weight: 700; margin-left: auto; flex: none; }
.opt-row .idiom-token {
  color: var(--accent-deep);
  font-weight: 600;
  border-bottom: 1px dashed var(--accent-line);
  cursor: pointer;
}
.opt-row .idiom-token:hover { color: var(--accent); border-bottom-style: solid; }
.q-analysis {
  margin-top: 14px;
  background: var(--warn-soft);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.q-analysis .lab { color: var(--gold); font-weight: 600; font-size: 12.5px; margin-right: 8px; }
.q-analysis .notes { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.q-analysis .notes b { font-family: var(--serif); color: var(--ink); }

/* ---------- exams ---------- */
.exam-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  color: var(--ink);
  margin-bottom: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.exam-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-card); color: var(--ink); }
.exam-card h3 { margin: 0 0 6px; font-size: 16.5px; }
.exam-card .meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- review ---------- */
.review-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8px; }
.mode-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  color: var(--ink);
}
.mode-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-card); }
.mode-card h3 { margin: 0 0 8px; font-size: 16.5px; }
.mode-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.mode-card .cnt { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--accent); margin-top: 12px; }

.flash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 44px 36px;
  text-align: center;
  margin-top: 10px;
}
.flash-card .f-term { font-family: var(--serif); font-size: clamp(36px, 6vw, 48px); font-weight: 700; letter-spacing: 0.12em; }
.flash-card .f-vs { color: var(--faint); font-size: 15px; margin: 6px 0; }
.flash-card .f-answer { margin-top: 22px; text-align: left; max-width: 560px; margin-left: auto; margin-right: auto; }
.flash-card .f-answer .row { padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 14.5px; }
.flash-card .f-answer .row b { font-family: var(--serif); color: var(--ink); font-size: 16px; }
.flash-card .f-answer .row .lab { color: var(--faint); font-size: 12.5px; display: block; }
.review-actions { display: flex; gap: 10px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.review-progress { text-align: center; color: var(--faint); font-size: 13px; margin-top: 18px; }

/* ---------- data page ---------- */
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.data-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
}
.data-panel h2 { margin: 0 0 6px; font-size: 16.5px; }
.data-panel .desc { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.data-panel .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.drop-zone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-card);
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  transition: all 0.15s ease;
  background: var(--bg);
}
.drop-zone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.drop-zone .big { font-size: 15px; color: var(--ink-soft); margin-bottom: 6px; }
.drop-zone input[type="file"] { display: none; }

.paste-area { margin-top: 14px; }
.paste-area textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  padding: 10px 14px;
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  resize: vertical;
}
.paste-area textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.import-errors {
  background: #fdf0ee;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--accent-deep);
}
.import-errors ul { margin: 6px 0 0; padding-left: 18px; }

.schema-note { font-size: 12.5px; color: var(--faint); margin-top: 14px; line-height: 1.6; }
.schema-note code { background: #f2efe9; border-radius: 4px; padding: 1px 6px; font-size: 12px; }

/* ---------- modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(40, 36, 30, 0.42);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 520px;
  max-height: 84dvh;
  overflow: auto;
  padding: 28px;
  animation: popIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.modal .preview-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin-bottom: 20px; }
.modal .preview-stats .row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.modal .preview-stats .row b { font-family: var(--serif); font-size: 16px; }
.modal .preview-stats .row .accent-n { color: var(--accent); }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal .warn-text { color: var(--accent-deep); font-size: 13.5px; background: var(--accent-soft); border-radius: var(--radius-input); padding: 10px 14px; margin-bottom: 16px; }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast {
  background: var(--ink);
  color: #f5f2ec;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px;
  box-shadow: var(--shadow-pop);
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.err { background: var(--accent-deep); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- compare (易混对比) ---------- */
.vs-head { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 10px 0 4px; flex-wrap: wrap; }
.vs-head .v-term { font-family: var(--serif); font-size: clamp(30px, 5vw, 40px); font-weight: 700; letter-spacing: 0.08em; }
.vs-head .v-x { color: var(--faint); font-size: 15px; }
.vs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.vs-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px 22px; }
.vs-col h4 { font-family: var(--serif); font-size: 20px; margin: 0 0 8px; }
.vs-col .def { color: var(--ink-soft); font-size: 14px; }
.vs-col .mini { color: var(--faint); font-size: 12.5px; margin-top: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .idiom-list { grid-template-columns: 1fr; }
  .confuse-grid { grid-template-columns: 1fr; }
  .review-modes { grid-template-columns: 1fr; }
  .data-grid { grid-template-columns: 1fr; }
  .vs-cols { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 6px 12px; }
  .mainnav { width: 100%; }
  .brand { flex: none; }
  .brand-name { font-size: 17px; white-space: nowrap; }
  .flash-card { padding: 32px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
