/* ============================================================
   中国文学史 · 大事年表 — 设计系统
   视觉方向：宋式美学 / 极简水墨 / 宣纸·墨·朱砂印
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --paper: #F6F1E7;
  --paper-2: #EFE7D6;
  --paper-3: #E9DFC9;
  --card: #FFFDF8;
  --ink: #26221C;
  --ink-2: #4C463C;
  --ink-3: #8B8372;
  --line: #DCD2BD;
  --line-2: #EDE5D3;
  --cinnabar: #A63D2F;
  --cinnabar-d: #7E2D23;
  --cinnabar-t: rgba(166, 61, 47, 0.08);
  --teal: #3D5A6C;
  --bamboo: #5F7D63;
  --gold: #A8863A;
  --ok: #5F7D63;
  --bad: #A63D2F;
  --font-display: "Noto Serif SC", "Songti SC", "SimSun", "STSong", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --shadow-1: 0 1px 2px rgba(38, 34, 28, 0.06), 0 4px 14px rgba(38, 34, 28, 0.05);
  --shadow-2: 0 4px 12px rgba(38, 34, 28, 0.08), 0 14px 40px rgba(38, 34, 28, 0.1);
  --radius: 10px;
  --topbar-h: 62px;
  --bottomnav-h: 58px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -100px, rgba(61, 90, 108, 0.07), transparent 60%),
    radial-gradient(900px 420px at -10% 8%, rgba(166, 61, 47, 0.05), transparent 55%),
    var(--paper);
  min-height: 100vh;
  padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom));
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; font-weight: 700; line-height: 1.35; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; border-radius: 3px; }

::selection { background: rgba(166, 61, 47, 0.18); }

/* ---------- 通用工具 ---------- */
.view { max-width: 1200px; margin: 0 auto; padding: 28px 22px 60px; }
.section { margin-bottom: 44px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin-bottom: 18px;
}
.section-title {
  font-size: 1.45rem; display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ""; width: 5px; height: 1.1em; background: var(--cinnabar);
  border-radius: 2px;
}
.section-sub { color: var(--ink-3); font-size: 0.85rem; }

.iconbtn {
  background: none; border: none; color: var(--ink-2);
  width: 38px; height: 38px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; position: relative; transition: background .2s, color .2s;
}
.iconbtn:hover { background: rgba(38, 34, 28, 0.06); color: var(--ink); }
.iconbtn:active { transform: scale(0.94); }

.seal {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cinnabar); color: #F6F1E7;
  font-family: var(--font-display); font-weight: 700; border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px rgba(246, 241, 231, 0.55);
  user-select: none; flex: none;
}
.seal.lg { width: 52px; height: 52px; font-size: 1.6rem; }
.seal.sm { width: 34px; height: 34px; font-size: 1.05rem; border-radius: 5px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); font-size: 0.85rem;
  transition: all .18s; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.empty {
  text-align: center; color: var(--ink-3); padding: 46px 16px; font-size: 0.95rem;
}
.empty .seal { margin: 0 auto 14px; opacity: 0.85; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(246, 241, 231, 0.86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 22px;
  height: var(--topbar-h); display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-seal {
  width: 34px; height: 34px; border-radius: 5px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cinnabar); color: var(--paper);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  box-shadow: inset 0 0 0 1.5px rgba(246, 241, 231, 0.5);
}
.brand-seal.sm { width: 30px; height: 30px; font-size: 0.95rem; }
.brand-text b { display: block; font-family: var(--font-display); font-size: 1.08rem; letter-spacing: 0.12em; line-height: 1.25; }
.brand-text i { font-style: normal; display: block; font-size: 0.7rem; color: var(--ink-3); letter-spacing: 0.18em; line-height: 1.3; }

.topnav { display: flex; gap: 4px; }
.topnav a {
  padding: 6px 13px; border-radius: 7px; font-size: 0.92rem; color: var(--ink-2);
  position: relative; transition: color .18s, background .18s;
}
.topnav a:hover { color: var(--ink); background: rgba(38, 34, 28, 0.05); }
.topnav a.active { color: var(--cinnabar-d); font-weight: 600; }
.topnav a.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 1px;
  height: 2px; background: var(--cinnabar); border-radius: 2px;
}
.topbar-right { display: flex; align-items: center; gap: 2px; }
.fav-count {
  position: absolute; top: 2px; right: 0; min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--cinnabar); color: #fff; border-radius: 999px;
  font-size: 0.62rem; line-height: 15px; text-align: center; font-weight: 700;
}

