/* exam.html 的页面样式（2026-10 样式收敛时从页面 <style> 原样搬出） */
/* 版面：首页先选章节，再按关键词找题；做题时材料题左右两栏（左材料、右题目），窄屏上下排 */
.ex { display: grid; gap: 18px; padding-block: 28px 80px; min-width: 0; }
.ex > * { min-width: 0; }
.ex-lead { color: var(--ink-2); font-size: var(--fs-base); margin-top: 6px; }
.ex-muted { color: var(--muted); font-size: var(--fs-base); }
.ex-note { max-width: 760px; }
.ex-note-copy { display: grid; gap: 4px; }
.ex-note-copy strong { color: var(--ink); }
.ex-start { display: flex; align-items: end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.ex-start p { color: var(--ink-2); font-size: var(--fs-base); max-width: 400px; }
.ex-eyebrow { color: var(--muted); font-size: var(--fs-xs); }
.ex-find-head { display: grid; gap: 4px; }
.ex-find-head p { color: var(--muted); font-size: var(--fs-base); }

/* 首页头部：标题 + 三个数字 */
.ex-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: end; }
.ex-stats { display: flex; gap: 8px 32px; flex-wrap: wrap; }
.ex-stat { min-width: 96px; padding: 4px 0; }
.ex-stat b { display: block; font-size: 20px; font-weight: calc(600 - var(--polish-weight-adjust)); letter-spacing: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.ex-stat span { color: var(--muted); font-size: var(--fs-xs); }

/* 找题：放在章节后面，一行大输入框 */
.ex-find { display: grid; gap: 10px; padding: 16px 0 0; }
html body.app-page main .ex-find { border-top: 1px solid var(--line); }
.ex-ask { display: flex; gap: 8px; flex-wrap: wrap; }
.ex-ask input { --wb-field-r: 10px; flex: 1 1 240px; font: inherit; font-size: var(--fs-base); padding: 8px 14px; min-height: 40px; }
.ex-hits { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ex-hit { display: grid; gap: 3px; text-align: left; width: 100%; height: 100%; font: inherit; font-size: var(--fs-base); padding: 10px 8px; color: var(--ink); cursor: pointer; }
.ex-hit small { color: var(--muted); font-size: var(--fs-xs); }

/* 章节：按科目分组，一组一行卡片 */
.ex-chapters { display: grid; gap: 22px; }
.ex-group { display: grid; gap: 10px; }
.ex-group h2 { display: flex; align-items: baseline; gap: 10px; }
.ex-group h2 small { font-weight: calc(400 - var(--polish-weight-adjust)); color: var(--muted); font-size: var(--fs-xs); }
.ex-group-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 16px; }
.ex-ch { display: grid; gap: 4px; text-align: left; font: inherit; padding: 12px 8px; color: var(--ink); cursor: pointer; min-height: 64px; align-content: start; }
.ex-ch b { font-size: var(--fs-base); }
.ex-ch span { color: var(--muted); font-size: var(--fs-xs); }

/* 做题：顶上一条固定的进度栏 */
.ex-top { position: sticky; top: 70px; z-index: 5; display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); background: var(--wb-page); }
.ex-bar { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
.ex-bar h2 { font-size: var(--fs-base); flex: 1 1 180px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-bar input { width: 76px; font: inherit; font-size: var(--fs-base); padding: 4px 10px; }
.ex-progress { height: 4px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.ex-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .25s; }
.ex-stage { display: grid; gap: 16px; align-items: start; }
.ex-stage.has-material { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.ex-stage:not(.has-material) { max-width: 820px; }
.ex-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: var(--fs-xs); color: var(--muted); }
.ex-q { display: grid; gap: 16px; }
.ex-html { font-size: var(--fs-base); line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.ex-html p + p, .ex-html div + div { margin-top: 6px; }
.ex-html table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; font-size: var(--fs-base); }
.ex-html td, .ex-html th { border: 1px solid var(--line); padding: 6px 10px; }
.ex-html h4 { margin: 8px 0 4px; }
/* 行内显示：解析里的分数、算式是一张张小图，要和文字排在同一行 */
.ex-html img.exam-img { display: inline-block; max-width: 100%; height: auto; vertical-align: middle; border-radius: var(--r-sm); background: #fff; }
.ex-html img.is-loading { min-width: 80px; min-height: 40px; background: var(--surface-2); }
.exam-img-missing { display: inline-flex; align-items: center; padding: 6px 12px; margin: 2px 0; border: 1px dashed var(--line); border-radius: var(--r-control); color: var(--muted); font-size: var(--fs-sm); background: var(--surface-2); }
.exam-tex { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95em; background: var(--surface-2); padding: 1px 5px; border-radius: var(--r-sm); }
#exStem { font-size: var(--fs-base); font-weight: calc(500 - var(--polish-weight-adjust)); }
/* 材料：宽屏在左边单独一栏，跟着滚动条停住，自己内部滚动 */
.ex-material { position: sticky; top: 150px; }
html body.app-page main .ex-material { border-top: 1px solid var(--line); }
.ex-material summary { cursor: pointer; padding: 12px 0; font-size: var(--fs-base); font-weight: calc(600 - var(--polish-weight-adjust)); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.ex-material .ex-html { padding: 12px 0 16px; max-height: calc(100vh - 230px); overflow: auto; }
.ex-options { display: grid; gap: 10px; }
.ex-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--wb-page); color: var(--ink); cursor: pointer; min-height: 44px; transition: border-color .12s, background .12s; }
.ex-opt:hover:not([disabled]):not([aria-checked="true"]):not(.is-answer):not(.is-wrong):not(.is-ref) { background: var(--wb-soft); }
.ex-opt b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--wb-soft); color: var(--ink-2); font-weight: calc(400 - var(--polish-weight-adjust)); font-size: var(--fs-xs); }
.ex-opt[role="checkbox"] b { border-radius: 6px; }
.ex-opt[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.ex-opt[aria-checked="true"] b { background: var(--accent); color: var(--accent-ink); }
.ex-opt[disabled] { cursor: default; }
.ex-opt.is-answer { border-color: var(--ok); }
.ex-opt.is-answer b { background: var(--ok); color: var(--accent-ink); }
.ex-opt.is-wrong { border-color: var(--danger); }
.ex-opt.is-wrong b { background: var(--danger); color: var(--accent-ink); }
.ex-opt.is-ref { border-style: dashed; border-color: var(--accent); }
.ex-result { padding: 8px 12px; border-radius: 8px; font-size: var(--fs-base); background: var(--wb-soft); color: var(--ink); }
.ex-result.bad { color: var(--danger-text); }
.ex-box { padding: 12px 0 0; display: grid; gap: 8px; }
html body.app-page main .ex-box { border-top: 1px solid var(--line); }
.ex-box h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ex-src { color: var(--muted); font-size: var(--fs-xs); }
.ex-ai-text { white-space: pre-wrap; font-size: var(--fs-base); line-height: 1.6; overflow-wrap: anywhere; }
.ex-foot { display: flex; justify-content: space-between; gap: 10px; }
.msg:empty { display: none; }
.linkish { font: inherit; font-size: var(--fs-base); color: var(--accent); background: none; border: 0; padding: 4px 2px; min-height: 32px; cursor: pointer; }
.linkish:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 960px) {
  .ex-stage.has-material { grid-template-columns: 1fr; }
  .ex-material { position: static; }
  .ex-material .ex-html { max-height: 360px; }
}
@media (max-width: 640px) {
  .ex-hero { grid-template-columns: 1fr; }
  .ex-stat { flex: 1 1 90px; min-width: 0; }
  .ex-hits { grid-template-columns: 1fr; }
  /* 手机上进度栏有三四行高，固定住会挡掉小半屏：不固定，题目底下另有「下一题」 */
  .ex-top { position: static; }
  .ex-bar h2 { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ex-ch, .ex-progress i, .ex-opt { transition: none; } }
