/* ============================================================
   全站基色 review.css —— 水墨主题（元素提取自主题参考图：
   雾白宣纸为底、浓墨为字、淡墨分层、朱砂作印）
   设计纪律：留白为纸 / 墨色分层 / 无玻璃拟态 / 无卡片套卡片
   正文衬线（试卷感），UI 标签无衬线；中文行高 1.9-2.0
   交互：.ink-card 卡片 = 聚光灯 + 水墨晕染（光斑/墨团跟随光标，
   坐标 --mx/--my 由 static/ink.js 写入）
   ============================================================ */
:root {
  --paper: #f4f5f2;          /* 宣纸（雾白页面底色） */
  --paper-deep: rgba(35,40,42,.05);  /* 淡墨浅填，用于分区 */
  --card: #fbfbf9;           /* 卡片纸面 */
  --ink: #23282a;            /* 浓墨正文 */
  --ink-soft: #5c6567;       /* 淡墨次级 */
  --ink-faint: #9aa3a4;      /* 枯笔弱化 */
  --zhu: #c0483a;            /* 朱砂印章红（仅点睛） */
  --zhu-soft: rgba(192,72,58,.08);
  --line: rgba(35,40,42,.14);  /* 墨色分隔线 */
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Heiti SC", "Noto Sans CJK SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--paper);
  /* 雾气：远山云雾的三层淡墨晕染，固定不随滚动 */
  background-image:
    radial-gradient(60vw 42vh at 88% -6%, rgba(35,40,42,.055), transparent 62%),
    radial-gradient(52vw 38vh at -12% 32%, rgba(35,40,42,.045), transparent 62%),
    radial-gradient(76vw 52vh at 50% 112%, rgba(35,40,42,.04), transparent 62%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.9;
}

.page { max-width: 880px; margin: 0 auto; padding: 20px 16px 64px; }

.serif { font-family: var(--serif); }

/* ---------- 水墨卡片：聚光灯 + 晕染（全站共用） ----------
   用法：卡片元素加 .ink-card，页面引入 /static/ink.js */
.ink-card { position: relative; overflow: hidden; }
.ink-card::before {  /* 聚光：一团宣纸被烛光照亮 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255,255,255,.95), rgba(255,255,255,.35) 45%, transparent 70%);
  opacity: 0; transition: opacity .35s ease; z-index: 0;
}
.ink-card::after {   /* 晕染：墨滴入水，从光标处洇开 */
  content: ""; position: absolute; inset: -20%; pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%),
    rgba(35,40,42,.13), rgba(35,40,42,.05) 42%, transparent 68%);
  filter: blur(8px);
  opacity: 0; transform: scale(.55);
  transition: opacity .5s ease, transform .6s ease; z-index: 0;
}
.ink-card:hover::before { opacity: 1; }
.ink-card:hover::after { opacity: 1; transform: scale(1); }
.ink-card > * { position: relative; z-index: 1; }

/* ---------- 顶部成绩总览 ---------- */
.hero { padding: 18px 4px 22px; border-bottom: 2px solid var(--ink); }
.hero-meta {
  font-size: 12px; color: var(--ink-soft); letter-spacing: .05em;
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px;
}
.hero-score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hero-score .num {
  font-family: var(--serif); font-size: 56px; font-weight: 700;
  line-height: 1; color: var(--ink);
}
.hero-score .scale { font-size: 16px; color: var(--ink-soft); }
.hero-score .avg-label { font-size: 13px; color: var(--ink-soft); width: 100%; margin-top: 2px; }
.grade-badge {
  display: inline-block; padding: 2px 12px; border: 1.5px solid var(--zhu);
  color: var(--zhu); font-size: 15px; font-weight: 600; border-radius: 3px;
  letter-spacing: .2em; text-indent: .2em;
}
.coach-line {
  margin-top: 16px; padding-left: 12px; border-left: 3px solid var(--zhu);
  font-size: 14px; color: var(--ink); line-height: 1.9;
}
.coach-line .who { color: var(--zhu); font-weight: 600; margin-right: 6px; }