.searchbar { border-top: 1px solid var(--line-2); background: var(--card); }
.searchbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 22px;
  display: flex; align-items: center; gap: 10px; color: var(--ink-3);
}
.searchbar input {
  flex: 1; border: none; outline: none; background: none;
  font-family: inherit; font-size: 0.98rem; color: var(--ink);
}
.searchbar input::placeholder { color: var(--ink-3); }
.search-close { border: none; background: none; color: var(--ink-3); font-size: 1.3rem; line-height: 1; padding: 4px 8px; }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 16px;
  min-height: 380px; display: flex; align-items: flex-end;
  background: var(--paper-2);
  box-shadow: var(--shadow-1);
}
.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
}
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(246, 241, 231, 0.92) 0%, rgba(246, 241, 231, 0.62) 42%, rgba(246, 241, 231, 0.08) 75%);
}
.hero-content {
  position: relative; z-index: 2; padding: 46px 44px; max-width: 640px;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; letter-spacing: 0.32em; color: var(--cinnabar-d);
  margin-bottom: 16px; font-weight: 600;
}
.hero-kicker::before { content: ""; width: 26px; height: 1px; background: var(--cinnabar); }
.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.4rem); font-weight: 900;
  letter-spacing: 0.06em; line-height: 1.2; margin-bottom: 12px;
}
.hero h1 .accent { color: var(--cinnabar-d); }
.hero p { font-size: 1rem; color: var(--ink-2); max-width: 54ch; }
.hero-stats {
  display: flex; gap: 34px; margin-top: 26px; flex-wrap: wrap;
}
.hero-stats .num {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 700;
  color: var(--ink); display: block; line-height: 1.1;
}
.hero-stats .num i { font-style: normal; color: var(--cinnabar); font-size: 0.7em; vertical-align: 0.18em; margin-left: 1px; }
.hero-stats .lbl { font-size: 0.78rem; color: var(--ink-3); letter-spacing: 0.08em; }

/* 今日文学 */
.today-card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-1); position: relative;
}
.today-card .today-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; letter-spacing: 0.22em; color: var(--cinnabar-d); font-weight: 600;
}
.today-card .today-label .seal { width: 22px; height: 22px; font-size: 0.7rem; border-radius: 4px; }
.today-body { margin-top: 12px; display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; }
.today-text { font-size: 1.02rem; color: var(--ink); flex: 1; min-width: 0; }
.today-meta { color: var(--ink-3); font-size: 0.82rem; margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; }
.today-meta b { color: var(--ink-2); font-weight: 600; }
.today-actions { display: flex; gap: 8px; flex: none; }

/* 朝代长廊 */
.dynasty-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.dynasty-card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 18px 18px 16px; cursor: pointer; position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  box-shadow: var(--shadow-1);
}
.dynasty-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--dc, var(--teal));
}
.dynasty-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line); }
.dynasty-card h3 { font-size: 1.12rem; display: flex; align-items: center; gap: 8px; }
.dynasty-card h3 .dyn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dc, var(--teal)); flex: none; }
.dynasty-card .period { font-size: 0.8rem; color: var(--ink-3); margin-top: 2px; font-family: var(--font-display); }
.dynasty-card .tagline { font-size: 0.86rem; color: var(--ink-2); margin-top: 8px; }
.dynasty-card .dyn-count {
  margin-top: 12px; font-size: 0.75rem; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 5px;
}
.dynasty-card .dyn-count b { color: var(--dc, var(--cinnabar)); font-size: 1rem; font-family: var(--font-display); }

