/* 悠创工作室 · 「试卷 + 红笔批改」：纸色底，标志里的海军蓝做墨色，红笔做批注，荧光黄做重点 */
:root {
  --brand: #1b2b52;
  --brand-2: #13203f;
  --brand-3: #0d1630;
  --accent: #ffd447;
  --accent-deep: #c63c22;
  --accent-soft: #fff1bf;
  --red: #c63c22;
  --ink: #1d2433;
  --muted: #67625a;
  --faint: #9a948a;
  --line: #e2dacb;
  --rule: rgba(27, 43, 82, .85);
  --page: #f5f1e8;
  --card: #fffdf7;
  --warn: #d99a00;
  --danger: #c63c22;
  --ok: #2f7a4a;
  --radius: 8px;
  --shadow-sm: 0 1px 0 rgba(29, 36, 51, .05);
  --shadow: 0 8px 22px rgba(60, 45, 20, .08);
  --shadow-lg: 6px 6px 0 var(--brand);
  --wrap: 1160px;
  --gutter: 32px;
  --num: Georgia, "Times New Roman", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); overflow-x: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .45; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--brand); text-decoration-color: rgba(198, 60, 34, .5); text-underline-offset: 3px; }
h1, h2, h3, p, ul, ol, dl, dd, blockquote { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- 红笔短划，用在小标题前 ---------- */
.slash { width: 18px; height: 3px; background: var(--red); display: inline-block; flex: none; border-radius: 2px; transform: rotate(-8deg); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--red); }
.kicker { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--red); letter-spacing: .08em; }

