:root {
  --primary: #0f5c4a;
  --primary-light: #e8f3f0;
  --border: #dde3e0;
  --danger: #c0392b;
  --bg: #f7f8f7;
  --text: #1b2321;
  --muted: #6b7873;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topnav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-right: 12px; white-space: nowrap; }
.topnav .brand-logo { display: block; width: 120px; height: 32px; flex-shrink: 0; }
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}
.topnav a:hover { background: var(--primary-light); color: var(--primary); }
.topnav .lang-switch {
  margin-left: auto; border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 14px; font-weight: 600; color: var(--primary);
}
.topnav .lang-switch:hover { border-color: var(--primary); }

main { max-width: 960px; margin: 0 auto; padding: 28px; }

h1 { font-size: 24px; margin: 0 0 4px; }
.subtitle { color: var(--muted); margin: 0 0 24px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.name-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.name-bar input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.exam-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.exam-row .name { font-weight: 600; }
.exam-row .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn.ghost { background: #fff; color: var(--primary); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label, .form-col label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.form-grid input, .form-grid select, .form-grid textarea,
.form-col input, .form-col select, .form-col textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  font-family: inherit;
}
.form-col { margin-bottom: 12px; }
.span2 { grid-column: 1 / 3; }

.tag {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary);
}

/* ================= 做题界面：高保真复刻 Bluebook ================= */
:root {
  --bb-bar: #e9edf6;          /* 顶/底栏淡蓝灰 */
  --bb-blue: #324ac6;         /* Next 按钮蓝 */
  --bb-blue-d: #26379b;
  --bb-ink: #1b1b1b;
  --bb-serif: "Times New Roman", Times, "STIX Two Text", "Songti SC", serif;
}

.bb-shell {
  height: 100vh; height: 100dvh; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; background: #fff;
  font-family: -apple-system, "PingFang SC", sans-serif;
}

/* ---- 顶栏 ---- */
.bb-top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 10px 24px 6px; background: var(--bb-bar);
}
.bb-top-left { justify-self: start; }
.bb-section { font-weight: 700; font-size: 17px; color: var(--bb-ink); }
.bb-directions {
  background: none; border: none; cursor: pointer; font-size: 15px; color: var(--bb-ink);
  padding: 2px 0; display: inline-flex; align-items: center; gap: 4px;
}
.bb-directions .caret { font-size: 13px; }
.bb-top-center { justify-self: center; text-align: center; }
.bb-timer { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: var(--bb-ink); }
.bb-hide {
  margin-top: 2px; background: #fff; border: 1px solid #b9c2d6; border-radius: 999px;
  padding: 3px 16px; font-size: 13px; cursor: pointer;
}
.bb-top-right { justify-self: end; display: flex; gap: 22px; }
.bb-tool {
  background: none; border: none; cursor: pointer; color: var(--bb-ink);
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px;
}
.bb-tool-ico { font-size: 17px; line-height: 1; }
.bb-ico-ref { font-weight: 700; font-style: italic; font-family: var(--bb-serif); }
.bb-tool.active { color: var(--bb-blue); }