/* 文学脉络 */
.stream { display: flex; gap: 0; overflow-x: auto; padding: 6px 2px 12px; scrollbar-width: thin; }
.stream-item { display: flex; align-items: center; flex: none; }
.stream-node {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 16px; cursor: pointer; min-width: 96px;
  transition: all .18s; position: relative;
}
.stream-node:hover { border-color: var(--cinnabar); transform: translateY(-2px); }
.stream-node .sn-char {
  width: 34px; height: 34px; border-radius: 50%; background: var(--paper-2);
  font-family: var(--font-display); font-weight: 700; color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.stream-node b { font-family: var(--font-display); font-size: 0.95rem; }
.stream-node i { font-style: normal; font-size: 0.7rem; color: var(--ink-3); }
.stream-arrow { color: var(--ink-3); padding: 0 6px; font-size: 1.05rem; flex: none; opacity: 0.7; }

/* 名作预览 */
.classic-strip {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px;
}
.mini-classic {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; transition: all .18s; box-shadow: var(--shadow-1);
}
.mini-classic:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line); }
.mini-classic .mc-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.mini-classic .mc-meta { font-size: 0.78rem; color: var(--ink-3); margin-top: 5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mini-classic .mc-brief { font-size: 0.82rem; color: var(--ink-2); margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 年表页 ---------- */
.timeline-toolbar {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-1); margin-bottom: 18px;
}
.toolbar-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.toolbar-search {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px;
  background: var(--paper); color: var(--ink-3);
}
.toolbar-search:focus-within { border-color: var(--ink-3); }
.toolbar-search input { flex: 1; border: none; outline: none; background: none; font-family: inherit; font-size: 0.9rem; color: var(--ink); min-width: 0; }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.range-row { display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.range-slider { flex: 1; min-width: 220px; position: relative; height: 26px; }
.range-slider input[type="range"] {
  position: absolute; left: 0; top: 8px; width: 100%; height: 3px; margin: 0;
  -webkit-appearance: none; appearance: none; background: none; pointer-events: none;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto;
  width: 16px; height: 16px; border-radius: 50%; background: var(--card);
  border: 2px solid var(--cinnabar); box-shadow: 0 1px 3px rgba(0,0,0,.2); cursor: grab;
}
.range-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: var(--card);
  border: 2px solid var(--cinnabar); cursor: grab;
}
.range-track {
  position: absolute; left: 0; right: 0; top: 9px; height: 3px; border-radius: 2px;
  background: var(--line);
}
.range-fill { position: absolute; top: 0; height: 100%; background: var(--cinnabar); border-radius: 2px; }
.range-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }

.timeline-summary {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 2px 14px; font-size: 0.85rem; color: var(--ink-3); flex-wrap: wrap; gap: 10px;
}
.timeline-summary b { color: var(--cinnabar-d); font-family: var(--font-display); font-size: 1.05rem; }
.seg {
  display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.seg button {
  border: none; background: var(--card); color: var(--ink-2); padding: 6px 13px; font-size: 0.82rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--ink); color: var(--paper); }
.seg button.active svg { opacity: 1; }