/* ---------- 逐题卡片（默认折叠） ---------- */
.qcard { border-bottom: 1px solid var(--line); }
.qhead {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 16px 4px; background: none; border: none; cursor: pointer;
  font-family: var(--sans); text-align: left; color: var(--ink);
}
.qhead .qno {
  font-family: var(--serif); font-size: 17px; font-weight: 700; flex-shrink: 0;
}
.qhead .qtitle {
  flex: 1; min-width: 0; font-size: 13px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qhead .qscore { font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--zhu); flex-shrink: 0; }
.qhead .qscore small { font-size: 12px; color: var(--ink-faint); font-weight: 400; }
.qhead .chev { flex-shrink: 0; color: var(--ink-faint); font-size: 12px; transition: none; }
.qcard.open .qhead .chev { transform: rotate(90deg); }

.qbody { padding: 4px 4px 28px; }
.qtext {
  font-family: var(--serif); font-size: 15px; line-height: 1.95;
  padding: 12px 14px; background: var(--paper-deep);
  border-left: 3px solid var(--ink); margin-bottom: 18px;
}
/* 答题广场入口（2026-08-20：复盘页每题跳广场看别人怎么答） */
.q-square { margin: -10px 0 16px; }
.q-square a {
  font-size: 13px; font-weight: 600; color: var(--zhu); text-decoration: none;
}
.q-square a:hover { text-decoration: underline; }

