:root {
  --bg: #f4f6f5;
  --card: #fff;
  --ink: #1c2826;
  --muted: #6b7774;
  --line: #e2e7e5;
  --primary: #0f6e6a;
  --primary-soft: #e3f1ef;
  --accent: #c2410c;
  --accent-soft: #fff4ea;
  --good: #15803d;
  --bad: #b91c1c;
  --en: #2457a6;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--primary); color: #fff;
}
.brand { font-weight: 700; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #fff; color: var(--primary); font-size: 15px; }
nav { display: flex; gap: 2px; }
.navbtn { position: relative; background: none; border: 0; color: #fff; opacity: .8; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.navbtn:has(.badge:not([hidden])) { padding-right: 18px; }
.navbtn:hover { opacity: 1; }
.navbtn.on { opacity: 1; background: rgba(255,255,255,.16); font-weight: 600; }
.badge { position: absolute; top: -2px; right: -2px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: #f59e0b; color: #fff; font-size: 11px; line-height: 17px; text-align: center; font-weight: 700; pointer-events: none; }
.banner { background: var(--accent-soft); color: var(--accent); padding: 7px 16px; font-size: 13px; text-align: center; }

main { max-width: 760px; margin: 0 auto; padding: 14px 14px 110px; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; justify-content: center; }
.err { color: var(--bad); }
.accent { color: var(--accent); }
.row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin: 0; }
.push { margin-left: auto; }
.lead { color: var(--muted); font-size: 14px; margin: 0 2px 14px; }
.foot { text-align: center; margin-top: 24px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card ul { margin: 0; padding-left: 20px; }
.card li + li { margin-top: 4px; }

.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 9px 16px; cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.ghost { border-color: transparent; background: none; padding-left: 4px; color: var(--primary); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { display: block; width: 100%; margin-bottom: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px; font-size: 13px; }
.link:disabled { opacity: .45; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-block; font-size: 12px; line-height: 1.6; padding: 0 8px; border-radius: 6px; background: #eef1f0; color: var(--muted); white-space: nowrap; }
.tag.en { background: #e8effa; color: var(--en); }
.tag.zh { background: #fbeee6; color: var(--accent); }
.tag.oral { background: var(--primary-soft); color: var(--primary); }
.tag.written { background: #f1ecfa; color: #6b4fa8; }

input, select, textarea { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
select { padding: 4px 8px; }
textarea { width: 100%; padding: 10px 12px; resize: vertical; display: block; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }

/* 登录 */
.login { margin-top: 8vh; text-align: center; padding: 30px 22px; }
.login-logo { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--primary); color: #fff; font-size: 28px; font-weight: 700; margin-bottom: 10px; }
#loginForm { display: flex; gap: 8px; margin-top: 18px; }
#loginForm input { flex: 1; min-width: 0; padding: 10px 12px; }

/* 首页 */
.seg { display: flex; background: #e4e9e7; border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.seg-btn { flex: 1; border: 0; background: none; padding: 9px; border-radius: 9px; cursor: pointer; color: var(--muted); font-size: 16px; }
.seg-btn.on { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.item { text-align: left; cursor: pointer; margin: 0; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.item:hover { border-color: var(--primary); transform: translateY(-1px); }
.item-name { font-weight: 700; font-size: 17px; }
.item .tags { margin-top: auto; padding-top: 4px; }
.count { margin-left: auto; color: var(--primary); font-size: 13px; }
.review-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(90deg, var(--primary-soft), #fff); }
.howto summary { cursor: pointer; font-weight: 600; }
.howto ol { margin: 10px 0 0; padding-left: 22px; font-size: 14px; }
.howto li + li { margin-top: 6px; }

/* 练习项目 */
.item-head { margin: 0 2px 12px; }
.item-head h2 { margin-bottom: 6px; }
.item-head p { margin: 8px 0 0; font-size: 14px; }
.settings { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; font-size: 14px; color: var(--muted); }
.settings select { margin-left: 6px; }
.check { display: inline-flex; align-items: center; gap: 5px; }
.custom .label { font-weight: 600; margin-bottom: 8px; }
.custom textarea { margin-bottom: 10px; }
.custom .row.end { gap: 8px; }
.cat h3 { display: flex; align-items: baseline; gap: 8px; }
.qlist { margin: 0; padding-left: 22px; }
.qlist li::marker { color: var(--muted); font-size: 13px; }
.qitem { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 4px; cursor: pointer; border-bottom: 1px dashed var(--line); }
.qlist li:last-child .qitem { border-bottom: 0; }
.qitem:hover { color: var(--primary); }
.qitem .small { display: block; }
.qitem .qtags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag.src-pred { background: #fdf3dc; color: #96690f; }
.tag.src-real { background: #fdecec; color: var(--bad); }
.qfilter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0; }
.qfilter label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.cat .more { margin-top: 8px; }
.kpbox { padding: 12px 14px; }
.kp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.kp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kp { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; color: inherit; }
.kp b { margin-left: 5px; font-weight: 600; color: var(--muted); font-size: 12px; }
.kp:hover { border-color: var(--primary); color: var(--primary); }
.kp.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.kp.on b { color: #fff; }

/* 作答 */
.qcard { border-left: 4px solid var(--primary); }
.q-label { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.q-full-wrap { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.q-full-wrap select { padding: 2px 6px; border-radius: 7px; font-size: 13px; color: var(--ink); }
.tag.tag-full { background: #f3f4f6; color: var(--muted); }
.q-text { font-size: 18px; font-weight: 600; line-height: 1.5; }
.hint { margin-top: 8px; font-size: 14px; color: var(--muted); }
.hint summary { cursor: pointer; color: var(--primary); }
.speak { background: none; border: 0; cursor: pointer; padding: 0 4px; font-size: 15px; opacity: .7; vertical-align: middle; }
.speak:hover { opacity: 1; }
.chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.msg { max-width: 92%; }
.msg.student { align-self: flex-end; }
.who { font-size: 12px; color: var(--muted); margin: 0 6px 2px; }
.msg.student .who { text-align: right; }
.bubble { padding: 10px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.msg.examiner .bubble { border-top-left-radius: 4px; }
.msg.student .bubble { background: var(--primary-soft); border-color: transparent; border-top-right-radius: 4px; }

.composer { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.composer.oral {
  position: sticky; bottom: 0; z-index: 5;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: 0 -14px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.composer.oral textarea { resize: none; max-height: 30vh; }
.composer.written textarea { min-height: 28vh; }
.composer textarea { border: 0; padding: 6px 2px; outline: none !important; }
.tools { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rec { border: 0; border-radius: 999px; padding: 8px 16px; background: var(--primary); color: #fff; cursor: pointer; font-weight: 600; }
.rec.on { background: var(--bad); animation: pulse 1.2s infinite; }
.rec:disabled { opacity: .45; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(185,28,28,.15); } }
.timer { font-variant-numeric: tabular-nums; color: var(--bad); font-size: 14px; }
.comp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.status { font-size: 13px; color: var(--muted); }
.status.err { color: var(--bad); }
.status.loading::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border: 2px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.prep { display: flex; align-items: center; gap: 8px; padding: 6px 2px 10px; flex-wrap: wrap; }
.prep b { font-size: 26px; color: var(--primary); font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
.prep .btn { margin-left: auto; }

/* 诊断与学习 */
.score-card { display: flex; gap: 18px; align-items: center; }
.ring { --p: 0; flex: none; width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), #e5ebe9 0); }
.ring span { width: 70px; height: 70px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 700; color: var(--primary); }
.score-txt p { margin: 4px 0 0; }
.level { font-weight: 700; font-size: 18px; }
.exam { font-size: 14px; color: var(--accent); }
.exam b { font-size: 18px; }
.ftabs { position: sticky; top: 54px; z-index: 6; display: flex; gap: 4px; background: var(--bg); padding: 6px 0; margin-bottom: 6px; }
.ftab { flex: 1; position: relative; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 4px; cursor: pointer; color: var(--muted); }
.ftab.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.ftab.dot::after { content: ""; position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.ftab.on.dot::after { display: none; }
.ftab.wait::after { content: ""; position: absolute; top: 50%; right: 8px; width: 9px; height: 9px; margin-top: -5px; border: 2px solid #cfd8d5; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.loadbox { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner { width: 18px; height: 18px; flex: none; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.errbox { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.errbox p { margin: 0; }
.bar { display: grid; grid-template-columns: 6.5em 1fr 2em; align-items: center; gap: 10px; font-size: 14px; }
.bar + .bar { margin-top: 8px; }
.track { height: 8px; background: #e5ebe9; border-radius: 4px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.bar b { text-align: right; }
.pc-sum { font-size: 13.5px; font-weight: 600; margin: -4px 0 6px; }
.pc-sum .hit-t { color: var(--good); }
.pc-sum .part-t { color: var(--accent); }
.pc-sum .miss-t { color: var(--bad); }
.pc-tip { margin: 0 0 10px; }
.pc-list { display: flex; flex-direction: column; }
.pc-item { padding: 12px 0; border-top: 1px dashed var(--line); cursor: pointer; }
.pc-item:first-child { border-top: 0; padding-top: 0; }
.pc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.pc-st { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.pc-st.hit { background: #dcfce7; color: var(--good); }
.pc-st.part { background: var(--accent-soft); color: var(--accent); }
.pc-st.miss { background: #f3e8e8; color: var(--bad); }
.pc-max { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.pc-score { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.pc-score b { font-size: 16px; color: var(--primary); }
.pc-p { font-size: 14.5px; line-height: 1.55; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.pc-item.open .pc-p { display: block; -webkit-line-clamp: unset; }
.pc-sec { margin-top: 7px; font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.pc-lbl { display: inline-block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.pc-quote { background: #f5f7f6; border-left: 3px solid #cbd5d1; padding: 6px 10px; border-radius: 0 8px 8px 0; color: #3d4a47; }
.pc-reason { color: var(--muted); padding: 0 2px; }
.pc-add { background: #eef8f1; border-left: 3px solid var(--good); padding: 6px 10px; border-radius: 0 8px 8px 0; color: #164e2c; }
.pc-add .pc-lbl { color: var(--good); }
.mat-list { display: flex; flex-direction: column; }
.mat-item { padding: 11px 0; border-top: 1px dashed var(--line); }
.mat-item:first-child { border-top: 0; padding-top: 0; }
.mat-top { margin-bottom: 5px; }
.mat-text { font-size: 14.5px; line-height: 1.6; color: var(--ink); word-break: break-word; }
.mat-quote { font-size: 14.5px; line-height: 1.6; color: var(--ink); background: #fdfaf3; border-left: 3px solid #d97706; padding: 6px 10px; border-radius: 0 8px 8px 0; word-break: break-word; }
.mat-meta { margin-top: 4px; word-break: break-word; }
.mat-foot { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.tag.m-quote { background: #fef3c7; color: #b45309; }
.tag.m-view { background: var(--primary-soft); color: var(--primary); }
.tag.m-frame { background: #f1ecfa; color: #6b4fa8; }
.tag.m-theory { background: #e8effa; color: var(--en); }
.tag.m-case { background: var(--accent-soft); color: var(--accent); }
.good h3 { color: var(--good); }
.issue { padding: 10px 0; border-top: 1px dashed var(--line); }
.issue:first-of-type { border-top: 0; padding-top: 0; }
.orig { color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(185,28,28,.35); }
.fix { color: var(--good); font-weight: 600; margin-top: 2px; }
.fix::before { content: "✓ "; }
.note { color: var(--muted); font-size: 14px; margin-top: 2px; }
.expr { border-collapse: collapse; width: 100%; }
.expr td { padding: 6px 4px; border-top: 1px dashed var(--line); vertical-align: top; }
.expr tr:first-child td { border-top: 0; }
.expr .plain { color: var(--muted); width: 40%; }
.expr .arrow { color: var(--muted); width: 1.5em; }
.expr .better { font-weight: 600; color: var(--primary); }
.transcript summary { cursor: pointer; color: var(--muted); }
.transcript p { margin: 8px 0 0; font-size: 15px; }

.takeaway { background: var(--accent-soft); border-color: #f6dcc6; font-weight: 600; }
.takeaway .label { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.kp + .kp { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.kp-t { font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.terms { border-collapse: collapse; width: 100%; font-size: 15px; }
.terms td { padding: 8px 6px; border-top: 1px dashed var(--line); vertical-align: top; }
.terms tr:first-child td { border-top: 0; }
.terms td:first-child { width: 42%; }
.terms .en, .ph-t { color: var(--en); }
.zh-ph .ph-t { color: var(--primary); }
.terms .en { font-size: 14px; }
.phrase + .phrase { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ph-t { font-weight: 600; }
.steps { margin: 0; padding-left: 22px; }
.steps li + li { margin-top: 6px; }
.qa { padding: 8px 0; border-top: 1px dashed var(--line); }
.qa:first-of-type { border-top: 0; padding-top: 0; }
.qa summary { cursor: pointer; font-weight: 600; }
.qa div { margin-top: 6px; color: var(--good); }
.saved { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--primary-soft); border-color: transparent; color: var(--primary); font-size: 14px; }
.model .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.model-text { line-height: 1.85; }
.model-text p { margin: 0 0 10px; }
.model-text p.model-h { font-weight: 700; color: var(--primary); margin: 14px 0 6px; }
.model-text.recite .sent { background: #dfe6e3; color: transparent; border-radius: 4px; cursor: pointer; user-select: none; }
.model-text.recite .sent b { color: inherit; }
.model-text.recite .sent.show { background: none; color: inherit; }

.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; justify-content: center; gap: 8px;
  padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,.05);
}
.bottombar .btn { flex: 1; max-width: 220px; }

/* 笔记本 */
.nb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nb-head p { margin: 4px 0 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.nb-filter { display: flex; gap: 8px; margin-bottom: 12px; }
.nb-filter select { padding: 8px; }
.nb-filter input { flex: 1; min-width: 0; padding: 8px 12px; }
.ncard { cursor: pointer; padding: 12px 14px; }
.nc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.del { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.del:hover { color: var(--bad); }
.nc-front { font-weight: 600; }
.nc-back { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ncard.open .nc-back { display: block; }
.nc-src { display: none; margin-top: 6px; }
.ncard.open .nc-src, .fl-back .nc-src { display: block; }
.tag.t-knowledge { background: var(--primary-soft); color: var(--primary); }
.tag.t-term { background: #e8effa; color: var(--en); }
.tag.t-phrase { background: #fbeee6; color: var(--accent); }
.tag.t-framework { background: #f1ecfa; color: #6b4fa8; }
.tag.t-answer { background: #eaf6ee; color: var(--good); }
.tag.t-fix { background: #fdecec; color: var(--bad); }
.tag.t-quote { background: #fef3c7; color: #b45309; }
.export-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.export-row span { margin-right: auto; }

/* 复习 */
.flash { min-height: 240px; display: flex; flex-direction: column; }
.fl-front { font-size: 20px; font-weight: 700; margin: 18px 0; line-height: 1.5; }
.fl-back { padding-top: 14px; border-top: 1px dashed var(--line); font-size: 16px; }
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.grades .btn { padding: 12px 4px; font-weight: 600; }
.g0 { color: var(--bad); }
.g1 { color: var(--accent); }
.g2 { color: #fff; background: var(--good) !important; border-color: var(--good) !important; }
.rv-done .big { font-size: 40px; color: var(--good); }
.rv-done .row { margin-top: 12px; }

/* 记录 */
#v-history h2 { margin-bottom: 12px; }
.hist { display: block; width: 100%; text-align: left; cursor: pointer; }
.hist:hover { border-color: var(--primary); }
.hist-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hist-score { margin-left: auto; color: var(--primary); font-size: 18px; }
.hist-q { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 导出弹窗 */
dialog { border: 0; border-radius: 16px; padding: 20px; width: min(92vw, 380px); box-shadow: 0 10px 40px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog h3 { margin-bottom: 4px; }
.dlg-btns { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 6px; }
dialog form { text-align: center; }

.print-only { display: none; }

@media (max-width: 420px) {
  .navbtn { padding: 6px 8px; }
  .score-card { gap: 14px; }
  .ring { width: 74px; height: 74px; }
  .ring span { width: 60px; height: 60px; font-size: 22px; }
  .items { grid-template-columns: 1fr 1fr; gap: 10px; }
  .item { padding: 12px; }
  .item-name { font-size: 16px; }
  .item .muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .count { display: none; }
}

@media print {
  body { background: #fff; font-size: 12pt; }
  body > *:not(#printArea) { display: none !important; }
  .print-only { display: block !important; padding: 0 8mm; }
  #printArea h1 { font-size: 18pt; }
  #printArea h2 { font-size: 15pt; margin: 16pt 0 6pt; border-bottom: 1px solid #ccc; padding-bottom: 2pt; }
  #printArea h3 { font-size: 13pt; margin: 12pt 0 4pt; }
  #printArea .pmeta { color: #666; font-size: 10pt; }
  #printArea table { border-collapse: collapse; width: 100%; }
  #printArea td { border: 1px solid #ccc; padding: 3pt 5pt; vertical-align: top; }
  #printArea li.sub { list-style: circle; margin-left: 16pt; }
  #printArea h3, #printArea li, #printArea tr { break-inside: avoid; }
}

/* 报考院校提示、参考来源 */
.school-tips .ptip { padding: 10px 0; border-top: 1px solid var(--line, #eee); }
.school-tips .ptip:first-of-type { border-top: 0; padding-top: 2px; }
.school-tips .ptitle { font-weight: 600; }
.school-tips .ptip p { margin: 6px 0 0; }
.refs { margin: 4px 4px 12px; line-height: 1.6; }

/* 批改次数条、提示、购买弹窗、估分说明 */
.credit-bar { background: #fff; border-bottom: 1px solid var(--line); }
.cb-inner { max-width: 760px; margin: 0 auto; padding: 6px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.cb-txt { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); flex-wrap: wrap; }
.cb-num { font-size: 16px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.cb-num.warn { color: #b45309; background: #fef3c7; padding: 0 6px; border-radius: 6px; }
.cb-num.zero { color: var(--bad); background: #fee2e2; padding: 0 6px; border-radius: 6px; }
.cb-plan { font-size: 11.5px; padding: 0 6px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.cb-buy { border-color: #d97706; background: #fffbeb; color: #b45309; font-weight: 600; }
.cb-buy:hover { background: #fef3c7; border-color: #b45309; }
.cb-buy-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.cb-buy-link:hover { text-decoration: underline; }

.credit-cost { font-size: 12.5px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.credit-cost.warn { color: #b45309; font-weight: 600; }
.credit-cost.zero { color: var(--bad); font-weight: 600; }
.comp-foot { flex-wrap: wrap; }

.exam-note { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.err-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: none; }
.re-eval-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 2px 12px; }

.buy-alert { background: #fee2e2; color: var(--bad); padding: 8px 10px; border-radius: 8px; font-size: 13.5px; margin: 10px 0 0; line-height: 1.5; }
.buy-hint { margin: 12px 0; padding: 10px 12px; background: #f6f8f7; border-radius: 10px; font-size: 14px; line-height: 1.65; color: var(--ink); word-break: break-word; }
.buy-code-box { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.buy-code-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.buy-code-row code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; font-weight: 700; color: var(--primary); letter-spacing: .5px; word-break: break-all; }
.buy-invite { margin: 10px 0 12px; padding: 8px 10px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); line-height: 1.55; }

/* 板块分级：未开放板块灰显与即将开放标签、提示浮层 */
.seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.seg-btn.locked { color: #9aa5a2; opacity: .78; cursor: not-allowed; }
.soon-tag { display: inline-block; font-size: 10.5px; line-height: 1.35; padding: 1px 5px; border-radius: 999px; background: #d8dfdd; color: #667370; font-weight: 500; white-space: nowrap; }
.toast {
  position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); z-index: 60;
  transform: translateX(-50%);
  max-width: min(90vw, 420px); padding: 10px 16px; border-radius: 10px;
  background: rgba(28, 40, 38, .92); color: #fff; font-size: 14px; line-height: 1.45;
  text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
@media (max-width: 420px) {
  .seg-btn { font-size: 14.5px; padding: 8px 4px; gap: 2px; }
  .soon-tag { font-size: 10px; padding: 0 4px; }
}