/* ---------- 外框 ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 241, 232, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  height: 66px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 40px;
}
.brand { display: flex; align-items: center; gap: 10px; text-align: left; color: var(--brand); text-decoration: none; flex: none; }
.brand-mark { width: 36px; height: 30px; object-fit: contain; mix-blend-mode: multiply; }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-name { font-size: 17px; font-weight: 800; line-height: 1.1; letter-spacing: .06em; }
.brand-en { font-size: 9px; letter-spacing: .22em; color: var(--faint); line-height: 1.1; }
.site-header nav { display: flex; gap: 6px; }
.nav-link { position: relative; color: var(--muted); font-size: 15px; padding: 8px 12px; text-decoration: none; white-space: nowrap; transition: color .12s; }
.nav-link:hover { color: var(--brand); }
.nav-link.active { color: var(--brand); font-weight: 700; }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
  transform: rotate(-1.5deg);
}
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.header-help { font-size: 14px; color: var(--muted); padding: 8px 4px; }
.header-help:hover { color: var(--brand); }
.who { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); color: var(--brand); font-size: 13px; font-weight: 700; padding: 4px 11px 4px 8px; border-radius: 6px; max-width: 10em; }
.who .icon { width: 15px; height: 15px; color: var(--red); }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 36px var(--gutter) 64px; }
main:focus, main:focus-visible { outline: none; }
.is-home main { max-width: none; padding: 0; }

/* ---------- 按钮：实色块 + 细边，不用发光阴影 ---------- */
.button {
  height: 46px;
  padding: 0 20px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border: 1.5px solid transparent;
  transition: background .12s, transform .1s, box-shadow .12s, border-color .12s;
}
.button .icon { width: 17px; height: 17px; transition: transform .12s; }
.button:not(:disabled):hover .icon { transform: translateX(2px); }
.button:not(:disabled):active { transform: translate(1px, 1px); }
.button.lg { height: 54px; padding: 0 26px; font-size: 16px; }
.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.primary:hover { background: var(--brand-2); }
.primary:disabled:hover { background: var(--brand); }
.accent { background: var(--accent); color: var(--brand-3); border-color: var(--brand); box-shadow: 3px 3px 0 var(--brand); }
.accent:not(:disabled):hover { background: #ffcb1f; }
.accent:not(:disabled):active { box-shadow: 1px 1px 0 var(--brand); transform: translate(2px, 2px); }
.secondary { background: var(--card); color: var(--brand); border-color: #cfc6b4; }
.secondary:hover { border-color: var(--brand); }
.danger { background: var(--red); color: #fff; border-color: var(--red); }
.danger:hover { background: #a93019; border-color: #a93019; }
.ghost { background: transparent; color: var(--brand); border-color: rgba(27, 43, 82, .3); }
.ghost:hover { border-color: var(--brand); }
.text-button { height: auto; padding: 8px; background: none; color: var(--red); font-size: 14px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.full-width { width: 100%; }
/* ================= 首页 ================= */
.home-page { overflow: hidden; }
.hero, .section { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: 80px;
  align-items: center;
  padding-top: 84px;
  padding-bottom: 76px;
}
.hero h1 { margin-top: 22px; font-size: clamp(42px, 5.6vw, 68px); line-height: 1.12; font-weight: 800; color: var(--brand); letter-spacing: .02em; }
/* 荧光笔划重点 */
.hl { padding: 0 .06em; background: linear-gradient(100deg, transparent 2%, var(--accent) 4%, var(--accent) 94%, transparent 97%) 0 72% / 100% 42% no-repeat; }
.lead { margin-top: 22px; max-width: 29em; font-size: 18px; line-height: 1.9; color: var(--muted); }

/* 像试卷表头的一行统计 */
.stat-row { list-style: none; padding: 0; margin-top: 42px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat-row li { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px 18px 0; }
.stat-row li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.stat-row b { font-family: var(--num); font-size: 30px; line-height: 1.15; font-weight: 700; color: var(--brand); font-variant-numeric: lining-nums tabular-nums; }
.stat-row span { margin-top: 6px; font-size: 14px; font-weight: 700; }
.stat-row small { font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* 右侧：一叠试卷，最上面一张是报名卡 */
.hero-side { position: relative; display: flex; justify-content: center; padding: 24px 12px 24px 0; }
.hero-side::before,
.hero-side::after {
  content: "";
  position: absolute;
  inset: 34px 30px 14px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.hero-side::before { transform: rotate(5deg); background: #f9f4e8; }
.hero-side::after { transform: rotate(-2.5deg); }
.enroll {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border: 1.5px solid var(--brand);
  border-radius: 4px;
  padding: 30px 30px 24px;
  box-shadow: var(--shadow-lg);
}
.stamp {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .12em;
  transform: rotate(-14deg);
  opacity: .82;
  box-shadow: inset 0 0 0 4px var(--card), inset 0 0 0 5.5px var(--red);
}
.enroll-label { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.enroll h2 { margin-top: 10px; padding-right: 80px; font-size: 25px; font-weight: 800; color: var(--brand); }
.enroll-lead { margin-top: 8px; padding-right: 60px; font-size: 14.5px; line-height: 1.7; color: var(--muted); }
.enroll-form { margin-top: 26px; display: flex; flex-direction: column; gap: 22px; }
.enroll-form > .button { width: 100%; height: 52px; font-size: 16px; }
.enroll-foot { display: flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 13px; color: var(--faint); }
.enroll-foot .icon { width: 15px; height: 15px; color: var(--red); }
.resume-note { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--accent-soft); color: var(--brand); border-left: 3px solid var(--accent); font-size: 14px; line-height: 1.6; }
.resume-note .icon { color: var(--brand); }
/* 姓名一栏做成试卷上的下划线 */
.name-field { display: flex; align-items: flex-end; gap: 12px; }
.name-field span { flex: none; padding-bottom: 11px; font-size: 16px; font-weight: 800; color: var(--brand); }
.name-field span::after { content: "："; }
.name-field input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  border-bottom: 2px solid var(--brand);
  border-radius: 0;
  padding: 0 4px;
  background: transparent;
  font-size: 18px;
  font-weight: 600;
  transition: border-color .12s, background .12s;
}
.name-field input::placeholder { color: #b0a999; font-weight: 400; font-size: 15px; }
.name-field input:focus { outline: none; border-bottom-color: var(--red); background: rgba(255, 212, 71, .14); }
.action-row { display: flex; gap: 8px; }
.action-row .button { flex: 1; }

/* 答题须知：编辑排版，不用卡片 */
.section { padding-top: 40px; padding-bottom: 96px; }
.section-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 0; padding-bottom: 16px; border-bottom: 2px solid var(--rule); }
.section-head h2 { margin-top: 0; font-size: clamp(24px, 2.8vw, 30px); line-height: 1.3; font-weight: 800; color: var(--brand); }
.rule-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rule-grid li { padding: 26px 26px 30px 0; }
.rule-grid li + li { padding-left: 26px; border-left: 1px solid var(--line); }
.step-no { display: block; font-family: var(--num); font-style: italic; font-size: 40px; line-height: 1; font-weight: 700; color: var(--red); }
.rule-grid h3 { margin-top: 16px; font-size: 17px; font-weight: 800; color: var(--brand); }
.rule-grid p { margin-top: 8px; font-size: 14.5px; line-height: 1.85; color: var(--muted); }
.score-note { display: flex; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.score-note .icon { width: 16px; height: 16px; color: var(--red); }
/* 页脚 */
.site-footer { background: var(--page); border-top: 2px solid var(--rule); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 36px var(--gutter) 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 46px; height: 38px; object-fit: contain; mix-blend-mode: multiply; }
.footer-brand strong { display: block; font-size: 15px; color: var(--brand); }
.footer-brand span { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.footer-links button, .footer-links a { font-size: 14px; color: var(--muted); text-decoration: none; padding: 4px 0; }
.footer-links button:hover, .footer-links a:hover { color: var(--brand); }
.admin-gate { max-width: 460px; margin: 24px auto; }
.admin-error { font-size: 13px; font-weight: 700; color: var(--danger); }

/* ================= 答题 ================= */
.quiz-heading, .result-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.quiz-heading h1, .result-title h1 { margin-top: 8px; font-size: 32px; font-weight: 800; color: var(--brand); line-height: 1.25; }
.quiz-heading h1 small { margin-left: 8px; font-size: 15px; font-weight: 500; color: var(--muted); }
.quiz-heading p, .result-title p { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.timer { text-align: right; padding: 8px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.timer span { display: block; font-size: 12px; color: var(--muted); }
.timer strong { font-family: var(--num); font-size: 22px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }

.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.question-card, .answer-panel, .result-summary, .history-table, .review-list, .empty-state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.question-card { padding: 26px 28px 6px; }
.question-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.question-type { font-size: 13px; font-weight: 700; color: var(--red); border: 1.5px solid var(--red); border-radius: 4px; padding: 2px 8px; }
.question-position { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.question-position strong { font-family: var(--num); font-size: 22px; color: var(--brand); font-weight: 800; }
.question-rule { margin-top: 16px; font-size: 13px; color: var(--muted); }
.question-prompt { font-size: 18px; line-height: 1.75; font-weight: 700; margin: 8px 0 20px; overflow-wrap: anywhere; color: var(--ink); }
/* 题目里的段落、列表和代码 */
.rich > * + * { margin-top: 10px; }
.rich ul { margin: 0; padding-left: 1.3em; }
.rich li + li { margin-top: 4px; }
.rich code { font-family: var(--mono); font-size: .88em; font-weight: 500; padding: 1px 5px; border-radius: 3px; background: #efe8da; color: var(--brand-2); overflow-wrap: anywhere; }
.rich pre { margin: 12px 0; padding: 12px 14px; overflow-x: auto; border-left: 3px solid var(--brand); border-radius: 0 4px 4px 0; background: #f3eee2; font-weight: 400; line-height: 1.6; }
.rich pre code { padding: 0; background: none; font-size: 13.5px; color: var(--ink); overflow-wrap: normal; white-space: pre; }
.option-text code { font-family: var(--mono); font-size: .9em; padding: 1px 4px; border-radius: 3px; background: #efe8da; overflow-wrap: anywhere; }
.option-unknown { margin-top: 4px; border-style: dashed; background: transparent; }
.option-unknown .option-letter { border-style: dashed; color: var(--muted); border-color: var(--muted); }
.option-unknown .option-text { color: var(--muted); }
.option-unknown small { margin-left: 10px; font-size: 13px; color: var(--faint); }
.option-unknown.selected { background: #efe8da; border-style: solid; border-color: var(--muted); }
.option-unknown.selected .option-letter { background: var(--muted); border-color: var(--muted); color: #fff; }
.option-unknown.selected .option-text { color: var(--ink); font-weight: 700; }
.unknown-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border: 1.5px dashed var(--muted); border-radius: 6px; background: #efe8da; }
.unknown-note p { font-size: 15px; color: var(--ink); }
.essay-unknown { margin-top: 4px; padding-left: 0; color: var(--muted); }
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 13px 16px;
  transition: background .12s, border-color .12s;
}
.option:hover { border-color: #b8ae9a; }
.option-letter {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--brand);
  font-size: 14px;
  font-weight: 800;
  color: var(--brand);
}
.option-text { display: flex; flex-wrap: wrap; align-items: baseline; font-size: 15.5px; line-height: 1.65; padding-top: 3px; overflow-wrap: anywhere; }
.option.selected { background: var(--accent-soft); border-color: var(--brand); }
.option.selected .option-letter { background: var(--brand); border-color: var(--brand); color: #fff; }
.question-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.flag-button { font-size: 14px; font-weight: 700; color: var(--muted); }
.flag-button:hover { color: var(--brand); }
.flag-button.is-flagged { color: #9a6700; }
.keyboard-hint { font-size: 13px; color: var(--muted); }
kbd { font-family: var(--mono); font-size: 12px; border: 1px solid #cfc6b4; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--card); }
.question-navigation { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.question-navigation .primary { margin-left: auto; }

.answer-panel { position: sticky; top: 90px; padding: 20px; }
.panel-title h2 { display: flex; align-items: center; font-size: 16px; font-weight: 800; color: var(--brand); }
.panel-title h2::before { content: ""; width: 16px; height: 3px; margin-right: 8px; background: var(--red); border-radius: 2px; transform: rotate(-8deg); }
.progress-numbers { display: flex; align-items: baseline; gap: 6px; margin-top: 14px; }
.progress-numbers strong { font-family: var(--num); font-size: 36px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.progress-numbers > span { font-size: 14px; color: var(--muted); }
.progress-percent { margin-left: auto; font-family: var(--num); font-weight: 700; color: var(--red); }
.progress-caption { margin-top: 2px; font-size: 13px; color: var(--muted); }
.progress-track { height: 6px; background: #ece5d6; border-radius: 99px; margin-top: 12px; overflow: hidden; }
.progress-track > div { height: 100%; background: var(--brand); border-radius: 99px; transition: width .25s; }
.question-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 18px; }
.question-dot {
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.question-dot:hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.question-dot.answered { background: var(--accent); color: var(--brand-3); box-shadow: none; }
.question-dot.unknown { background: repeating-linear-gradient(135deg, #e3dac6 0 3px, var(--card) 3px 6px); color: var(--muted); box-shadow: inset 0 0 0 1px #b8ae9a; }
.question-dot.current { background: var(--brand); color: #fff; box-shadow: none; }
.question-dot.flagged::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.question-dot.current.flagged::after { box-shadow: 0 0 0 1px #fff; }
.grid-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.grid-legend span { display: inline-flex; align-items: center; gap: 5px; }
.grid-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-done { background: var(--accent); }
.legend-blank { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.legend-unknown { background: repeating-linear-gradient(135deg, #d6cdb9 0 2px, var(--card) 2px 4px); box-shadow: inset 0 0 0 1px #b8ae9a; }
.legend-flag { background: var(--red); border-radius: 50% !important; }
.save-status { margin-top: 14px; min-height: 20px; font-size: 13px; color: var(--ok); font-weight: 700; }
.save-status.saving { color: var(--muted); font-weight: 500; }
.save-status.error { color: var(--danger); }
.save-status.error button { color: var(--danger); text-decoration: underline; font-size: 13px; padding-left: 6px; }
.panel-submit { width: 100%; margin-top: 14px; }
.panel-tip { margin-top: 12px; font-size: 13px; line-height: 1.6; color: var(--muted); }

.reading-sources { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 16px; }
.reading-sources a, .source-links a { font-size: 14px; font-weight: 700; }
.essay-label { display: block; font-size: 14px; font-weight: 800; margin-bottom: 8px; }
textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.75;
  background: repeating-linear-gradient(180deg, var(--card) 0 25.5px, #efe8da 25.5px 26.5px);
  background-attachment: local;
}
textarea:focus { outline: none; border-color: var(--brand); }
textarea::placeholder { color: #b0a999; }
.essay-counter { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 4px; font-size: 13px; color: var(--muted); }

/* ================= 结果 & 记录 ================= */
.result-summary { display: flex; align-items: stretch; overflow: hidden; }
.score-figure { position: relative; overflow: hidden; min-width: 220px; padding: 30px 28px; background: var(--brand); display: flex; flex-direction: column; justify-content: center; }
.score-figure::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 22px; height: 3px; border-radius: 2px; background: var(--red); transform: rotate(-2deg); }
.score-figure strong { position: relative; font-family: var(--num); font-size: 68px; font-weight: 700; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.score-figure strong small { font-size: 22px; margin-left: 2px; }
.score-figure span { display: block; margin-top: 10px; font-size: 13px; color: rgba(255, 255, 255, .72); }
.result-stats { flex: 1; min-width: 0; padding: 28px 30px; }
.result-stats h2 { font-size: 20px; font-weight: 800; line-height: 1.45; color: var(--brand); }
.result-stats > p { margin-top: 8px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.result-metrics { display: flex; flex-wrap: wrap; gap: 18px 36px; margin-top: 20px; }
.result-metrics dt { font-size: 13px; color: var(--muted); }
.result-metrics dd { margin-top: 4px; font-family: var(--num); font-size: 22px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }

.review-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 32px 0 14px; }
.review-header h2 { font-size: 20px; font-weight: 800; color: var(--brand); }
.review-header p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.filter-tabs { display: flex; gap: 4px; padding: 3px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.filter-tabs button { padding: 6px 14px; font-size: 14px; color: var(--muted); border-radius: 4px; }
.filter-tabs button:hover { color: var(--brand); }
.filter-tabs button.active { color: #fff; font-weight: 700; background: var(--brand); }
.review-list { overflow: hidden; }
.review-card + .review-card { border-top: 1px solid var(--line); }
.review-card summary { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px; cursor: pointer; list-style: none; }
.review-card summary:hover { background: #faf6ec; }
.review-card summary::-webkit-details-marker { display: none; }
.review-index { width: 1.6em; flex: none; font-family: var(--num); font-size: 16px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.review-question { flex: 1; min-width: 0; font-size: 15px; line-height: 1.6; font-weight: 700; overflow-wrap: anywhere; }
.review-question pre code { font-size: 12.5px; }
.review-unknown { margin-top: 6px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.explanation .rich { margin-top: 6px; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.result-badge { flex: none; font-size: 12px; font-weight: 800; line-height: 1.4; padding: 3px 9px; border-radius: 999px; }
.result-badge.correct { color: var(--ok); background: #e4f1e6; }
.result-badge.incorrect { color: var(--danger); background: #fbe6e0; }
.result-badge.unknown { color: var(--muted); background: #efe8da; }
.result-badge.reading { color: var(--brand); background: var(--accent-soft); }
.disclosure { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); }
.review-card[open] .disclosure { font-size: 0; }
.review-card[open] .disclosure::before { content: "收起"; font-size: 13px; }
.review-content { padding: 0 20px 18px 50px; }
.review-list .empty-state { border: 0; box-shadow: none; }
.review-options { display: flex; flex-direction: column; gap: 6px; }
.review-option { display: flex; gap: 8px; align-items: baseline; padding: 9px 12px; border-radius: 4px; font-size: 14px; line-height: 1.6; }
.review-option > span:nth-child(2) { flex: 1; overflow-wrap: anywhere; }
.review-letter { font-weight: 800; color: var(--brand); }
.review-option small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.review-option.right { background: #e4f1e6; box-shadow: inset 3px 0 0 var(--ok); }
.review-option.wrong { background: #fbe6e0; box-shadow: inset 3px 0 0 var(--red); }
.explanation { margin-top: 14px; padding: 14px 16px; background: var(--page); border-left: 3px solid var(--red); border-radius: 0 4px 4px 0; }
.explanation > span { font-size: 13px; font-weight: 800; color: var(--brand); }
.explanation p { margin-top: 6px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.reading-answer { background: var(--page); border-radius: 4px; padding: 12px 14px; }
.reading-answer > span { font-size: 13px; color: var(--muted); }
.reading-answer p { margin-top: 6px; font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.result-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

.empty-state { padding: 56px 24px; text-align: center; }
.empty-state h3 { font-size: 18px; font-weight: 800; color: var(--brand); }
.empty-state p { margin-top: 8px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.empty-state .button { margin-top: 18px; }

.history-table { overflow: hidden; }
.history-head, .history-row { display: grid; grid-template-columns: 1.2fr 1.5fr .8fr .5fr; gap: 8px; align-items: center; }
.history-head { padding: 14px 92px 14px 20px; font-size: 13px; color: var(--muted); background: var(--page); border-bottom: 1px solid var(--rule); }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) 72px; align-items: center; border-top: 1px solid var(--line); background: var(--card); transition: background .12s; }
.history-head + .history-item { border-top: 0; }
.history-item:hover { background: #faf6ec; }
.history-row { width: 100%; min-width: 0; text-align: left; padding: 17px 20px; font-size: 15px; }
.history-delete { justify-self: end; margin-right: 14px; padding: 6px 10px; border-radius: 4px; font-size: 13px; font-weight: 700; color: var(--faint); }
.history-delete:hover { color: var(--red); background: #fbe6e0; }
.history-name { font-weight: 700; }
.history-name em { font-style: normal; margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--red); border: 1px solid var(--red); padding: 1px 6px; border-radius: 4px; }
.history-score { font-family: var(--num); font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.history-privacy { margin-top: 14px; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* ================= 弹窗 ================= */
dialog {
  border: 0;
  border-radius: 6px;
  border: 1.5px solid var(--brand);
  padding: 24px 26px;
  width: min(480px, calc(100vw - 32px));
  overflow-x: hidden;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(29, 36, 51, .45); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-header h2, dialog h2 { font-size: 20px; font-weight: 800; color: var(--brand); }
.icon-button { width: 34px; height: 34px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.icon-button:hover { border-color: var(--brand); }
dialog p { font-size: 14px; line-height: 1.7; margin: 8px 0; }
dialog p strong { font-weight: 800; }
.modal-list { margin: 8px 0 18px; padding-left: 1.2em; }
.modal-list li { margin: 8px 0; font-size: 14px; line-height: 1.75; }
.modal-list li::marker { color: var(--red); font-family: var(--num); font-weight: 700; }
.modal-note { margin: 12px 0; padding: 10px 12px; border-radius: 4px; background: var(--page); font-size: 13px; line-height: 1.7; color: var(--muted); }
.submit-stat { display: flex; gap: 28px; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.submit-stat dt { font-size: 13px; color: var(--muted); }
.submit-stat dd { margin-top: 4px; font-family: var(--num); font-size: 24px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: opacity .2s;
}
#toast.visible { opacity: 1; }

.boot-screen { min-height: 100vh; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.boot-screen img { width: 56px; height: auto; mix-blend-mode: multiply; }

/* ================= 题库管理 ================= */
.admin-error, .admin-notice { margin-bottom: 14px; }
.admin-notice { padding: 10px 14px; border-left: 3px solid var(--ok); background: #e9f2e9; font-size: 14px; font-weight: 700; color: var(--ok); }
.q-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.q-search { width: min(100%, 300px); height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--card); font-size: 14px; }
.q-search:focus { outline: none; border-color: var(--brand); }
.q-list { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--rule); }
.q-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.q-row.is-off .q-prompt, .q-row.is-off .q-answer { color: var(--faint); }
.q-no { font-family: var(--num); font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--red); font-variant-numeric: lining-nums; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12.5px; color: var(--muted); }
.q-type { font-weight: 700; color: var(--brand); }
.q-off { padding: 1px 6px; border: 1px solid var(--faint); border-radius: 4px; color: var(--muted); font-weight: 700; }
.q-prompt { margin-top: 6px; font-size: 15.5px; line-height: 1.65; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.q-answer { margin-top: 6px; font-size: 13.5px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.q-answer b { margin-right: 8px; color: var(--ok); }
.q-actions { display: flex; gap: 2px; }
.q-actions button { padding: 6px 10px; border-radius: 4px; font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.q-actions button:hover { background: #efe8da; }
.q-actions .q-delete { color: var(--faint); }
.q-actions .q-delete:hover { color: var(--red); background: #fbe6e0; }

.q-editor { max-width: 860px; }
.q-card { padding: 26px 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field-label { padding: 0; font-size: 14px; font-weight: 800; color: var(--brand); }
.field-label small { margin-left: 8px; font-size: 12.5px; font-weight: 400; color: var(--faint); }
.field-hint { font-size: 12.5px; color: var(--faint); }
.field textarea { min-height: 0; }
.field textarea, .opt-text, .src-row input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 15px;
  line-height: 1.7;
  padding: 10px 12px;
}
.field textarea:focus, .opt-text:focus, .src-row input:focus { outline: none; border-color: var(--brand); }
.seg { display: inline-flex; align-self: flex-start; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--page); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 16px; border-radius: 4px; font-size: 14px; font-weight: 700; color: var(--muted); }
.seg input:checked + span { background: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.opt-list, .src-list { display: flex; flex-direction: column; gap: 8px; }
.opt-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.opt-pick { position: relative; cursor: pointer; }
.opt-pick input { position: absolute; opacity: 0; pointer-events: none; }
.opt-pick span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--brand); background: var(--card); font-size: 14px; font-weight: 800; color: var(--brand); }
.opt-pick:hover span { background: var(--accent-soft); }
.opt-pick input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.opt-row.is-correct .opt-text { border-color: var(--ok); background: #f1f7f1; }
.opt-remove { padding: 6px 8px; border-radius: 4px; font-size: 13px; color: var(--faint); }
.opt-remove:not(:disabled):hover { color: var(--red); background: #fbe6e0; }
.field > .text-button { align-self: flex-start; padding: 4px 0; }
.src-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.src-row input { font-size: 14px; padding: 8px 10px; }
.check { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; font-size: 15px; font-weight: 700; color: var(--brand); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.q-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ================= 响应式 ================= */
@media (max-width: 1080px) {
  .hero { gap: 40px; }
  .rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .header-inner { height: 60px; gap: 12px; }
  .brand-en { display: none; }
  .site-header nav { gap: 0; }
  .nav-link { padding: 8px 8px; }
  .nav-link:hover { background: none; }
  main { padding: 24px var(--gutter) 40px; }

  .hero { display: flex; flex-direction: column; align-items: stretch; padding-top: 40px; padding-bottom: 32px; gap: 0; }
  .hero-copy { display: contents; }
  .hero .eyebrow { align-self: flex-start; }
  .hero-side { order: 1; margin-top: 12px; }
  .stat-row { order: 2; }
  .hero h1 { margin-top: 18px; }
  .lead { font-size: 16px; }
  .stat-row { margin-top: 28px; }
  .hero-side { padding: 20px 10px 20px 0; }
  .enroll { max-width: none; padding: 28px 22px 22px; }
  .section { padding-top: 32px; padding-bottom: 64px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  .quiz-layout { grid-template-columns: 1fr; }
  .question-card { padding: 22px 18px 4px; }
  .answer-panel { position: static; }
  .keyboard-hint { display: none; }
  .quiz-heading, .result-title, .review-header { flex-direction: column; align-items: stretch; }
  .quiz-heading h1, .result-title h1 { font-size: 26px; }
  .timer { text-align: left; align-self: flex-start; }
  .result-summary { flex-direction: column; }
  .score-figure { min-width: 0; }
  .filter-tabs { overflow-x: auto; }
  .review-content { padding: 0 16px 16px; }
  .history-head { display: none; }
  .history-item { grid-template-columns: minmax(0, 1fr) 60px; }
  .history-delete { margin-right: 8px; }
  .history-row { padding: 15px 4px 15px 16px; grid-template-columns: 1fr auto; grid-template-areas: "name score" "time choice"; row-gap: 4px; }
  .history-row span:nth-child(1) { grid-area: name; }
  .history-row span:nth-child(2) { grid-area: time; color: var(--muted); font-size: 13px; }
  .history-row span:nth-child(3) { grid-area: choice; color: var(--muted); font-size: 13px; }
  .history-row span:nth-child(4) { grid-area: score; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
  .q-row { grid-template-columns: 32px minmax(0, 1fr); gap: 4px 10px; }
  .q-actions { grid-column: 2; margin-left: -10px; }
  .q-search { width: 100%; }
  .q-card { padding: 20px 16px; }
  .src-row { grid-template-columns: minmax(0, 1fr) auto; }
  .src-row input[data-src-url] { grid-column: 1; }
  .src-row .opt-remove { grid-row: 1 / span 2; grid-column: 2; }
  .q-form-actions .button { flex: 1; }
}

@media (max-width: 560px) {
  .header-inner { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 10px; }
  .site-header nav { order: 3; width: calc(100% + var(--gutter) * 2); margin: 4px calc(var(--gutter) * -1) 0; padding: 0 calc(var(--gutter) - 8px); overflow-x: auto; scrollbar-width: none; }
  .site-header nav::-webkit-scrollbar { display: none; }
  .nav-link { padding: 10px 8px 12px; border-radius: 0; }
  .nav-link.active::after { bottom: 2px; }
  .who { max-width: 6.5em; }
  .hero h1 { font-size: 38px; }
  .rule-grid { grid-template-columns: 1fr; gap: 12px; }
  .rule-grid li, .rule-grid li + li { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; padding: 20px 0; border-left: 0; }
  .rule-grid li + li { border-top: 1px solid var(--line); }
  .step-no { grid-row: span 2; font-size: 30px; }
  .rule-grid h3 { margin-top: 0; font-size: 16px; }
  .rule-grid p { margin-top: 4px; grid-column: 2; }
  .stat-row { grid-template-columns: 1fr; }
  .stat-row li, .stat-row li + li { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 0; border-left: 0; }
  .stat-row li + li { border-top: 1px solid var(--line); }
  .stat-row b { font-size: 22px; min-width: 3.6em; }
  .stat-row span { margin-top: 0; }
  .stat-row small { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