/* 时间轴 */
.tl { position: relative; padding-left: 34px; }
.tl::before {
  content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(to bottom, var(--line), var(--line-2));
}
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item::before {
  content: ""; position: absolute; left: -30px; top: 18px;
  width: 12px; height: 12px; border-radius: 2.5px;
  background: var(--paper); border: 2px solid var(--dc, var(--cinnabar));
  transform: rotate(45deg);
}
.tl-item.hot::before { background: var(--dc, var(--cinnabar)); }
.tl-card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 14px 18px; cursor: pointer; box-shadow: var(--shadow-1);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line); }
.tl-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 7px; }
.tl-year {
  font-family: var(--font-display); font-weight: 700; font-size: 0.92rem;
  color: var(--dc, var(--cinnabar-d)); letter-spacing: 0.04em;
  background: var(--dc-t, var(--cinnabar-t)); border-radius: 6px; padding: 1px 9px;
}
.tl-date { font-size: 0.78rem; color: var(--ink-3); }
.tl-tag {
  font-size: 0.7rem; color: var(--ink-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 8px; line-height: 1.6;
}
.tl-text { font-size: 0.93rem; color: var(--ink-2); line-height: 1.85; }
.tl-text mark { background: rgba(168, 134, 58, 0.32); color: inherit; border-radius: 2px; padding: 0 1px; }
.tl-works { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.tl-work {
  font-size: 0.74rem; color: var(--teal); border: 1px dashed rgba(61, 90, 108, 0.45);
  border-radius: 5px; padding: 0 8px; line-height: 1.8; cursor: pointer;
}
.tl-work:hover { background: rgba(61, 90, 108, 0.08); }
.load-more {
  display: block; margin: 18px auto 6px; padding: 9px 26px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  color: var(--ink-2); font-size: 0.88rem; transition: all .18s;
}
.load-more:hover { border-color: var(--ink-3); color: var(--ink); }

/* ---------- 名作页 ---------- */
.classic-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}
.classic-card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 18px 18px 15px; cursor: pointer; position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s; box-shadow: var(--shadow-1);
}
.classic-card::after {
  content: ""; position: absolute; right: -18px; bottom: -18px; width: 74px; height: 74px;
  background: radial-gradient(circle, var(--dc-t, var(--cinnabar-t)) 0%, transparent 70%);
  border-radius: 50%;
}
.classic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line); }
.classic-card .cc-type {
  position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--dc, var(--teal));
}
.classic-card h3 { font-size: 1.08rem; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.classic-card .cc-author { font-size: 0.82rem; color: var(--ink-2); margin-top: 4px; }
.classic-card .cc-dyn {
  display: inline-block; font-size: 0.72rem; color: var(--dc, var(--teal));
  background: var(--dc-t, rgba(61, 90, 108, 0.1)); border-radius: 5px; padding: 0 8px; margin-top: 8px;
}
.classic-card .cc-brief { font-size: 0.83rem; color: var(--ink-2); margin-top: 9px; line-height: 1.75; }

/* ---------- 统计页 ---------- */
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-1); text-align: center;
}
.stat-card .sc-num {
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--cinnabar-d);
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat-card .sc-lbl { font-size: 0.8rem; color: var(--ink-3); margin-top: 5px; letter-spacing: 0.1em; }
.chart-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px;
}
.chart-panel {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 18px 18px 10px; box-shadow: var(--shadow-1);
}
.chart-panel h3 { font-size: 1.05rem; margin-bottom: 2px; }
.chart-panel .cp-sub { font-size: 0.8rem; color: var(--ink-3); margin-bottom: 8px; }
.chart-box { width: 100%; height: 320px; }
.chart-panel.wide { grid-column: 1 / -1; }
.stats-note {
  margin-top: 18px; font-size: 0.8rem; color: var(--ink-3);
  background: var(--paper-2); border-radius: var(--radius); padding: 12px 16px; line-height: 1.8;
}

/* ---------- 测验页 ---------- */
.quiz-wrap { max-width: 720px; margin: 0 auto; }
.quiz-start { text-align: center; padding: 50px 20px; }
.quiz-start .seal { margin: 0 auto 18px; }
.quiz-start h2 { font-size: 1.7rem; margin-bottom: 10px; }
.quiz-start p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 24px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--paper); border: none;
  border-radius: 10px; padding: 12px 30px; font-size: 0.98rem; font-weight: 600;
  transition: transform .18s, box-shadow .18s, background .18s;
  box-shadow: 0 4px 14px rgba(38, 34, 28, 0.18);
}
.btn-primary:hover { transform: translateY(-2px); background: var(--cinnabar-d); box-shadow: 0 6px 18px rgba(126, 45, 35, 0.3); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 22px; font-size: 0.92rem; transition: all .18s;
}
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); }