.bb-divider { border-top: 2px dashed #333; margin: 0; }
.bb-divider-bottom { margin-top: auto; }
.bb-practice-banner { flex-shrink: 0; margin: 0 40px; padding: 9px 12px; border-radius: 0 0 17px 17px; background: #1b2161; color: white; text-align: center; font: bold 12px Arial, sans-serif; }

/* More 菜单 */
.bb-more-menu {
  position: fixed; top: 64px; right: 18px; z-index: 80; background: #fff;
  border: 1px solid #d5dae6; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15);
  padding: 8px; display: none; min-width: 220px;
}
.bb-more-menu.open { display: block; }
.bb-more-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 10px 14px; font-size: 15px; cursor: pointer; border-radius: 8px;
}
.bb-more-menu button:hover { background: var(--bb-bar); }

/* Directions 弹窗 */
.bb-modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 90;
  display: none; align-items: flex-start; justify-content: center; padding-top: 4vh;
}
.bb-modal-bg.open { display: flex; }
.bb-modal {
  background: #fff; border-radius: 14px; width: min(760px, 92vw); max-height: 86vh;
  display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.bb-modal-body { padding: 28px 32px; overflow-y: auto; font-size: 16px; line-height: 1.65; }
.bb-modal-body p { margin: 0 0 14px; }
.bb-modal-foot { padding: 14px 24px; display: flex; justify-content: flex-end; border-top: 1px solid #eee; }
.bb-yellow {
  background: #ffd21e; border: none; border-radius: 999px; padding: 10px 30px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}

/* ---- 题目区 ---- */
/* 做题区是 <main>，要抵消全局 main 的 max-width/margin:auto/padding——
   在列向 flex 容器里 margin:0 auto 会取消横向拉伸，导致题目栏宽度随题干长短变化 */
main.bb-body {
  flex: 1; min-height: 0; position: relative; display: flex; justify-content: center; overflow: hidden;
  width: 100%; max-width: none; margin: 0; padding: 0;
}
.bb-question-col { width: 780px; max-width: 100%; min-width: 0; flex: none; overflow-y: auto; overflow-anchor: none; }
.question-pane { padding: 24px 28px 60px; }

.q-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #eef0f2; border-bottom: 1px dashed #333; padding: 6px 10px; margin-bottom: 20px;
}
.q-head-left { display: flex; align-items: center; gap: 12px; }
.q-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; background: #1b1b1b; color: #fff; font-size: 15px; font-weight: 600;
}
.q-mark-label { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; cursor: pointer; }
.q-bookmark { font-size: 13px; filter: grayscale(1); }
.q-abc {
  border: 1px solid #9aa3b6; background: #fff; border-radius: 6px; padding: 2px 8px;
  font-size: 13px; font-weight: 700; cursor: pointer; letter-spacing: .5px;
  text-decoration: line-through;
}
.q-abc.active { background: var(--bb-blue); color: #fff; border-color: var(--bb-blue); }

/* 题干用衬线体，贴近 Bluebook */
.q-stem { font-family: var(--bb-serif); font-size: 18px; font-weight: 400; line-height: 1.45; margin-bottom: 20px; color: #1b1b1b; }
.q-stem p { margin: 0 0 14px; }
.q-stem p:last-child { margin-bottom: 0; }
.q-eq { text-align: center; margin: 8px 0 18px; font-size: 18px; }

.q-figure { text-align: center; margin: 0 0 20px; }
.q-figure img { max-width: min(100%, 440px); max-height: 46vh; height: auto; width: auto; }

.q-table {
  border-collapse: collapse; margin: 0 auto 20px; width: auto;
  font-family: var(--bb-serif); font-size: 16px;
}
.q-table th, .q-table td {
  border: 1px solid #1b1b1b; padding: 9px 16px; text-align: center; font-weight: 400;
}
.q-table tbody th { text-align: left; }
.q-table-narrow th, .q-table-narrow td { min-width: 70px; }

/* 选项：左字母圈 + 右划除按钮 */
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice-row { display: flex; align-items: stretch; gap: 10px; }
.choice {
  flex: 1; display: flex; align-items: center; gap: 18px; padding: 11px 12px;
  border: 1px solid #777; border-radius: 8px; cursor: pointer; background: #fff;
  font-family: var(--bb-serif); font-size: 18px; line-height: 1.4;
}
.choice:hover { border-color: #8b93a7; }
.choice.selected { border-color: var(--bb-blue); border-width: 2px; box-shadow: inset 0 0 0 1px var(--bb-blue); }
.choice .letter {
  width: 27px; height: 27px; border-radius: 50%; border: 1.5px solid #1b1b1b;
  display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
  font-family: -apple-system, sans-serif;
}
.choice.selected .letter { background: var(--bb-blue); color: #fff; border-color: var(--bb-blue); }
.choice.letter-only { flex: 0 0 auto; width: 90px; justify-content: center; }
.choice-row.crossed .choice { opacity: .55; }
.choice-row.crossed .choice-text { text-decoration: line-through; }

/* 划除按钮：默认隐藏，点 ABC 后显示（Bluebook 行为） */
.cross-btn {
  width: 30px; flex-shrink: 0; align-self: center; background: none; border: none;
  border-radius: 50%; font-size: 13px; font-weight: 700; cursor: pointer; color: #555;
  text-decoration: line-through; display: none;
}
.show-cross .cross-btn { display: inline-flex; align-items: center; justify-content: center; height: 30px; }
.cross-btn:hover { background: #eef0f2; }
.cross-btn.on { color: var(--bb-blue); background: #e5e9fb; }

/* Numeric response: compact underlined input and a separate math preview. */
.grid-in-wrap { margin-top: 26px; }
.grid-input-box {
  display: inline-flex; position: relative; width: 96px; height: 54px;
  border: 1px solid #555; border-radius: 8px; background: #fff;
}
.grid-input-box::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 10px; border-bottom: 1px solid #555; pointer-events: none; }
.grid-input-box:focus-within { outline: 2px solid var(--bb-blue); outline-offset: 2px; }
.grid-in {
  width: 100%; min-width: 0; border: 0; outline: none; background: transparent;
  padding: 8px 4px 15px; font: 24px var(--bb-serif); text-align: center; color: #1b1b1b;
}
.grid-preview-title { margin: 40px 0 14px; font: bold 22px var(--bb-serif); }
.grid-preview { min-height: 38px; font: 24px var(--bb-serif); color: #1b1b1b; }
.grid-preview .katex { font-size: 1em; }
.grid-error { margin: 10px 0 0; color: #b3261e; font: 14px/1.4 Arial, sans-serif; }
.grid-error[hidden], .spr-directions[hidden], .spr-toggle[hidden], .q-abc[hidden] { display: none; }

/* Independent scrolling panes keep the timer and navigation on screen. */
.bb-top, .bb-bottom, .bb-divider { flex-shrink: 0; }
.bb-body.is-grid-in:not(.directions-collapsed) .bb-question-col { width: 50%; max-width: none; }
.spr-directions {
  width: 50%; min-width: 0; flex: none; overflow-y: auto;
  border-right: 2px solid #999; padding: 26px 32px 48px;
  font: 18px/1.4 var(--bb-serif); color: #1b1b1b;
}
.spr-directions h2 { margin: 0 0 22px; font-size: 21px; }
.spr-directions ul { margin: 0; padding-left: 32px; }
.spr-directions li { margin-bottom: 3px; }
.spr-examples { width: 90%; max-width: 520px; margin: 30px auto 0; font: inherit; }
.spr-examples caption { padding-bottom: 6px; }
.spr-examples th, .spr-examples td { border: 1px solid #777; padding: 15px 10px; text-align: center; vertical-align: middle; }
.spr-examples th { color: inherit; font: inherit; }
.spr-examples td:first-child { width: 24%; }
.spr-examples code { display: table; margin: 5px auto; padding: 1px 3px; border-radius: 3px; background: #e7e7e7; font: 14px/1.3 Menlo, Consolas, monospace; white-space: nowrap; }
.spr-toggle {
  position: absolute; top: 42%; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 16px; height: 30px; padding: 0; border: 1px solid white; border-radius: 3px;
  background: #222; color: white; font-size: 7px; cursor: pointer;
}
.directions-collapsed .spr-toggle { left: 10px; }
.spr-toggle:focus-visible { outline: 2px solid var(--bb-blue); outline-offset: 2px; }

/* Match the lighter lining numerals and italic variables in the reference. */
.q-stem, .choice-text { font-variant-numeric: lining-nums; }
.q-stem em, .choice-text em { font-family: var(--bb-serif); }
.choice-text p { margin: 0; }
.q-stem .katex, .choice-text .katex { font-size: 1em; }
.q-stem [style*="font-family"], .q-stem [style*="font-size"],
.choice-text [style*="font-family"], .choice-text [style*="font-size"] { font-family: inherit !important; font-size: inherit !important; }
.q-stem img, .choice-text img { max-width: 100%; height: auto; vertical-align: middle; }
.q-stem table { font-family: inherit; font-size: 1em; width: auto; max-width: 100%; margin: 16px auto; }
.q-stem th, .q-stem td { color: inherit; font-size: 1em; text-align: center; }
.q-stem td p { margin: 0; }

@media (max-width: 1000px) {
  .spr-directions { padding: 24px 20px 40px; font-size: 16px; }
  .spr-examples { width: 100%; font-size: 15px; }
  .spr-examples th, .spr-examples td { padding: 14px 5px; }
  .bb-body.is-grid-in .question-pane { padding: 24px 20px 50px; }
}
@media (max-width: 680px) {
  .bb-body.is-grid-in:not(.directions-collapsed) { flex-direction: column; }
  .spr-directions { width: 100%; max-height: 38%; border-right: 0; border-bottom: 2px solid #999; }
  .bb-body.is-grid-in:not(.directions-collapsed) .bb-question-col { width: 100%; flex: 1; min-height: 0; }
  .spr-toggle { display: none; }
  .bb-top, .bb-bottom { padding-left: 12px; padding-right: 12px; }
  .bb-top-right { gap: 10px; }
  .bb-section { font-size: 14px; }
  .bb-back, .bb-next { padding: 10px 16px; }
  .bb-qnav { padding: 9px 12px; }
}

/* ---- 底栏 ---- */
.bb-bottom {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 12px 24px; background: var(--bb-bar);
}
.bb-name { justify-self: start; font-weight: 700; font-size: 16px; }
.bb-qnav {
  justify-self: center; background: #1b1b1b; color: #fff; border: none;
  padding: 9px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.bb-nav-btns { justify-self: end; display: flex; gap: 12px; }
.bb-back, .bb-next {
  border: none; border-radius: 999px; padding: 11px 34px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.bb-back { background: #fff; color: var(--bb-blue); border: 1.5px solid var(--bb-blue); }
.bb-next { background: var(--bb-blue); color: #fff; }
.bb-next:hover { background: var(--bb-blue-d); }

/* 题目导航面板 */
.bb-nav-panel {
  position: fixed; bottom: 66px; left: 50%; transform: translateX(-50%);
  width: min(560px, 92vw); background: #fff; border: 1px solid #d5dae6; border-radius: 14px;
  padding: 18px 22px; display: none; box-shadow: 0 12px 40px rgba(0,0,0,.2); z-index: 70;
}
.bb-nav-panel.open { display: block; }
.bb-nav-title { text-align: center; font-size: 14px; color: #555; margin-bottom: 14px; }
.bb-nav-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.bb-nav-grid button {
  padding: 9px 0; border: 1.5px dashed #9aa3b6; border-radius: 6px; background: #fff;
  cursor: pointer; font-size: 14px; position: relative;
}
.bb-nav-grid button.answered { background: var(--bb-blue); color: #fff; border-style: solid; border-color: var(--bb-blue); }
.bb-nav-grid button.current { outline: 2px solid #1b1b1b; outline-offset: 1px; }
.bb-nav-grid button.marked::after {
  content: "🔖"; position: absolute; top: -8px; right: -6px; font-size: 11px;
}

/* ---- 计算器面板 ---- */
.bb-calc {
  position: fixed; top: 70px; left: 20px; width: 460px; height: 520px;
  background: #fff; border: 1px solid #999; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  z-index: 60; display: none; flex-direction: column; overflow: hidden;
}
.bb-calc.open { display: flex; }
.bb-calc-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #2b2b2b; color: #fff; padding: 6px 10px; cursor: move;
  flex-shrink: 0; touch-action: none;
}
.bb-calc-tabs { display: flex; gap: 4px; }
.bb-calc-tab {
  background: none; border: none; color: #cfcfcf; cursor: pointer; font-size: 14px;
  padding: 4px 12px; border-radius: 6px;
}
.bb-calc-tab.active { background: #fff; color: #1b1b1b; font-weight: 600; }
.bb-calc-close { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; }
.bb-calc-body { flex: 1; min-height: 0; position: relative; }
.bb-calc-view { position: absolute; inset: 0; }
.bb-calc-resize {
  position: absolute; right: 2px; bottom: 2px; z-index: 2;
  width: 25px; height: 25px; padding: 3px;
  display: grid; place-items: center;
  border: 1px solid #aaa; border-radius: 50%; background: #eee; color: #222;
  cursor: nwse-resize; touch-action: none;
}
.bb-calc-resize:hover { background: #ddd; }
.bb-calc-resize:focus-visible { outline: 2px solid #304aca; outline-offset: -2px; }
.bb-calc-resize svg { width: 17px; height: 17px; pointer-events: none; }
.bb-calc.interacting { user-select: none; }


/* ---- Reference 面板 ---- */
.bb-ref {
  position: fixed; top: 58px; right: 0; bottom: 0; width: 420px; background: #fff;
  border-left: 1px solid #d5dae6; box-shadow: -6px 0 24px rgba(0,0,0,.12);
  z-index: 55; display: none; flex-direction: column;
}
.bb-ref.open { display: flex; }
.bb-ref-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #17284d; color: #fff; padding: 12px 18px; font-weight: 600;
}
.bb-ref-head button { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; }
.bb-ref-body { padding: 22px 20px; overflow-y: auto; font-family: var(--bb-serif); }
.ref-grid { display: grid; gap: 10px; margin-bottom: 26px; align-items: end; }
.ref-grid3 { grid-template-columns: repeat(3, 1fr); }
.ref-grid2 { grid-template-columns: repeat(2, 1fr); }
.ref-item { text-align: center; }
.ref-f { font-size: 15px; line-height: 1.4; margin-top: 4px; }
.ref-title { text-align: center; font-weight: 700; font-size: 15px; margin: -12px 0 22px; }
.ref-notes { border-top: 1px solid #e2e6ee; padding-top: 16px; font-size: 15px; line-height: 1.55; }
.ref-notes p { margin: 0 0 12px; }
/* SVG 几何示意图 */
.ref-svg { display: block; height: 72px; width: auto; margin: 0 auto; }
.ref-svg text { font-family: var(--bb-serif); font-style: italic; font-size: 12px; fill: #111; }
.ref-svg text.ra { font-style: normal; font-size: 10px; }

/* ---------------- 分类练习（Bluebook 外观 + 练习特有状态） ---------------- */
.bb-timer-label { font-size: 11px; color: #666; margin-top: 1px; }
.bb-timer-done { color: #2e9e5b; }

.choice.correct { border-color: #2e9e5b !important; background: #e7f6ec; box-shadow: inset 0 0 0 1px #2e9e5b; }
.choice.wrong { border-color: #c0392b !important; background: #fdeceb; box-shadow: inset 0 0 0 1px #c0392b; }
.choice.correct .letter { background: #2e9e5b; color: #fff; border-color: #2e9e5b; }
.choice.wrong .letter { background: #c0392b; color: #fff; border-color: #c0392b; }

.prac-actions { margin-top: 22px; display: flex; gap: 14px; align-items: center; }
.prac-verdict { font-weight: 700; font-size: 17px; }
.prac-verdict.ok { color: #2e9e5b; }
.prac-verdict.no { color: #c0392b; }
.prac-answer { margin-top: 10px; font-size: 15px; color: #555; font-family: var(--bb-serif); }

.bb-nav-grid button.done-ok { background: #e7f6ec; border: 1.5px solid #2e9e5b; }
.bb-nav-grid button.done-no { background: #fdeceb; border: 1.5px solid #c0392b; }

/* ---------------- 成绩报告 ---------------- */
.score-hero { text-align: center; padding: 24px 0; }
.score-big { font-size: 48px; font-weight: 800; color: var(--primary); }
.module-bar { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.module-bar > div { height: 100%; background: var(--primary); }
.wrong-item { border-left: 3px solid var(--danger); padding-left: 14px; margin-bottom: 16px; }


/* ================= 模考报告 ================= */
.rp-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.rp-title { font-size:26px; margin:0 0 4px; }
.rp-sub { color:var(--muted); font-size:14px; }
.rp-actions { display:flex; gap:10px; }
.rp-btn { display:inline-flex; align-items:center; gap:6px; padding:9px 18px; border-radius:999px;
  border:1.5px solid var(--primary); background:var(--primary); color:#fff; font-size:14px;
  font-weight:600; cursor:pointer; text-decoration:none; }
.rp-btn.ghost { background:#fff; color:var(--primary); }
.rp-card { background:#fff; border:1px solid var(--border); border-radius:14px; padding:20px 22px; margin-bottom:18px; }
.rp-h2 { font-size:18px; margin:26px 0 12px; }

/* 分数卡 */
.rp-score { background:#f4f6f8; }
.rp-score-label { font-weight:700; font-size:15px; margin-bottom:10px; }
.rp-score-big { font-size:52px; font-weight:800; color:var(--primary); line-height:1.1; }
.rp-score-scale { font-size:16px; font-weight:400; color:#9aa3b0; margin-left:14px; }

/* 总览四宫格 */
.rp-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; margin-bottom:18px; }
.rp-stat { background:#eaf3fb; border-radius:12px; padding:18px; text-align:center; }
.rp-stat .n { font-size:30px; font-weight:800; }
.rp-stat .n.ok { color:#1f9254; } .rp-stat .n.no { color:var(--danger); }
.rp-stat .l { font-size:13px; color:#5c6672; margin-top:4px; }

/* 表格 */
.rp-tablewrap { overflow-x:auto; }
.rp-table { width:100%; border-collapse:collapse; font-size:14px; }
.rp-table th { background:#3d4451; color:#fff; padding:11px 12px; text-align:left; font-weight:600; white-space:nowrap; }
.rp-table th:first-child { border-radius:8px 0 0 0; } .rp-table th:last-child { border-radius:0 8px 0 0; }
.rp-table td { padding:10px 12px; border-bottom:1px solid var(--border); }
.rp-table td.c { text-align:center; } .rp-table td.mono { font-family:ui-monospace,Menlo,monospace; }
.rp-table td.ok { color:#1f9254; font-weight:600; } .rp-table td.no { color:var(--danger); font-weight:600; }
.rp-mod { display:block; font-size:11px; color:var(--muted); }

/* 知识点条 */
.rp-domain { display:inline-block; background:#dceafd; color:#2c5fa8; font-size:13px;
  padding:4px 14px; border-radius:999px; margin-bottom:14px; font-weight:600; }
.rp-topics { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:14px; }
.rp-topic-row { display:flex; justify-content:space-between; font-size:14px; margin-bottom:6px; gap:10px; }
.rp-topic-pct { color:var(--muted); white-space:nowrap; }
.rp-bar { height:7px; background:#e8ecf1; border-radius:999px; overflow:hidden; }
.rp-bar > div { height:100%; background:#2563eb; }
.rp-bar > div.low { background:#e8833a; }

/* 错题 */
.rp-wrong { border-left:3px solid var(--danger); padding:2px 0 2px 16px; margin-bottom:22px; }
.rp-wrong-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.rp-wrong-no { font-weight:700; font-size:14px; }
.rp-chip { background:var(--primary-light); color:var(--primary); font-size:12px; padding:2px 10px; border-radius:999px; }
.rp-time { color:var(--muted); font-size:13px; }
.rp-stem { font-family:var(--bb-serif); font-size:16px; line-height:1.6; margin-bottom:10px; }
.rp-fig { margin-bottom:10px; } .rp-fig img { max-width:min(100%,360px); }
.rp-wrong-ans { font-size:14px; } .rp-wrong-ans .ok { color:#1f9254; } .rp-wrong-ans .no { color:var(--danger); }
.rp-exp { margin-top:8px; font-size:14px; color:#4a5462; }

/* 打印成 PDF */
@media print {
  .no-print, .topnav { display:none !important; }
  body { background:#fff; }
  main { max-width:none; padding:0; }
  .rp-card { break-inside:avoid; border-color:#ddd; }
  .rp-wrong { break-inside:avoid; }
  .rp-table th { background:#3d4451 !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .rp-stat, .rp-score, .rp-bar > div, .rp-domain { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}


/* ---------------- 模考大厅：卡片网格 ---------------- */
main:has(.exam-grid) { max-width: 1180px; }
.exam-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 16px; margin-bottom: 8px;
}
.exam-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px 16px; display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.exam-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(0,0,0,.07); transform: translateY(-2px); }
.ec-top { display: flex; align-items: center; justify-content: space-between; min-height: 22px; margin-bottom: 12px; }
.ec-region { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.ec-region.na { background: #eaf1fd; color: #2c5fa8; }
.ec-region.ap { background: #fdf0e8; color: #b0622a; }
.ec-date { font-size: 12px; color: var(--muted); }
.ec-title { font-size: 16px; font-weight: 600; text-align: center; line-height: 1.4; }
.ec-meta { font-size: 12px; color: var(--muted); text-align: center; margin-top: 6px; }
.ec-action { margin-top: 14px; display: flex; justify-content: center; }
.ec-btn {
  border: 1px solid var(--primary); background: var(--primary); color: #fff;
  padding: 7px 26px; border-radius: 999px; font-size: 14px; cursor: pointer;
  text-decoration: none; display: inline-block;
}
.ec-btn.ghost { background: #fff; color: var(--primary); }
.ec-btn:disabled { opacity: .38; cursor: not-allowed; }

/* ================= Bluebook 流程页（准备 / 须知 / 模块结束 / 休息） ================= */
.bb-screen {
  position: fixed; inset: 0; z-index: 200; background: #f8f9fa;
  display: none; flex-direction: column; align-items: center;
  padding: 6vh 24px 0; overflow-y: auto;
  font-family: -apple-system, "PingFang SC", sans-serif;
}
.bb-screen.open { display: flex; }
.bb-screen-title { font-size: 34px; font-weight: 400; margin: 0 0 34px; text-align: center; color: #1b1b1b; }

/* 1) 准备中 */
.bb-prep-card {
  background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.14);
  padding: 34px 40px 30px; width: min(600px, 92vw); text-align: center;
}
.bb-hourglass { width: 200px; height: 130px; display: block; margin: 0 auto 20px; }
.bb-prep-card p { font-size: 17px; line-height: 1.5; color: #1b1b1b; margin: 0; }

/* 2) 考前须知 */
.bb-intro-card {
  background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.14);
  padding: 30px 44px 34px; width: min(600px, 92vw);
}
.bb-intro-item { display: flex; gap: 16px; margin-bottom: 26px; }
.bb-intro-item:last-child { margin-bottom: 0; }
.bb-intro-ico {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: #eceff1;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.bb-intro-item h3 { font-size: 21px; margin: 6px 0 8px; font-weight: 700; }
.bb-intro-item p { font-size: 16px; line-height: 1.55; margin: 0; color: #1b1b1b; }
.bb-screen-foot {
  position: fixed; left: 0; right: 0; bottom: 0; background: #f8f9fa;
  border-top: 1px solid #e3e6e8; padding: 16px 34px;
  display: flex; justify-content: flex-end; gap: 14px;
}

/* 3) 模块结束 */
.bb-over { text-align: center; margin-top: 22vh; }
.bb-over h1 { font-size: 32px; font-weight: 400; color: #3d5afe; margin: 0 0 26px; }
.bb-over p { font-size: 17px; margin: 0 0 16px; color: #1b1b1b; }
.bb-dots { position: relative; width: 46px; height: 46px; margin: 34px auto 0; }
.bb-dots span {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px;
  background: #1b1b1b; border-radius: 50%; animation: bbfade 1s linear infinite;
}
.bb-dots span:nth-child(1){transform:rotate(0deg) translate(19px);animation-delay:0s}
.bb-dots span:nth-child(2){transform:rotate(45deg) translate(19px);animation-delay:.125s}
.bb-dots span:nth-child(3){transform:rotate(90deg) translate(19px);animation-delay:.25s}
.bb-dots span:nth-child(4){transform:rotate(135deg) translate(19px);animation-delay:.375s}
.bb-dots span:nth-child(5){transform:rotate(180deg) translate(19px);animation-delay:.5s}
.bb-dots span:nth-child(6){transform:rotate(225deg) translate(19px);animation-delay:.625s}
.bb-dots span:nth-child(7){transform:rotate(270deg) translate(19px);animation-delay:.75s}
.bb-dots span:nth-child(8){transform:rotate(315deg) translate(19px);animation-delay:.875s}
@keyframes bbfade { 0%{opacity:1} 100%{opacity:.15} }

/* 4) 休息（深色） */
.bb-screen-dark { background: #1a1a1a; color: #fff; padding: 0 24px; justify-content: center; }
.bb-break {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start;
  width: min(1180px, 94vw); margin: auto 0;
}
.bb-break-left { display: flex; flex-direction: column; align-items: center; gap: 26px; padding-top: 30px; }
.bb-break-clock { border: 1px solid #fff; border-radius: 8px; padding: 16px 44px; text-align: center; }
.bb-break-label { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.bb-break-time { font-size: 66px; font-weight: 400; line-height: 1.05; }
.bb-break-right h2 { font-size: 27px; margin: 0 0 16px; font-weight: 700; }
.bb-break-right p { font-size: 16px; line-height: 1.55; margin: 0 0 14px; }
.bb-break-right hr { border: none; border-top: 1px solid #666; margin: 26px 0; }
.bb-break-right ol { padding-left: 22px; margin: 10px 0 0; }
.bb-break-right li { font-size: 16px; line-height: 1.55; margin-bottom: 14px; }
.bb-break-name { position: fixed; left: 34px; bottom: 26px; font-size: 19px; font-weight: 600; }
@media (max-width: 860px) {
  .bb-break { grid-template-columns: 1fr; gap: 30px; }
}

/* Online accounts and report history. */
.account-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.account-card { width: min(100%, 440px); }
.account-form { display: grid; gap: 14px; max-width: 420px; }
.account-form label { display: grid; gap: 6px; font-size: 14px; }
.account-form input, .account-actions select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.account-error { color: #a12525; }
.account-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.account-info { display: flex; align-items: center; gap: 12px; }
