/* =========================================================
   党的二十届五中全会精神 · 学习与自测
   移动端优先的极简阅读 / 刷题样式
   ========================================================= */

:root {
  --paper: #f5f2ea;
  --paper-deep: #ece6da;
  --card: #fffdf8;
  --ink: #211f1c;
  --ink-soft: #4d4842;
  --muted: #7b746a;
  --line: #e2dad0;
  --line-strong: #d2c7b8;
  --red: #922a24;
  --red-deep: #6f1d19;
  --red-soft: #f5e5df;
  --gold: #a97a34;
  --gold-soft: #f7eedc;
  --green: #2f6b4f;
  --green-soft: #e9f2ec;
  --danger: #b23a30;
  --danger-soft: #fbe9e5;
  --blue: #355c7d;
  --blue-soft: #eaf0f5;
  --shadow-sm: 0 1px 2px rgba(45, 36, 25, .05);
  --shadow-md: 0 8px 24px rgba(45, 36, 25, .07);
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1120px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(84px + env(safe-area-inset-top));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(146, 42, 36, .055), transparent 65%),
    radial-gradient(700px 400px at -10% 30%, rgba(169, 122, 52, .05), transparent 60%);
  pointer-events: none;
}

img, svg { max-width: 100%; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-deep); }
button, input, select { font: inherit; }
button { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.35em; }
li + li { margin-top: .35em; }
strong { color: var(--red-deep); font-weight: 650; }
[hidden] { display: none !important; }

::selection { background: rgba(146, 42, 36, .16); }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 99;
  padding: 8px 14px;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  background: rgba(245, 242, 234, .92);
  border-bottom: 1px solid rgba(210, 199, 184, .7);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { color: var(--ink); }

.brand-seal {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff8ef;
  border-radius: 7px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 248, 239, .2);
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text small { color: var(--muted); font-size: 11px; line-height: 1.4; letter-spacing: .08em; }