.quiz-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.quiz-progress .qp-bar { flex: 1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.quiz-progress .qp-fill { height: 100%; background: var(--cinnabar); border-radius: 3px; transition: width .3s; }
.quiz-progress .qp-txt { font-size: 0.82rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.quiz-card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 26px 26px 22px; box-shadow: var(--shadow-1);
}
.quiz-card .q-count { font-size: 0.78rem; color: var(--ink-3); letter-spacing: 0.18em; }
.quiz-card .q-text { font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; margin: 8px 0 20px; line-height: 1.6; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  display: flex; align-items: flex-start; gap: 12px; text-align: left;
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 10px;
  padding: 12px 15px; font-size: 0.94rem; color: var(--ink); transition: all .16s;
  font-family: var(--font-body);
}
.quiz-opt .opt-key {
  flex: none; width: 24px; height: 24px; border-radius: 6px; background: var(--card);
  border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: var(--ink-2); margin-top: 1px;
}
.quiz-opt:hover { border-color: var(--ink-3); }
.quiz-opt.correct { border-color: var(--ok); background: rgba(95, 125, 99, 0.1); }
.quiz-opt.correct .opt-key { background: var(--ok); border-color: var(--ok); color: #fff; }
.quiz-opt.wrong { border-color: var(--bad); background: rgba(166, 61, 47, 0.08); }
.quiz-opt.wrong .opt-key { background: var(--bad); border-color: var(--bad); color: #fff; }
.quiz-opt:disabled { cursor: default; }
.quiz-why {
  margin-top: 16px; font-size: 0.87rem; color: var(--ink-2);
  background: var(--paper-2); border-left: 3px solid var(--gold);
  border-radius: 8px; padding: 11px 14px; line-height: 1.75;
}
.quiz-next { margin-top: 18px; display: flex; justify-content: flex-end; }
.quiz-result { text-align: center; padding: 34px 20px; }
.quiz-result .qr-score {
  font-family: var(--font-display); font-size: 3rem; font-weight: 900; color: var(--cinnabar-d);
}
.quiz-result .qr-sub { color: var(--ink-2); margin: 8px 0 22px; }
.qr-wronglist { text-align: left; margin: 18px auto 0; max-width: 560px; }
.qr-wronglist h4 { font-size: 0.95rem; margin-bottom: 10px; }
.qr-item { background: var(--paper); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 15px; margin-bottom: 10px; font-size: 0.86rem; }
.qr-item .qr-q { font-weight: 600; margin-bottom: 5px; }
.qr-item .qr-a { color: var(--ok); }
.qr-item .qr-yours { color: var(--bad); }

/* ---------- 收藏页 ---------- */
.fav-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin-bottom: 18px; }
.fav-tabs button { border: none; background: var(--card); color: var(--ink-2); padding: 8px 20px; font-size: 0.9rem; }
.fav-tabs button + button { border-left: 1px solid var(--line); }
.fav-tabs button.active { background: var(--ink); color: var(--paper); }
.fav-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.fav-item {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 13px 16px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow-1);
}
.fav-item .fi-main { flex: 1; min-width: 0; cursor: pointer; }
.fav-item .fi-year { font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; color: var(--cinnabar-d); }
.fav-item .fi-text { font-size: 0.88rem; color: var(--ink-2); margin-top: 3px; line-height: 1.75; }
.fav-item .fi-rm { flex: none; }
.fav-item .fi-meta { font-size: 0.75rem; color: var(--ink-3); margin-top: 4px; }

/* ---------- 关于页 ---------- */
.about-card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 26px 28px; box-shadow: var(--shadow-1); max-width: 860px;
}
.about-card h2 { font-size: 1.3rem; margin-bottom: 12px; }
.about-card p, .about-card li { color: var(--ink-2); font-size: 0.95rem; line-height: 1.9; }
.about-card ul { padding-left: 20px; margin: 10px 0; }
.about-card .note { background: var(--paper-2); border-radius: 8px; padding: 12px 16px; font-size: 0.85rem; color: var(--ink-3); margin-top: 14px; }
.kbd {
  display: inline-block; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 0 8px; font-size: 0.85rem; color: var(--ink-2);
}