/* ---------- 评分区 ---------- */
.score-block { margin-bottom: 22px; }
.dim-row { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; margin-bottom: 8px; }
.dim { color: var(--ink-soft); }
.dim b { font-family: var(--serif); font-size: 16px; color: var(--ink); font-weight: 700; }
.dim .lv { margin-left: 4px; font-size: 12px; color: var(--ink-faint); }
.dim .lv.bad { color: var(--zhu); }
.issue-row { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.issue-row .tag {
  display: inline-block; margin: 2px 6px 2px 0; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 3px;
  font-size: 12px; color: var(--ink-soft); background: none;
}
.comment { font-size: 14px; color: var(--ink); }
.comment::before { content: "简评  "; color: var(--zhu); font-size: 12px; font-weight: 600; }
/* 本班名师解析（M5 本班优先） */
.class-answers .class-answer { margin-top: 10px; }
.class-answer-meta { font-size: 12px; color: var(--zhu); font-weight: 600; margin-bottom: 4px; }
.class-answer-body { font-size: 14px; color: var(--ink); white-space: pre-wrap; }

/* ---------- 兜底态（无批改数据） ---------- */
.polish-empty {
  padding: 14px; font-size: 13px; color: var(--ink-soft);
  border: 1px dashed var(--line); border-radius: 4px; line-height: 1.9;
}

/* ---------- 题内双栏对照 ---------- */
.compare { display: block; margin-bottom: 24px; }
.pane + .pane { margin-top: 20px; }
.pane h4, .sec-title {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--ink-soft); letter-spacing: .12em; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.pane h4::after, .sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pane .ans {
  font-family: var(--serif); font-size: 15px; line-height: 1.95;
  white-space: pre-wrap; word-break: break-word;
}
.pane.rev .ans { border-left: 2px solid var(--zhu); padding-left: 12px; }
.pane.orig .ans { border-left: 2px solid var(--line); padding-left: 12px; }

@media (min-width: 760px) {
  .compare { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
  .pane + .pane { margin-top: 0; }
}

/* 改动高亮 + 编号角标（两侧共用编号） */
.hl-orig {
  background: var(--paper-deep);
  border-bottom: 1px dashed var(--ink-faint);
}
.hl-rev {
  color: var(--zhu); background: var(--zhu-soft);
  border-bottom: 1.5px solid var(--zhu); font-weight: 600;
}
.chg-num {
  display: inline-block; min-width: 17px; height: 17px; line-height: 17px;
  margin: 0 2px; padding: 0 3px; border-radius: 50%;
  background: var(--zhu); color: #fff;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-align: center; vertical-align: 2px;
}
.pane.orig .chg-num { background: var(--ink-faint); }

/* ---------- 改动说明列表 ---------- */
.changes { list-style: none; margin-bottom: 26px; }
.changes li {
  display: flex; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.changes li:last-child { border-bottom: none; }
.changes .no {
  flex-shrink: 0; width: 22px; height: 22px; line-height: 22px; margin-top: 3px;
  border-radius: 50%; background: var(--zhu); color: #fff;
  font-size: 12px; font-weight: 600; text-align: center;
}
.changes .body { flex: 1; min-width: 0; }
.changes .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.chg-type {
  display: inline-block; padding: 0 8px; border: 1px solid var(--zhu);
  border-radius: 3px; color: var(--zhu); font-size: 12px; font-weight: 600;
}
.chg-loc { font-size: 12px; color: var(--ink-faint); }
.changes .diff { font-family: var(--serif); font-size: 14px; line-height: 1.9; }
.changes .diff .from { color: var(--ink-soft); }
.changes .diff .arrow { color: var(--ink-faint); margin: 0 4px; }
.changes .diff .to { color: var(--zhu); }
.changes .reason { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.changes .reason::before { content: "理由："; color: var(--ink-faint); }

/* fallback 提示条 */
.fallback-note {
  padding: 10px 12px; margin-bottom: 18px;
  border: 1px solid var(--zhu); border-left-width: 4px; border-radius: 3px;
  color: var(--zhu); font-size: 13px; line-height: 1.9; background: none;
}
.salvage { font-size: 13px; color: var(--ink-soft); margin: -10px 0 18px; line-height: 1.9; }
.salvage b { color: var(--ink); }

/* ---------- 答题骨架 mindmap ---------- */
.mindmap { margin-bottom: 26px; }
.mm-box { overflow-x: auto; padding: 8px 0; }
.mm-box svg { max-width: 100%; height: auto; }
.mm-box pre {
  font-family: var(--sans); font-size: 12px; color: var(--ink-soft);
  white-space: pre-wrap; line-height: 1.8;
}

/* ---------- 对照标准答案 tab ---------- */
.leveltab { margin-bottom: 8px; }
.level-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.level-btns button {
  min-width: 44px; padding: 5px 12px; border: 1px solid var(--line);
  border-radius: 3px; background: none; cursor: pointer;
  font-family: var(--sans); font-size: 13px; color: var(--ink-soft);
}
.level-btns button.active {
  border-color: var(--zhu); color: var(--zhu); font-weight: 600;
}
.level-ans {
  font-family: var(--serif); font-size: 15px; line-height: 1.95;
  white-space: pre-wrap; word-break: break-word;
  border-left: 2px solid var(--ink); padding-left: 12px; margin-bottom: 16px;
}
.level-state { font-size: 13px; color: var(--ink-faint); padding: 8px 0 16px; }

/* ---------- 页面级空态 / 错误态 ---------- */
.page-state {
  text-align: center; padding: 80px 20px; color: var(--ink-soft);
}
.page-state .big { font-family: var(--serif); font-size: 20px; color: var(--ink); margin-bottom: 10px; }
.page-state button {
  margin-top: 18px; padding: 8px 22px; border: 1px solid var(--zhu);
  background: none; color: var(--zhu); border-radius: 3px;
  font-size: 14px; cursor: pointer;
}

/* ---------- 单题模式返回链接（复盘列表页进入时由 review.js 注入） ---------- */
.back-link {
  display: inline-block; margin-bottom: 10px;
  font-size: 13px; color: var(--ink-soft); text-decoration: none;
}
.back-link:hover { color: var(--zhu); }