.desktop-nav { display: flex; align-items: center; gap: 4px; }
.desktop-nav a {
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
}
.desktop-nav a:hover { background: rgba(146, 42, 36, .06); color: var(--red-deep); }
.desktop-nav a.is-active { background: var(--red); color: #fff; }

/* ---------- 通用 ---------- */
.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 20px 52px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn-primary:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.btn-ghost { background: rgba(255, 253, 248, .65); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--card); border-color: var(--red); color: var(--red-deep); }
.btn-soft { background: var(--red-soft); color: var(--red-deep); border-color: transparent; }
.btn-soft:hover { background: #efd7cf; color: var(--red-deep); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #24553e; color: #fff; }
.btn-danger-ghost { background: transparent; border-color: #dfc0ba; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { cursor: not-allowed; opacity: .5; transform: none; }

.text-link {
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.text-link:hover { text-decoration: underline; }

.bar {
  height: 6px;
  overflow: hidden;
  background: var(--paper-deep);
  border-radius: 999px;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--red), #b64b3e);
  border-radius: inherit;
  transition: width .45s ease;
}

/* ---------- 首页 hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 28px;
  align-items: stretch;
  padding: 26px 0 20px;
}

.hero-copy { padding: 18px 0 6px; }
.hero h1 {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 5.3vw, 56px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: .015em;
  color: var(--red-deep);
}
.hero-lead {
  max-width: 38em;
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.9;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-jump {
  display: inline-block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 1px;
}
.hero-jump:hover { color: var(--red); border-color: var(--red); }

.hero-card {
  position: relative;
  padding: 26px 24px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--red-deep);
  color: #f9eee3;
  box-shadow: var(--shadow-md);
}
.hero-card::after {
  content: "五";
  position: absolute;
  right: -16px;
  bottom: -42px;
  font-family: var(--font-serif);
  font-size: 170px;
  line-height: 1;
  color: rgba(255, 248, 239, .07);
  pointer-events: none;
}
.hero-card-label {
  margin: 0 0 10px;
  color: #e5c6a0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
}
.hero-card-title {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.55;
}
.hero-card dl { margin: 0; display: grid; gap: 14px; }
.hero-card dl > div { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 248, 239, .16); }
.hero-card dt { color: #d9b68d; font-size: 12px; letter-spacing: .08em; }
.hero-card dd { margin: 0; color: #f7e9da; font-size: 13px; line-height: 1.65; }

/* ---------- 速览数字 ---------- */
.quickfacts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0 22px;
}
.fact {
  padding: 18px 16px 15px;
  background: rgba(255, 253, 248, .66);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.fact-num {
  display: block;
  margin-bottom: 4px;
  color: var(--red);
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}
.fact p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }

/* ---------- 进度 ---------- */
.progress-card {
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.progress-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.progress-head .eyebrow { margin-bottom: 2px; }
.progress-head h2 { font-family: var(--font-serif); font-size: 22px; }
.progress-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.progress-item { min-width: 0; }
.progress-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--muted); font-size: 12.5px; }
.progress-label strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.progress-note { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- 学习布局 ---------- */
.learn-layout {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  gap: 42px;
  margin-top: 34px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 84px;
  padding: 18px 16px;
  background: rgba(255, 253, 248, .62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toc-title { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li + li { margin-top: 1px; }
.toc a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.4;
  text-decoration: none;
}
.toc a span { color: #b3a99b; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.toc a:hover, .toc a.is-current { background: var(--red-soft); color: var(--red-deep); }
.toc a.is-done span { color: var(--green); }
.toc a.is-done::after { content: "✓"; margin-left: auto; color: var(--green); font-size: 11px; }
.toc-progress { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.toc-progress > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }

.toc-mobile { display: none; }

.knowledge { min-width: 0; max-width: 780px; }

.knowledge-section {
  padding: 6px 0 38px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 84px;
}
.knowledge-section + .knowledge-section { padding-top: 34px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section-num {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 3px;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}
.section-head h2 {
  flex: 1;
  min-width: 0;
  font-family: var(--font-serif);
  font-size: clamp(23px, 3.2vw, 30px);
  font-weight: 700;
  letter-spacing: .01em;
  text-wrap: balance;
}
.mark-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mark-btn:hover { border-color: var(--green); color: var(--green); }
.mark-btn[aria-pressed="true"] { background: var(--green-soft); border-color: #b9d4c3; color: var(--green); }

.lead { font-size: 16px; line-height: 1.9; color: var(--ink-soft); }
.knowledge-section h3 {
  margin: 26px 0 10px;
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 700;
}
.knowledge-section h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--red);
  vertical-align: -1px;
}
.knowledge-section p { color: var(--ink-soft); }
.knowledge-section ul, .knowledge-section ol { color: var(--ink-soft); }

.check-list { list-style: none; padding-left: 0; }
.check-list li { position: relative; padding-left: 22px; }
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}
.num-list { padding-left: 1.4em; }
.num-list li::marker { color: var(--red); font-weight: 700; }

.pill-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 16px; }
.pill {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid #e3cfc3;
  border-radius: 999px;
  background: #fbf1eb;
  color: var(--red-deep);
  font-size: 12.5px;
  line-height: 1.6;
}

.key-box {
  margin: 18px 0;
  padding: 16px 18px;
  background: #fbf6ec;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.key-box.tight { margin: 0; }
.key-box .key-title {
  margin: 0 0 7px;
  color: #80602c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}
.key-box ul { margin: 0; padding-left: 1.2em; }
.key-box li { color: var(--ink-soft); }
.key-box p:last-child { margin-bottom: 0; }

.note {
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--blue-soft);
  border: 1px solid #d7e2eb;
  border-radius: var(--radius-sm);
  color: #3d566b;
  font-size: 13.5px;
  line-height: 1.8;
}
.note strong { color: #2c4b65; }

.mnemonic {
  padding: 10px 14px;
  background: rgba(236, 230, 218, .55);
  border-radius: 8px;
  color: #665d50 !important;
  font-size: 12.5px;
  line-height: 1.7;
}
.mnemonic::before { content: "记忆卡 · "; color: var(--gold); font-weight: 700; }

.slogan {
  padding: 12px 16px;
  border-top: 1px solid #e5d2c6;
  border-bottom: 1px solid #e5d2c6;
  color: var(--red-deep) !important;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
}

.two-col, .three-col { display: grid; gap: 12px; margin: 16px 0; }
.two-col { grid-template-columns: repeat(2, 1fr); }
.three-col { grid-template-columns: repeat(3, 1fr); }
.mini-card {
  padding: 15px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.mini-tag {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
}
.mini-card h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.55;
}
.mini-card h3::before { display: none; }
.mini-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }

.table-wrap {
  margin: 14px 0 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 13px; text-align: left; vertical-align: top; line-height: 1.65; border-bottom: 1px solid var(--line); }
tr:last-child td, tr:last-child th { border-bottom: 0; }
thead th { background: #f3ede3; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }
tbody th { width: 88px; color: var(--muted); font-weight: 600; background: #fbf8f1; }
td { color: var(--ink-soft); }
td strong { color: var(--red-deep); }

.source-box {
  margin-top: 34px;
  padding: 20px 22px;
  background: rgba(255, 253, 248, .62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.source-box h2 { margin-bottom: 8px; font-family: var(--font-serif); font-size: 18px; }
.source-box p, .source-box li { color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.source-box ul { margin-bottom: 8px; }
.source-note { margin: 0; font-size: 11.5px !important; }

.site-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 20px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}
.site-footer p { margin: 0; font-size: 11.5px; line-height: 1.9; }

/* ---------- 底部导航（手机） ---------- */
.tabbar { display: none; }

/* =========================================================
   刷题 / 模考通用
   ========================================================= */
.quiz-page { max-width: 820px; }
.quiz-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 18px;
}
.quiz-head h1 { font-family: var(--font-serif); font-size: clamp(26px, 5vw, 34px); }
.quiz-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.quiz-head .head-stat {
  flex: 0 0 auto;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.quiz-head .head-stat strong { display: block; color: var(--red); font-size: 24px; font-family: var(--font-serif); line-height: 1.2; }

.quiz-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  background: var(--paper-deep);
  border-radius: 999px;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: 1 0 auto;
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.segmented button.is-active { background: var(--card); color: var(--red-deep); font-weight: 700; box-shadow: 0 1px 4px rgba(45, 36, 25, .1); }

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.switch { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; cursor: pointer; user-select: none; }
.switch input { width: 16px; height: 16px; accent-color: var(--red); margin: 0; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }

.question-card {
  padding: 22px 22px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.question-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: .04em;
}
.badge-single { background: var(--red-soft); color: var(--red-deep); }
.badge-multiple { background: var(--gold-soft); color: #7a581f; }
.badge-judge { background: var(--blue-soft); color: var(--blue); }
.badge-topic { background: #f1ede5; color: var(--muted); font-weight: 500; }
.question-index { margin-left: auto; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.question-stem {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.8;
}
.question-stem .q-num { color: var(--gold); margin-right: 4px; font-family: var(--font-serif); }

.options { display: grid; gap: 9px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffefb;
  color: var(--ink-soft);
  text-align: left;
  font-size: 14.5px;
  line-height: 1.7;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .12s ease, background-color .12s ease;
}
.option:hover { border-color: #cdb6a9; background: #fdf8f3; }
.option .letter {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}
.option .option-text { flex: 1; min-width: 0; }
.option.selected { border-color: var(--red); background: var(--red-soft); color: var(--red-deep); }
.option.selected .letter { background: var(--red); border-color: var(--red); color: #fff; }
.option.correct { border-color: #87b297; background: var(--green-soft); color: #234f3b; }
.option.correct .letter { background: var(--green); border-color: var(--green); color: #fff; }
.option.wrong { border-color: #d7958b; background: var(--danger-soft); color: #7b2b23; }
.option.wrong .letter { background: var(--danger); border-color: var(--danger); color: #fff; }
.option.missed { border-color: #d6b36b; background: #fbf3df; color: #71531c; }
.option.missed .letter { border-color: #c79d4c; color: #8a651f; }
.options.is-locked .option { cursor: default; }

.multi-tip { margin: -7px 0 13px; color: var(--muted); font-size: 12px; }

.feedback {
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.75;
}
.feedback.is-correct { background: var(--green-soft); border: 1px solid #c5dccd; color: #24563d; }
.feedback.is-wrong { background: var(--danger-soft); border: 1px solid #ecc9c2; color: #7c2c24; }
.feedback-title { display: flex; align-items: center; gap: 7px; margin: 0 0 5px; font-weight: 800; font-size: 14px; }
.feedback-title .icon { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; font-size: 11px; }
.feedback.is-wrong .feedback-title .icon { background: var(--danger); }
.feedback p { margin: 0 0 5px; color: inherit; }
.feedback p:last-child { margin-bottom: 0; }
.answer-line { font-weight: 700; }
.explain { margin-top: 9px; padding-top: 9px; border-top: 1px dashed rgba(120, 90, 70, .22); color: var(--ink-soft); font-size: 13px; line-height: 1.85; }
.explain strong { color: inherit; }

.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.question-actions .right { display: flex; gap: 8px; margin-left: auto; }
.question-actions .btn { min-width: 0; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.pager .page-indicator { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.empty-state {
  padding: 48px 24px;
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}
.empty-state .empty-icon { font-size: 36px; line-height: 1; margin-bottom: 12px; color: var(--gold); }
.empty-state h2 { margin-bottom: 8px; font-family: var(--font-serif); font-size: 22px; }
.empty-state p { margin: 0 auto 20px; max-width: 32em; color: var(--muted); font-size: 13.5px; }

/* 答题卡 */
.answer-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
  margin: 4px 0 16px;
}
.answer-grid button {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffefa;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.answer-grid button.is-done { background: var(--red-soft); border-color: #dfbdb2; color: var(--red-deep); }
.answer-grid button.is-current { outline: 2px solid var(--red); outline-offset: 1px; color: var(--red-deep); font-weight: 700; }
.answer-grid button.is-right { background: var(--green-soft); border-color: #b7d3c1; color: var(--green); }
.answer-grid button.is-wrong { background: var(--danger-soft); border-color: #e3b8b1; color: var(--danger); }
.answer-grid button.is-current::after { content: ""; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 11.5px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: #fffefa; border: 1px solid var(--line); }
.legend .l-done { background: var(--red-soft); border-color: #dfbdb2; }
.legend .l-right { background: var(--green-soft); border-color: #b7d3c1; }
.legend .l-wrong { background: var(--danger-soft); border-color: #e3b8b1; }

/* 弹层 */
dialog {
  width: min(92vw, 560px);
  max-height: 84vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(35, 28, 20, .25);
}
dialog::backdrop { background: rgba(33, 28, 23, .45); backdrop-filter: blur(2px); }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: 16px; }
.dialog-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.dialog-close:focus { outline: none; }
.dialog-close:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.dialog-body { padding: 18px; overflow-y: auto; max-height: calc(84vh - 64px); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: calc(100vw - 36px);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(33, 31, 28, .92);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   模考
   ========================================================= */
.exam-intro {
  padding: 30px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}
.exam-intro .eyebrow { margin-bottom: 6px; }
.exam-intro h1 { margin-bottom: 10px; font-family: var(--font-serif); font-size: clamp(28px, 5vw, 38px); }
.exam-intro > p { color: var(--muted); font-size: 14px; }
.exam-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0;
}
.exam-rule {
  padding: 13px 14px;
  background: #faf6ee;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.exam-rule strong { display: block; color: var(--red-deep); font-family: var(--font-serif); font-size: 22px; line-height: 1.3; }
.exam-rule span { color: var(--muted); font-size: 11.5px; }
.exam-intro ul { margin: 0 0 22px; color: var(--ink-soft); font-size: 13px; }
.exam-history { margin-top: 22px; }
.exam-history h2 { margin-bottom: 10px; font-size: 15px; }
.history-list { display: grid; gap: 7px; }
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #faf7f0;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}
.history-item span { color: var(--muted); }
.history-item strong { color: var(--red); font-size: 15px; }

.exam-bar {
  position: sticky;
  top: calc(58px + env(safe-area-inset-top));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -20px 16px;
  padding: 9px 20px;
  background: rgba(245, 242, 234, .95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.exam-timer { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; }
.exam-timer.is-low { color: var(--danger); }
.exam-timer small { color: var(--muted); font-weight: 500; font-size: 11px; }
.exam-progress-text { color: var(--muted); font-size: 12px; }
.exam-bar-actions { display: flex; align-items: center; gap: 8px; }
.exam-bar-actions .btn { min-height: 34px; padding: 5px 12px; font-size: 12px; }

.result-hero {
  padding: 30px 24px;
  background: var(--red-deep);
  border-radius: 18px;
  color: #fff8ef;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.result-hero .result-label { margin: 0 0 4px; color: #ddb98f; font-size: 11px; letter-spacing: .18em; }
.result-score { margin: 0; font-family: var(--font-serif); font-size: 64px; font-weight: 700; line-height: 1; }
.result-score small { font-size: 18px; font-weight: 500; opacity: .7; }
.result-verdict { display: inline-block; margin: 10px 0 8px; padding: 3px 12px; border: 1px solid rgba(255, 248, 239, .35); border-radius: 999px; font-size: 12px; }
.result-sub { margin: 0; color: #e8d2bb; font-size: 12px; }

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}
.result-stat { padding: 13px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); text-align: center; }
.result-stat strong { display: block; color: var(--red); font-family: var(--font-serif); font-size: 21px; }
.result-stat span { color: var(--muted); font-size: 11px; }

.review-list { display: grid; gap: 10px; }
.review-item {
  padding: 15px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.review-item.is-right { border-left: 3px solid var(--green); }
.review-item.is-wrong { border-left: 3px solid var(--danger); }
.review-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 7px; }
.review-head .review-status { font-size: 11px; font-weight: 700; }
.review-item.is-right .review-status { color: var(--green); }
.review-item.is-wrong .review-status { color: var(--danger); }
.review-stem { margin: 0 0 8px; font-size: 14px; font-weight: 600; line-height: 1.75; }
.review-answer { margin: 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.8; }
.review-answer b { color: var(--red-deep); }
.review-item details { margin-top: 7px; }
.review-item summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.review-item .explain { margin-top: 7px; font-size: 12px; }

/* =========================================================
   错题本
   ========================================================= */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat-box {
  padding: 14px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}
.stat-box strong { display: block; color: var(--red); font-family: var(--font-serif); font-size: 24px; line-height: 1.2; }
.stat-box span { color: var(--muted); font-size: 11px; }

.wrong-list { display: grid; gap: 10px; }
.wrong-card {
  padding: 17px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.wrong-card .question-meta { margin-bottom: 8px; }
.wrong-stem { margin: 0 0 9px; font-size: 14.5px; font-weight: 600; line-height: 1.75; }
.wrong-card details summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.wrong-card details[open] summary { margin-bottom: 8px; }
.wrong-card .explain { margin-top: 6px; }
.wrong-card .card-actions { display: flex; gap: 8px; margin-top: 12px; }
.wrong-card .card-actions .btn { min-height: 34px; padding: 5px 12px; font-size: 12px; }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1.2fr .8fr; gap: 18px; }
  .hero-card { padding: 22px 20px; }
  .hero-card-title { font-size: 18px; }
  .quickfacts { gap: 8px; }
  .fact { padding: 15px 12px; }
  .learn-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
  .progress-grid { gap: 16px; }
  .three-col { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .header-inner { min-height: 52px; padding: 8px 16px; }
  .desktop-nav { display: none; }
  .brand-seal { width: 30px; height: 30px; flex-basis: 30px; font-size: 17px; border-radius: 6px; }
  .brand-text strong { font-size: 13.5px; }
  .brand-text small { font-size: 10px; }

  .page { padding: 14px 16px 32px; }

  .hero { grid-template-columns: 1fr; gap: 16px; padding: 10px 0 4px; }
  .hero-copy { padding: 8px 0 0; }
  .hero h1 { margin-bottom: 12px; font-size: clamp(32px, 9.5vw, 42px); line-height: 1.2; }
  .hero-lead { margin-bottom: 18px; font-size: 14px; line-height: 1.85; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn { flex: 1; }
  .hero-card { padding: 20px 18px; border-radius: 14px; }
  .hero-card-title { font-size: 17px; margin-bottom: 14px; }
  .hero-card dl { gap: 10px; }
  .hero-card dl > div { padding-top: 9px; }
  .hero-card dd { font-size: 12px; }

  .quickfacts { grid-template-columns: 1fr 1fr; margin: 12px 0 14px; }
  .fact { padding: 13px 13px 12px; }
  .fact-num { font-size: 24px; }
  .fact p { font-size: 11.5px; }

  .progress-card { padding: 16px; }
  .progress-head { margin-bottom: 14px; }
  .progress-head h2 { font-size: 19px; }
  .progress-grid { grid-template-columns: 1fr 1fr; gap: 13px 16px; }
  .progress-item:last-child { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .progress-item:last-child .progress-label { flex: 1; margin: 0; }
  .progress-item:last-child .progress-note { margin: 0; }

  .learn-layout { display: block; margin-top: 22px; }
  .toc { display: none; }
  .toc-mobile {
    display: block;
    margin-bottom: 8px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .toc-mobile summary {
    padding: 13px 15px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile summary::after { content: "＋"; float: right; color: var(--muted); font-weight: 400; }
  .toc-mobile[open] summary::after { content: "－"; }
  .toc-mobile summary span { color: var(--muted); font-weight: 400; font-size: 11.5px; }
  .toc-mobile ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin: 0;
    padding: 4px 8px 12px;
    list-style: none;
    border-top: 1px solid var(--line);
  }
  .toc-mobile li { margin: 0; }
  .toc-mobile a { display: block; padding: 7px 8px; border-radius: 6px; color: var(--ink-soft); font-size: 12px; text-decoration: none; }
  .toc-mobile a:hover { background: var(--red-soft); color: var(--red-deep); }

  .knowledge { max-width: none; }
  .knowledge-section { padding-bottom: 28px; scroll-margin-top: 66px; }
  .knowledge-section + .knowledge-section { padding-top: 26px; }
  .section-head { gap: 8px; margin-bottom: 13px; align-items: flex-start; flex-wrap: wrap; }
  .section-num { margin-top: 5px; font-size: 11px; }
  .section-head h2 { font-size: 22px; }
  .mark-btn { min-height: 30px; padding: 4px 10px; font-size: 10.5px; margin-left: auto; }
  .lead { font-size: 14.5px; line-height: 1.85; }
  .knowledge-section h3 { margin-top: 22px; font-size: 15.5px; }
  .knowledge-section p, .knowledge-section li { font-size: 14px; }
  .two-col, .three-col { grid-template-columns: 1fr; gap: 8px; }
  .mini-card { padding: 13px 14px; }
  .mini-card h3 { font-size: 13.5px; }
  .slogan { font-size: 15px; letter-spacing: .04em; padding: 10px 8px; }
  .table-wrap { margin-left: -2px; margin-right: -2px; }
  th, td { padding: 8px 9px; font-size: 12px; word-break: break-word; overflow-wrap: anywhere; }
  table { min-width: 0; table-layout: fixed; }
  .table-facts tbody th { width: 68px; }
  .table-thought tbody th { width: 90px; }
  .table-principles thead th:first-child { width: 42%; }
  .table-deploy thead th:nth-child(1) { width: 42px; }
  .table-deploy thead th:nth-child(2) { width: 43%; }
  .table-deploy th:first-child, .table-deploy td:first-child { padding-left: 6px; padding-right: 6px; }
  .table-org thead th:first-child { width: 28%; }
  .source-box { padding: 16px; margin-top: 24px; }

  .site-footer { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 248, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 10px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.is-active { color: var(--red); }
  .tabbar a.is-active svg { stroke-width: 2; }

  .quiz-page { max-width: none; }
  .quiz-head { margin: 4px 0 13px; align-items: flex-start; }
  .quiz-head h1 { font-size: 26px; }
  .quiz-head p { font-size: 12px; }
  .quiz-head .head-stat strong { font-size: 21px; }
  .question-card { padding: 17px 15px 16px; border-radius: 12px; }
  .question-stem { font-size: 15.5px; line-height: 1.8; margin-bottom: 14px; }
  .option { padding: 11px 12px; font-size: 14px; gap: 9px; }
  .option .letter { flex-basis: 24px; width: 24px; height: 24px; font-size: 10.5px; }
  .question-actions { flex-wrap: nowrap; }
  .question-actions .right { width: auto; flex: 1; }
  .question-actions .right .btn { flex: 1; }
  .question-actions > .btn { flex: 0 0 auto; }

  .answer-grid { grid-template-columns: repeat(6, 1fr); }

  .exam-intro { padding: 22px 18px; border-radius: 14px; }
  .exam-rules { gap: 6px; margin: 16px 0; }
  .exam-rule { padding: 10px 9px; }
  .exam-rule strong { font-size: 18px; }
  .exam-rule span { font-size: 10.5px; }
  .exam-bar { top: calc(52px + env(safe-area-inset-top)); margin-left: -16px; margin-right: -16px; padding: 8px 14px; }
  .exam-timer { font-size: 14px; }
  .exam-progress-text { display: none; }
  .result-score { font-size: 56px; }
  .result-stats { gap: 6px; }
  .result-stat { padding: 10px 6px; }
  .result-stat strong { font-size: 18px; }
  .result-stat span { font-size: 10.5px; }

  .stats-strip { gap: 6px; }
  .stat-box { padding: 12px 8px; }
  .stat-box strong { font-size: 21px; }
  .stat-box span { font-size: 10.5px; }

  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .brand-text small { display: none; }
  .brand-text strong { max-width: 62vw; }
  .quiz-head .head-stat { display: none; }
  .toolbar-row { align-items: flex-start; }
  .segmented button { padding: 6px 11px; font-size: 12.5px; }
  .toc-mobile ol { grid-template-columns: 1fr; }
  .toc-mobile ol li:nth-child(n+7) { display: none; }
  .toc-mobile[open] ol li:nth-child(n+7) { display: block; }
  .source-box ul { padding-left: 18px; }
  .answer-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .btn { width: 100%; }
}

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

@media (max-width: 360px) {
  .answer-grid { grid-template-columns: repeat(5, 1fr); }
  .exam-rules { grid-template-columns: 1fr 1fr; }
  .exam-rule:last-child { grid-column: 1 / -1; }
}

@media print {
  .site-header, .tabbar, .site-footer, .hero-actions, .progress-card, .toc, .toc-mobile, .mark-btn, .source-box { display: none !important; }
  body { background: #fff; padding: 0; }
  .page { max-width: none; padding: 0; }
  .hero { display: block; padding: 0 0 12px; }
  .learn-layout { display: block; }
  .knowledge { max-width: none; }
  .knowledge-section { break-inside: avoid; }
  a { color: #000; }
}