/* ---------- 抽屉 ---------- */
.drawer-mask, .modal-mask {
  position: fixed; inset: 0; background: rgba(38, 34, 28, 0.42);
  z-index: 90; opacity: 0; transition: opacity .25s;
}
.drawer-mask.show, .modal-mask.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw);
  background: var(--card); z-index: 95; box-shadow: var(--shadow-2);
  transform: translateX(102%); transition: transform .3s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column; border-left: 1px solid var(--line-2);
}
.drawer.show { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line-2); gap: 12px;
}
.drawer-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot {
  border-top: 1px solid var(--line-2); padding: 12px 20px calc(12px + var(--safe-bottom));
  display: flex; gap: 10px; flex-wrap: wrap;
}
.drawer .d-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: 14px; }
.drawer .d-text { font-size: 0.97rem; line-height: 2; color: var(--ink); white-space: pre-wrap; }
.drawer .d-works { margin-top: 18px; }
.drawer .d-works h4 { font-size: 0.86rem; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.drawer .d-tags { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.dyn-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; border-radius: 6px; padding: 2px 10px;
  background: var(--dc-t, var(--cinnabar-t)); color: var(--dc, var(--cinnabar-d));
}
.dyn-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(0.98);
  width: min(560px, 92vw); max-height: 82vh; overflow-y: auto;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow-2);
  z-index: 96; padding: 26px 26px 24px; opacity: 0; transition: all .25s;
}
.modal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal h3 { font-size: 1.35rem; margin-bottom: 4px; padding-right: 30px; }
.modal .m-meta { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 14px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.modal .m-brief { font-size: 0.95rem; line-height: 2; color: var(--ink-2); }
.modal .m-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottomnav-h) + 22px);
  transform: translateX(-50%) translateY(14px);
  background: var(--ink); color: var(--paper); border-radius: 999px;
  padding: 9px 20px; font-size: 0.86rem; opacity: 0; pointer-events: none;
  transition: all .28s; z-index: 120; box-shadow: var(--shadow-2); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 底部导航 ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: none; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 253, 248, 0.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-2);
  padding-bottom: var(--safe-bottom);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 7px; color: var(--ink-3); font-size: 0.7rem;
  transition: color .18s;
}
.bottomnav a.active { color: var(--cinnabar-d); font-weight: 600; }
.bottomnav a svg { width: 21px; height: 21px; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line-2); margin-top: 40px;
  background: var(--paper-2);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 26px 22px 18px;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand b { font-family: var(--font-display); font-size: 1rem; }
.footer-brand p { font-size: 0.8rem; color: var(--ink-3); margin-top: 3px; }
.footer-links { font-size: 0.8rem; color: var(--ink-3); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.footer-note {
  max-width: 1200px; margin: 0 auto; padding: 0 22px 20px;
  font-size: 0.75rem; color: var(--ink-3);
}

/* ---------- 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.view > * { animation: fadeUp .4s ease both; }
@keyframes inkPulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.seal { animation: inkPulse 4s ease-in-out infinite; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .topnav { display: none; }
  .view { padding: 18px 14px 40px; }
  .hero { min-height: 320px; }
  .hero-content { padding: 34px 24px; }
  .hero-stats { gap: 22px; }
  .footer-inner { flex-direction: column; }
  .footer-links { align-items: flex-start; }
}
@media (max-width: 640px) {
  .bottomnav { display: grid; }
  body { padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom)); }
  .topbar-right .iconbtn[data-nav] { display: none; }
  .brand-text i { display: none; }
  .section-title { font-size: 1.25rem; }
  .tl { padding-left: 26px; }
  .tl::before { left: 7px; }
  .tl-item::before { left: -25px; width: 11px; height: 11px; }
  .tl-card { padding: 12px 14px; }
  .chart-box { height: 280px; }
  .quiz-card { padding: 20px 18px; }
  .drawer { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
