/* 教师端 / 学生端共用样式。浅色、紧凑、边框细，和导入台保持一致。 */

:root {
  --ink: #12313d;
  --ink2: #2e4250;
  --dim: #6b8191;
  --line: #e3eaf0;
  --line2: #d5dfe6;
  --bg: #f4f7f9;
  --card: #ffffff;
  --brand: #1c6e85;
  --brand-l: #e8f2f5;
  --ok: #1f7a52;
  --ok-bg: #e9f6ef;
  --warn: #a8690b;
  --warn-bg: #fdf3e2;
  --bad: #b03a3a;
  --bad-bg: #fbecec;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink2);
  font: 13.5px/1.6 "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 500; margin: 0; }
table { border-collapse: collapse; width: 100%; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* ---------- 通用控件 ---------- */

button {
  cursor: pointer;
  border: 1px solid var(--line2);
  background: #fff;
  color: var(--ink2);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 14px;
  transition: background .12s, border-color .12s;
}
button:hover { background: #f7fafb; border-color: #bccfd8; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: #175c70; }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: #eef4f7; }
button.danger { color: var(--bad); border-color: #ecc9c9; }
button.danger:hover { background: var(--bad-bg); }
button.mini { padding: 2px 8px; font-size: 13px; }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  background: #fff;
  color: var(--ink2);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28,110,133,.10); }
label { color: var(--dim); font-size: 13.5px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card + .card { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.sp { flex: 1; }
.dim { color: var(--dim); font-size: 13.5px; }
.mono { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  font-size: 12.5px; background: var(--brand-l); color: #14566b;
}
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- 学情：状态点、段位标签、升降箭头 ---------- */

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 1px;
}
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.tier-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(120, 140, 160, .16);
  font-size: 13px;
}
.up { color: var(--ok); font-size: 12.5px; }
.down { color: var(--bad); font-size: 12.5px; }
.bad-text { color: var(--bad); }
.tag.gray { background: #eef2f5; color: var(--dim); }

/* ---------- 登录 ---------- */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px 26px; }
.login-box h1 { font-size: 17px; margin-bottom: 4px; }
.login-box .sub { color: var(--dim); font-size: 13.5px; margin-bottom: 20px; }
.login-box .field { margin-bottom: 12px; }
.login-box .field input, .login-box .field select { width: 100%; }
.login-box button { width: 100%; margin-top: 6px; padding: 8px; }
.err { color: var(--bad); font-size: 13.5px; min-height: 18px; margin-top: 6px; }

/* ---------- 后台框架 ---------- */

.shell { display: grid; grid-template-columns: 186px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 14px 0; }
.side .brand { padding: 0 16px 14px; font-size: 15px; color: var(--ink); font-weight: 500; }
.side .brand small { display: block; color: var(--dim); font-size: 12.5px; font-weight: 400; margin-top: 2px; }
.side nav a {
  display: block; padding: 8px 16px; color: var(--ink2); font-size: 14px;
  border-left: 2px solid transparent;
}
.side nav a:hover { background: #f5f9fb; }
.side nav a.on { background: var(--brand-l); border-left-color: var(--brand); color: #14566b; }
.side .foot { padding: 14px 16px; border-top: 1px solid var(--line); margin-top: 10px; font-size: 13px; color: var(--dim); }

.main { padding: 18px 22px 40px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.topbar h2 { font-size: 16px; }

/* ---------- 选题组卷（三栏） ---------- */

.pick3 {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr) 336px;
  gap: 12px;
  align-items: start;
}
.pick-nav,
.pick-list,
.pick-sel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.pick-nav { padding: 10px; max-height: calc(100vh - 250px); overflow: auto; }
.pick-list { padding: 12px 14px; min-height: 420px; max-height: calc(100vh - 250px); overflow: auto; }
.pick-sel { padding: 10px 12px; display: flex; flex-direction: column; max-height: calc(100vh - 250px); }

/* 竖排的分段按钮 */
.seg-v { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg-v button {
  border: none; border-radius: 0; text-align: left; padding: 7px 11px;
  border-bottom: 1px solid var(--line); background: #fff; font-size: 13.5px;
}
.seg-v button:last-child { border-bottom: none; }
.seg-v button:hover { background: #f7fafb; }
.seg-v button.on { background: var(--brand); color: #fff; }

/* 左栏每一行（课本单元 / 知识点 / 卷子） */
.nav-item {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 6px; border-radius: 5px; cursor: pointer; font-size: 13.5px;
}
.nav-item:hover { background: #f3f8fa; }
.nav-item.on { background: var(--brand-l); color: #14566b; }
.nav-arrow { width: 12px; text-align: center; color: var(--dim); user-select: none; flex: none; cursor: pointer; }
.nav-arrow.leaf { opacity: .3; cursor: default; }

/* 中栏题目行 */
.qitem { display: flex; align-items: flex-start; gap: 8px; padding: 8px 6px; border-bottom: 1px solid #f2f6f8; cursor: pointer; }
.qitem.on { background: #f7fbfc; }
.qitem:hover { background: #f4fafc; }
/* 题号：上面是题库全局号，下面是卷内号（2-5 = 第2份卷第5题） */
.qno {
  flex: none; width: 54px; text-align: center;
  color: var(--brand); font-weight: 500; font-size: 13.5px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.3;
}
.qno b { font-weight: 500; }
.qno i { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--dim); }
.qstem { flex: 1; font-size: 13.5px; line-height: 1.75; min-width: 0; }
.qmeta { flex: none; font-size: 12px; white-space: nowrap; }
/* 行尾的「详情」，鼠标移上去才明显 */
.qview {
  flex: none; font-size: 12px; color: var(--brand);
  padding: 1px 6px; border: 1px solid #cfe3ea; border-radius: 4px;
  opacity: .45; transition: opacity .12s;
}
.qitem:hover .qview { opacity: 1; }

/* 右栏已选 */
.sel-row { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid #f2f6f8; font-size: 13.5px; }

/* ---------- 组卷：选题方式 ---------- */

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; padding: 7px 16px; background: #fff; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--brand); color: #fff; }

/* 按试卷：一份卷子一张卡 */
.src-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px;
}
.src-card:hover { border-color: #bccfd8; }

/* 按知识点：可以一层层展开的树 */
.kp-tree { max-height: 520px; overflow: auto; border-right: 1px solid var(--line); padding-right: 10px; }
.kp-node { display: flex; align-items: center; gap: 4px; padding: 3px 0; font-size: 13.5px; }
.kp-arrow { width: 14px; text-align: center; color: var(--dim); cursor: pointer; user-select: none; flex: none; }
.kp-arrow.leaf { cursor: default; opacity: .35; }
.kp-name { cursor: pointer; flex: 1; padding: 2px 4px; border-radius: 4px; }
.kp-name:hover { background: #eef4f7; }
.kp-name.on { background: var(--brand-l); color: #14566b; font-weight: 500; }
.kp-count { font-size: 12px; flex: none; }

/* 按知识点：右边题目列表 */
.q-row {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; cursor: pointer;
}
.q-row:hover { border-color: #bccfd8; }
.q-row input[type=checkbox] { margin-top: 3px; }

table.grid { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.grid th, table.grid td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eef3f6; vertical-align: top; }
table.grid th { background: #f8fbfc; color: var(--dim); font-weight: 500; font-size: 13px; white-space: nowrap; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover { background: #fbfdfe; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 统计块 ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 22px; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.stat span { color: var(--dim); font-size: 13px; }

/* 题面（图片 / 公式 / 表格）的样式已统一到 /stem.css，三端共用一份 */

/* ---------- 图片点击放大（2026-10-30） ----------
 * 题里的公式、表格图在版面上只有 260px 高，手机上根本看不清。
 * 点一下弹出全屏大图，点任意处关闭。
 */
.stem-img, .eq-img { cursor: zoom-in; }
.img-zoom {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 18, 28, 0.93);
  cursor: zoom-out;
  animation: imgZoomIn .16s ease;
}
.img-zoom img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .55);
}
.img-zoom-tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
  pointer-events: none;
}
@keyframes imgZoomIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* 化合价：标在元素符号正上方 */
.cv { position: relative; display: inline-block; }
.cv i {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 100%; margin-bottom: -0.12em;
  font-size: .66em; line-height: 1; font-style: normal;
  color: var(--brand); font-weight: 500; white-space: nowrap; pointer-events: none;
}

/* 自主练习：对答案后展开的一块 */
.practice-reveal {
  margin-top: 8px; padding: 8px 10px; border-radius: 6px;
  background: #f7fbfc; border-left: 2px solid #cfe3ea; font-size: 13.5px;
}
.practice-reveal .reveal-line { line-height: 1.9; }
.practice-reveal b { color: var(--ink); }

/* ---------- 题目详情（全部信息） ---------- */

.dt-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  color: var(--dim); font-size: 13px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); margin-bottom: 14px;
}

.dt-block { margin-bottom: 18px; }
.dt-h {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid #eef3f6;
}
.dt-h b { font-size: 14px; color: var(--ink); }

/* 每个空一张卡 */
.dt-unit {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 10px; background: #fff;
}
.dt-unit-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.dt-no {
  display: inline-grid; place-items: center; min-width: 26px; height: 22px;
  padding: 0 6px; border-radius: 4px; background: var(--brand-l); color: #14566b;
  font-size: 13px; font-weight: 500;
}

/* 选项分条列，不再挤成一行 */
.dt-opts { margin: 8px 0; display: grid; gap: 4px; }
.dt-opt { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.9; }
.dt-opt b { flex: none; width: 16px; color: var(--ink); }

.dt-ans {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed #eef3f6;
  font-size: 14px;
}
.dt-ans b { color: var(--ok); }

.dt-analysis { margin-top: 8px; }
.dt-analysis summary { cursor: pointer; color: var(--dim); font-size: 13px; }
.dt-analysis div { margin-top: 6px; font-size: 13.5px; line-height: 1.9; color: #55697a; }
.dt-analysis-body {
  background: #f7fbfc; border-left: 2px solid #cfe3ea; border-radius: 0 6px 6px 0;
  padding: 10px 14px; font-size: 13.5px; line-height: 1.95; color: #55697a; white-space: pre-wrap;
}

/* ---------- 题干里挖的横线 ---------- */

/**
 * 直接嵌在题干里的填空框，代替「题干一行、输入框一行」的老做法。
 * 黄色下划线 + 浅黄底，和原卷的横线感觉接近。
 */
.blank-fill {
  display: inline-block;
  vertical-align: baseline;
  margin: 0 3px;
  padding: 1px 8px;
  border: none;
  border-bottom: 1.5px solid #d9a13a;
  background: #fdf7e6;
  border-radius: 3px 3px 0 0;
  font: inherit;
  font-size: inherit;
  line-height: 1.7;
  color: var(--ink);
  text-align: center;
  transition: background .12s, border-color .12s;
}
.blank-fill::placeholder { color: #b9a97f; font-size: .92em; }
.blank-fill:hover { background: #fbf1d6; }
.blank-fill:focus {
  outline: none;
  background: #fff;
  border-bottom-color: var(--brand);
  box-shadow: 0 2px 0 -1px var(--brand);
}
.blank-fill[readonly] { background: #f6f9fa; border-bottom-color: #cfdde4; }

/* 图片尺寸调节 */
.img-tune { margin-bottom: 14px; }
.img-tune summary { cursor: pointer; color: var(--brand); font-size: 13.5px; padding: 4px 0; }
.img-tune-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); }
.img-tune-row img { width: 72px; max-height: 60px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: #fbfdfe; }
.img-tune-row input { width: 90px; }

/* 计分开关 */
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ink2); font-size: 14px; }
.switch input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

/* ---------- 题库覆盖统计 ---------- */

.stat-tree { max-height: 620px; overflow: auto; }
.stat-row {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; font-size: 13.5px; border-bottom: 1px solid #f4f8fa;
}
.stat-row:hover { background: #fbfdfe; }
.stat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-nums { display: flex; gap: 10px; flex: none; font-size: 12.5px; color: var(--dim); }
.stat-nums b { color: var(--ink); font-weight: 500; min-width: 22px; text-align: right; }
/* 缺某种题型的用颜色标出来，一眼能看出往哪补 */
.stat-row.need-choice .stat-nums span:first-child { color: var(--bad); }
.stat-row.need-blank .stat-nums span:nth-child(2) { color: var(--brand); }
.stat-row.zero { opacity: .45; }

/* 试做页：判分后展开的标答与解析 */
.try-reveal {
  margin-top: 8px; padding: 8px 10px; background: #f7fbfc;
  border-left: 2px solid #cfe3ea; border-radius: 0 6px 6px 0; font-size: 13.5px;
}

/* 试做页：题干里去掉重复编号后的排版 */
.unit-stem { line-height: 2.2; }
.unit-stem .blank-line { display: inline-block; min-width: 68px; border-bottom: 1px solid var(--line2); }

/* ---------- 选项 ---------- */

.opts { display: grid; gap: 6px; margin-top: 8px; }
.opt {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer;
}
.opt:hover { border-color: #bccfd8; }
.opt.on { border-color: var(--brand); background: var(--brand-l); }
.opt .opt-key { font-weight: 600; color: var(--ink); width: 16px; flex: none; }
.opt .opt-text { flex: 1; line-height: 2; }

/* ---------- 判断题（2026-10-31）----------
   判断题不显示输入框，给「正确 / 错误」两个按钮，点一下就是答案。
   以前它被当成填空题，学生得手打「正确」两个字，慢还容易打成「对」「√」。 */
.judge-opts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.judge-opt {
  flex: 1 1 0;
  min-width: 96px;
  max-width: 200px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}
.judge-opt:hover { border-color: #bccfd8; }
.judge-opt.on {
  border-color: var(--brand);
  background: var(--brand-l);
  font-weight: 500;
}

/* ---------- 答题区 ---------- */

.ans-input {
  width: 100%; min-height: 34px; resize: vertical;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; line-height: 1.7;
}
.ans-input:focus { border-color: var(--brand); }

/* ---------- 模态 ---------- */

.mask { position: fixed; inset: 0; background: rgba(18,49,61,.42); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 10px; width: min(920px, 94vw); max-height: 88vh; display: flex; flex-direction: column; }
.modal.is-wide { width: min(1100px, 96vw); }

/* 全屏：审卷时一道题占大半屏，88vh 根本看不全（2026-10-31 用户要求） */
.mask.is-full { padding: 0; }
.modal.is-full {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
}
.modal.is-full .body { flex: 1; min-height: 0; }
/* 全屏时列表别再限高，让整块 body 滚 */
.modal.is-full .rv-list { max-height: none; }
/* 题号条在全屏下多显示几行，省得来回滚 */
.modal.is-full .rv-nav { max-height: 200px; }

.modal header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal header h3 { font-size: 15px; }
.modal .body { padding: 16px 18px; overflow: auto; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 提示条 ---------- */

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 32px;
  background: #12313d; color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 14px; z-index: 90; opacity: 0; transition: opacity .2s, bottom .2s;
}
.toast.on { opacity: 1; bottom: 40px; }
.toast.bad { background: var(--bad); }

.empty { text-align: center; color: var(--dim); padding: 36px 0; font-size: 14px; }

/* ---------- 学生端 ---------- */

.s-shell { max-width: 980px; margin: 0 auto; padding: 20px 20px 60px; }
.s-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.s-head h1 { font-size: 17px; }
.paper-list { display: grid; gap: 12px; }
.paper-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
}
.paper-card h3 { font-size: 15px; margin-bottom: 3px; }
.paper-card .meta { color: var(--dim); font-size: 13px; }

/* 答题页：左侧题号导航 + 右侧题目 */
.exam { display: grid; grid-template-columns: 168px 1fr; gap: 18px; }
.exam .nav { position: sticky; top: 16px; align-self: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.exam .nav .title { font-size: 13px; color: var(--dim); margin-bottom: 8px; }
.exam .nav .dots { display: flex; flex-wrap: wrap; gap: 6px; }
.exam .nav .dot {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer;
}
.exam .nav .dot.done { background: var(--brand-l); border-color: #a8cdd9; color: #14566b; }
.exam .nav .dot.cur { outline: 2px solid var(--brand); }
.exam .nav .dot.flag { position: relative; }
.exam .nav .dot.flag::after {
  content: ''; position: absolute; right: -3px; top: -3px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--warn);
}

.q-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.q-block .qh { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-block .qh .no { font-weight: 500; color: var(--ink); }
.timer { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--ink); }
.timer.hot { color: var(--bad); }

.correct-mark { color: var(--ok); }
.wrong-mark { color: var(--bad); }

/* ---------- 整题块内的小问 ---------- */

/* 材料是整题共用的，只出现一次 */
.ctx-line {
  background: #f7fbfc; border-left: 2px solid #cfe3ea; border-radius: 0 6px 6px 0;
  padding: 8px 12px; margin-bottom: 10px; color: #55697a; font-size: 13.5px; line-height: 1.9;
}

/* 一道题里有多个空时，每个空一行：左边小问号，右边题干和作答 */
.sub-unit { display: flex; gap: 10px; padding: 9px 0; border-top: 1px dashed #eef3f6; }
.sub-unit:first-of-type { border-top: none; padding-top: 2px; }
.sub-label {
  flex: none; min-width: 46px; color: var(--brand); font-weight: 500;
  font-size: 13.5px; padding-top: 3px; white-space: nowrap;
}
.sub-body { flex: 1; min-width: 0; }
.sub-body .opts { margin-top: 6px; }
.sub-body .ans-input { margin-top: 6px; }

/* ---------- 整题渲染：题面连贯，空嵌在横线位置 ---------- */

.full-stem {
  font-size: 14.5px;
  line-height: 2.15;
  color: var(--ink);
  margin-top: 4px;
}
.full-stem br { line-height: 2.15; }

/* 只读题面（横线数对不上空数时用）：横线画成静态下划线，输入框放到下面 */
.full-stem.readonly .blank-mark {
  display: inline-block;
  min-width: 64px;
  height: 1em;
  vertical-align: -0.12em;
  border-bottom: 1px solid #9aa7b4;
  margin: 0 2px;
}
.theme-dark .full-stem.readonly .blank-mark { border-bottom-color: rgba(226, 236, 245, .42); }

/* 切分没切到的空，补在题面下面 */
.blank-rest {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e6eef2;
}
.blank-rest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

/* 考试中途离开的提醒 */
.leave-tip:empty { display: none; }
.leave-tip {
  background: #fff8e6;
  border: 1px solid #f0dca8;
  border-left: 3px solid #d9a13a;
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  font-size: 13.5px;
  color: #7a5c1e;
  margin-bottom: 12px;
  line-height: 1.7;
}

/* 覆盖统计里每行末尾的「看题 ›」 */
.stat-go {
  flex: none;
  font-size: 12.5px;
  color: var(--brand);
  cursor: pointer;
  opacity: .55;
  padding: 0 4px;
}
.stat-row:hover .stat-go { opacity: 1; text-decoration: underline; }

/* 学生端：最近几次成绩 */
.trend-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 13px; }
.trend-name { width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-bar { flex: 1; height: 9px; background: #eef3f6; border-radius: 5px; overflow: hidden; }
.trend-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7cc0d8, var(--brand)); border-radius: 5px; }
.trend-val { width: 62px; text-align: right; color: var(--ink); }

/* 题面（图片 / 公式 / 表格）的样式已统一到 /stem.css，三端共用一份 */

/* ---------- 行内公式（MathType 公式的预览图）----------
   公式是文字的一部分，尺寸必须跟着字号走，不能像插图那样撑开一行。 */
.eq-img {
  display: inline-block;
  height: 1.18em;
  width: auto;
  max-width: none;
  vertical-align: -0.22em;
  margin: 0 2px;
}

/* ---------- 选题组卷：删除题目 + 撤销条 ---------- */

.pick-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}



/* 题目列表上方的「已删除 N 道题」条 */
.undo-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff8e6;
  border-bottom: 1px solid #f0dca8;
  font-size: 13px;
  color: #7a5c1e;
  flex: none;
}
.undo-bar[hidden] { display: none; }
.undo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border-top: 1px dashed #f0e0bc;
  font-size: 13px;
}
.undo-stem { flex: 1; color: #5b6b73; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 题目行末的「删除」按钮：和导入台一致，平时半透明，鼠标移上去变实 */
.qdel {
  flex: none;
  padding: 1px 7px;
  margin-left: 6px;
  border: 1px solid #f0d0d0;
  border-radius: 4px;
  background: #fff6f6;
  color: #c0392b;
  font-size: 12px;
  line-height: 16px;
  cursor: pointer;
  opacity: .45;
  transition: opacity .12s;
}
.qitem:hover .qdel { opacity: 1; }
.qdel:hover { background: #ffe3e3; border-color: #e8b4b4; }

/* 选题组卷上方的操作栏 */
.pick-bar { gap: 8px; }
.pick-bar .mini.danger {
  background: #fff6f6; border: 1px solid #f0d0d0; color: #c0392b;
}
.pick-bar .mini.danger:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- 学生答题页：反馈（申诉） ---------- */

/* 题干底部那一行：平时只有一行小字，不抢注意力 */
.q-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed #eef3f6;
}

.rep-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid #d9e6ec;
  border-radius: 6px;
  background: #f8fbfc;
  color: #5b7a88;
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
  transition: all .15s;
}
.rep-btn:hover {
  border-color: #e6c07a;
  background: #fffaf0;
  color: #b8791c;
}

.rep-done {
  font-size: 12.5px;
  color: #47945f;
}
.rep-done::before { content: '✓ '; }

/* 展开后的反馈面板 */
.rep-panel {
  margin-top: 8px;
  padding: 12px 14px;
  background: #fbfdfe;
  border: 1px solid #e4eef2;
  border-radius: 8px;
}
.rep-panel[hidden] { display: none; }

.rep-title {
  font-size: 13.5px;
  color: #37505c;
  margin-bottom: 8px;
}

.rep-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: #4b5b64;
  margin-bottom: 8px;
}
.rep-types label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }

.rep-reason {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #dfeaf0;
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  resize: vertical;
}
.rep-reason:focus { outline: none; border-color: #7cc0d8; }

.rep-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.rep-send {
  background: #1e6c82;
  border: 1px solid #1e6c82;
  color: #fff;
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 13px;
  cursor: pointer;
}
.rep-send:hover { background: #14566b; }
.rep-cancel {
  border: 1px solid #dde7ec;
  background: #fff;
  color: #6b7f8a;
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- 教师端：学生反馈 ---------- */

/* 侧栏那个小红点 */
.fb-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e0553f;
  margin-left: 3px;
  vertical-align: middle;
}

/* 分段按钮（待处理 / 已改判 / 已驳回 / 全部） */
.seg { display: flex; gap: 4px; }
.seg .mini {
  border: 1px solid #dde7ec;
  background: #fff;
  color: #5b6b73;
  border-radius: 5px;
  padding: 2px 10px;
  font-size: 13px;
  cursor: pointer;
}
.seg .mini.on { background: #1e6c82; border-color: #1e6c82; color: #fff; }

/* 反馈列表 */
.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.grid th,
.grid td {
  border-bottom: 1px solid #eef3f6;
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.grid th { background: #f7fafb; font-weight: 500; color: #4b5b64; }
.grid tr:hover td { background: #fbfdfe; }

/* 按试卷列表：卷号徽章 */
.src-no {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 2px;
  border-radius: 4px;
  background: #e8f2f6;
  color: #1e6c82;
  font-size: 12px;
  font-weight: 500;
}

/* 修炼页：掌握度百分比 */
.mast { font-size: 13px; font-variant-numeric: tabular-nums; }
.mast.good { color: #47945f; }
.mast.mid { color: #b8791c; }
.mast.low { color: #c0392b; }
.mast.dim { color: #9aa8b0; font-size: 12.5px; }

/* ---------- 知识星图 ---------- */







/* 点亮的星：外圈金色光环，缓缓呼吸 */
.sm-halo {
  fill: none;
  stroke: #ffd479;
  stroke-width: 1.2;
  opacity: .85;
  animation: smHalo 2.6s ease-in-out infinite;
}
@keyframes smHalo {
  0%, 100% { opacity: .35; r: 6.5; }
  50%      { opacity: 1;   r: 8; }
}

.sm-theme { cursor: pointer; }
.sm-ring {
  fill: rgba(70, 150, 185, 0.10);
  stroke: rgba(90, 190, 220, 0.45);
  stroke-width: 1;
}
.sm-core {
  fill: rgba(60, 175, 205, 0.85);
  stroke: #8ee8f8;
  stroke-width: 1;
}
.sm-theme:hover .sm-core { fill: rgba(90, 215, 240, 1); }
.sm-theme:hover .sm-ring { stroke: rgba(120, 225, 250, 0.8); }

.sm-name {
  font-size: 14px;
  fill: #dff1fa;
  font-weight: 500;
}
.sm-label-great, .sm-label-ok, .sm-label-weak, .sm-label-dim { }
.sm-label-great { font-size: 12px; fill: #57dcf0; }
.sm-label-ok    { font-size: 12px; fill: #7dc4dd; }
.sm-label-weak  { font-size: 12px; fill: #d98b74; }
.sm-label-dim   { font-size: 12px; fill: #5d7183; }

/* 星点轻微浮动，让画面「活」起来（光环保留自己的呼吸动画，别覆盖） */
@keyframes smDrift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .sm-halo, .sm-dot { animation: none; }
  .starmap { transform: none; }
}

/* ============================================================
   深色主题（只作用于学生端 body.theme-dark，教师端不受影响）
   刻意不用纯蓝 + 荧光青：底色带灰、强调色降饱和，看起来像系统而不像游戏
   ============================================================ */

/**
 * 学生端深色主题 —— 唯一变量入口（2026-10-26 收敛）
 *
 * 以前这里有 6 个 .theme-dark {} 块（V1→V4 一路覆盖），改一次颜色要翻半天找「最后生效的那条」。
 * 现在合并成一个块，值 = 当时最终生效的值，视觉零变化。
 * 想改学生端配色，只改这里。
 */
.theme-dark {
  --ink: #e8f6fd;                       /* 主文字 */
  --ink2: #b9d9ea;                      /* 正文 */
  --dim: #6d93aa;                       /* 次要文字 */
  --line: rgba(56, 182, 232, 0.22);     /* 分隔线 */
  --line2: rgba(56, 182, 232, 0.38);    /* 强分隔线 / 描边 */
  --bg: #0d1e33;                        /* 页面底色（明亮的深蓝） */
  --card: rgba(20, 52, 84, 0.42);       /* 面板（半透明玻璃） */
  --brand: #38b6e8;                     /* 强调色 */
  --brand-l: rgba(56, 182, 232, 0.16);  /* 强调色浅底 */
  --ok: #58c48e;
  --ok-bg: #0e2c20;
  --warn: #e0a95c;
  --warn-bg: #2d2310;
  --bad: #e88a70;
  --bad-bg: #2e1a15;
}

/* 页面骨架 */
.theme-dark,
.theme-dark body {
  background: var(--bg);
  color: var(--ink2);
}

/* 顶栏 / 卡片 / 面板 */
.theme-dark .topbar,
.theme-dark .card,
.theme-dark .login-box,
.theme-dark .side,
.theme-dark .q-block,
.theme-dark .sub-unit,
.theme-dark .paper-card {
  background: var(--card);
  border-color: var(--line);
}

.theme-dark .stat,
.theme-dark .kpi .stat {
  background: var(--card);
  border-color: var(--line);
}

.theme-dark table.grid {
  background: var(--card);
  border-color: var(--line);
}
.theme-dark table.grid th {
  background: #0f2440;
  color: var(--dim);
}
.theme-dark table.grid tbody tr:hover { background: #173252; }

/* 分隔线 */
.theme-dark hr,
.theme-dark .line { border-color: var(--line); }

/* 输入类 */
.theme-dark input,
.theme-dark textarea,
.theme-dark select {
  background: #0e2136;
  border-color: var(--line2);
  color: var(--ink);
}
/* 答题框是学生要长时间盯着打字的地方，用灰白底最不累 */
.theme-dark .ans-input,
.theme-dark .blank-fill {
  background: rgba(238, 246, 252, 0.94);
  border-color: rgba(140, 190, 220, 0.55);
  color: #0d2334;
}
.theme-dark input::placeholder,
.theme-dark textarea::placeholder { color: #5d6d79; }
.theme-dark input:focus,
.theme-dark textarea:focus,
.theme-dark select:focus {
  outline: none;
  border-color: var(--brand);
}

/* 按钮 */
.theme-dark .btn {
  background: #16304e;
  border-color: var(--line2);
  color: var(--ink2);
}
.theme-dark .btn:hover { background: #1b3c62; }
.theme-dark .btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #08141a;
}
.theme-dark .btn.primary:hover { background: #5aaccb; }
.theme-dark .seg button { background: transparent; color: var(--dim); }
.theme-dark .seg button.on { background: var(--brand-l); color: var(--ink); }

/* 选项 / 填空（答题页） */
.theme-dark .opt {
  background: rgba(20, 48, 76, 0.65);
  border-color: var(--line2);
}
.theme-dark .opt:hover { border-color: var(--brand); }
.theme-dark .opt.on {
  background: rgba(30, 90, 135, 0.75);
  border-color: var(--brand);
  box-shadow: 0 0 12px rgba(56, 182, 232, 0.35);
}

/* 判断题按钮：跟选项同一套配色，深色主题下别被通用 button 规则刷成灰蓝 */
.theme-dark .judge-opt {
  background: rgba(20, 48, 76, 0.65);
  border-color: var(--line2);
  color: var(--ink);
}
.theme-dark .judge-opt:hover { border-color: var(--brand); }
.theme-dark .judge-opt.on {
  background: rgba(30, 90, 135, 0.75);
  border-color: var(--brand);
  box-shadow: 0 0 12px rgba(56, 182, 232, 0.35);
}

.theme-dark .blank-fill {
  background: #101a20;
  border-color: var(--line2);
  color: var(--ink);
}
.theme-dark .blank-fill:focus { border-color: var(--brand); }

/* 公式图是白底 PNG，直接贴在深色上会「一闪一闪」刺眼 —— 给个浅色衬底 */
.theme-dark .eq-img,
.theme-dark .stem-img {
  background: #eef3f7;
  border-radius: 3px;
  padding: 1px 3px;
}
.theme-dark .eq-img { padding: 1px 2px; }

/* 标签 / 徽章 */
.theme-dark .tag {
  background: #16304e;
  color: var(--dim);
  border-color: var(--line2);
}
.theme-dark .tag.warn { background: var(--warn-bg); color: var(--warn); border-color: #3d301a; }
.theme-dark .badge.ok { background: var(--ok-bg); color: var(--ok); }
.theme-dark .badge.warn { background: var(--warn-bg); color: var(--warn); }

/* 知识点行 */
.theme-dark .bar { background: #0f2a46; }
.theme-dark .lit { color: #ffd479; }

/* 进度条 */
.theme-dark .bar i { background: var(--brand); }

/* 空状态 / 提示 */
.theme-dark .empty { color: var(--dim); }
.theme-dark .dim { color: var(--dim); }

/* 星图卡片和整体底色融为一体，不再是「一块黑布」 */

/* 深色主题补充：tab 药丸 / 全局 button 白底 */
.theme-dark .tabs button {
  background: #16304e;
  border-color: var(--line2);
  color: var(--dim);
}
.theme-dark .tabs button.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #08141a;
}

/* 全局 button 在 app.css 里写死了 #fff，深色下必须兜住 */
/* 题号按钮（.qn）有自己的配色，要排除掉，否则会被这条规则压成同一种深蓝灰 */
.theme-dark button:not(.btn):not(.rep-send):not(.rep-btn):not(.mini):not(.qdel):not(.opt):not(.qn):not(.judge-opt) {
  background: #16304e;
  border-color: var(--line2);
  color: var(--ink2);
}
.theme-dark button:not(.btn):not(.mini):not(.qdel):not(.qn):not(.judge-opt):hover { background: #212d36; }
.theme-dark .qn { background: transparent; }
.theme-dark .qn.done { background: var(--brand); border-color: var(--brand); color: #06202e; }

/* ---------- 星图 Canvas 容器 ---------- */


#smCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

/* 悬停提示 */

/* 左下角图例 */

/* ============================================================
   科技感细节（参考图那种：网格底 + 发光细线 + 数字微光）
   原则：只在关键位置加一点光，不加满屏特效
   ============================================================ */

/* 页面底：极淡的网格，像控制台背板 */
.theme-dark {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(70, 180, 230, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 180, 230, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  background-attachment: fixed;
}

/* 卡片：顶部一条渐隐的发光线 */
.theme-dark .card {
  position: relative;
  border-color: rgba(45, 95, 135, 0.55);
  background: linear-gradient(180deg, #142c48 0%, #112944 45%, #112944 100%);
}
.theme-dark .card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(90, 210, 250, 0.55), transparent);
  pointer-events: none;
}

/* KPI 数字带一点冷光 */
.theme-dark .kpi .stat b,
.theme-dark .stat b {
  color: #eaf7fd;
  text-shadow: 0 0 12px rgba(64, 190, 220, 0.35);
}
.theme-dark .kpi .stat {
  border-color: rgba(45, 95, 135, 0.5);
  background: linear-gradient(180deg, #153052 0%, #112944 100%);
}

/* 顶栏：底部一条发光细线 */
.theme-dark .topbar {
  border-bottom: 1px solid rgba(50, 100, 122, 0.45);
  box-shadow: 0 1px 14px rgba(20, 90, 115, 0.16);
}

/* 选中态的 tab：加一点外发光，像被点亮 */
.theme-dark .tabs button.on {
  background: linear-gradient(180deg, #2e9fbe 0%, #1f8098 100%);
  border-color: rgba(140, 230, 250, 0.55);
  color: #04141b;
  box-shadow: 0 0 14px rgba(46, 160, 190, 0.45);
}

/* 进度条：填充部分带光 */
.theme-dark .bar i {
  background: linear-gradient(90deg, #1f8098, #3fc4e0);
  box-shadow: 0 0 8px rgba(63, 196, 224, 0.45);
}

/* 分割线变暗，别抢视线 */

/* 滚动条也换成深色，白滚动条太跳 */
.theme-dark ::-webkit-scrollbar { width: 10px; height: 10px; }
.theme-dark ::-webkit-scrollbar-track { background: #0a1a2c; }
.theme-dark ::-webkit-scrollbar-thumb {
  background: #27507a;
  border-radius: 6px;
  border: 2px solid #0a1a2c;
}
.theme-dark ::-webkit-scrollbar-thumb:hover { background: #33648f; }

/* 深色主题：带 .primary 的裸 button（登录页等）要用主色 */
.theme-dark button.primary {
  background: linear-gradient(180deg, #2e9fbe 0%, #1f8098 100%);
  border-color: rgba(140, 230, 250, 0.5);
  color: #04141b;
  box-shadow: 0 0 14px rgba(46, 160, 190, 0.35);
}
.theme-dark button.primary:hover {
  background: linear-gradient(180deg, #3ab2d2 0%, #238fa9 100%);
}

/* 关键修复：--bg 定义在 body.theme-dark 上，html 拿不到变量，
   内容不满一屏时露出的就是 html 的白底 —— 这就是「下半截是白的」的原因。
   具体底色统一在文件末尾那一条 html:has 里给（只留一处，避免层层覆盖）。 */
.theme-dark {
  min-height: 100vh;
}

/* 学生端顶栏（类名是 .s-head，不是 .topbar） */
.theme-dark .s-head {
  background: transparent;
  border-bottom: 1px solid rgba(45, 95, 135, 0.45);
}
.theme-dark .s-head h1 { color: var(--ink); }

/* ============================================================
   深色主题 V3：科幻控制台面板（参考用户给的控制台图）
   特征：黑底 + 亮青发光边框 + 半透明面板 + 内发光
   后写的覆盖前面的，这是最终版
   ============================================================ */

/* （V3 的变量已合并到文件上方的 .theme-dark 唯一入口，此处不再重复定义） */

/* 页面底：纯黑星空 + 极淡网格 */
.theme-dark {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(20, 70, 110, 0.35) 0%, rgba(4, 7, 12, 0) 55%),
    linear-gradient(rgba(56, 182, 232, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 182, 232, 0.04) 1px, transparent 1px),
    #04070c;
  background-size: 100% 100%, 34px 34px, 34px 34px, auto;
  background-attachment: fixed;
}

/* 核心面板：半透明玻璃 + 亮青描边 + 内外发光 */
.theme-dark .card,
.theme-dark .stat,
.theme-dark .kpi .stat,
.theme-dark .login-box,
.theme-dark .paper-card,
.theme-dark .q-block {
  background: linear-gradient(180deg, rgba(16, 48, 78, 0.60) 0%, rgba(8, 26, 44, 0.72) 100%);
  border: 1px solid rgba(56, 182, 232, 0.45);
  border-radius: 10px;
  box-shadow:
    inset 0 0 26px rgba(56, 182, 232, 0.10),
    0 0 16px rgba(56, 182, 232, 0.14);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* 面板四角的装饰亮角（参考图的面板角上都有亮线段） */
.theme-dark .card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(#5cd8f8, #5cd8f8) left 0 top 0 / 14px 2px no-repeat,
    linear-gradient(#5cd8f8, #5cd8f8) left 0 top 0 / 2px 14px no-repeat,
    linear-gradient(#5cd8f8, #5cd8f8) right 0 top 0 / 14px 2px no-repeat,
    linear-gradient(#5cd8f8, #5cd8f8) right 0 top 0 / 2px 14px no-repeat,
    linear-gradient(#5cd8f8, #5cd8f8) left 0 bottom 0 / 14px 2px no-repeat,
    linear-gradient(#5cd8f8, #5cd8f8) left 0 bottom 0 / 2px 14px no-repeat,
    linear-gradient(#5cd8f8, #5cd8f8) right 0 bottom 0 / 14px 2px no-repeat,
    linear-gradient(#5cd8f8, #5cd8f8) right 0 bottom 0 / 2px 14px no-repeat;
  opacity: 0.75;
}
/* 原来的顶部光线保留但弱一点，别和角标打架 */
.theme-dark .card::before {
  background: linear-gradient(90deg, transparent, rgba(120, 225, 250, 0.6), transparent);
}

/* tab：胶囊发光 */
.theme-dark .tabs button {
  background: rgba(12, 38, 62, 0.55);
  border: 1px solid rgba(56, 182, 232, 0.35);
  color: var(--dim);
  box-shadow: inset 0 0 12px rgba(56, 182, 232, 0.08);
}
.theme-dark .tabs button.on {
  background: linear-gradient(180deg, rgba(70, 200, 240, 0.95), rgba(28, 130, 165, 0.95));
  border-color: rgba(160, 235, 255, 0.8);
  color: #03141b;
  box-shadow:
    0 0 18px rgba(56, 182, 232, 0.55),
    inset 0 0 10px rgba(255, 255, 255, 0.25);
}

/* KPI：数字大发光，面板像仪表 */
.theme-dark .kpi .stat {
  text-align: center;
}
.theme-dark .kpi .stat b {
  font-size: 26px;
  color: #7ce4ff;
  text-shadow:
    0 0 10px rgba(56, 200, 240, 0.9),
    0 0 28px rgba(56, 200, 240, 0.45);
}
.theme-dark .kpi .stat span { color: var(--dim); letter-spacing: 1px; }

/* 进度条：轨道内嵌发光 */
.theme-dark .bar {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(56, 182, 232, 0.3);
}
.theme-dark .bar i {
  background: linear-gradient(90deg, #1a8fb5, #4fd6ff);
  box-shadow: 0 0 10px rgba(79, 214, 255, 0.8);
}

/* 主按钮：能量感 */
.theme-dark button.primary,
.theme-dark .btn.primary {
  background: linear-gradient(180deg, rgba(80, 205, 245, 0.95), rgba(24, 125, 160, 0.95));
  border-color: rgba(170, 240, 255, 0.75);
  color: #02121a;
  box-shadow:
    0 0 20px rgba(56, 182, 232, 0.5),
    inset 0 0 12px rgba(255, 255, 255, 0.3);
}

/* 输入框：深蓝玻璃 + 聚焦时亮边 */
.theme-dark input,
.theme-dark textarea,
.theme-dark select {
  background: rgba(6, 20, 34, 0.7);
  border-color: rgba(56, 182, 232, 0.3);
  color: var(--ink);
}
.theme-dark input:focus,
.theme-dark textarea:focus {
  border-color: rgba(120, 225, 250, 0.85);
  box-shadow: 0 0 12px rgba(56, 182, 232, 0.35);
}

/* 答题框：保持灰白易读（学生打字的地方） */
.theme-dark .ans-input,
.theme-dark .blank-fill {
  background: rgba(240, 247, 252, 0.95);
  border-color: rgba(140, 200, 230, 0.6);
  color: #0c2334;
}

/* 选项：玻璃条 + 选中发光 */
.theme-dark .opt {
  background: rgba(12, 38, 62, 0.45);
  border-color: rgba(56, 182, 232, 0.28);
}
.theme-dark .opt.on {
  background: rgba(24, 96, 140, 0.6);
  border-color: rgba(120, 225, 250, 0.8);
  box-shadow: 0 0 14px rgba(56, 182, 232, 0.45), inset 0 0 10px rgba(56, 182, 232, 0.18);
}

/* 标题字带微光 */
.theme-dark h1, .theme-dark .card b { color: #eaf7fd; }
.theme-dark .card > .row > b,
.theme-dark .s-head h1 {
  text-shadow: 0 0 14px rgba(56, 190, 230, 0.45);
}

/* 星图容器：边框更亮 */

/* ---------- 星图 HUD（左上角段位） + L2 详情面板 ---------- */


/* L2 详情面板：右侧全息玻璃 */
.sd-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sd-head b { font-size: 14.5px; color: #eaf7fd; text-shadow: 0 0 10px rgba(56, 190, 230, 0.5); }
.sd-back {
  background: rgba(12, 38, 62, 0.6);
  border: 1px solid rgba(56, 182, 232, 0.4);
  color: #9fc3d6;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 12.5px;
  cursor: pointer;
}
.sd-back:hover { color: #eaf7fd; border-color: rgba(120, 225, 250, 0.7); }
.sd-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.sd-stats > div {
  flex: 1;
  text-align: center;
  padding: 7px 4px;
  border-radius: 7px;
  background: rgba(14, 44, 72, 0.55);
  border: 1px solid rgba(56, 182, 232, 0.3);
}
.sd-stats i {
  font-style: normal;
  display: block;
  font-size: 16px;
  color: #7ce4ff;
  text-shadow: 0 0 8px rgba(56, 200, 240, 0.7);
}
.sd-stats span { font-size: 11.5px; color: #7fa0b5; }
.sd-list { overflow-y: auto; flex: 1; padding-right: 2px; }
.sd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 7px;
  border-bottom: 1px solid rgba(40, 70, 95, 0.55);
  font-size: 13px;
}
.sd-row.is-lit .nm { color: #ffd479; }
.sd-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c3d9ea; }
.sd-row .mast.good { color: #58c48e; }
.sd-row .mast.mid { color: #e0a95c; }
.sd-row .mast.low { color: #e88a70; }
.sd-row .mast.dim { color: #5d7a8c; }

/* ============================================================
   知识星树（L2）+ 节点聚焦（L3）
   ============================================================ */

.sm-tree {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow-y: auto;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 10%, rgba(24, 80, 120, 0.4) 0%, rgba(7, 20, 34, 0.98) 60%), #071426;
}
.sm-tree[hidden] { display: none; }

.tree-svg { position: absolute; top: 0; left: 0; pointer-events: none; }
.tree-link {
  fill: none;
  stroke: rgba(90, 210, 245, 0.5);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 4px rgba(90, 210, 245, 0.7));
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: treeLine .7s ease forwards;
}
.tree-link.thin {
  stroke: rgba(90, 190, 225, 0.35);
  stroke-width: 1;
  filter: none;
}
@keyframes treeLine { to { stroke-dashoffset: 0; } }

.tree-title {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #9fc3d6;
  letter-spacing: 2px;
}
.tree-back { position: absolute; left: 12px; top: 10px; z-index: 6; }

.tnode { position: absolute; transform: translate(-50%, -50%); animation: treeIn .55s ease both; cursor: default; }
.tnode.leaf { cursor: pointer; }
@keyframes treeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.tn-star {
  border-radius: 50%;
  margin: 0 auto;
}
.tn-star.root-star {
  width: 74px; height: 74px;
  background: radial-gradient(circle at 38% 34%, #d8f8ff 0%, #46c8ec 40%, #14608c 100%);
  box-shadow: 0 0 26px rgba(80, 210, 245, 0.8), 0 0 60px rgba(60, 180, 220, 0.4), inset 0 0 18px rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.tn-star.root-star span {
  font-size: 13.5px; color: #04202c; font-weight: 500;
  padding: 0 6px; line-height: 1.25;
}
.tn-star.branch-star {
  width: 52px; height: 52px;
  background: radial-gradient(circle at 40% 35%, #bfeffb 0%, #2fa8d0 45%, #0e4a6c 100%);
  box-shadow: 0 0 16px rgba(70, 190, 230, 0.65);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.tn-star.branch-star span {
  font-size: 11.5px; color: #e8fbff; padding: 0 4px; line-height: 1.2;
}
.tn-star.leaf-star {
  width: 15px; height: 15px;
  display: inline-block;
  vertical-align: middle;
}
.leaf-star.lit    { background: #ffd479; box-shadow: 0 0 12px #ffd479; }
.leaf-star.great  { background: #4de8ff; box-shadow: 0 0 10px #4de8ff; }
.leaf-star.ok     { background: #2f9bb8; }
.leaf-star.weak   { background: #c2684f; }
.leaf-star.none   { background: #33506a; }

.tn-label {
  margin-top: 6px;
  font-size: 12.5px;
  color: #c9e2ee;
  text-align: center;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tn-label i { font-style: normal; margin-left: 5px; }
.tn-label i.lit   { color: #ffd479; }
.tn-label i.great { color: #4de8ff; }
.tn-label i.ok    { color: #7dc4dd; }
.tn-label i.weak  { color: #d98b74; }
.tn-label i.none  { color: #5d7a8c; }

/* 聚焦：瞄准框四角 */
.tnode.focused { z-index: 5; }
.tnode.focused::before {
  content: '';
  position: absolute;
  inset: -14px -20px;
  pointer-events: none;
  background:
    linear-gradient(#6ae4ff, #6ae4ff) left 0 top 0 / 16px 2px no-repeat,
    linear-gradient(#6ae4ff, #6ae4ff) left 0 top 0 / 2px 16px no-repeat,
    linear-gradient(#6ae4ff, #6ae4ff) right 0 top 0 / 16px 2px no-repeat,
    linear-gradient(#6ae4ff, #6ae4ff) right 0 top 0 / 2px 16px no-repeat,
    linear-gradient(#6ae4ff, #6ae4ff) left 0 bottom 0 / 16px 2px no-repeat,
    linear-gradient(#6ae4ff, #6ae4ff) left 0 bottom 0 / 2px 16px no-repeat,
    linear-gradient(#6ae4ff, #6ae4ff) right 0 bottom 0 / 16px 2px no-repeat,
    linear-gradient(#6ae4ff, #6ae4ff) right 0 bottom 0 / 2px 16px no-repeat;
  filter: drop-shadow(0 0 6px rgba(90, 220, 255, 0.8));
  animation: focusPulse 1.6s ease-in-out infinite;
}
@keyframes focusPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* 切角全息面板 */
.nd-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.nd-head b { font-size: 14px; color: #eaf7fd; flex: 1; }
.nd-lit { font-style: normal; color: #ffd479; font-size: 12.5px; text-shadow: 0 0 8px rgba(255, 200, 100, 0.6); }
.nd-close { padding: 2px 7px; }
.nd-meter-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.nd-meter-top span { font-size: 12.5px; color: #7fa0b5; }
.nd-meter-top b { font-size: 20px; font-weight: 500; text-shadow: 0 0 10px rgba(56, 200, 240, 0.6); }
.nd-meter-top b.good { color: #58c48e; }
.nd-meter-top b.mid  { color: #e0a95c; }
.nd-meter-top b.low  { color: #e88a70; }
.nd-meta { font-size: 12px; color: #7fa0b5; margin-top: 8px; }
.nd-tip { font-size: 12px; color: #9fc3d6; margin-top: 6px; padding: 5px 8px; border-radius: 5px; background: rgba(20, 60, 90, 0.4); }

/* 树叶子：垂枝名单行 */
.tnode.leafrow {
  display: flex;
  align-items: center;
  gap: 7px;
  transform: translate(-50%, -50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(6, 20, 34, 0.55);
  border: 1px solid rgba(56, 182, 232, 0.18);
  white-space: nowrap;
  transition: background .2s, border-color .2s;
}
.tnode.leafrow:hover {
  background: rgba(16, 52, 82, 0.75);
  border-color: rgba(120, 225, 250, 0.6);
}
.lr-name {
  font-size: 12.5px;
  color: #c9e2ee;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr-pct { font-size: 12px; font-variant-numeric: tabular-nums; }
.lr-pct.lit   { color: #ffd479; }
.lr-pct.great { color: #4de8ff; }
.lr-pct.ok    { color: #7dc4dd; }
.lr-pct.weak  { color: #d98b74; }
.lr-pct.none  { color: #5d7a8c; }
.tnode.leafrow .leaf-star { width: 11px; height: 11px; flex: none; }

.tn-bname {
  margin-top: 7px;
  font-size: 12px;
  color: #bfe3f2;
  text-align: center;
  line-height: 1.3;
  max-width: 110px;
  transform: translateX(0);
}
.tnode.branch { display: flex; flex-direction: column; align-items: center; }

/* ============================================================
   V4：三栏布局（左导航 / 中内容 / 右助手）+ 背景调亮 + 面板更透
   ============================================================ */

/* 底色从近黑调亮一档，能明显看出深蓝 */
html:has(> body.theme-dark) { background: #0d1e33; }
.theme-dark {
  /* --bg / --card 见文件上方的唯一变量入口；这里只留页面底纹 */
  background:
    radial-gradient(ellipse at 50% 0%, rgba(40, 110, 165, 0.4) 0%, rgba(13, 30, 51, 0) 58%),
    linear-gradient(rgba(70, 180, 230, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 180, 230, 0.045) 1px, transparent 1px),
    #0d1e33;
  background-size: 100% 100%, 34px 34px, 34px 34px, auto;
  background-attachment: fixed;
}

/* 面板：透明度调高（0.6/0.72 → 0.35/0.48），毛玻璃感更强 */
.theme-dark .card,
.theme-dark .stat,
.theme-dark .kpi .stat,
.theme-dark .login-box,
.theme-dark .paper-card,
.theme-dark .q-block {
  background: linear-gradient(180deg, rgba(28, 72, 112, 0.35) 0%, rgba(14, 40, 66, 0.48) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 三栏骨架 */
.s-shell { max-width: 1280px; }
.s-layout {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 264px;
  gap: 14px;
  align-items: start;
}

/* 左侧选项卡：竖排 */
.s-nav {
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 14px;
}
.s-nav button {
  width: 100%;
  text-align: center;
  padding: 9px 10px;
}

/* 右侧助手栏 */
.s-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 14px;
}
.bot-card {
  background: linear-gradient(180deg, rgba(28, 72, 112, 0.4) 0%, rgba(14, 40, 66, 0.5) 100%);
  border: 1px solid rgba(56, 182, 232, 0.4);
  border-radius: 10px;
  padding: 12px;
  box-shadow: inset 0 0 20px rgba(56, 182, 232, 0.08), 0 0 14px rgba(56, 182, 232, 0.12);
  backdrop-filter: blur(8px);
}
.bot-head { display: flex; align-items: center; gap: 10px; }
.bot-head b { display: block; font-size: 14px; color: #eaf7fd; }
.bot-head .dim { font-size: 11.5px; }
.bot-avatar { flex: none; animation: botFloat 3.4s ease-in-out infinite; }
@keyframes botFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.bot-msg {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #b9d9ea;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(10, 30, 50, 0.55);
  border: 1px solid rgba(56, 182, 232, 0.22);
}

/* ---------- 修炼助手：可点击换话 + 固定问答（2026-10-30） ---------- */
.bot-card { cursor: pointer; user-select: none; }
.bot-card:active { transform: scale(.995); }

.bot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.bot-chips button {
  font: inherit;
  font-size: 11.5px;
  line-height: 1.4;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  color: #9fd0e6;
  background: rgba(56, 182, 232, 0.10);
  border: 1px solid rgba(56, 182, 232, 0.30);
  transition: background .15s, color .15s, border-color .15s;
}
.bot-chips button:hover,
.bot-chips button:focus-visible {
  background: rgba(56, 182, 232, 0.22);
  border-color: rgba(56, 182, 232, 0.55);
  color: #eaf7fd;
  outline: none;
}
.bot-chips button:active { transform: translateY(1px); }

.bot-hint {
  margin-top: 8px;
  font-size: 11.5px;
  text-align: right;
  color: rgba(159, 208, 230, 0.5);
}

/* 点一下：头像轻轻点个头，气泡弹一下 —— 只播一次，不常驻，免得做题时分心 */
.bot-avatar.tap { animation: botNod .55s ease; }
@keyframes botNod {
  0%   { transform: translateY(0) rotate(0deg); }
  30%  { transform: translateY(-3px) rotate(-7deg); }
  65%  { transform: translateY(0) rotate(5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}
.bot-msg.pop { animation: botPop .3s ease; }
@keyframes botPop {
  0%   { opacity: .3; transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}

.act-card {
  background: linear-gradient(180deg, rgba(28, 72, 112, 0.35) 0%, rgba(14, 40, 66, 0.45) 100%);
  border: 1px solid rgba(56, 182, 232, 0.32);
  border-radius: 10px;
  padding: 12px;
  backdrop-filter: blur(8px);
}
.act-title {
  font-size: 13.5px;
  color: #d8f2fc;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.act-list { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; }
.act-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border-radius: 7px;
  background: rgba(10, 30, 50, 0.45);
  border: 1px solid rgba(56, 182, 232, 0.14);
}
.act-tag {
  font-style: normal;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.act-tag.exam { background: rgba(56, 182, 232, 0.25); color: #7ce4ff; }
.act-tag.prac { background: rgba(255, 200, 100, 0.18); color: #ffd479; }
.act-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.act-name {
  font-size: 12.5px;
  color: #d8f2fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.act-sub { font-size: 11.5px; color: #6d93aa; }
.act-rate { font-size: 13px; color: #7ce4ff; font-variant-numeric: tabular-nums; }
.act-delta { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.act-delta.up   { color: #58c48e; }
.act-delta.down { color: #e88a70; }

/* 星图和树在这些页面占满中间列，右侧栏 sticky 不跟滚 */

/* 左侧导航：卡牌式大按钮（图标上、文字下） */
.s-layout { grid-template-columns: 152px minmax(0, 1fr) 264px; }
.s-nav { gap: 12px; }
.s-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 16px 8px;
  font-size: 14.5px;
  letter-spacing: 1.5px;
  border-radius: 12px;
  line-height: 1;
}
.s-nav button svg {
  opacity: 0.75;
  transition: opacity .2s, transform .2s;
}
.s-nav button:hover svg { opacity: 1; transform: translateY(-1px); }
.s-nav button.on svg { opacity: 1; }
.s-nav button.on {
  box-shadow:
    0 0 20px rgba(56, 182, 232, 0.55),
    inset 0 0 14px rgba(255, 255, 255, 0.22);
}

/* ============================================================
   试炼空间：答题模式（全屏 + 米白纸面，一次一题）
   深色外壳收起来，像翻开一页纸
   ============================================================ */

body.exam-mode {
  --ink: #2c3a42;
  --ink2: #4a5a63;
  --dim: #7c8b93;
  --line: #dfe2d3;
  --line2: #d3d8c6;
  --bg: #f1f2e9;
  --card: #fafbf4;
  --brand: #2b7f9c;
  --brand-l: #e3f2f6;
  --ok: #2f7d54;
  --ok-bg: #e8f5ee;
  --warn: #9a6a15;
  --warn-bg: #fbf2df;
  --bad: #a8412f;
  --bad-bg: #fbeceb;
  background: #f1f2e9 !important;
  background-image: none !important;
}

/* 外壳全部收起 */
body.exam-mode .s-head,
body.exam-mode .s-nav,
body.exam-mode .s-right { display: none !important; }
body.exam-mode .s-layout { display: block; }
body.exam-mode .s-shell { max-width: 880px; padding: 8px 18px 0; }

/* 顶部进度条 */
.exam-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px 12px;
  position: sticky;
  top: 0;
  z-index: 6;
  background: linear-gradient(180deg, rgba(241, 242, 233, 0.98) 60%, rgba(241, 242, 233, 0));
}
.ex-title { font-size: 14.5px; color: #2a3844; font-weight: 500; }
.timer { font-variant-numeric: tabular-nums; color: #2b7f9c; font-weight: 500; }

/* 纸面 */
.exam-paper {
  background: #faf5e8;
  border: 1px solid #e8e1d2;
  border-radius: 14px;
  padding: 20px 24px 26px;
  box-shadow: 0 8px 34px rgba(70, 58, 34, 0.10);
  min-height: 62vh;
}
body.exam-mode .leave-tip {
  background: #fbf6e8;
  border: 1px solid #eadfc4;
  color: #8a6a2a;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* 题目卡片在纸面上：去边框，只用分隔线 */
body.exam-mode .q-block {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 6px 0 0;
  backdrop-filter: none;
}
body.exam-mode .q-block + .q-block { border-top: 1px dashed #e3dccb; margin-top: 18px; }
body.exam-mode .q-block::after { display: none; }
body.exam-mode .q-block::before { display: none; }

/* 选项：纸面风格 */
body.exam-mode .opt {
  background: #fdfaf2;
  border: 1px solid #e3dccb;
  color: #3f4f5b;
}
body.exam-mode .opt:hover { border-color: #b8cfd8; background: #fbfdfd; }
body.exam-mode .opt.on {
  background: #e7f4f8;
  border-color: #2b7f9c;
  box-shadow: 0 0 0 1px rgba(43, 127, 156, 0.35);
  color: #1e4c5e;
}

/* 填空：白纸上的横线框 */
body.exam-mode .blank-fill {
  background: #ffffff;
  border: 1px solid #d8cfba;
  border-bottom: 1.5px solid #9fb4c0;
  color: #2a3844;
}
body.exam-mode .blank-fill:focus {
  border-color: #2b7f9c;
  box-shadow: 0 0 0 2px rgba(43, 127, 156, 0.15);
}

/* 标签 / 按钮 */
body.exam-mode .tag { background: #f1ece0; color: #7d8d97; border-color: #e3dccb; }
body.exam-mode .tag.warn { background: #fdf2df; color: #9a6a15; border-color: #ecd9b6; }
body.exam-mode .mini {
  background: #f0ecdf;
  border: 1px solid #d8cfba;
  color: #5b6b76;
}
body.exam-mode .mini.on { background: #fdeecc; border-color: #e0b95c; color: #8a6212; }
body.exam-mode .btn {
  background: #fafbf4;
  border: 1px solid #d8cfba;
  color: #3f4f5b;
}
body.exam-mode .btn:disabled { opacity: 0.45; }
body.exam-mode .primary,
body.exam-mode .btn.primary {
  background: linear-gradient(180deg, #3d9cbb 0%, #26758f 100%);
  border-color: #26758f;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(38, 117, 143, 0.28);
}

/* 底部操作栏：吸附在底部，像翻页的封底 */
.exam-bar {
  position: sticky;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px 14px;
  margin-top: 10px;
  background: linear-gradient(180deg, rgba(241, 242, 233, 0) 0%, rgba(241, 242, 233, 0.97) 34%);
}
.exam-bar .btn,
.exam-bar .primary { min-width: 118px; padding: 9px 16px; }
.ex-hint { font-size: 13px; color: #7d8d97; }

/* 试炼空间按钮：提高特异性，压过 .theme-dark button.primary */
body.exam-mode .exam-bar button.primary,
body.exam-mode button.primary,
body.exam-mode .btn.primary {
  background: linear-gradient(180deg, #3d9cbb 0%, #26758f 100%) !important;
  border-color: #26758f !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(38, 117, 143, 0.28) !important;
}
body.exam-mode .exam-bar button.btn {
  color: #3f4f5b !important;
  background: #fafbf4 !important;
  border-color: #d8cfba !important;
}
body.exam-mode .exam-bar button.btn:disabled {
  opacity: 0.4 !important;
}

/* 试炼空间：返回按钮（浅色纸面上的小胶囊） */
.ex-back {
  border: 1px solid #d8cfba;
  background: #fafbf4;
  color: #5b6b76;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ex-back:hover {
  background: #f2ede0;
  border-color: #c2b59a;
  color: #2a3844;
}

/* 返回按钮：压过 .theme-dark 的通用按钮样式 */
body.exam-mode .exam-top .ex-back,
body.exam-mode .ex-back {
  background: #fafbf4 !important;
  border: 1px solid #d8cfba !important;
  color: #3f4f5b !important;
  box-shadow: none !important;
}
body.exam-mode .ex-back:hover {
  background: #f2ede0 !important;
  border-color: #c2b59a !important;
  color: #22303a !important;
}

/* ============================================================
   静室：藏书阁练习模式（全屏 + 深青夜 + 青金发光）
   和考场（米白纸 / 蓝色）刻意区分：一个是正式考试，一个是自己修炼
   ============================================================ */

body.practice-mode {
  --ink: #e6f4fb;
  --ink2: #c6dded;
  --dim: #7fa3b8;
  --line: rgba(79, 214, 255, 0.22);
  --line2: rgba(79, 214, 255, 0.36);
  --bg: #0b1620;
  --card: rgba(16, 38, 54, 0.72);
  --brand: #4fd6ff;
  --brand-l: rgba(79, 214, 255, 0.14);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(30, 120, 160, 0.34) 0%, rgba(11, 22, 32, 0) 60%),
    #0b1620 !important;
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(30, 120, 160, 0.34) 0%, rgba(11, 22, 32, 0) 60%),
    linear-gradient(rgba(79, 214, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 214, 255, 0.035) 1px, transparent 1px) !important;
  background-size: 100% 100%, 36px 36px, 36px 36px !important;
}

/* 外壳收起（和考场一样全屏） */
body.practice-mode .s-head,
body.practice-mode .s-nav,
body.practice-mode .s-right { display: none !important; }
body.practice-mode .s-layout { display: block; }
body.practice-mode .s-shell { max-width: 880px; padding: 8px 18px 0; }

/* 顶部 */
body.practice-mode .exam-top {
  /* 用页面**实测**底色 #1a3552（不是 --bg 的 #0d1e33，页面被别的层叠亮了），
       否则顶栏会比页面更黑，看着像独立的一个黑框 */
  background: linear-gradient(180deg, rgba(26, 53, 82, 0.97) 62%, rgba(26, 53, 82, 0));
}

/**
 * 报告页顶栏要跟着皮肤走（2026-11-05 老师截图）。
 * 从「试炼卷宗」点「看报告」进来时是**深色皮肤**，而 .exam-top 默认是浅米色渐变 ——
 * 结果顶部一条浅色、下面深蓝卡片，割裂得很明显。交卷进来的那条路径是浅色，所以没暴露。
 */
.theme-dark .exam-top {
  /* 用页面**实测**底色 #1a3552（不是 --bg 的 #0d1e33，页面被别的层叠亮了），
       否则顶栏会比页面更黑，看着像独立的一个黑框 */
  background: linear-gradient(180deg, rgba(26, 53, 82, 0.97) 62%, rgba(26, 53, 82, 0));
}
.theme-dark .ex-title { color: #d8ecf6; }
.theme-dark .exam-top .dim { color: #9fc2d4; }

/* 浅色皮肤再盖回来 */
.theme-dark.work-light .exam-top {
  background: linear-gradient(180deg, rgba(253, 248, 236, 0.98) 60%, rgba(253, 248, 236, 0));
}
.theme-dark.work-light .ex-title { color: #2a3844; }
.theme-dark.work-light .exam-top .dim { color: #6a6358; }
body.practice-mode .ex-title {
  color: #d8ecf6;
  text-shadow: 0 0 14px rgba(79, 214, 255, 0.45);
  letter-spacing: 1px;
}

/* 静室纸面：玻璃质感的深色修练台 */
body.practice-mode .practice-paper {
  background: linear-gradient(180deg, rgba(20, 48, 68, 0.62) 0%, rgba(12, 28, 40, 0.78) 100%);
  border: 1px solid rgba(79, 214, 255, 0.38);
  border-radius: 14px;
  box-shadow:
    inset 0 0 40px rgba(79, 214, 255, 0.08),
    0 0 26px rgba(38, 140, 180, 0.18);
  backdrop-filter: blur(8px);
  padding: 20px 24px 26px;
  min-height: 62vh;
}

/* 选项 / 填空 / 标签 静室风 */
body.practice-mode .opt {
  background: rgba(18, 44, 62, 0.55);
  border: 1px solid rgba(79, 214, 255, 0.24);
  color: #c6dded;
}
body.practice-mode .opt:hover { border-color: rgba(79, 214, 255, 0.6); background: rgba(26, 60, 84, 0.7); }
body.practice-mode .opt.on {
  background: rgba(28, 96, 128, 0.62);
  border-color: rgba(140, 235, 255, 0.85);
  color: #eafbff;
  box-shadow: 0 0 14px rgba(79, 214, 255, 0.42), inset 0 0 10px rgba(79, 214, 255, 0.16);
}
body.practice-mode .blank-fill,
body.practice-mode .ans-input {
  background: rgba(240, 248, 252, 0.94);
  border-color: rgba(140, 200, 230, 0.55);
  color: #0c2334;
}
body.practice-mode .tag {
  background: rgba(79, 214, 255, 0.12);
  color: #8fd4ea;
  border-color: rgba(79, 214, 255, 0.28);
}
body.practice-mode .tag.warn {
  background: rgba(255, 200, 100, 0.14);
  color: #ffd479;
  border-color: rgba(255, 200, 100, 0.32);
}
body.practice-mode .sub-unit,
body.practice-mode .unit-stem { color: #c6dded; }

/* 返回按钮（静室版：青色胶囊） */
body.practice-mode .ex-back {
  background: rgba(79, 214, 255, 0.1) !important;
  border: 1px solid rgba(79, 214, 255, 0.4) !important;
  color: #9fe4f8 !important;
  box-shadow: none !important;
}
body.practice-mode .ex-back:hover {
  background: rgba(79, 214, 255, 0.2) !important;
  color: #eafbff !important;
}

/* 底部栏 */
body.practice-mode .exam-bar {
  background: linear-gradient(180deg, rgba(11, 22, 32, 0) 0%, rgba(11, 22, 32, 0.97) 34%);
}
body.practice-mode button.primary,
body.practice-mode .btn.primary,
body.practice-mode .exam-bar button.primary {
  background: linear-gradient(180deg, #4fd6ff 0%, #1f8fb8 100%) !important;
  border-color: rgba(160, 240, 255, 0.7) !important;
  color: #03202b !important;
  box-shadow: 0 0 20px rgba(79, 214, 255, 0.45) !important;
}
body.practice-mode .exam-bar button.btn,
body.practice-mode .btn {
  background: rgba(16, 38, 54, 0.7) !important;
  border-color: rgba(79, 214, 255, 0.32) !important;
  color: #c6dded !important;
}
body.practice-mode .hud-bar i,
body.practice-mode .bar i { background: linear-gradient(90deg, #1f8fb8, #4fd6ff); }

/* ============================================================
   沉浸模式字号放大：一屏只有一道题，字可以给足
   ============================================================ */

body.exam-mode .s-shell,
body.practice-mode .s-shell { font-size: 15.5px; }

/* 题目正文 */
body.exam-mode .q-block .unit-stem,
body.exam-mode .q-block .full-stem,
body.practice-mode .unit-stem,
body.practice-mode .q-block .unit-stem {
  font-size: 15.5px;
  line-height: 1.95;
}
body.exam-mode .q-block,
body.practice-mode .practice-paper { font-size: 15.5px; }

/* 题号 / 标签 */
body.exam-mode .q-block .qh .no,
body.practice-mode .q-block .qh .no { font-size: 15px; }
body.exam-mode .q-block .qh .tag,
body.practice-mode .q-block .qh .tag { font-size: 13.5px; }

/* 选项 */
body.exam-mode .opt,
body.practice-mode .opt {
  font-size: 15px;
  padding: 10px 14px;
  line-height: 1.7;
}
body.exam-mode .opt .opt-key,
body.practice-mode .opt .opt-key { font-size: 15px; }

/* 填空 / 输入 */
body.exam-mode .blank-fill,
body.practice-mode .blank-fill,
body.practice-mode .ans-input {
  font-size: 15px;
  padding: 3px 8px;
}
body.practice-mode .ans-input { padding: 8px 10px; }

/* 顶部信息 & 底部按钮 */
body.exam-mode .exam-top,
body.practice-mode .exam-top { font-size: 14.5px; }
body.exam-mode .ex-title,
body.practice-mode .ex-title { font-size: 15px; }
body.exam-mode .exam-bar .btn,
body.exam-mode .exam-bar .primary,
body.practice-mode .exam-bar .btn,
body.practice-mode .exam-bar .primary { font-size: 15px; }

/* 单元小标签、自评标记也放大一点 */
body.exam-mode .tag,
body.practice-mode .tag { font-size: 13.5px; }
body.practice-mode .sub-label { font-size: 14px; }

/* ============================================================
   练习结果页（静室内）：正确率 + 逐题回顾
   ============================================================ */

.pr-head { text-align: center; padding: 6px 0 18px; border-bottom: 1px dashed rgba(79, 214, 255, 0.25); margin-bottom: 14px; }
.pr-big {
  font-size: 46px;
  font-weight: 500;
  line-height: 1.1;
  color: #7ce4ff;
  text-shadow: 0 0 22px rgba(79, 214, 255, 0.55);
  font-variant-numeric: tabular-nums;
}
.pr-big.good { color: #6fe0a8; text-shadow: 0 0 22px rgba(90, 220, 150, 0.5); }
.pr-big.mid  { color: #ffd479; text-shadow: 0 0 22px rgba(255, 200, 100, 0.5); }
.pr-big.low  { color: #ff9b7a; text-shadow: 0 0 22px rgba(255, 130, 100, 0.5); }
.pr-head .dim { margin-top: 6px; font-size: 13.5px; }

.pr-card {
  border: 1px solid rgba(79, 214, 255, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(12, 30, 44, 0.5);
}
.pr-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pr-card-head b { font-size: 15px; color: #e6f4fb; }
.pr-mark {
  font-style: normal;
  font-size: 12.5px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.pr-mark.ok   { color: #6fe0a8; background: rgba(90, 220, 150, 0.12); border-color: rgba(90, 220, 150, 0.35); }
.pr-mark.bad  { color: #ff9b7a; background: rgba(255, 130, 100, 0.12); border-color: rgba(255, 130, 100, 0.35); }
.pr-mark.wait { color: #ffd479; background: rgba(255, 200, 100, 0.1); border-color: rgba(255, 200, 100, 0.3); }

.pr-line {
  display: flex;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  margin-top: 8px;
  background: rgba(8, 22, 34, 0.6);
  border-left: 3px solid transparent;
  font-size: 15px;
}
.pr-line.ok  { border-left-color: #4bbd85; }
.pr-line.bad { border-left-color: #e07a5f; }
.pr-line.self { border-left-color: #d0a05c; flex-direction: column; gap: 6px; }
.pr-flag { font-size: 16px; line-height: 1.4; flex: none; }
.pr-line.ok .pr-flag  { color: #4bbd85; }
.pr-line.bad .pr-flag { color: #e07a5f; }
.pr-body { flex: 1; min-width: 0; }
.pr-your, .pr-answer { line-height: 1.8; color: #b9d9ea; }
.pr-your b, .pr-answer b { color: #eaf7fd; font-weight: 500; }
.pr-answer { color: #8fd4ea; }
.pr-answer b { color: #b8f0ff; }
.pr-line .analysis-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(79, 214, 255, 0.07);
  border: 1px solid rgba(79, 214, 255, 0.16);
  font-size: 14.5px;
  line-height: 1.85;
  color: #c6dded;
}

/* 结果页自评按钮：压过深色通用样式 */
body.practice-mode .pr-line .mini {
  background: rgba(79, 214, 255, 0.14) !important;
  border: 1px solid rgba(79, 214, 255, 0.42) !important;
  color: #a9ecff !important;
  font-size: 13.5px !important;
  padding: 3px 10px !important;
}
body.practice-mode .pr-line .mini:hover {
  background: rgba(79, 214, 255, 0.26) !important;
  color: #eafbff !important;
}
body.practice-mode .pr-line .mini[data-self="1"] {
  border-color: rgba(110, 220, 160, 0.5) !important;
  color: #8ee8b6 !important;
}
body.practice-mode .pr-line .mini[data-self="0"] {
  border-color: rgba(255, 150, 120, 0.5) !important;
  color: #ffb39a !important;
}

/* ============================================================
   题库导入内嵌（iframe 8801）
   ============================================================ */

.imp-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--card, #fff);
  border: 1px solid var(--line, #e3eaf0);
  border-radius: 10px;
}
.imp-bar b { font-size: 15px; color: var(--ink, #12313d); }

.imp-wrap {
  position: relative;
  height: calc(100vh - 205px);
  min-height: 520px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line, #dfe8ee);
  background: #f4f7f9;
  box-shadow: 0 2px 12px rgba(20, 50, 70, 0.06);
}
.imp-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}
/* 全屏：盖住整个窗口，连侧边栏也压住 */
.imp-wrap.full {
  position: fixed;
  inset: 0;
  z-index: 9999;
  height: 100vh;
  min-height: 0;
  border-radius: 0;
  border: 0;
}
.imp-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b8191;
  font-size: 14px;
}

/* ============================================================
   学生端：登录页 + 顶部系统名 + 布局下压（2026-10-26）
   ============================================================ */

/* 登录面板：玻璃质感 + 大字号 */
.theme-dark .login-box {
  width: 420px;
  max-width: 92vw;
  padding: 44px 40px 34px;
  text-align: center;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(30, 78, 120, 0.52) 0%, rgba(12, 36, 58, 0.66) 100%);
  border: 1px solid rgba(56, 182, 232, 0.5);
  box-shadow:
    inset 0 0 44px rgba(56, 182, 232, 0.10),
    0 0 42px rgba(56, 182, 232, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lg-title {
  font-size: 27px;
  line-height: 1.35;
  letter-spacing: 3px;
  color: #eaf7fd;
  margin: 0 0 12px;
  font-weight: 500;
  text-shadow: 0 0 20px rgba(56, 200, 240, 0.75), 0 0 46px rgba(56, 200, 240, 0.32);
}

.lg-welcome {
  font-size: 15px;
  color: #8fd4ea;
  letter-spacing: 2.5px;
  margin: 0 0 30px;
}

.theme-dark .login-box .field { margin-bottom: 14px; }

.theme-dark .login-box .field input {
  font-size: 15.5px;
  padding: 13px 16px;
  border-radius: 10px;
  text-align: left;
}

.theme-dark .login-box button.primary,
.theme-dark #sLogin {
  width: 100%;
  font-size: 16px;
  letter-spacing: 5px;
  padding: 13px 8px;
  border-radius: 10px;
  margin-top: 10px;
  background: linear-gradient(180deg, rgba(80, 205, 245, 0.95), rgba(24, 125, 160, 0.95)) !important;
  border-color: rgba(170, 240, 255, 0.75) !important;
  color: #02121a !important;
  box-shadow: 0 0 22px rgba(56, 182, 232, 0.5) !important;
}

.lg-hint {
  font-size: 13.5px;
  color: #7fa0b5;
  margin: 20px 0 0;
  text-align: center;
  letter-spacing: .5px;
}

/* 顶部：系统名（大字）+ 当前栏目名 */
.s-brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.sys-title {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 2.5px;
  color: #eaf7fd;
  margin: 0;
  white-space: nowrap;
  text-shadow: 0 0 16px rgba(56, 190, 230, 0.55);
}
.page-name {
  font-size: 14px;
  letter-spacing: 1.5px;
  color: #8fd4ea;
  padding-left: 14px;
  border-left: 1px solid rgba(56, 182, 232, 0.35);
  white-space: nowrap;
}

/* 布局整体下压一点，内容区撑高，别显得底下空 */
.theme-dark .s-shell { padding-top: 30px; }
.theme-dark .s-layout { margin-top: 8px; }
body.theme-dark:not(.exam-mode):not(.practice-mode) #view {
  min-height: calc(100vh - 180px);
}

/* 卡牌导航再大一点点（一屏只有四项，空间够） */
.s-nav button { padding: 18px 8px; font-size: 15px; }

/* ============================================================
   学生端布局微调（2026-10-26 二版）
   - 标题再大一点
   - 内容不再强行撑满一屏（内容少时不要显得空旷）
   - 整体往下压一点
   ============================================================ */

/* 登录页：标题/欢迎词再放大，面板加宽 */
.theme-dark .login-box { width: 460px; padding: 52px 44px 40px; }
.lg-title { font-size: 32px; letter-spacing: 4px; margin-bottom: 14px; }
.lg-welcome { font-size: 16px; letter-spacing: 3px; margin-bottom: 34px; }
.theme-dark .login-box .field input { font-size: 16px; padding: 14px 16px; }
.theme-dark #sLogin { font-size: 17px !important; padding: 14px 8px !important; letter-spacing: 6px; }
.lg-hint { font-size: 14px; margin-top: 22px; }

/* 顶部系统名再大一号 */
.sys-title { font-size: 23px; }
.page-name { font-size: 14.5px; }

/* 整体下压 */
.theme-dark .s-shell { padding-top: 42px; }
.theme-dark .s-layout { margin-top: 10px; }

/* 关键：内容区不再强行撑到 100vh —— 内容少的时候别拖出一大片空白 */
body.theme-dark:not(.exam-mode):not(.practice-mode) #view {
  min-height: 0;
}

/* 内容很多时（星图页）仍然要够高 */

/* 右侧栏卡片拉齐、字号略放大 */
.s-right { align-self: stretch; }
.bot-head b { font-size: 14.5px; }
.bot-msg { font-size: 13.5px; line-height: 1.75; }
.act-title { font-size: 14px; }
.act-name { font-size: 13px; }
.act-rate { font-size: 13.5px; }

/* 左侧卡牌文字再大一点点 */
.s-nav button { font-size: 15px; letter-spacing: 2px; }

/* 三栏顶部对齐：中间内容区与左右两栏同一起点，
   不再被「垂直居中」压到屏幕下半部分（用户反馈中间面板整体偏下） */
body.theme-dark:not(.exam-mode):not(.practice-mode) .s-layout {
  min-height: calc(100vh - 230px);
  align-items: start;
}

/* 左栏段位徽章 */
.nav-badge {
  margin-top: 14px;
  padding: 12px 10px;
  border-radius: 10px;
  background: rgba(10, 30, 50, 0.55);
  border: 1px solid rgba(56, 182, 232, 0.32);
  text-align: center;
}
.nav-badge:empty { display: none; }
.nb-tier {
  font-size: 13.5px;
  color: #ffd479;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(255, 200, 100, 0.55);
}
.nb-tier span { margin-right: 3px; }
.nb-lit { font-size: 11.5px; color: #7fa0b5; margin-top: 3px; }
.nb-bar {
  height: 4px;
  margin-top: 6px;
  border-radius: 3px;
  background: rgba(10, 30, 48, 0.9);
  overflow: hidden;
}
.nb-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1a8fb5, #4fd6ff);
  box-shadow: 0 0 6px rgba(79, 214, 255, 0.8);
}

/* 右栏「今日修炼」 */
.today-tip { font-size: 13px; line-height: 1.8; color: #b9d9ea; }
.today-tip b { color: #ffd479; font-weight: 500; }
.today-go {
  display: inline-block;
  margin-top: 6px;
  color: #7ce4ff;
  text-decoration: none;
  font-size: 12.5px;
}
.today-go:hover { color: #d8f2fc; text-decoration: underline; }

/* 内容少时别悬在半空：整体上移，留白集中在下方（读起来更自然） */
body.theme-dark:not(.exam-mode):not(.practice-mode) .s-layout {
  min-height: calc(100vh - 330px);
}

/* toast 里的「撤销」按钮（删完立刻能退回） */
.toast { display: flex !important; align-items: center; gap: 14px; }
.toast .toast-act {
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  font-size: 13.5px;
  padding: 3px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.toast .toast-act:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.7);
}

/* 红点：hidden 属性的 display:none 优先级极低，会被 .fb-dot 的 display 覆盖，
   导致「0 条待处理」时红点还亮着。这里显式压掉。 */
.fb-dot[hidden] { display: none !important; }

/* ============================================================
   星图右侧详情面板（点知识点滑出）
   ============================================================ */
.sm-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 82%;
  padding: 16px 16px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(13, 38, 62, 0.97) 0%, rgba(7, 24, 40, 0.99) 100%);
  border-left: 1px solid rgba(56, 182, 232, 0.38);
  box-shadow: -14px 0 34px rgba(0, 0, 0, 0.38);
  transform: translateX(103%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 8;
}
.sm-panel.on { transform: translateX(0); }

.sm-panel-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(120, 200, 235, 0.4);
  background: rgba(10, 32, 52, 0.8);
  color: #9fd8ee;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}
.sm-panel-x:hover { background: rgba(30, 80, 120, 0.9); color: #eaf7fd; }

.sm-panel-body h3 {
  font-size: 15px;
  line-height: 1.55;
  color: #eaf7fd;
  margin: 0 30px 6px 0;
  font-weight: 500;
}
.sm-meta { font-size: 12.5px; color: #7fa0b5; line-height: 1.6; margin-bottom: 16px; }

.sm-pct { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.sm-pct b {
  font-size: 30px;
  color: #7ce4ff;
  text-shadow: 0 0 18px rgba(80, 210, 250, 0.55);
  font-weight: 500;
}
.sm-pct span { font-size: 12.5px; color: #7fa0b5; }
.sm-bar {
  height: 6px;
  border-radius: 4px;
  background: rgba(8, 26, 42, 0.9);
  overflow: hidden;
  margin-bottom: 18px;
}
.sm-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1a8fb5, #4fd6ff);
  box-shadow: 0 0 8px rgba(79, 214, 255, 0.8);
  transition: width 0.4s ease;
}

.sm-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 16px; }
.sm-rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(10, 32, 52, 0.6);
  border: 1px solid rgba(56, 182, 232, 0.16);
}
.sm-rows span { color: #7fa0b5; }
.sm-rows b { color: #d9f2fb; font-weight: 500; }

.sm-hint {
  font-size: 13px;
  line-height: 1.7;
  color: #b9d9ea;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(30, 70, 105, 0.35);
  border-left: 2px solid rgba(255, 200, 110, 0.7);
  margin-bottom: 14px;
}
.sm-hint.ok { border-left-color: rgba(120, 230, 170, 0.75); }

.sm-panel .sm-go { width: 100%; font-size: 14.5px; padding: 10px; border-radius: 9px; }
.sm-sub { font-size: 12px; color: #6d93aa; line-height: 1.7; margin-top: 10px; }

/* ---------- 成长轨迹：三层知识地图（思维导图） ---------- */

.star-card { padding: 14px 16px 16px; }

.star-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.star-head b { color: var(--ink); font-size: 15px; font-weight: 500; }

.star-foot { margin-top: 10px; font-size: 13px; color: var(--dim); }

.star-crumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 13px; color: var(--dim); margin-bottom: 10px;
}
.star-crumb .sc-link { color: var(--brand); cursor: pointer; }
.star-crumb .sc-link:hover { text-decoration: underline; }
.star-crumb .sc-sep { color: var(--line2); }
.star-crumb .sc-cur { color: var(--ink); }
.star-crumb .sc-back {
  margin-left: auto; cursor: pointer;
  color: var(--brand);
  background: var(--brand-l);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 13.5px;
  line-height: 1.5;
}
.star-crumb .sc-back:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.star-subhead {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.star-subhead b { color: var(--ink); font-size: 15px; font-weight: 500; }

.star-list { display: flex; flex-direction: column; gap: 6px; }

.star-row {
  background: rgba(20, 45, 68, 0.55);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.star-row:hover { border-color: var(--line2); }
.star-row.lit {
  border-color: rgba(242, 193, 78, 0.42);
  background: rgba(38, 40, 44, 0.72);
}

.star-row-main { display: flex; align-items: center; gap: 9px; }
.star-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.star-name { flex: 1; min-width: 0; font-size: 14px; }
.star-status { font-size: 13px; flex: none; }
.star-caret { font-size: 13px; color: var(--dim); flex: none; width: 12px; text-align: right; }

.star-bar {
  margin-top: 7px; height: 3px; border-radius: 2px; overflow: hidden;
  background: rgba(15, 42, 61, 0.9);
}
.star-bar i { display: block; height: 100%; border-radius: 2px; }

/* 知识点讲解（2026-11-06）：星图点开一个知识点，先看讲解，再看统计。
   不铺底色，只用左边框 + 行距区分 —— 深色和护眼浅色两套皮肤下都不会糊成一片。 */
.star-desc {
  margin: 0 0 12px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--brand);
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--ink);
}
.star-desc p { margin: 0 0 8px; }
.star-desc p:last-child { margin-bottom: 0; }
.star-desc b { color: var(--brand); font-weight: 700; }
.star-desc-wait { color: var(--dim); }

.star-detail {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line);
}
.star-detail-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.sd-label { font-size: 12px; color: var(--dim); }
.sd-num {
  font-size: 15px; color: var(--ink); font-weight: 500;
  margin-top: 2px; font-variant-numeric: tabular-nums;
}
.star-detail-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px;
}
.star-detail-foot .dim { flex: 1; min-width: 120px; }
.star-go {
  background: transparent; border: 1px solid var(--line2); color: var(--brand);
  border-radius: 6px; padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.star-go:hover { background: var(--brand-l); }

@media (max-width: 560px) {
  .star-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   2026-10-27 配色调整
   一、整体调淡：底色提亮一档，面板更透
   二、静室（自主练习）改成「淡黄纸面」，和考场的米白纸区分开
   ============================================================ */

/* ---------- 一、整体调淡 ---------- */

html:has(> body.theme-dark) { background: #1a3552; }

.theme-dark {
  --bg: #1a3552;
  --card: rgba(44, 92, 136, 0.26);
  --line: rgba(126, 202, 240, 0.20);
  --line2: rgba(126, 202, 240, 0.34);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(96, 176, 226, 0.26) 0%, rgba(26, 53, 82, 0) 62%),
    linear-gradient(rgba(126, 202, 240, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 202, 240, 0.03) 1px, transparent 1px),
    #1a3552;
  background-size: 100% 100%, 34px 34px, 34px 34px, auto;
  background-attachment: fixed;
}

.theme-dark .card,
.theme-dark .stat,
.theme-dark .kpi .stat,
.theme-dark .login-box,
.theme-dark .paper-card,
.theme-dark .q-block,
.theme-dark .bot-card,
.theme-dark .act-card,
.theme-dark .today-tip {
  background: linear-gradient(180deg, rgba(56, 108, 154, 0.20) 0%, rgba(30, 64, 102, 0.28) 100%);
  border-color: rgba(126, 202, 240, 0.20);
}

/* ---------- 二、静室：淡黄纸面 ---------- */

body.practice-mode {
  --ink: #3f3726;
  --ink2: #5f5440;
  --dim: #948868;
  --line: #ecdfc2;
  --line2: #e0cfa6;
  --bg: #f8f1de;
  --card: #fdf9ee;
  --brand: #a8761a;
  --brand-l: #fbf0d2;
  --ok: #3f7d4a;
  --ok-bg: #eef7ea;
  --warn: #9a6a15;
  --warn-bg: #fbf2df;
  --bad: #a8412f;
  --bad-bg: #fbeceb;
  background: #f8f1de !important;
  background-image: none !important;
}

body.practice-mode .exam-top {
  background: linear-gradient(180deg, rgba(248, 241, 222, 0.98) 62%, rgba(248, 241, 222, 0));
}
body.practice-mode .ex-title { color: #554a33; text-shadow: none; letter-spacing: 0; }
body.practice-mode .ex-hint,
body.practice-mode .dim { color: #8d8163; }

body.practice-mode .practice-paper {
  background: #fbf6e9;
  border: 1px solid #ecdfc2;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(120, 95, 40, 0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 20px 24px 26px;
  min-height: 62vh;
}

body.practice-mode .opt {
  background: #fdfaf0;
  border: 1px solid #e4d7b6;
  color: #554a33;
}
body.practice-mode .opt:hover { border-color: #cdb98d; background: #faf5e8; }
body.practice-mode .opt.on {
  background: #fbf0d2;
  border-color: #a8761a;
  color: #6b4a08;
  box-shadow: none;
}

body.practice-mode .blank-fill,
body.practice-mode .ans-input {
  background: #ffffff;
  border-color: #dcc9a0;
  color: #2f2a1c;
}
body.practice-mode .blank-fill:focus,
body.practice-mode .ans-input:focus {
  border-color: #a8761a;
  box-shadow: 0 0 0 2px rgba(168, 118, 26, 0.16);
}

body.practice-mode .tag {
  background: #f6efdc;
  color: #7a6a42;
  border-color: #e4d7b6;
}
body.practice-mode .tag.warn {
  background: #fbf0d2;
  color: #9a6a15;
  border-color: #e6cf9a;
}

body.practice-mode .sub-unit,
body.practice-mode .unit-stem { color: #554a33; }

body.practice-mode .ex-back {
  background: #fbf0d2 !important;
  border: 1px solid #e0cfa6 !important;
  color: #8a6410 !important;
  box-shadow: none !important;
}
body.practice-mode .ex-back:hover { background: #f6e7bd !important; color: #6b4a08 !important; }

body.practice-mode .exam-bar {
  background: linear-gradient(180deg, rgba(248, 241, 222, 0) 0%, rgba(248, 241, 222, 0.98) 34%);
}
body.practice-mode button.primary,
body.practice-mode .btn.primary,
body.practice-mode .exam-bar button.primary {
  background: #a8761a !important;
  border-color: #8a6410 !important;
  color: #fbf6e9 !important;
  box-shadow: none !important;
}
body.practice-mode .exam-bar button.btn,
body.practice-mode .btn {
  background: #fbf6e9 !important;
  border-color: #e0cfa6 !important;
  color: #554a33 !important;
}
body.practice-mode .hud-bar i,
body.practice-mode .bar i { background: #a8761a; }

body.practice-mode .practice-reveal { border-color: #ecdfc2; }
body.practice-mode .sub-unit + .sub-unit { border-color: #ecdfc2; }

/* 静室里的化学式工具：白底面板，样式交给 formula-tool.css 自己管。
   （以前这里想把按钮改成琥珀色，但那条通用深色按钮规则
     `.theme-dark button:not(...):not(...)…` 带 6 个 :not()，每个都算一份权重，
     实际是 (0,7,1)，普通选择器压不过 —— 之前那版没生效就栽在这。
     这里用 !important 定向还原，只作用于 .ft-card 内部，不碰别的地方。） */
.theme-dark .ft-card button,
.theme-dark .ft-card .ft-tab,
.theme-dark .ft-card .ft-btn,
.theme-dark .ft-card .ft-ghost {
  background: #fff !important;
  border-color: #D5DFE6 !important;
  color: #46586a !important;
}
.theme-dark .ft-card .ft-tab { background: #FBFDFE !important; }
.theme-dark .ft-card .ft-tab.is-active {
  background: #fff !important;
  color: #1C6E85 !important;
  border-color: #D5DFE6 !important;
  border-bottom-color: #fff !important;
}
.theme-dark .ft-card .ft-ok { background: #1C6E85 !important; border-color: #1C6E85 !important; color: #fff !important; }
.theme-dark .ft-card .ft-script.is-on { background: #1C6E85 !important; border-color: #1C6E85 !important; color: #fff !important; }
.theme-dark .ft-card .ft-btn:hover,
.theme-dark .ft-card .ft-ghost:hover { border-color: #1C6E85 !important; color: #1C6E85 !important; background: #F1F8FA !important; }
.theme-dark .ft-card input,
.theme-dark .ft-card textarea,
.theme-dark .ft-card select {
  background: #fff !important;
  color: #22313c !important;
  border-color: #D5DFE6 !important;
}
.theme-dark .ft-card .ft-head { background: #1C6E85 !important; color: #fff !important; }
.theme-dark .ft-card .ft-target { color: rgba(255, 255, 255, 0.72) !important; }

/* 段位卡放到右栏最下方（贴住整栏底部，避开右下角悬浮的化学式工具） */
.s-right .nav-badge { margin-top: auto; }

/* 让右栏撑满整栏高度，段位卡才能真的沉到底部（不再和右下角悬浮按钮重叠） */
body.theme-dark:not(.exam-mode):not(.practice-mode) .s-right { align-self: stretch; }

/* ============================================================
   学生端首页（2026-10-29）
   默认进入的仪表盘：段位 + 近期记录 + 今日修炼 + 快捷入口。
   首页把右栏的「近期记录 / 今日修炼 / 段位」收进主区，右栏本身隐藏，
   让主内容占满（导航 152 + 内容），不再右侧留一大块空。
   ============================================================ */
body.home-mode .s-right { display: none; }
body.home-mode .s-layout { grid-template-columns: 152px minmax(0, 1fr); }

.home { display: flex; flex-direction: column; gap: 16px; }
.home-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; }
.hh-hi { font-size: 22px; font-weight: 600; color: var(--ink); }
.hh-sub { font-size: 14px; margin-top: 6px; }
.hh-tier { text-align: right; min-width: 200px; }
.ht-tier { font-size: 18px; color: #ffd479; letter-spacing: 1px; text-shadow: 0 0 10px rgba(255, 200, 100, .55); }
.ht-tier .ht-star { margin-right: 4px; }
.ht-lit { font-size: 12px; color: #7fa0b5; margin-top: 4px; }
.ht-bar { height: 5px; margin-top: 7px; border-radius: 3px; background: rgba(10, 30, 48, .9); overflow: hidden; }
.ht-bar i { display: block; height: 100%; background: linear-gradient(90deg, #1a8fb5, #4fd6ff); box-shadow: 0 0 6px rgba(79, 214, 255, .8); }
.ht-go { display: inline-block; margin-top: 8px; color: #7ce4ff; text-decoration: none; font-size: 13px; }

.home-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hq {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  padding: 16px; border-radius: 12px; text-align: left;
  background: rgba(16, 38, 54, .6); border: 1px solid rgba(79, 214, 255, .22);
  color: var(--ink); cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.hq:hover { transform: translateY(-2px); border-color: rgba(79, 214, 255, .5); background: rgba(20, 48, 68, .7); }
.hq b { font-size: 15px; }
.hq small { font-size: 12.5px; color: #7fa3b8; }

.home-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.home-act .act-list { max-height: none; }
.home-today .today-tip { font-size: 13.5px; line-height: 1.85; color: #b9d9ea; }
.home-today .today-tip b { color: #ffd479; font-weight: 500; }
.home-today .today-go { display: inline-block; margin-top: 6px; color: #7ce4ff; text-decoration: none; font-size: 12.5px; }

/* 错题本：默认折叠，只露摘要行，点开看详情 */
.wb-list { display: flex; flex-direction: column; gap: 8px; }
.wb-item {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--card);
}
.wb-item[open] { border-color: rgba(79, 214, 255, .4); }
.wb-sum {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  cursor: pointer; list-style: none; user-select: none;
}
.wb-sum::-webkit-details-marker { display: none; }
.wb-sum:hover { background: rgba(79, 214, 255, .06); }
.wb-no { font-weight: 600; color: var(--ink); flex: none; }
.wb-label { color: var(--ink2); font-size: 14px; }
.wb-meta { font-size: 12px; }
.wb-chev { flex: none; color: #7fa3b8; transition: transform .2s; font-size: 16px; }
.wb-item[open] .wb-chev { transform: rotate(90deg); }
.wb-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }

/* ============================================================
   手机端布局（2026-10-28）

   为什么单开一段：原来的三栏（导航 152 + 内容 + 助手 264）在手机上
   留给题目的宽度不到 30px，字全被挤成竖排。这里改成
   单栏 + 底部固定导航，助手栏挪到内容下面。

   所有规则都在 760px 断点里 —— 桌面端一行都没改。
   ============================================================ */

@media (max-width: 760px) {
  /* ---------- ① 外壳：收边，给底部导航让出空间 ---------- */
  .s-shell {
    max-width: none;
    padding: 8px 12px calc(74px + env(safe-area-inset-bottom, 0px));
  }
  .s-head { margin-bottom: 10px; gap: 8px; flex-wrap: nowrap; }
  /* 手机上「化学大师修炼系统」这行太占地方，只留当前页面名 */
  .s-head h1 { display: none; }
  .s-head .page-name { font-size: 16px; font-weight: 600; }
  .s-head #sWho {
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
  }
  .s-head #sLogout { font-size: 13px; flex: none; }

  /* ---------- ② 三栏 → 单栏 ---------- */
  .s-layout { display: block; }

  /* ---------- ③ 竖排导航 → 底部固定横排 ---------- */
  .s-nav {
    position: fixed;
    /* 原来的规则是 sticky + top:14px，不显式清掉 top 的话
       固定定位会贴着顶部而不是底部（实测踩过） */
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    display: flex;
    flex-direction: row;
    gap: 2px;
    margin: 0;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    border-top: 1px solid rgba(126, 202, 240, 0.22);
    background: rgba(18, 42, 66, 0.97);
    backdrop-filter: blur(14px);
    box-shadow: 0 -6px 22px rgba(0, 0, 0, 0.22);
  }
  .s-nav button {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    padding: 7px 2px 8px;
    font-size: 12px;
    letter-spacing: 0;
    line-height: 1.2;
    border: none;
    border-radius: 9px;
    background: transparent;
    box-shadow: none !important;
  }
  .s-nav button span { white-space: nowrap; }
  .s-nav button svg { width: 21px; height: 21px; opacity: 0.8; }
  .s-nav button.on svg { opacity: 1; }
  .s-nav button.on { background: rgba(56, 182, 232, 0.16); }

  /* ---------- ④ 助手栏：不再悬浮，挪到内容下面 ---------- */
  .s-right {
    position: static;
    margin-top: 14px;
    gap: 10px;
    align-self: auto;
  }
  .s-right .nav-badge { position: static; margin-top: 0; }

  /* ---------- ⑤ 卡片与文字 ---------- */
  .card { padding: 12px; border-radius: 10px; }
  .q-block { padding: 12px; }
  .stats { gap: 8px; }
  .stat { min-width: 0; flex: 1 1 calc(50% - 8px); padding: 9px 10px; }
  .stat b { font-size: 17px; }
  .stat span { font-size: 12px; }

  /* 表格：在窄屏里横向滚，别硬压成一团 */
  .grid { font-size: 13px; }
  .grid th, .grid td { padding: 6px 7px; }

  /* ---------- ⑥ 手指友好的控件 ---------- */
  /* 16px 以上 iOS 才不会在聚焦时自动放大页面 */
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input:not([type]),
  select,
  textarea,
  .blank-fill,
  .ans-input { font-size: 16px !important; }

  button, .btn, .primary { min-height: 40px; }
  .mini { min-height: 32px; }

  /* 填空输入框：手机上给足宽度，别一个字就换行 */
  .blank-fill { min-width: 110px; max-width: 100%; }

  /* 题里的图：宽度不超过屏幕，点开可以看大图（JS 里绑了） */
  .stem-img, .eq-img { max-width: 100%; }
  .stem-img { height: auto; }

  /* ---------- ⑦ 答题 / 练习：底部操作条贴底 ---------- */
  body.exam-mode .exam-bar,
  body.practice-mode .exam-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    margin: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    background: rgba(255, 253, 247, 0.97);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e8e1d2;
  }
  body.exam-mode .exam-bar .btn,
  body.exam-mode .exam-bar .primary,
  body.practice-mode .exam-bar .btn,
  body.practice-mode .exam-bar .primary {
    min-width: 0;
    flex: 1 1 0;
    padding: 11px 6px;
    font-size: 15px;
  }
  body.exam-mode .exam-bar .ex-hint,
  body.practice-mode .exam-bar .ex-hint { display: none; }

  /* 给固定底栏留出空白，最后一道题不被挡住 */
  body.exam-mode .exam-paper,
  body.practice-mode .exam-paper { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

  /* 顶栏在手机上压扁一点 */
  body.exam-mode .exam-top,
  body.practice-mode .exam-top { padding: 8px 4px 10px; gap: 8px; }
  .exam-top .ex-title { font-size: 13.5px; }
  .exam-top .ex-back { padding: 6px 10px; font-size: 13.5px; }

  /* 题面小一号，行距保留（化学式上下标挤在一起会看不清） */
  .full-stem, .unit-stem { font-size: 15px; line-height: 2.05; }
  /* 表格字号见 /stem.css 的窄屏规则 */

  /* 首页：移动端单栏，快捷入口两列，hero 竖排 */
  body.home-mode .s-layout { display: block; }
  .home-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hh-tier { text-align: left; min-width: 0; }
  .home-quick { grid-template-columns: repeat(2, 1fr); }
  .home-cols { grid-template-columns: 1fr; }
}

/* ============================================================
   手机端化学式工具（2026-10-28 第二次调整）

   第一版把它固定在底部，结果软键盘一弹，面板和键盘上下一起挤，
   题目完全看不见。改成：
     · 展开时**贴顶部**（键盘永远在底部，两者不抢）
     · 面板内部可滚动（原来 touch-action:none 把它锁死了）
     · 输入框和按钮放大，手指点得准
   ============================================================ */
@media (max-width: 760px) {
  .ft-card:not(.is-collapsed) {
    /* 位置一律交给 JS（formula-tool.js 的 applyPos）——
       这里只要不写 !important 的 left/top，拖动才有效。
       第一版图省事写死了 top:0 !important，结果面板完全拖不动。 */
    width: min(340px, calc(100vw - 20px));
    /* vh 是布局视口，键盘弹出后不会变小 → 再用 dvh 兜一层（新版安卓/iOS 支持）。
       dvh 生效时按真实可视高度算，键盘一弹面板自动变矮，不会顶到键盘里。 */
    max-height: 56vh;
    max-height: 62dvh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    /* 千万不要写成 auto —— 浏览器会把触摸当成滚动手势，
       pointermove 被 pointercancel 掉，卡片就拖不动了（踩过两次） */
    touch-action: none;
    box-shadow: 0 10px 28px rgba(20, 60, 80, 0.28);
  }

  /* 面板内部是可以滚的，单独放开纵向手势 */
  .ft-body, .ft-tools { touch-action: pan-y; }

  /* ---------- 收起状态：一个圆形小球 ----------
     原来是横着一条「化学式工具 答案框」，占地方又不好拖。
     缩成 56px 的球，停在旁边，点一下才展开。 */
  .ft-card.is-collapsed {
    width: 56px !important;
    height: 56px;
    min-height: 56px;
    max-width: none;
    border-radius: 50%;
    overflow: hidden;
    touch-action: none;
    box-shadow: 0 6px 20px rgba(8, 36, 56, 0.38);
  }
  .ft-card.is-collapsed .ft-head {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #3ab0cf 0%, #1c6e85 100%);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
  }
  .ft-card.is-collapsed .ft-title,
  .ft-card.is-collapsed .ft-target,
  .ft-card.is-collapsed .ft-chevron { display: none; }
  .ft-card.is-collapsed .ft-head::after {
    content: '化';
    font-size: 23px;
    font-weight: 600;
    color: #fff;
    line-height: 1;
  }

  /* ---- 内部：把纵向空间省给输入框 ---- */
  /* 高度交给 flex 分配：tabs / tools / foot 固定，输入区伸缩 */
  .ft-content {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }
  .ft-head { padding: 8px 14px; flex: none; }
  .ft-title { font-size: 15px; }
  .ft-target { font-size: 12px; }

  .ft-tabs { padding: 4px 10px 0; gap: 5px; flex: none; }
  .ft-tab { padding: 5px 0; font-size: 13.5px; border-radius: 7px 7px 0 0; }

  /* 输入区：给足高度，内部可以滚，绝不压扁 */
  .ft-body {
    flex: 1 1 auto;
    min-height: 64px;
    padding: 7px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ft-eq { gap: 6px; flex: none; }
  .ft-zone .tok {
    min-height: 50px;
    height: 50px;
    font-size: 16.5px;
  }
  /* 手机上面板本来就窄，提示文字最占地方，去掉 */
  .ft-tip { display: none; }

  .ft-tools {
    gap: 5px;
    padding: 5px 10px;
    flex: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ft-btn {
    padding: 5px 9px;
    font-size: 14px;
    min-height: 32px;
    border-radius: 8px;
    flex: none;
  }
  .ft-symbol { width: 36px; padding: 8px 0; font-size: 15px; flex: none; }

  .ft-foot { padding: 5px 10px 7px; gap: 8px; flex: none; }
  .ft-ok, .ft-ghost {
    padding: 6px 14px;
    font-size: 14.5px;
    min-height: 34px;
    border-radius: 9px;
  }
  .ft-ok { flex: 1; }
  .ft-ghost { flex: none; }
}

/* ============================================================
   软键盘弹出时收起底部导航（2026-10-28）

   不收的话，屏幕上从上到下是：化学式面板 → 页面内容 → 底部导航 → 键盘，
   四层控件把题目挤得一点不剩。body.kb-open 由 student.js 用
   visualViewport 判断（可视高度比窗口矮 160px 以上就算键盘弹了）。
   ============================================================ */
body.kb-open .s-nav { display: none; }
body.kb-open .s-shell { padding-bottom: 10px; }
body.kb-open .s-right { display: none; }

/* ============================================================
   薄弱知识点（首页「需要补的地方」+ 报告页「错题集中在哪」）
   2026-10-30 加。

   首页是深色底，报告页是浅色底，所以两处分开写，不共用一套颜色。
   ============================================================ */

.home-weak { margin-bottom: 14px; }

.home-weak .weak-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.home-weak .weak-more { font-size: 12px; color: #7ce4ff; }

.home-weak .weak-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(10, 30, 50, 0.45);
  border: 1px solid rgba(56, 182, 232, 0.14);
  margin-bottom: 6px;
}
.home-weak .weak-row:last-child { margin-bottom: 0; }

.home-weak .weak-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-weak .weak-name {
  font-size: 13.5px;
  color: #d8f2fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-weak .weak-sub { font-size: 11.5px; color: #6d93aa; }
.home-weak .weak-count {
  flex: none;
  font-size: 12.5px;
  color: #e88a70;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.home-weak .weak-go {
  flex: none;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(56, 182, 232, 0.35);
  background: rgba(56, 182, 232, 0.12);
  color: #7ce4ff;
  font-size: 12.5px;
}
.home-weak .weak-empty {
  font-size: 13px;
  color: #b9d9ea;
  line-height: 1.8;
  padding: 2px 0;
}
.home-weak .weak-foot { margin-top: 9px; }
.home-weak .today-go { color: #7ce4ff; font-size: 12.5px; }

/* ---------- 报告页（浅色） ---------- */

.weak-report { margin-bottom: 14px; }
.weak-report .weak-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.weak-report .act-title { color: var(--ink); font-size: 14px; letter-spacing: 0; }
.weak-report .weak-more { font-size: 12.5px; color: var(--dim); }

.weak-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.weak-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 16px;
  border: 1px solid var(--line2);
  background: var(--brand-l);
  color: var(--brand);
  font-size: 13px;
}
.weak-chip b {
  font-weight: 500;
  font-size: 12px;
  background: #fff;
  border-radius: 9px;
  padding: 0 6px;
  color: var(--bad);
}
.weak-chip:disabled { opacity: 0.5; cursor: default; }

/* ============================================================
   藏书阁「出题范围」多选
   2026-10-30 加：原来是一个下拉只能选一个单元，改成复选框多选。
   ============================================================ */

.unit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.unit-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fbfdfe;
}

.unit-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px;
}
.unit-row:hover { background: var(--brand-l); }
.unit-row input {
  flex: none;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}
.unit-row .unit-name { flex: 1; min-width: 0; color: var(--ink2); }
.unit-row .unit-count { font-size: 12px; color: var(--dim); white-space: nowrap; }
.unit-row.is-locked { opacity: 0.45; cursor: not-allowed; }
.unit-row.is-locked:hover { background: none; }

.unit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.unit-actions .dim { font-size: 12.5px; }

/* ---------- 出题范围：学生端深色主题适配 ----------
   2026-10-30 补。
   这个组件只在学生端（body.theme-dark）用，但我一开始按浅色写了：
   列表底色是 #fbfdfe，在深色页面上白得像块补丁。
   「全选 / 清空」用的 .mini 也没被深色主题覆盖（主题里只覆盖了 .btn）。
   这里统一改成和首页卡片一致的半透明深蓝。
   ------------------------------------------------------ */

.theme-dark .unit-pick {
  background: rgba(10, 30, 50, 0.45);
  border-color: var(--line);
}

.theme-dark .unit-row .unit-name { color: var(--ink2); }
.theme-dark .unit-row .unit-count { color: var(--dim); }
.theme-dark .unit-row:hover { background: var(--brand-l); }
.theme-dark .unit-row.is-locked { opacity: 0.38; }
.theme-dark .unit-row input { accent-color: var(--brand); }

.theme-dark .unit-actions .mini {
  background: #16304e;
  border-color: var(--line2);
  color: var(--ink2);
}
.theme-dark .unit-actions .mini:hover { background: #1b3c62; }

/* 「开始练习」用强调色，跟深色主题里其它主按钮一致 */
.theme-dark #pStart {
  background: var(--brand);
  border-color: var(--brand);
  color: #08141a;
}
.theme-dark #pStart:hover { background: #5aaccb; }

/* ---------- 报告页「错题集中在这些知识点」：深色适配 ----------
   2026-10-30 补。
   知识点胶囊用的是 var(--brand-l)/var(--brand)，深色下本来就对；
   但角标里的数字我写了 background:#fff，深色页面上是个白点，太扎眼。
   改成暗红底 + 橙红字，跟 --bad/--bad-bg 一套。
   ------------------------------------------------------------ */

.theme-dark .weak-chip {
  background: var(--brand-l);
  border-color: var(--line2);
  color: var(--brand);
}
.theme-dark .weak-chip b {
  background: var(--bad-bg);
  color: var(--bad);
}
.theme-dark .weak-report .weak-more { color: var(--dim); }

/* ============================================================
   答题页题号导航条
   2026-10-31 加。用户反馈：交卷时提示「还有 1 道题没答完」，
   但 40 道题一题一页，翻遍全卷也找不到是哪一道。
   这里给一排题号，已答/未答/当前/标记一眼看清，点一下跳过去。
   ============================================================ */

.q-nav {
  display: flex;
  gap: 6px;
  padding: 2px 2px 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.q-nav::-webkit-scrollbar { height: 4px; }
.q-nav::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 2px; }
.q-nav::-webkit-scrollbar-track { background: transparent; }

.qn {
  position: relative;
  flex: none;
  min-width: 32px;
  height: 30px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid rgba(56, 182, 232, 0.22);
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

/* 已答：明显的蓝底 + 亮蓝字，跟没答的灰框拉开距离 */
.qn.done {
  background: var(--brand);
  border-color: var(--brand);
  color: #06202e;
}

/* 当前题：外面套一圈白环，深色底上最显眼；底色保留「答没答」的信息 */
.qn.on {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(56, 182, 232, 0.55);
  font-weight: 500;
}

/* 标记过：右上角一个小橙点 */
.qn.flag::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warn);
}

/* ============================================================
   组卷页「未审题」提示条（2026-10-31）
   组卷列表默认只给已审的题。老师刚导完卷、还没审就想组卷时，
   看到的是「这个范围里没有题」—— 不说原因会以为题丢了。
   ============================================================ */

.pending-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 7px;
  background: #fff8e6;
  border: 1px solid #f0d9a8;
  color: #8a5a00;
  font-size: 13.5px;
}

.pending-bar b {
  color: #b45309;
  font-variant-numeric: tabular-nums;
}

/* 已经在「显示待审」状态：换成偏冷的底，跟默认状态区分开 */
.pending-bar.is-on {
  background: #eef6ff;
  border-color: #c5dcf5;
  color: #1f4e79;
}

.pending-bar.is-on b { color: #0b6bcb; }

.pending-bar .mini {
  background: #fff;
  border-color: currentColor;
  color: inherit;
  font-size: 12.5px;
}

/* 未审的那一行：左侧加一道橙边 + 淡黄底，跟已审的题一眼分开 */
.qitem.is-pending {
  background: #fffdf6;
  box-shadow: inset 3px 0 0 #f0b429;
}
.qitem.is-pending:hover { background: #fff8e6; }

/* ============================================================
   回收站（2026-10-31）
   以前删除题目只有一个「撤销（N）」按钮：写着 N 道，实际只回最后一批，
   还会把更早的批次静默永久删掉。现在改成列表：逐条恢复 / 逐条彻底删除。
   ============================================================ */

.rb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
}

.rb-row {
  display: grid;
  grid-template-columns: 62px 1fr 168px 64px 84px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.rb-row:hover { background: #f4f8fb; border-color: var(--line2); }

.rb-no {
  font-size: 13.5px;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rb-stem {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rb-meta {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.5;
  overflow: hidden;
}

/* 来源名单独一行并省略 —— 不截的话长的卷名会折成两行，把整行撑高、各行不齐 */
.rb-meta .rb-src {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rb-row .mini { width: 100%; }
.rb-row .mini.danger { color: var(--bad); border-color: #e6b8b8; }
.rb-row .mini.danger:hover { background: #fdf1f1; }

/* 窄屏（平板/手机看教师端）改成两行 */
@media (max-width: 760px) {
  .rb-row {
    grid-template-columns: 56px 1fr 64px 84px;
    row-gap: 4px;
  }
  .rb-meta { grid-column: 2 / 5; }
}

/* ============================================================
   一键组卷弹窗（2026-10-31）
   范围用 .unit-pick / .unit-row（和藏书阁同一套），这里只补布局。
   ============================================================ */

.ac-sec { margin-bottom: 16px; }
.ac-sec:last-child { margin-bottom: 0; }

.ac-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ac-label {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}

.ac-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink2);
}

.ac-row label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ac-row input[type="number"] { text-align: center; }

/* ============================================================
   试卷审核窗口（2026-10-31）
   组完卷不保存也能看整卷：难度分布、超纲提示、逐题上移/下移/替换/删。
   ============================================================ */

.rv-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin-bottom: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--ink2);
}
.rv-bar b { color: var(--ink); font-variant-numeric: tabular-nums; }

.rv-tag {
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12.5px;
  border: 1px solid transparent;
}
.rv-tag.easy { background: #EAF3DE; color: #3B6D11; border-color: #C0DD97; }
.rv-tag.mid { background: #FAEEDA; color: #854F0B; border-color: #FAC775; }
.rv-tag.hard { background: #FCEBEB; color: #A32D2D; border-color: #F7C1C1; }
.rv-tag.unk { background: #F1EFE8; color: #5F5E5A; border-color: #D3D1C7; }
.rv-tag.warn { background: #FCEBEB; color: #A32D2D; border-color: #E24B4A; }

/* 题号条：拖这里换顺序（2026-10-31 二次改，原来拖整道题太麻烦） */
.rv-nav-wrap { margin-bottom: 10px; }

.rv-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
  max-height: 128px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
}

.rvn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  border: 1px solid var(--line2);
  border-radius: 7px;
  background: #fff;
  color: var(--ink2);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.rvn:hover { border-color: var(--brand); color: var(--brand); }
.rvn:active { cursor: grabbing; }
.rvn.dragging { opacity: 0.35; cursor: grabbing; }

/* 超纲题：右上角小红点，跟下面列表的红底呼应 */
.rvn.is-warn::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #E24B4A;
}

/* 落点：被指向的格子左/右画一条竖线，表示「插到这里」 */
.rvn.drop-before::before,
.rvn.drop-after::after {
  content: '';
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 3px;
  border-radius: 2px;
  background: var(--brand);
}
.rvn.drop-before::before { left: -5px; }
.rvn.drop-after::after { right: -5px; }

.rv-nav-tip {
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--dim);
}

.rv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
}

.rv-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.rv-item.is-warn { background: #FCEBEB; border-color: #E24B4A; }

/* 从题号条跳过来时闪一下边，让人看清是哪道 */
.rv-item.is-flash {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-l);
}

.rv-no {
  flex: none;
  width: 26px;
  font-size: 14px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  user-select: none;
  -webkit-user-select: none;
}

.rv-main { flex: 1; min-width: 0; }

.rv-stem {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
}
.rv-stem p { margin: 0 0 4px; }
/* 公式图（.eq-img）是文字的一部分，尺寸必须跟着字号走，不能像插图那样撑开一行。
   这里必须排除 .eq-img：`.rv-stem img` 的特异性比 `.eq-img` 高，
   不排除就会把 height:1.18em 冲掉，公式按原图像素显示（352×144 那种），
   审核窗口里一道题占大半屏 —— 2026-10-31 用户反馈「预览和试做显示不一样」就是它。 */
.rv-stem img:not(.eq-img) { max-width: 100%; height: auto; }

.rv-opts {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--ink2);
}
.rv-opts img:not(.eq-img) { max-width: 100%; height: auto; }

.rv-meta {
  margin-top: 7px;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.5;
}
.rv-warn-text { color: #A32D2D; }

.rv-ops {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 118px;
  align-content: start;
}
.rv-ops .mini { width: 100%; font-size: 12.5px; }

/* ---------- 替换候选 ---------- */

.rp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: 4px;
}

.rp-row {
  display: grid;
  grid-template-columns: 64px 1fr 200px 94px;
  align-items: start;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  cursor: pointer;
}
.rp-row:hover { background: #f4f8fb; border-color: var(--line2); }
.rp-row.is-open { background: #fff; border-color: var(--brand); }

.rp-no {
  font-size: 13.5px;
  color: var(--ink2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.rp-main { min-width: 0; }

.rp-stem {
  font-size: 13.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 展开后摘要整行隐藏 —— 摘要里已经带着选项文字，不隐藏会和下面的详情重复 */
.rp-row.is-open .rp-stem { display: none; }
.rp-row.is-open .rp-detail { margin-top: 0; padding-top: 0; border-top: none; }

.rp-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line2);
}
.rp-full {
  /* 2026-11-04：字号/行高跟学生答题页、导入台预览对齐，三端看起来一样 */
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink);
}
.rp-full p { margin: 0 0 4px; }
.rp-full img:not(.eq-img) { max-width: 100%; height: auto; }
.rp-opts {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--ink2);
}
.rp-opts img:not(.eq-img) { max-width: 100%; height: auto; }

.rp-meta { font-size: 12px; color: var(--dim); line-height: 1.5; padding-top: 2px; }
.rp-row .mini { width: 100%; }

/* ---------- 器材柜（修炼系统，2026-11-01） ---------- */

.lab-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.lab-top .stat { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.lab-top .stat b { font-size: 19px; color: var(--ink); display: block; }
.lab-top .stat span { font-size: 12.5px; color: var(--dim); }

.lab-h { font-size: 14.5px; color: var(--dim); margin: 20px 0 10px; letter-spacing: 1px; }
.lab-due { background: var(--warn-bg, #fdf2f2); color: #b4552a; border: 1px solid #f0c8ac;
           border-radius: 8px; padding: 7px 12px; font-size: 13.5px; margin-bottom: 10px; }
.lab-empty { color: var(--dim); font-size: 13.5px; }

.lab-req { display: flex; align-items: center; gap: 12px; background: var(--card, #fff);
           border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.lab-req.done { opacity: .72; }
.lab-req.due { border-left: 3px solid var(--brand); }
.lab-req-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lab-req-main .dim { font-size: 12.5px; }

.lab-level { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px;
             padding: 12px 14px; margin-bottom: 8px; }
.lab-level.cleared { border-color: #bfe3cf; background: #f4fbf6; }
.lab-level.locked { opacity: .8; }
.lab-level-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.lab-level-head .dim { font-size: 12.5px; }
.lab-bar { height: 7px; background: #e8eef3; border-radius: 4px; overflow: hidden; }
.lab-bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.lab-bar-meta { font-size: 12.5px; color: var(--dim); margin-top: 5px; }
.lab-boss { font-size: 13px; color: #7a4a9a; background: #f6f1fa; border-radius: 6px;
            padding: 5px 9px; margin-bottom: 8px; display: inline-block; }
.lab-alt-row { display: flex; align-items: center; justify-content: space-between; }
.lab-switched { font-size: 12.5px; margin-top: 6px; }

.lab-cabinet { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lab-cell { display: flex; flex-direction: column; align-items: center; gap: 4px;
            border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px 8px;
            background: var(--card, #fff); cursor: pointer; }
.lab-cell b { font-size: 13.5px; color: var(--ink); }
.lab-cell .dim { font-size: 12px; }
.lab-cell .lab-svg { width: 62px; height: 62px; display: block; }
.lab-cell .lab-svg svg { width: 100%; height: 100%; }
.lab-cell .lab-svg svg .stroke { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lab-cell .lab-svg svg .mark { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.lab-cell .lab-svg svg .rod { stroke-width: 3.4; }
.lab-cell .lab-svg svg .dash { stroke-dasharray: 3 3.5; stroke-width: 2; }
.lab-cell.on { border-color: #bfe3cf; background: #f4fbf6; }
.lab-cell.on .lab-svg svg .stroke { stroke: var(--brand); }
.lab-cell.on .lab-svg svg .mark { stroke: #6fc0da; }
.lab-cell.on .lab-svg svg .fill { fill: var(--brand-soft, #e3f4fa); stroke: none; }
.lab-cell.on .lab-svg svg .plate { fill: #bfe8f5; stroke: var(--brand); stroke-width: 2.2; }
.lab-cell.on .lab-svg svg .flame { fill: #cdeefb; stroke: var(--brand); stroke-width: 2.2; }
.lab-cell:not(.on) { opacity: .68; }
.lab-cell:not(.on) .lab-svg svg .stroke { stroke: var(--off-stroke, #c3d2dd); }
.lab-cell:not(.on) .lab-svg svg .mark { stroke: #d7e2ea; }
.lab-cell:not(.on) .lab-svg svg .fill { fill: var(--off-fill, #eef4f8); stroke: none; }
.lab-cell:not(.on) .lab-svg svg .plate { fill: #dfeaf2; stroke: #c3d2dd; stroke-width: 2.2; }
.lab-cell:not(.on) .lab-svg svg .flame { fill: #e7eff4; stroke: #c3d2dd; stroke-width: 2.2; }
.lab-cell:not(.on):hover { opacity: 1; }

.lab-passes { display: flex; flex-direction: column; gap: 8px; }
.lab-pass { display: flex; align-items: center; gap: 12px; background: var(--card, #fff);
            border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; }
.lab-pass b { flex-shrink: 0; }
.lab-pass .dim { font-size: 13px; flex: 1; }
.lab-pass.on { border-color: #bfe3cf; background: #f4fbf6; }

.lab-body p { font-size: 14px; line-height: 1.8; margin: 6px 0; }
.lab-points { padding-left: 20px; font-size: 14px; line-height: 1.9; }

/* 手机端：柜子两列 */
@media (max-width: 760px) {
  .lab-top { grid-template-columns: repeat(3, 1fr); }
  .lab-top .stat b { font-size: 15px; }
  .lab-top .stat span { font-size: 11.5px; }
  .lab-cabinet { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 首页「本周修炼」摘要（2026-11-01） ---------- */

.home-lab { margin-bottom: 12px; }
.home-lab .hl-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.home-lab .hl-meta { font-size: 12.5px; color: var(--dim); }
.home-lab .hl-go { margin-left: auto; font-size: 12px; color: #7ce4ff; }

.home-lab .hl-req {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; margin-bottom: 9px;
  background: rgba(10, 30, 50, 0.45); border: 1px solid rgba(56, 182, 232, 0.14);
}
.home-lab .hl-req.due { border-left: 3px solid var(--brand); }
.home-lab .hl-req b { font-size: 13.5px; color: #d8f2fc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-lab .hl-req .dim { font-size: 11.5px; color: #6d93aa; flex: 1; }
.home-lab .hl-req.nodue { justify-content: center; }

.home-lab .hl-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.home-lab .hl-lv {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 9px; border-radius: 8px;
  background: rgba(10, 30, 50, 0.45); border: 1px solid rgba(56, 182, 232, 0.14);
}
.home-lab .hl-lv.ok { border-color: rgba(88, 196, 142, 0.5); background: rgba(14, 44, 32, 0.5); }
.home-lab .hl-lv.locked { opacity: .7; }
.home-lab .hl-lv b { font-size: 13px; color: #d8f2fc; }
.home-lab .hl-lv .dim { font-size: 11.5px; color: #6d93aa; }
.home-lab .hl-bar { height: 5px; background: rgba(56, 182, 232, 0.16); border-radius: 3px; overflow: hidden; }
.home-lab .hl-bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }

/* 需要补的地方：压缩版（首页只放 3 条，行高收紧） */
.home-weak.is-tight .weak-head { margin-bottom: 7px; }
.home-weak.is-tight .weak-row { padding: 5px 9px; margin-bottom: 4px; }
.home-weak.is-tight .weak-name { font-size: 13px; }
.home-weak.is-tight .weak-sub { font-size: 11.5px; }
.home-weak.is-tight .weak-count { font-size: 12px; }
.home-weak.is-tight .weak-go { padding: 2px 8px; font-size: 12px; }
.home-weak.is-tight .weak-foot { margin-top: 6px; }

/* ---------- 深色主题下的弹窗（原来 .modal 写死白底，深色里变成白底浅字） ---------- */

body.theme-dark .modal {
  background: #12283f;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
}
body.theme-dark .modal header { border-bottom-color: var(--line); }
body.theme-dark .modal header h3 { color: var(--ink); }
body.theme-dark .modal footer { border-top-color: var(--line); }
body.theme-dark .modal .body { color: var(--ink2); }

/* 仪器卡 / 实验卡在深色主题下的文字 */
body.theme-dark .lab-body p { color: var(--ink2); }
body.theme-dark .lab-body .use { color: var(--ink2); }
body.theme-dark .lab-body .dim { color: var(--dim); }
body.theme-dark .lab-body .trap {
  color: #f0c39a;
  background: rgba(224, 169, 92, .12);
  border-left-color: rgba(224, 169, 92, .55);
}
body.theme-dark .lab-body .trap b { color: #f3c98f; }

@media (max-width: 760px) {
  .home-lab .hl-levels { grid-template-columns: repeat(3, 1fr); }
  .home-lab .hl-lv b { font-size: 12px; }
}

/* ---------- 修炼系统：A/B 组体验优化（2026-11-01） ---------- */

/* 三关右边的动作按钮 */
.lab-level-head { flex-wrap: wrap; }
.lab-level-act { margin-left: auto; }

/* 断签 / 本周未修炼提示 */
.lab-streak-warn {
  font-size: 13.5px; line-height: 1.7;
  background: rgba(232, 138, 112, .12);
  border: 1px solid rgba(232, 138, 112, .45);
  color: #f0b39c; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
}
.lab-streak-warn.soft {
  background: rgba(224, 169, 92, .12);
  border-color: rgba(224, 169, 92, .45);
  color: #f0c39a;
}

/* 碎片规则折叠卡 */
.lab-rules {
  margin: 14px 0 4px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(20, 52, 84, .35); padding: 10px 14px;
}
.lab-rules summary {
  cursor: pointer; font-size: 13.5px; color: #7ce4ff; outline: none;
}
.lab-rules ul { margin: 10px 0 2px; padding-left: 20px; }
.lab-rules li { font-size: 13.5px; line-height: 1.9; color: var(--ink2); }
.lab-rules b { color: #d8f2fc; }

/* 柜子的价格分档标题（横跨整行） */
.lab-cabinet { grid-auto-flow: row; }
.lab-tier {
  grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; color: #7ce4ff; letter-spacing: .5px;
  margin: 6px 0 2px; padding-top: 6px; border-top: 1px dashed rgba(56, 182, 232, .22);
}
.lab-tier:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.lab-tier .dim { color: var(--dim); font-size: 11.5px; }

/* 首页：断签提示 + 换关小按钮 */
.home-lab .hl-warn {
  font-size: 12.5px; line-height: 1.6; color: #f0b39c;
  background: rgba(232, 138, 112, .1); border-radius: 6px;
  padding: 6px 9px; margin-bottom: 8px;
}
.home-lab .hl-warn.soft { color: #f0c39a; background: rgba(224, 169, 92, .1); }
.home-lab .hl-lv[data-hl-go] { cursor: pointer; }
.home-lab .hl-lv[data-hl-go]:hover { border-color: rgba(56, 182, 232, .45); }
.home-lab .hl-alt {
  margin-top: 2px; font-size: 11.5px; padding: 2px 6px;
  border-radius: 6px; border: 1px solid rgba(56, 182, 232, .4);
  background: rgba(56, 182, 232, .12); color: #7ce4ff; cursor: pointer;
}

/* 兑换庆祝 */
.lab-celebrate { font-size: 14.5px; color: #f3c98f; }

/* ---------- 深色主题下的小按钮（.mini）----------
 * 2026-11-01 补：深色主题的 button 覆盖规则里显式排除了 .mini，
 * 结果 .mini 保持白底 + 浅色文字，几乎看不见（器材柜「换一关」实测）。
 * 这里给 .mini 一套深色皮肤，只作用在学生端（theme-dark 只在学生端挂）。
 */
.theme-dark .mini {
  background: rgba(56, 182, 232, .14);
  border-color: rgba(56, 182, 232, .45);
  color: #9fe4ff;
}
.theme-dark .mini:hover { background: rgba(56, 182, 232, .26); border-color: rgba(56, 182, 232, .7); }
.theme-dark .mini.primary { background: var(--brand); border-color: var(--brand); color: #06202e; }
.theme-dark .mini.primary:hover { background: #4cc3ef; }
.theme-dark .mini.danger { background: rgba(232, 138, 112, .12); border-color: rgba(232, 138, 112, .5); color: #ff9e8a; }
.theme-dark .mini:disabled { opacity: .45; }

/* 锁定关卡的说明文字别太淡（原来 dim 在深底上偏灰） */
.lab-level.locked .dim { color: var(--ink2); }

/* 错题本里的选择题选项（2026-11-01 补：以前丢了选项，学生没法重做） */
.wb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; margin-top: 6px; font-size: 14px; color: var(--ink2); }
.wb-opts i { font-style: normal; font-weight: 700; margin-right: 5px; color: #7ce4ff; }
.wb-opts img { max-width: 100%; }
@media (max-width: 620px) { .wb-opts { grid-template-columns: 1fr; } }

/* 错题本勾选框（只打印勾中的几道） */
.wb-sum .wb-ck { width: 15px; height: 15px; flex: none; cursor: pointer; accent-color: var(--brand); }

/* 首页「本周任务」：主线/支线的小标题 */
.home-lab .hl-sub { font-size: 12px; color: #7ce4ff; letter-spacing: .5px; margin: 2px 0 6px; }

/* 首页主线任务多于 3 条时的提示 */
.home-lab .hl-more { font-size: 12.5px; color: #7ce4ff; margin: -2px 0 8px; }

/* 碎片明细（流水） */
.stat-click { cursor: pointer; transition: border-color .12s; }
.stat-click:hover { border-color: rgba(56, 182, 232, .5); }
.ledger-list { display: flex; flex-direction: column; }
.ledger-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px dashed rgba(56, 182, 232, .16);
  font-size: 13.5px;
}
.ledger-row:last-child { border-bottom: none; }
.lg-time { flex: none; width: 76px; color: var(--dim); font-size: 12px; }
.lg-label { flex: 1; color: var(--ink2); }
.lg-delta { flex: none; font-weight: 700; }
.lg-delta.in { color: #6fe0a8; }
.lg-delta.out { color: #ff9e8a; }

/* 已过期的主线任务：折叠起来，不催但还能做 */
.lab-expired { margin: 6px 0 4px; }
.lab-expired summary {
  cursor: pointer; font-size: 12.5px; color: var(--dim);
  padding: 6px 2px; outline: none;
}
.lab-expired .lab-req.expired { opacity: .72; border-left: 2px solid rgba(224, 169, 92, .5); }

/* 从器材柜「入关」跳进藏书阁时的提示条 */
.lab-tip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-left: 3px solid var(--brand);
  font-size: 14px;
}
.lab-tip b { color: var(--brand); }
.lab-tip a.mini { margin-left: auto; text-decoration: none; }

/* 首页三关格子里的「去练 / 入关」小按钮 */
.home-lab .hl-lv { position: relative; }
.home-lab .hl-go {
  margin-top: 6px; width: 100%; padding: 5px 0; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(56, 182, 232, .45); background: rgba(56, 182, 232, .12);
  color: #bdeaff; font-size: 12.5px; font-family: inherit;
}
.home-lab .hl-go:hover { background: rgba(56, 182, 232, .22); }

/* ---------- 修炼笔记（2026-11-04 重做） ---------- */

/* 顶部那句结论：学生不看数字，看结论 */
.nb-conclude {
  font-size: 15px; line-height: 1.75; color: var(--ink);
  background: var(--brand-l); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px;
}
.nb-stats {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-size: 13.5px; color: var(--dim); margin-bottom: 10px;
}
.nb-stats b { color: var(--ink); font-weight: 600; font-size: 15px; }
.nb-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.nb-tools .nb-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
@media (max-width: 520px) {
  /* 手机上一行放不下三个按钮，让它们自己换行、右对齐 */
  .nb-tools .nb-acts { margin-left: 0; width: 100%; justify-content: flex-end; }
}

.nb-delta { font-style: normal; font-size: 13px; margin-left: 4px; }
.nb-delta.up { color: var(--ok); }
.nb-delta.down { color: var(--bad); }

.nb-list { display: flex; flex-direction: column; gap: 8px; }

/* 一次记录（可折叠） */
.nb-rec { border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.nb-rec[open] { background: var(--card); border-color: var(--line2); }
.nb-sum {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; cursor: pointer; list-style: none;
}
.nb-sum::-webkit-details-marker { display: none; }
.nb-when { font-size: 13.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.nb-title { font-size: 14.5px; color: var(--ink); font-weight: 500; }
.nb-rate { font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.nb-mix { font-size: 13px; }
.nb-fixed { font-size: 13px; color: var(--ok); }
.nb-new-wrong { font-size: 13px; color: var(--bad); }
.nb-chev { color: var(--dim); font-size: 15px; transform: rotate(90deg); transition: transform .15s; }
.nb-rec[open] .nb-chev { transform: rotate(-90deg); }
.nb-body { padding: 0 12px 12px; }

/* 一道题：错题默认展开，对题只给一行
   2026-11-04 老师反馈"题目和题目靠太近"，改成方案一：
   **展开的题 = 一张卡片**（圆角 + 边框 + 浅底 + 内边距），题间留 8px；
   **收起的题 = 一行标题**（不加框），这样一次 20 题也不会满屏方块。 */
.nb-q {
  border-top: 0;
  padding: 7px 9px;
  margin: 8px 0;
  border-radius: 10px;
  border: 1px solid transparent;
}
.nb-q:first-child { margin-top: 0; }
.nb-q:not([open]):hover { background: rgba(255, 255, 255, .04); }
.nb-q[open] {
  padding: 12px 12px 10px;
  background: rgba(255, 255, 255, .055);
  border-color: rgba(56, 182, 232, .22);
}
.nb-q[open] > .nb-q-sum {
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--line2);
}
.nb-q-sum {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  cursor: pointer; list-style: none; font-size: 14px;
}
.nb-q-sum::-webkit-details-marker { display: none; }
.nb-q-no { font-weight: 600; color: var(--ink); }
.nb-q-body { padding-top: 8px; }
.nb-q.is-passed .unit-stem { color: var(--ink2); }

.nb-unit { margin-top: 8px; padding-left: 2px; }
.nb-unit-label { font-size: 13px; color: var(--dim); margin-right: 6px; }
/* 订正进度点：●○ = 还差 1 次连续答对 */
.nb-dots { margin-left: 8px; letter-spacing: 2px; color: var(--brand); font-size: 13px; }

/* 每次记录顶部的"打印这一次"工具条 */
.nb-print-bar { margin: 0 0 6px; }

/* ---------- 修炼笔记 · 批次2：曲线 / 知识点 / 已订正 ---------- */

.nb-curve-box { margin: 4px 0 12px; }
.nb-curve-box .curve { width: 100%; height: auto; display: block; }
.curve-empty { font-size: 13.5px; color: var(--dim); padding: 14px 0; }

.nb-kp { margin-bottom: 12px; }
.nb-kp-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.nb-kp-title { font-size: 13.5px; font-weight: 500; margin-right: 2px; }
.nb-kp-title.weak { color: var(--bad); }
.nb-kp-title.ok { color: var(--ok); }
.nb-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; padding: 2px 8px; border-radius: 12px;
  border: 1px solid var(--line); background: transparent; color: var(--ink2); cursor: pointer;
}
.nb-chip:hover { border-color: var(--brand); }
.nb-chip.weak { border-color: var(--bad); background: var(--bad-bg); }
.nb-chip.ok { border-color: var(--ok); background: var(--ok-bg); }
.nb-chip i { font-style: normal; color: var(--dim); font-size: 12px; }
.nb-kp-tip, .nb-kp-empty { font-size: 12.5px; color: var(--dim); }
.nb-kp-empty { padding: 8px 0; }
.nb-kp-sel {
  font-size: 13px; padding: 3px 6px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink2); max-width: 190px;
}

/* 已订正折叠栏 */
.nb-fixed-box { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.nb-fixed-box > summary { font-size: 13.5px; color: var(--ink2); cursor: pointer; }
.nb-fixed-box > summary .dim { margin-left: 6px; font-size: 12.5px; }
.nb-fixed-list { margin-top: 6px; }
.nb-fixed-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; padding: 5px 0; border-bottom: 1px dashed var(--line);
}

/* 笔记里的答案行：窄屏自动换行成两行，不挤成竖排 */
.nb-ans { flex-wrap: wrap; gap: 6px 18px; }
.nb-ans div { min-width: 0; }

/* 解析框在深色主题下别用白底（学生端默认就是深色） */
.theme-dark .analysis-box {
  background: rgba(56, 182, 232, 0.08);
  border-left-color: var(--brand);
  color: var(--ink2);
}

/* 记录行的展开箭头固定右上，别跟着文字换行往下掉 */
.nb-sum { position: relative; padding-right: 20px; }
.nb-sum .nb-chev {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%) rotate(90deg);
}
.nb-rec[open] > .nb-sum .nb-chev { transform: translateY(-50%) rotate(-90deg); }

/* ---------- 图片拖动改大小（2026-11-04，跟录题台同一套手势） ----------
   鼠标移到图上，右下角冒小圆点，按住横向拖；松手自动存；双击恢复默认。
   以前教师端要输入数字，老师要求改成和录题台一样的拖动。 */
.img-wrap { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.img-resizer {
  position: absolute; right: -5px; bottom: -5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand, #1c6e85);
  cursor: nwse-resize; opacity: 0; transition: opacity .12s; z-index: 2;
}
.img-wrap:hover .img-resizer { opacity: 1; }
.img-wtip {
  position: absolute; right: 0; bottom: -26px;
  padding: 1px 7px; border-radius: 4px; font-size: 12px;
  background: rgba(18, 49, 61, .88); color: #fff;
  opacity: 0; pointer-events: none; transition: opacity .12s; white-space: nowrap;
}
.img-wtip.show { opacity: 1; }
body.img-dragging { user-select: none; cursor: nwse-resize; }

/* 组卷详情里"改题干"（2026-11-04） */
.rp-edit { margin-top: 8px; }
.rp-stem-edit {
  width: 100%; box-sizing: border-box; margin-top: 4px;
  font: 12.5px/1.6 ui-monospace, Menlo, Consolas, monospace;
  padding: 8px 10px; border: 1px solid var(--line2); border-radius: 6px;
  background: #fff; color: #1d2433; resize: vertical;
}

/* ============================================================
   做题 / 练习界面：米白护眼浅色（2026-11-04 老师要求）
   老师原话：字体要黑色，界面颜色淡一点，淡黄/米白，保护视力；
   学生反馈"看不清"，主要是深色底 + 灰蓝次要文字（对比度约 3.4:1，手机上看很吃力）。
   只作用于做题相关视图（.work-light 由 JS 加），首页/笔记/星图/器材柜保持原样。
   ============================================================ */
.theme-dark.work-light {
  --ink: #16191d;          /* 近黑，正文 */
  --ink2: #262b31;
  --dim: #6a6358;          /* 次要文字也压深，别再用灰蓝 */
  --line: #e6dcc6;
  --line2: #d5c7a9;
  --bg: #f2e8d0;           /* 米黄（比初版更深一档，不刺眼） */
  --card: #fdf9ee;
  --brand: #1c6e85;
  --brand-l: #eaf2f4;
  --ok: #1c7a4b;
  --bad: #b0342a;
  --warn: #a8690b;
  background: var(--bg);
  color: var(--ink2);
}

/* 深色皮肤里那些写死的浅色字，这里统一压回深色 */
.theme-dark.work-light .unit-stem,
.theme-dark.work-light .exam-top,
.theme-dark.work-light .ex-hint,
.theme-dark.work-light .ex-top span,
.theme-dark.work-light .q-block,
.theme-dark.work-light .practice-tip,
.theme-dark.work-light .opt,
.theme-dark.work-light .opts span { color: var(--ink2); }

/* 卡片 / 面板回到浅底 */
.theme-dark.work-light .card,
.theme-dark.work-light .paper-card,
.theme-dark.work-light .q-block,
.theme-dark.work-light .sub-unit,
.theme-dark.work-light .stat,
.theme-dark.work-light .practice-box,
.theme-dark.work-light .book-list,
.theme-dark.work-light .mode-list {
  background: var(--card);
  border-color: var(--line);
}

/* 输入框：白底黑字（原来是深底浅字，最费眼） */
.theme-dark.work-light textarea,
.theme-dark.work-light input[type="text"],
.theme-dark.work-light input[type="number"],
.theme-dark.work-light select {
  background: #fff;
  color: #16191d;
  border-color: var(--line2);
}
.theme-dark.work-light textarea::placeholder,
.theme-dark.work-light input::placeholder { color: #9a9184; }

/* 选项 / 按钮：浅底深字，选中态用主色 */
.theme-dark.work-light .opt {
  background: #fff;
  border-color: var(--line2);
}
.theme-dark.work-light .opt:hover { border-color: var(--brand); background: #f7fbfc; }
.theme-dark.work-light .opt.on,
.theme-dark.work-light .opt.selected {
  border-color: var(--brand);
  background: var(--brand-l);
  color: var(--ink);
}
.theme-dark.work-light .mini,
.theme-dark.work-light .btn {
  background: #fff;
  border-color: var(--line2);
  color: var(--ink2);
}
.theme-dark.work-light .mini.primary,
.theme-dark.work-light .primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* 解析框：浅黄底 + 深字，和备注区分开 */
.theme-dark.work-light .analysis-box {
  background: #fdf7e6;
  border-left-color: var(--warn);
  color: #3a342a;
}

/* 顶栏 / 导航：底色和文字必须同时改，只改一半就是"深底深字"（2026-11-05 实测 2.3:1 看不清） */
.theme-dark.work-light .topbar,
.theme-dark.work-light #tabs {
  background: #fffdf6 !important;
  border-color: #e6dcc6 !important;
}
/* 导航按钮是"深色胶囊"，底色和文字必须一起改 —— 只改文字＝深底深字（实测 1.8:1） */
.theme-dark.work-light #tabs button {
  background: #f6f1e4 !important;
  background-image: none !important;
  border-color: #e6dcc6 !important;
  color: #5c564b !important;
}
.theme-dark.work-light #tabs button span { color: #5c564b !important; }
.theme-dark.work-light #tabs button.on {
  background: #1c6e85 !important;
  background-image: none !important;
  border-color: #1c6e85 !important;
  color: #ffffff !important;
}
.theme-dark.work-light #tabs button.on span { color: #ffffff !important; }

/* 浅色皮肤补漏（2026-11-04）：
   .theme-dark h1 / .theme-dark .card b 用的是近白色 #eaf7fd，
   在米白底上就"消失"了（截图里"砺剑：还差 N 道"看不见就是这个）。 */
.theme-dark.work-light h1,
.theme-dark.work-light .card b,
.theme-dark.work-light .unit-pick .unit-name b { color: var(--ink); }

/* 出题范围那块列表：深色皮肤是半透明黑，浅底上会变脏灰 */
.theme-dark.work-light .unit-pick,
.theme-dark.work-light .unit-row,
.theme-dark.work-light .opt-row {
  background: #fff;
  border-color: var(--line);
}
.theme-dark.work-light .unit-row:hover { background: #f7fbfc; }
.theme-dark.work-light .unit-row.is-locked { background: #f4f0e6; color: #8a8175; }

/* 浅色皮肤：标签文字再压深一点（3:1 差一点点，手机上会发虚） */
.theme-dark.work-light .tag {
  background: #f4efe2;
  border-color: var(--line2);
  color: #5a5348;
}
.theme-dark.work-light .tag.warn { background: #fdf2df; border-color: #ecd9b6; color: #8a5a10; }

/* 笔记里的选择题选项（2026-11-04）：不走深色皮肤，浅底深字看得清 */
.nb-opts { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 6px; }
.nb-opt {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 7px 12px; border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line2);
  color: var(--ink);
  font-size: 14.5px; line-height: 1.6;
}
.nb-opt i { font-style: normal; font-weight: 700; color: var(--brand); flex: none; }

/* 整题解析（多空题只显示一次，2026-11-04） */
.nb-ana-once { margin-top: 12px; }
.nb-ana-once::before {
  content: "解析";
  display: block;
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 4px;
}

/* 练习结算页的题面（2026-11-05 老师要求：必须能看到题目才能对照）
   以前只显示"你的答案/标准答案/解析"，学生不知道这题问的是什么。 */
.pr-stem {
  font-size: 14.5px;
  line-height: 1.75;
  color: #dbeefb;
  padding: 8px 11px;
  margin-bottom: 8px;
  border-left: 2px solid rgba(79, 214, 255, .35);
  background: rgba(255, 255, 255, .03);
  border-radius: 0 8px 8px 0;
}
.pr-stem .stem-table { font-size: 13px; }
.pr-opts { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.pr-opts > span {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 14px; color: #dbeefb; line-height: 1.6;
}
.pr-opts > span > i {
  font-style: normal; font-weight: 500; color: #7fd4ef; flex: none; min-width: 14px;
}

/* 浅色皮肤下（work-light）的结算页题面 */
.theme-dark.work-light .pr-stem { color: #262b31; background: #fff; border-left-color: #b9d9e6; }
.theme-dark.work-light .pr-opts > span { color: #262b31; }
.theme-dark.work-light .pr-opts > span > i { color: #1c6e85; }

/* 结算页解析框在浅色皮肤下：白底字会看不见（.pr-line .analysis-box 里写死了浅蓝字） */
.theme-dark.work-light .pr-line .analysis-box {
  background: #fdf7e6;
  border-color: #ecd9b6;
  color: #3a342a;
}

/* 成绩报告的数字（总分/得分率）在米白护眼皮肤下要压深。
   深色皮肤里它们是近白色 #eaf7fd，放到米黄底上几乎看不见（2026-11-05 老师截图）。 */
.theme-dark.work-light .kpi .stat b,
.theme-dark.work-light .stat b {
  color: #16191d;
  text-shadow: none;
}
.theme-dark.work-light .kpi .stat span { color: #5c564b; }

/* 练习结算页在米白护眼皮肤下：卡片和行都要改成浅底深字，
   否则深色半透明底 + 深色字 = 看不清（2026-11-05 老师截图：选项几乎看不清）。 */
.theme-dark.work-light .pr-card {
  background: #fff;
  border-color: var(--line);
}
.theme-dark.work-light .pr-card-head b { color: #16191d; }
.theme-dark.work-light .pr-line {
  background: #fdfaf2;
  border-left-color: #d8cfb6;
}
.theme-dark.work-light .pr-line.ok { border-left-color: #2f9e6b; }
.theme-dark.work-light .pr-line.bad { border-left-color: #c9543a; }
.theme-dark.work-light .pr-line.self { border-left-color: #b8863b; }
.theme-dark.work-light .pr-your,
.theme-dark.work-light .pr-answer { color: #3a342a; }
.theme-dark.work-light .pr-your b,
.theme-dark.work-light .pr-answer b { color: #16191d; }
.theme-dark.work-light .pr-flag { color: #8a8175; }

/* ============================================================
   试炼报告页 · 浅色皮肤下的可读性（2026-11-05）
   老师两次反馈"知识点这里看不清"。原因：胶囊用的是 --brand / --brand-l，
   而这两个变量在 exam-mode / theme-dark 里有好几套定义，叠起来会变成"深底深字"。
   这里不再依赖变量，直接给确定的颜色。
   ============================================================ */
.theme-dark.work-light .weak-report {
  background: #fff;
  border-color: var(--line);
}
/* 用 !important：这个胶囊的底色经过 --brand-l 变量中转，exam-mode / theme-dark
   各自又覆盖过一轮，实测计算出来是"深藏蓝底 + 深灰字"（老师两次说看不清）。
   这里直接钉死颜色，不再参与变量优先级博弈。 */
.theme-dark.work-light .weak-chip {
  background: #e8f2f5 !important;
  border-color: #c3d8e2 !important;
  color: #17545f !important;
}
.theme-dark.work-light .weak-chip b {
  background: #fff !important;
  color: #b0342a !important;
  border: 1px solid #f0d2cc;
}
.theme-dark.work-light .weak-report .weak-head,
.theme-dark.work-light .weak-report .weak-more,
.theme-dark.work-light .weak-report .act-title { color: #3a342a; }
.theme-dark.work-light .weak-chip:disabled { opacity: .55; }

/* 报告页顶栏（回主菜单 + 试炼报告标题） */
.exam-top .ex-title { font-weight: 500; }

/* 结算页：正确率大数字和「有错」标签在浅色底上太淡（2026-11-05 实测 2:1） */
.theme-dark.work-light .pr-big.low { color: #c0392b; }
.theme-dark.work-light .pr-big.mid { color: #a86a06; }
.theme-dark.work-light .pr-big.good { color: #1c7a4b; }
.theme-dark.work-light .pr-mark.bad { background: #fbe6e2; color: #a8331f; }
.theme-dark.work-light .pr-mark.ok { background: #e3f3ea; color: #1c7a4b; }
.theme-dark.work-light .pr-mark.wait { background: #f7efdd; color: #7a5a12; }

/* 深色皮肤下的知识点胶囊：钉死颜色。
   实测计算值是"深灰字 #3f4f5b"，在深蓝底上只有 1.6:1（2026-11-05 深色报告页扫描出来的）。 */
.theme-dark:not(.work-light) .weak-chip {
  background: rgba(56, 182, 232, .16) !important;
  border-color: rgba(56, 182, 232, .38) !important;
  color: #a8e2f7 !important;
}
.theme-dark:not(.work-light) .weak-chip b {
  background: rgba(255, 255, 255, .14) !important;
  color: #ffb0a4 !important;
  border-color: transparent !important;
}
.theme-dark:not(.work-light) .weak-report .weak-head,
.theme-dark:not(.work-light) .weak-report .act-title,
.theme-dark:not(.work-light) .weak-report .weak-more { color: #b9d9ea !important; }

/* 反馈小按钮在深色皮肤下：通用 .theme-dark .mini 把字染成浅青，
   而按钮底还是白的 → 1.4:1 看不清（2026-11-05 报告页扫描出来）。
   这里按"自己的底 + 自己的字"钉死。 */
.theme-dark .rep-send {
  background: #1e6c82 !important;
  border-color: #1e6c82 !important;
  color: #ffffff !important;
}
/* 反馈框本身是白底，半透明白按钮叠上去还是白 → 文字必然糊。改用深实底。 */
.theme-dark .rep-cancel {
  background: #24485c !important;
  border-color: #3a6b83 !important;
  color: #e6f4fb !important;
}
.theme-dark.work-light .rep-send { background: #1c6e85 !important; border-color: #1c6e85 !important; color: #fff !important; }
.theme-dark.work-light .rep-cancel { background: #f6f1e4 !important; border-color: #e6dcc6 !important; color: #3a342a !important; }


/* 首页「今日待办」（2026-11-05） */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  background: rgba(56, 182, 232, .08);
  border: 1px solid rgba(56, 182, 232, .22);
  color: var(--ink); font-size: 14.5px; text-align: left;
}
.todo-row:hover { background: rgba(56, 182, 232, .14); }
.todo-row b {
  font-size: 18px; font-weight: 500; color: #7fd4ef; min-width: 26px;
  font-variant-numeric: tabular-nums;
}
.theme-dark.work-light .todo-row {
  background: #fff; border-color: #d9e6ec; color: #262b31;
}
.theme-dark.work-light .todo-row b { color: #1c6e85; }

/* 星图第三层：暂无题目的知识点（2026-11-05） */
.star-row.noq { opacity: .62; }
.star-noq {
  font-size: 12px; padding: 1px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: #8fa6b6; margin-left: 6px;
}
.theme-dark.work-light .star-noq { background: #eef2f5; color: #6b7f8a; }

/* 错题本进度条（2026-11-05） */
.nb-progress {
  margin: 12px 0 4px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(56, 182, 232, .05);
}
.nbp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.nbp-head b { font-size: 15px; }
.nbp-pct { color: var(--brand); font-variant-numeric: tabular-nums; }
.nbp-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.nbp-bar i { display: block; height: 100%; background: #58c48e; }
.nbp-nums {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 8px; font-size: 14px;
}
.nbp-nums b { font-size: 17px; font-weight: 500; color: var(--ink); margin-right: 2px; }
.nbp-nums .mini { margin-left: auto; }
.theme-dark.work-light .nb-progress { background: #fff; border-color: #d9e6ec; }
.theme-dark.work-light .nbp-bar { background: #e8eef2; }
.theme-dark.work-light .nbp-nums b { color: #16191d; }

/* 「今天学了什么」小结（2026-11-05） */
.study-sum {
  margin: 0 0 14px; padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid rgba(56, 182, 232, .28);
  background: rgba(56, 182, 232, .07);
}
.ss-title { font-size: 14px; color: var(--brand); margin-bottom: 6px; }
.ss-line { font-size: 14.5px; line-height: 1.9; color: var(--ink2); }
.ss-line b { color: var(--ink); font-weight: 500; }
.theme-dark.work-light .study-sum { background: #fff; border-color: #cfe0e8; }
.theme-dark.work-light .ss-title { color: #1c6e85; }
.theme-dark.work-light .ss-line { color: #3a342a; }
.theme-dark.work-light .ss-line b { color: #16191d; }

/* 「点亮」横幅（2026-11-05） */
.lit-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px; padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid rgba(242, 193, 78, .45);
  background: rgba(242, 193, 78, .10);
}
.lb-star { font-size: 22px; color: #f2c14e; line-height: 1; }
.lb-title { font-size: 15px; color: #f2c14e; font-weight: 500; }
.lb-list { font-size: 14px; color: var(--ink2); margin-top: 3px; }
.theme-dark.work-light .lit-banner { background: #fdf6e3; border-color: #e8d3a0; }
.theme-dark.work-light .lb-title { color: #8a6410; }
.theme-dark.work-light .lb-list { color: #4a4132; }

/* 全班最弱知识点（2026-11-05） */
.wkp-list { display: flex; flex-direction: column; gap: 8px; }
.wkp-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.wkp-name { flex: 0 0 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkp-bar { flex: 1; height: 7px; border-radius: 4px; background: rgba(120, 140, 160, .18); overflow: hidden; }
.wkp-bar i { display: block; height: 100%; }
.wkp-rate { flex: 0 0 44px; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.wkp-sub { flex: 0 0 110px; text-align: right; font-size: 13px; }

/* ============================================================
   学生端浅色主题 v2（2026-11-28）
   ------------------------------------------------------------
   原则：**所有规则一律加 .theme-light 前缀**。
   教师端 body 上没有这个类，所以教师端零影响 —— 这是硬约束。
   深色主题（.theme-dark 那 300 多条）一行没改，仍然可用。
   ============================================================ */

.theme-light {
  --bg: #e9ede0;            /* 暖淡青：比纯白暗一档，教室灯下不反光 */
  --card: #f6f9ee;          /* 米白卡，不是 #fff */
  --line: #d9dfc9;
  --line2: #cdd5bb;
  --brand: #1c6e85;
  --brand-d: #175c70;
  --brand-l: #e3efee;
  --ink: #2f3a35;
  --ink2: #46554c;
  --dim: #56655d;           /* 实测 5.17:1，压暗底色后同步加深才达标 */
  --ok: #1f7a52;
  --ok-bg: #e8f2e6;
  --warn: #a8690b;
  --warn-bg: #f7efdd;
  --bad: #b03a3a;
  --bad-bg: #f8e8e4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(47, 58, 53, .05);
}

/* ---------- 骨架 ---------- */
.theme-light,
.theme-light body {
  background: var(--bg);
  color: var(--ink2);
  font-size: 15px;
  line-height: 1.7;
}
.theme-light h1,
.theme-light h2,
.theme-light h3,
.theme-light h4 { color: var(--ink); }

/* ---------- 顶栏 ---------- */
.theme-light .s-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.theme-light .s-head .page-name { color: var(--ink); font-weight: 600; }
.theme-light .s-head #sWho { color: var(--dim); }

/* ---------- 主题切换按钮（两端通用） ---------- */
.theme-btn {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border-radius: 999px;
  border: 1px solid var(--line2);
  background: #fff; color: var(--ink2);
  transition: transform .12s ease, background .12s ease;
}
.theme-btn:active { transform: scale(.92); }
.theme-dark .theme-btn {
  background: #16304e;
  border-color: rgba(56, 182, 232, .38);
  color: #b9d9ea;
}

/* ---------- 卡片 ---------- */
.theme-light .card,
.theme-light .q-block,
.theme-light .sub-unit,
.theme-light .paper-card,
.theme-light .practice-box,
.theme-light .book-list,
.theme-light .stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.theme-light .card { padding: 16px; }
.theme-light .act-title { color: var(--ink); font-size: 15px; font-weight: 600; }

/* ---------- 按钮 ---------- */
.theme-light button,
.theme-light .btn {
  background: #fff;
  border: 1px solid var(--line2);
  color: var(--ink2);
  border-radius: 10px;
  min-height: 40px;
}
.theme-light button:active,
.theme-light .btn:active { transform: scale(.985); }

.theme-light .primary,
.theme-light button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  min-height: 46px;
  border-radius: 10px;
}
.theme-light .primary:active,
.theme-light button.primary:active { background: var(--brand-d); border-color: var(--brand-d); }
.theme-light .primary:hover { background: var(--brand-d); }

.theme-light .mini { min-height: 32px; border-radius: 8px; font-size: 14px; }

/* ---------- 输入 ---------- */
.theme-light input,
.theme-light textarea,
.theme-light select {
  background: #fff;
  border: 1px solid var(--line2);
  color: var(--ink);
  border-radius: 10px;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 16px;      /* iOS 聚焦不放大 */
}
.theme-light input:focus,
.theme-light textarea:focus,
.theme-light select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-l);
}
.theme-light .blank-fill,
.theme-light .ans-input {
  background: #fff;
  border: 1px solid var(--line2);
  border-bottom: 2px solid var(--brand);
  border-radius: 8px;
  min-height: 46px;
  font-size: 16px;
  color: var(--ink);
}

/* ---------- 标签 ---------- */
.theme-light .tag {
  background: var(--brand-l);
  color: var(--brand-d);
  border: none;
  border-radius: 999px;
  font-size: 12px;
  padding: 2px 9px;
}

/* ---------- 表格 ---------- */
.theme-light table.grid { background: var(--card); }
.theme-light table.grid th {
  background: #f2f6f5;
  color: var(--dim);
  font-weight: 500;
  border-color: var(--line);
}
.theme-light table.grid td { border-color: var(--line); }
.theme-light table.grid tbody tr:hover { background: #f7faf9; }

/* ---------- 链接 ---------- */
.theme-light a { color: var(--brand); }
.theme-light .dim { color: var(--dim); }

/* ============================================================
   首页新结构（2026-11-28 重排）
   ① 问候  ② 今日任务大卡  ③ 本周三格  ④ 星图卡  ⑤ 助手折叠
   ============================================================ */

/* 问候条 */
.theme-light .home-hi {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.theme-light .home-hi .hh-name { font-size: 18px; font-weight: 600; color: var(--ink); }
.theme-light .home-hi .hh-sub { font-size: 13px; color: var(--dim); }

/* 今日任务大卡 */
.theme-light .home-task {
  background: linear-gradient(160deg, #1c6e85 0%, #175c70 100%);
  color: #fff;
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(28, 110, 133, .18);
}
.theme-light .home-task .ht-label {
  font-size: 13px; opacity: .82; letter-spacing: .5px; margin-bottom: 6px;
}
.theme-light .home-task .ht-title {
  font-size: 20px; font-weight: 600; line-height: 1.4; margin-bottom: 4px;
}
.theme-light .home-task .ht-sub { font-size: 13.5px; opacity: .82; margin-bottom: 14px; }

.theme-light .home-task .ht-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 52px;
  background: rgba(255, 255, 255, .12);
  border: none; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 8px;
  color: #fff; text-align: left;
  font-size: 15px;
}
.theme-light .home-task .ht-row:last-of-type { margin-bottom: 0; }
.theme-light .home-task .ht-row b { font-size: 19px; font-weight: 600; }
.theme-light .home-task .ht-row .ht-go { margin-left: auto; font-size: 14px; opacity: .9; }
.theme-light .home-task .ht-row:active { background: rgba(255, 255, 255, .2); }

.theme-light .home-task .ht-main {
  width: 100%; min-height: 48px; margin-top: 14px;
  background: #fff; color: var(--brand-d);
  border: none; border-radius: 12px;
  font-size: 15.5px; font-weight: 600;
}
.theme-light .home-task .ht-main:active { background: #eef5f7; }

/* 本周三格 */
.theme-light .home-nums {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 14px;
}
.theme-light .home-nums .hn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.theme-light .home-nums .hn b { display: block; font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.theme-light .home-nums .hn span { font-size: 12.5px; color: var(--dim); }

/* 星图入口卡 */
.theme-light .home-orbit {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.theme-light .home-orbit .ho-ring {
  width: 52px; height: 52px; flex: none;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-l);
  color: var(--brand-d);
  font-size: 13px; font-weight: 600;
}
.theme-light .home-orbit .ho-txt { flex: 1; min-width: 0; }
.theme-light .home-orbit .ho-txt b { display: block; font-size: 15px; color: var(--ink); }
.theme-light .home-orbit .ho-txt span { font-size: 13px; color: var(--dim); }
.theme-light .home-orbit .ho-go { color: var(--brand); font-size: 14px; flex: none; }

/* 助手折叠 */
.theme-light .home-bot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.theme-light .home-bot .hb-line {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14.5px; color: var(--ink2);
}
.theme-light .home-bot .hb-line b { color: var(--brand-d); }
.theme-light .home-bot .hb-toggle {
  margin-left: auto; flex: none;
  color: var(--dim); font-size: 13px;
  background: none; border: none; min-height: 0; padding: 0;
}

/* ============================================================
   手机端（≤760）：Tab、安全区、触控
   ============================================================ */

@media (max-width: 760px) {
  .theme-light .s-shell {
    padding: 8px 14px calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .theme-light .s-nav {
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(18, 49, 61, .07);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .theme-light .s-nav button {
    color: var(--dim);
    min-height: 52px;
    border-radius: 10px;
    background: transparent;
  }
  .theme-light .s-nav button.on {
    background: var(--brand-l);
    color: var(--brand-d);
  }
  .theme-light .s-nav button.on svg { opacity: 1; }
  .theme-light .s-nav button svg { opacity: .72; }
  .theme-light .s-nav button span { font-size: 12px; }

  /* 底部操作条：浅色版 */
  .theme-light body.exam-mode .exam-bar,
  .theme-light body.practice-mode .exam-bar {
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(18, 49, 61, .07);
  }

  .theme-light .card { padding: 16px; }
  .theme-light .stat b { font-size: 18px; }
}

/* 窄屏（≤480） */
@media (max-width: 480px) {
  .theme-light .s-shell { padding-left: 14px; padding-right: 14px; }
  .theme-light .home-task { padding: 16px 16px 14px; border-radius: 14px; }
  .theme-light .home-task .ht-title { font-size: 19px; }
  .theme-light .home-nums { gap: 8px; }
  .theme-light .home-nums .hn { padding: 12px 6px; }
  .theme-light .home-nums .hn b { font-size: 20px; }
}

/* ============================================================
   补丁（2026-11-28 首轮实拍后修正）
   1. 任务行右侧箭头默认是斜体，改成正常字重
   2. 深色主题下新组件原本没有任何样式，补齐
   3. 浅色下仍有深色残留：助手卡、星图 SVG
   4. 星图 5 个统计卡在手机上换行错位
   ============================================================ */

.theme-light .home-task .ht-go,
.theme-dark .home-task .ht-go {
  margin-left: auto;
  font-style: normal;
  font-size: 14px;
  opacity: 1;
  font-weight: 500;
  flex: none;
}
.theme-light .home-task .ht-go { color: #ffffff; }

/* ---------- 深色主题：补齐新组件 ---------- */
.theme-dark .home-hi .hh-name { color: var(--ink); }
.theme-dark .home-hi .hh-sub { color: var(--dim); }

.theme-dark .home-task {
  background: linear-gradient(160deg, rgba(56, 182, 232, .18) 0%, rgba(14, 40, 66, .55) 100%);
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  box-shadow: none;
}
.theme-dark .home-task .ht-label { color: var(--dim); }
.theme-dark .home-task .ht-title { color: var(--ink); font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.theme-dark .home-task .ht-sub { color: var(--dim); font-size: 13.5px; margin-bottom: 14px; }
.theme-dark .home-task .ht-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 52px;
  background: rgba(56, 182, 232, .10) !important;
  border: none !important; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 8px;
  color: var(--ink) !important; text-align: left; font-size: 15px;
}
.theme-dark .home-task .ht-row b { font-size: 19px; color: var(--ink); }
/* 深色下有一条「所有 button 统一深蓝底」的全局规则（特异性很高），这里必须加权重 */
.theme-dark .home-task .ht-main {
  width: 100%; min-height: 48px; margin-top: 14px;
  background: var(--brand) !important;
  color: #08141a !important;
  border: none !important;
  border-radius: 12px;
  font-size: 15.5px; font-weight: 600;
}

.theme-dark .home-nums {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 14px;
}
.theme-dark .home-nums .hn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 8px; text-align: center;
}
.theme-dark .home-nums .hn b { display: block; font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.theme-dark .home-nums .hn span { font-size: 12.5px; color: var(--dim); }

.theme-dark .home-orbit {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px; margin-bottom: 14px;
  cursor: pointer;
}
.theme-dark .home-orbit .ho-ring {
  width: 52px; height: 52px; flex: none; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-l); color: var(--brand);
  font-size: 13px; font-weight: 600;
}
.theme-dark .home-orbit .ho-txt b { display: block; font-size: 15px; color: var(--ink); }
.theme-dark .home-orbit .ho-txt span { font-size: 13px; color: var(--dim); }
.theme-dark .home-orbit .ho-go { color: var(--brand); font-size: 14px; flex: none; }

.theme-dark .home-bot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.theme-dark .home-bot .hb-line { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--ink2); }
.theme-dark .home-bot .hb-line b { color: var(--brand); }
.theme-dark .home-bot .hb-toggle { margin-left: auto; flex: none; color: var(--dim); font-size: 13px; background: none; border: none; min-height: 0; padding: 0; }

/* ---------- 浅色：助手卡（原本硬编码深蓝渐变） ---------- */
.theme-light .bot-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.theme-light .bot-head b { color: var(--ink); }
.theme-light .bot-msg {
  background: #f2f6f5;
  border: 1px solid var(--line);
  color: var(--ink2);
}
.theme-light .bot-chips button {
  background: #fff;
  border: 1px solid var(--line2);
  color: var(--brand-d);
  min-height: 36px;
}
.theme-light .bot-hint { color: var(--dim); }

/* ---------- 浅色：星图 SVG 圆角，避免白卡里一块直角深色 ---------- */
.theme-light #starMap { border-radius: 12px; overflow: hidden; }
.theme-light .star-card { overflow: hidden; }

/* ---------- 浅色：薄弱知识点行（原样式是深色硬编码） ---------- */
.theme-light .home-weak { margin-bottom: 14px; }
.theme-light .home-weak .weak-row {
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.theme-light .home-weak .weak-name { color: var(--ink); font-size: 14px; }
.theme-light .home-weak .weak-sub { color: var(--dim); font-size: 12.5px; }
.theme-light .home-weak .weak-count { color: var(--bad); font-size: 13px; }
.theme-light .home-weak .weak-go {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  min-height: 32px;
  padding: 4px 12px;
  font-size: 13px;
}
.theme-light .weak-empty { color: var(--dim); }
.theme-light .weak-more { color: var(--brand); }

/* ---------- 手机：星图统计卡改 3 列；底部留白加大 ---------- */
@media (max-width: 760px) {
  .theme-light .kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .theme-light .s-shell { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .theme-dark .home-nums { gap: 8px; }
}

/* ============================================================
   补丁 2（2026-11-28 答题页实拍后）
   顶部信息栏在 390px 下换行成四段，底部主按钮仍是旧配色
   ============================================================ */

@media (max-width: 760px) {
  .theme-light body.practice-mode .exam-top,
  .theme-light body.exam-mode .exam-top {
    flex-wrap: nowrap;
    gap: 8px;
    font-size: 13px;
    padding: 8px 10px;
  }
  .theme-light .exam-top .ex-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
  }
  .theme-light .exam-top .sp { display: none; }
  .theme-light .exam-top .dim { font-size: 12px; white-space: nowrap; flex: none; }
  .theme-light .exam-top .tag { font-size: 11.5px; padding: 1px 7px; white-space: nowrap; flex: none; }
  .theme-light .exam-top .ex-back {
    min-height: 32px;
    padding: 2px 10px;
    font-size: 13px;
    flex: none;
    border-radius: 8px;
  }
}

/* 底部主按钮统一成主色（原来沿用练习纸面的棕色）
   ⚠️ 这里必须用字面色值：body.practice-mode 下 --brand 被重定义成棕色 #a8761a，
   用 var(--brand) 会跟着变棕。 */
.theme-light .exam-bar .primary,
.theme-light body.practice-mode .exam-bar .primary,
.theme-light body.exam-mode .exam-bar .primary {
  background: #1c6e85 !important;
  border-color: #1c6e85 !important;
  color: #fff !important;
}

/* 练习/考试底部的主操作按钮（#pNext / #pPrev 等）不在 .exam-bar 容器里，
   用 id 兜住，避免继续沿用纸面的棕色 */
.theme-light #pNext,
.theme-light #pPrev,
.theme-light #pSubmit,
.theme-light #eNext,
.theme-light #eSubmit {
  background: #1c6e85 !important;
  border-color: #1c6e85 !important;
  color: #fff !important;
}
.theme-light #pPrev:disabled,
.theme-light #ePrev:disabled {
  background: var(--card) !important;
  color: var(--dim) !important;
  border-color: var(--line2) !important;
}

/* ============================================================
   字号放大后的布局配合（2026-11-28）
   字号整体上移一档，下面这些尺寸必须跟着放大，否则会挤、会换行
   ============================================================ */

.theme-light { line-height: 1.7; }

.theme-light button,
.theme-light .btn { min-height: 44px; }

.theme-light .primary,
.theme-light button.primary { min-height: 48px; }

.theme-light input,
.theme-light textarea,
.theme-light select { min-height: 48px; }

@media (max-width: 760px) {
  /* 底部 6 个 Tab：高度加 6px，字距收 0.2px，保证「试炼卷宗」不贴边 */
  .theme-light .s-nav button {
    min-height: 62px;
    letter-spacing: -0.2px;
  }
  .theme-light .s-nav button svg { width: 22px; height: 22px; }
  .theme-light .s-nav button span { font-size: 12px; }

  /* 表格：字大了要透气 */
  .theme-light .grid th,
  .theme-light .grid td { padding: 7px 8px; }

  /* 底部留白跟着 Tab 高度一起加 */
  .theme-light .s-shell {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================
   字号放大后答题页的连带修正（2026-11-28 实拍发现）
   1. 题号「第 4 题」被挤成两行
   2. 「全部机器判」标签换行
   3. 顶栏标题被截断
   4. 内容不足时底部大片空白
   ============================================================ */

@media (max-width: 760px) {
  /* 窄屏优先保标题和题号，题型统计让位 */
  .theme-light .exam-top .tag { display: none; }
  .theme-light .exam-top .ex-title { flex: 1 1 auto; min-width: 0; }

  /* 题号与标签不许折行 */
  .theme-light .exam-paper .row b,
  .theme-light .exam-paper .row .tag,
  .theme-light .q-block .row b { white-space: nowrap; }
  .theme-light .exam-paper .row { gap: 8px; flex-wrap: nowrap; }
}

/* 内容不足时把纸面撑满，避免底部一大块空白 */
.theme-light body.practice-mode .exam-paper,
.theme-light body.exam-mode .exam-paper {
  min-height: 72vh;
}

/* html 也要跟着上色：body 高度不足时，页面外区域会露出 html 的默认白 */
html:has(> body.theme-light) { background: #e9ede0; }
html:has(> body.theme-light.practice-mode) { background: #f8f1de; }
html:has(> body.theme-light.exam-mode) { background: #f1f2e9; }

/* 题目来源那一行：字变大后来源名被挤成一字一行，必须单行省略 */
.theme-light .exam-paper .row > span.dim,
.theme-light .q-block .row > span.dim {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   补丁 3（2026-11-28 真机反馈）
   1. 右侧栏只在首页隐藏，其他页面还挂着三块深色硬编码内容
      （近期修炼记录 / 今日修炼 / 段位徽章），在米绿页面上非常突兀
   2. 星图 5 个统计卡用 grid 三列，第二行两个卡被拉宽，大小不一
   ============================================================ */

@media (max-width: 760px) {
  /* 手机上右侧栏整体不显示：内容与首页任务卡、星图卡重复 */
  .theme-light .s-right { display: none !important; }

  /* 统计卡固定三分之一宽，第二行宁可留空也不拉伸 */
  .theme-light .kpi {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .theme-light .kpi .stat {
    flex: 0 0 calc((100% - 16px) / 3);
    min-width: 0;
  }
}

/* ============================================================
   P1（2026-11-28）：器材柜任务进首页 + 底部导航减到 5 个
   ============================================================ */

/* 首页「器材柜」入口条 */
.theme-light .home-lab-link,
.theme-dark .home-lab-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13.5px;
  text-decoration: none;
}
.theme-light .home-lab-link { box-shadow: var(--shadow); }
.theme-light .home-lab-link .hl-name { font-weight: 600; color: var(--ink); }
.theme-light .home-lab-link .hl-meta { margin-left: auto; font-size: 12.5px; color: var(--dim); }
.theme-light .home-lab-link .hl-go { color: var(--brand); font-size: 15px; }
.theme-dark .home-lab-link .hl-name { font-weight: 600; color: var(--ink); }
.theme-dark .home-lab-link .hl-meta { margin-left: auto; font-size: 12.5px; color: var(--dim); }
.theme-dark .home-lab-link .hl-go { color: var(--brand); font-size: 15px; }

/* 5 个 Tab 时每个更宽，四字名称不再贴边 */
@media (max-width: 760px) {
  .theme-light .s-nav button { letter-spacing: 0; }
}

/* ============================================================
   P2（2026-11-28）：底部导航可收起（用户自选，默认展开）
   收起后不消失，变成显示当前页名的半透明小胶囊，避免迷路
   ============================================================ */

.nav-edge, .nav-tip { display: none; }

@media (max-width: 760px) {
  /* 导航栏顶部的把手：抽屉的通用视觉语言，看到横杠就知道能往下拖 */
  .nav-handle {
    position: absolute;
    left: 50%;
    top: 6px;
    transform: translateX(-50%);
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background: #9aa88f;
    transition: background-color .15s ease, width .15s ease;
    z-index: 2;
    pointer-events: none;
  }
  .s-nav.pulling .nav-handle { background: var(--dim); width: 46px; }

  /* 首次提示：进来 4 秒后自动消失 */
  .nav-tip {
    display: flex;
    align-items: center;
    gap: 5px;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    z-index: 57;
    padding: 6px 13px;
    border-radius: 999px;
    background: rgba(28, 110, 133, .94);
    color: #fff;
    font-size: 11.5px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(20, 40, 50, .18);
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
  }
  .nav-tip.on { opacity: 1; }

  /* 收起后的浅边 */
  .nav-edge {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 12px;
    z-index: 56;
    align-items: center;
    justify-content: center;
    background: #eef2e4;
    border-top: 1px solid #c6cfb6;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -2px 10px rgba(20, 40, 50, .10);
    touch-action: none;
  }
  .nav-edge::after {
    content: '';
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #b3bfa4;
  }
  /* 触摸热区比视觉高 */
  .nav-edge::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46px;
  }
  .theme-dark .nav-edge { background: #16304a; border-top-color: #24486a; }
  .theme-dark .nav-edge::after { background: #3d6588; }
  body.nav-collapsed .nav-edge { display: flex; }

  /* 导航整体滑出屏幕，transform 由 theme.js 按手势实时写 */
  .s-nav {
    transition: transform .26s cubic-bezier(.32, .72, 0, 1);
    will-change: transform;
    padding-top: 15px;   /* 给顶部的把手留出位置，否则会压住图标 */
  }
  .s-nav.dragging { transition: none; }
  body.nav-collapsed .s-nav { transform: translateY(100%); }

  body.nav-collapsed .s-shell { padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================
   P3（2026-11-28）：笔记页收纳
   首屏只留「待订正数量 + 主按钮 + 3 条记录」，其余进折叠
   ============================================================ */

.theme-light .nb-head { margin-bottom: 12px; }
.theme-light .nb-sum b { display: block; font-size: 20px; color: var(--ink); line-height: 1.35; }
.theme-light .nb-sum span { display: block; font-size: 12.5px; color: var(--dim); margin-top: 3px; }
.theme-light .nb-main { width: 100%; margin-top: 12px; }

.nb-fold {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.nb-fold summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 14px;
  font-size: 13.5px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nb-fold summary::-webkit-details-marker { display: none; }
.nb-fold summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--dim);
  font-size: 12px;
}
.nb-fold[open] summary::after { content: '▴'; }
.nb-fold summary .dim { font-size: 11.5px; color: var(--dim); }
.nb-fold-body { padding: 0 14px 14px; }

.theme-light .nb-more {
  width: 100%;
  margin: 4px 0 12px;
  min-height: 40px;
  background: var(--card);
  border: 1px dashed var(--line2);
  color: var(--brand-d);
  font-size: 13px;
  border-radius: 10px;
}

/* ============================================================
   P4（2026-11-28）：星图统计卡收纳成一行摘要
   ============================================================ */

.star-kpi-fold {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
}
.star-kpi-fold summary {
  list-style: none;
  cursor: pointer;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.star-kpi-fold summary::-webkit-details-marker { display: none; }
.star-kpi-fold summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--dim);
  font-size: 12px;
  flex: none;
}
.star-kpi-fold[open] summary::after { content: '▴'; }
.star-kpi-fold .sk-main b { font-size: 18px; color: var(--ink); }
.star-kpi-fold .sk-main span { font-size: 12.5px; color: var(--dim); margin-left: 8px; }
.star-kpi-fold .sk-sub { font-size: 11.5px; color: var(--dim); flex: none; }
.star-kpi-fold .kpi { padding: 0 12px 12px; margin-bottom: 0; }

/* ============================================================
   P6（2026-11-28）：体验细节
   ============================================================ */

/* ① 点击反馈：所有按钮按下缩一下 */
.theme-light button,
.theme-light .btn,
.theme-light .home-lab-link,
.nb-fold summary,
.star-kpi-fold summary {
  transition: transform .1s ease, background-color .12s ease;
}
.theme-light button:active,
.theme-light .btn:active,
.theme-light .home-lab-link:active { transform: scale(.97); }

/* ② 骨架屏：替代「加载中…」三个字 */
.skeleton { padding: 14px 2px; }
.skeleton i {
  display: block;
  height: 14px;
  border-radius: 7px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .05) 25%, rgba(0, 0, 0, .09) 37%, rgba(0, 0, 0, .05) 63%);
  background-size: 400% 100%;
  animation: sk 1.3s ease infinite;
}
.skeleton i:nth-child(2) { width: 82%; }
.skeleton i:nth-child(3) { width: 58%; }
.theme-dark .skeleton i {
  background: linear-gradient(90deg, rgba(255, 255, 255, .06) 25%, rgba(255, 255, 255, .13) 37%, rgba(255, 255, 255, .06) 63%);
  background-size: 400% 100%;
}
@keyframes sk {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ③ 空状态：居中、留白、不显得像出错 */
.theme-light .empty {
  text-align: center;
  color: var(--dim);
  padding: 30px 14px;
  font-size: 13px;
  line-height: 1.8;
}

/* 星图「怎么才算点亮」折叠 */
.star-foot-fold {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
}.star-foot-fold summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 0 0;
  font-size: 12.5px;
  color: var(--brand-d);
}
.star-foot-fold summary::-webkit-details-marker { display: none; }
.star-foot-fold summary::after { content: ' ▾'; color: var(--dim); }
.star-foot-fold[open] summary::after { content: ' ▴'; }
.star-foot-fold[open] .star-foot { margin-top: 8px; }

/* ============================================================
   P7（2026-11-28）：轻应用化 —— 去网页味
   ============================================================ */

/* 左上角返回按钮（非首页显示） */
.s-back {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  border-radius: 999px;
  font-size: 21px;
  line-height: 1;
  background: var(--card);
  border: 1px solid var(--line2);
  color: var(--ink2);
}
.s-back.hide { display: none; }
.s-back:active { transform: scale(.92); }

/* 禁双击缩放（touch-action） */
html { touch-action: manipulation; }

/* 去点击高亮方块、去长按弹出菜单 */
body {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* 全局禁选中，但题干、输入框、解析要能选（学生可能要复制） */
body,
.theme-light,
.theme-dark { user-select: none; -webkit-user-select: none; }

.stem,
.stem-img,
.eq-img,
.q-block .stem,
.ans-input,
textarea,
input,
.star-detail,
.nb-body,
.analysis-box,
.practice-reveal { user-select: text; -webkit-user-select: text; }

/* ============================================================
   P8（2026-11-28）：首页三张独立任务卡
   整张卡可点，各自去对应页面；左侧色条 + 圆形图标区分性质
   ============================================================ */

.ht2-head { margin-bottom: 9px; }
.ht2-head b { display: block; font-size: 15px; color: var(--ink); }
.ht2-head span { font-size: 12.5px; color: var(--dim); }

.task-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  margin-bottom: 9px;
  padding: 13px 13px 13px 12px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--c);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(47, 58, 53, .05);
  transition: transform .1s ease;
}
.theme-light .task-card:active { transform: scale(.985); }

.task-card .tc-ic {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--bg);
  color: var(--c);
}
.task-card .tc-main { flex: 1; min-width: 0; }
.task-card .tc-main b { font-size: 19px; font-weight: 600; color: var(--ink); }
.task-card .tc-main span { font-size: 13.5px; color: var(--ink2); margin-left: 6px; }

.task-card .tc-act {
  flex: none;
  height: 34px;
  line-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--c);
  border-radius: 9px;
  color: var(--c);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

/* 空态：没有待办时也保留一张卡，点了去练一组 */
.task-card.task-empty { --c: var(--brand); }
.task-card.task-empty .tc-main b { font-size: 15px; }

/* 器材柜轻量入口：一行小字，不抢三张卡的视觉重量 */
.lab-line {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 4px 12px;
  font-size: 12.5px;
  color: var(--dim);
  text-decoration: none;
}
.lab-line .ll-meta { color: var(--dim); }
.lab-line .ll-go { margin-left: auto; color: var(--brand); font-size: 14px; }

/* ============================================================
   P9（2026-11-28）：并排两个入口（成长轨迹 + 器材柜）
   底部导航收起时，学生靠它们去这两个模块
   ============================================================ */

.entry-row {
  display: flex;
  gap: 9px;
  margin: 2px 0 14px;
}
.entry {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(47, 58, 53, .05);
  transition: transform .1s ease;
}
.theme-light .entry:active { transform: scale(.98); }
.entry .e-ic {
  width: 30px;
  height: 30px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--bg);
  color: var(--c);
}
.entry .e-main { flex: 1; min-width: 0; }
.entry .e-main b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.entry .e-main span { font-size: 11.5px; color: var(--dim); }
.entry .e-go { flex: none; color: var(--dim); font-size: 14px; }

/* ============================================================
   P10（2026-11-28）：反馈气泡 + 建议弹窗
   只在首页出现；可拖动，位置记在 localStorage
   ============================================================ */

.fb-fab {
  display: none;
  position: fixed;
  right: 14px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 54;
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line2);
  color: var(--brand-d);
  box-shadow: 0 3px 12px rgba(20, 40, 50, .16);
  touch-action: none;
  transition: transform .16s ease, box-shadow .16s ease;
}
.fb-fab::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 999px;
}
.fb-fab.dragging {
  transform: scale(1.12);
  box-shadow: 0 10px 26px rgba(20, 40, 50, .26);
}
.theme-dark .fb-fab { color: var(--brand); }
/* 只在首页显示 */
body[data-page="home"] .fb-fab { display: flex; }
body.nav-collapsed .fb-fab { bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }

/* 弹窗 */
.fb-sheet-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 40, 50, .35);
  align-items: flex-end;
}
.fb-sheet-mask.on { display: flex; }
.fb-sheet {
  width: 100%;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(20, 40, 50, .18);
}
.fb-sheet-head { display: flex; align-items: center; margin-bottom: 4px; }
.fb-sheet-head b { font-size: 16px; color: var(--ink); }
.fb-x {
  margin-left: auto;
  min-height: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--dim);
  font-size: 17px;
  line-height: 1;
}
.fb-sheet-sub { font-size: 12.5px; color: var(--dim); margin-bottom: 12px; }
.fb-sheet textarea {
  width: 100%;
  height: 104px;
  resize: none;
  border: 1px solid var(--line2);
  border-radius: 11px;
  background: #fff;
  padding: 11px 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
}
.theme-dark .fb-sheet textarea { background: rgba(255, 255, 255, .06); }
.fb-sheet textarea::placeholder { color: #9aa79e; }
.fb-cnt { text-align: right; font-size: 11px; color: var(--dim); margin-top: 4px; }
.fb-acts { display: flex; gap: 9px; margin-top: 12px; }
.fb-acts button {
  flex: 1;
  height: 46px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--ink2);
}
.fb-acts .ok {
  flex: 2;
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ============================================================
   P11（2026-11-28）：电脑端与手机端隔离
   老师要求：电脑端不是手机端的放大版，各自独立调
   ============================================================ */

/* 器材柜入口只在电脑端出现（手机端 5 个，靠首页卡片进）
   注意：必须用 .s-nav .nav-lab 这种双类选择器，
   否则会被 .s-nav button { display: flex } 盖掉（实测手机端会多出第 6 个） */
.s-nav .nav-lab { display: none; }
@media (min-width: 761px) {
  .s-nav .nav-lab { display: flex; }
}

/* 电脑端整体字号放大一档：学生端在教室大屏/老师演示时字太小看不清 */
@media (min-width: 761px) {
  body { zoom: 1.08; }
  /* zoom 会让 100vw 变成 100vw/1.08，这里把宽度补回去，避免右侧留白 */
  .s-shell { width: 100%; }
}

/* 电脑端不显示反馈气泡：zoom 会影响 fixed 定位，而且电脑端主要是老师演示，
   提建议是学生用手机做的事 */
@media (min-width: 761px) {
  .fb-fab { display: none !important; }
}

/* 电脑端不显示反馈气泡：zoom 会影响 fixed 定位，而且电脑端主要是老师演示，
   提建议是学生用手机做的事 */
@media (min-width: 761px) {
  .fb-fab { display: none !important; }
}

/* ============================================================
   P12（2026-11-28）：右侧栏跟随浅色主题
   老师反馈：近期修炼记录 / 今日修炼 / 段位卡还是深蓝，和整个主题不搭
   ============================================================ */

.theme-light .act-card {
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: none;
}
.theme-light .act-title { color: var(--ink); }
.theme-light .today-tip { color: var(--ink2); }
.theme-light .today-tip b { color: var(--brand-d); font-weight: 600; }

.theme-light .nav-badge {
  background: var(--card);
  border: 1px solid var(--line);
}

/* 记录条目也跟着浅色化（原来文字是浅蓝，浅底上会看不清） */
.theme-light .act-row {
  background: #f2f6e9;
  border-color: var(--line);
}
.theme-light .act-name { color: var(--ink); }
.theme-light .act-sub { color: var(--dim); }
.theme-light .act-rate { color: var(--brand-d); }
.theme-light .act-tag.exam { background: #dcebee; color: #1c6e85; }
.theme-light .act-tag.prac { background: #f8f1e2; color: #a8761a; }
.theme-light .act-delta.up { color: #2f7d54; }
.theme-light .act-delta.down { color: #b8563f; }

/* 段位卡：浅色主题下换成深金（保留金色等级感，但米白底上看得清） */
.theme-light .nb-tier {
  color: #a8761a;
  text-shadow: none;
}
.theme-light .nb-lit { color: var(--dim); }
.theme-light .nb-bar { background: #e3e9d8; }
.theme-light .nb-bar i {
  background: linear-gradient(90deg, #1c6e85, #4fa8b8);
  box-shadow: none;
}

/* ============================================================
   P13（2026-11-28）：深色主题导航选中态
   老师要求：不要发光，用「背景提亮」区分；底色一律不动
   选中 #26618c（比容器底 #122a42 提两档），未选中保持透明
   ============================================================ */

/* 电脑端（竖排） */
.theme-dark .s-nav button.on {
  background: #26618c;
  color: #ffffff;
  box-shadow: none;
}
.theme-dark .s-nav button.on svg { opacity: 1; }

/* 手机端（底部横排）：原来是 rgba(56,182,232,.16)，太淡 */
@media (max-width: 760px) {
  .theme-dark .s-nav button.on {
    background: #26618c;
    color: #ffffff;
    box-shadow: none !important;
  }
  .theme-dark .s-nav button.on span { color: #ffffff; }
}

/* ============================================================
   P14（2026-11-28）：深色主题整体可读性
   1 卡片提亮一档  2 按钮提亮  3 入口卡加色条  4 四角亮角降一档
   ============================================================ */

/* ① 卡片与背景拉开层次（原来是 #142c48，比背景只亮一点点） */
.theme-dark .card {
  background: linear-gradient(180deg, #1a3a5c 0%, #173351 45%, #173351 100%);
  border-color: rgba(56, 182, 232, 0.26);
}
.theme-dark .task-card,
.theme-dark .entry {
  background: rgba(26, 62, 96, 0.66);
  border-color: rgba(56, 182, 232, 0.26);
}

/* ② 任务卡右侧按钮：字和描边一起提亮，暗底上才看得清 */
.theme-dark .task-card .tc-act {
  color: #4cc4ef;
  border-color: rgba(76, 196, 239, 0.55);
  background: rgba(56, 182, 232, 0.08);
}
.theme-dark .task-card .tc-main b { color: #f0f9fe; }
.theme-dark .task-card .tc-main span { color: #b9d9ea; }

/* ③ 入口卡（成长轨迹 / 器材柜）：加一条左侧色条，和任务卡呼应 */
.theme-dark .entry {
  border-left: 3px solid var(--c);
}
.theme-dark .entry .e-main b { color: #e8f6fd; }
.theme-dark .entry .e-main span { color: #8fb3c9; }

/* ④ 四角亮角降一档，别和导航选中态抢注意力 */
.theme-dark .card::after {
  background:
    linear-gradient(#3d9cc4, #3d9cc4) left 0 top 0 / 14px 2px no-repeat,
    linear-gradient(#3d9cc4, #3d9cc4) left 0 top 0 / 2px 14px no-repeat,
    linear-gradient(#3d9cc4, #3d9cc4) right 0 top 0 / 14px 2px no-repeat,
    linear-gradient(#3d9cc4, #3d9cc4) right 0 top 0 / 2px 14px no-repeat,
    linear-gradient(#3d9cc4, #3d9cc4) left 0 bottom 0 / 14px 2px no-repeat,
    linear-gradient(#3d9cc4, #3d9cc4) left 0 bottom 0 / 2px 14px no-repeat,
    linear-gradient(#3d9cc4, #3d9cc4) right 0 bottom 0 / 14px 2px no-repeat,
    linear-gradient(#3d9cc4, #3d9cc4) right 0 bottom 0 / 2px 14px no-repeat;
}

/* ============================================================
   P15（2026-11-28）：导航选中态两端统一
   老师反馈：浅色端是「深青实心+发光」，深色端是「中蓝」，两头不统一
   统一原则：都靠明度差，都去掉发光
   ============================================================ */

/* 浅色主题：浅青底 + 深青字（和手机端保持一致），去掉发光 */
.theme-light .s-nav button.on {
  background: var(--brand-l);
  color: var(--brand-d);
  box-shadow: none;
}
.theme-light .s-nav button.on svg { opacity: 1; }

/* 深色主题：亮蓝底 + 白字，去掉发光（提高一档，比 #26618c 更清楚） */
.theme-dark .s-nav button.on {
  background: #2d7aa8;
  color: #ffffff;
  box-shadow: none;
}
.theme-dark .s-nav button.on svg { opacity: 1; }

/* 深色导航选中：用 body 前缀 + !important 确保压过历史规则 */
body.theme-dark .s-nav button.on {
  background: #2d7aa8 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* 深色导航选中：用 body 前缀 + !important 确保压过历史规则 */
body.theme-dark .s-nav button.on {
  background: #2d7aa8 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* ============================================================
   P16（2026-11-28）：浅色主题下两处深色硬编码
   老师截图反馈：规则面板、知识点列表在浅色页面里是灰蓝块，字看不清
   ============================================================ */

/* 器材柜「规则」折叠面板 */
.theme-light .lab-rules {
  background: var(--card);
  border-color: var(--line);
}
.theme-light .lab-rules summary { color: var(--brand-d); }
.theme-light .lab-rules b { color: var(--ink); }

/* 成长轨迹的知识点行 */
.theme-light .star-row {
  background: var(--card);
  border-color: var(--line);
}
.theme-light .star-row.lit {
  background: #fdf6e3;
  border-color: rgba(168, 118, 26, .35);
}

/* ============================================================
   P17（2026-11-28）：两端体验优化（第二轮）
   ============================================================ */

/* ① 手机端器材柜三格 → 2+1 布局（原来三格并排，文字被挤碎） */
@media (max-width: 760px) {
  .lab-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .lab-top .stat { padding: 10px 12px; }
  .lab-top .stat b { font-size: 20px; }
  .lab-top .stat span { font-size: 12px; }
  .lab-top .stat-wide { grid-column: 1 / -1; }
}

/* ② 手机端秘境三关卡片压缩（原来 230px 一张，一屏看不全两关）
   只压内边距，不截断说明文字——说明是学生判断"这关干什么"的唯一依据 */
@media (max-width: 760px) {
  .lab-level { padding: 12px; }
  .lab-level-head { margin-bottom: 8px; }
  .lab-level .mini { min-height: 32px; }
}

/* ③ 电脑端：内容少时垂直居中，不再把空白全堆在下面
   注意容器是 #view（不是 .s-main，那个类不存在）。
   用 flex + auto 外边距：内容少时居中，内容多时自动退回顶部对齐。 */
@media (min-width: 761px) {
  body:not(.exam-mode):not(.practice-mode) #view {
    display: flex;
    flex-direction: column;
  }
  body:not(.exam-mode):not(.practice-mode) #view > *:first-child { margin-top: auto; }
  body:not(.exam-mode):not(.practice-mode) #view > *:last-child { margin-bottom: auto; }
}

/* ④ 电脑端「一键重练错题」不再占满整行
   注意 .theme-light .nb-main { width:100% } 权重更高，这里必须带 .theme-light 才压得住 */
@media (min-width: 761px) {
  .theme-light .nb-main,
  .theme-dark .nb-main {
    width: auto;
    min-width: 200px;
    align-self: flex-start;
  }
}

/* ⑤ 「今日修炼」按词换行，别把「判断」拆成两行 */
.today-tip { word-break: keep-all; overflow-wrap: anywhere; }

/* ⑥ 电脑端记录行右侧数字留出边距，别贴边框 */
@media (min-width: 761px) {
  .act-row { padding-right: 10px; }
}

/* ⑦ 电脑端「老师已教到」提高可读性 */
@media (min-width: 761px) {
  .teacher-hint {
    font-size: 13px;
    color: var(--ink2);
  }
}

/* ⑧ 电脑端藏书阁：行高压到 40px，去掉 320px 限高，7 个单元一屏看完 */
@media (min-width: 761px) {
  .unit-pick {
    max-height: none;
    overflow-y: visible;
  }
  .unit-row {
    min-height: 40px;
    padding: 6px 10px;
  }
  .unit-row .unit-name { font-size: 14px; }
}

/* ⑧ 电脑端藏书阁：行高压到 40px，去掉 320px 限高，7 个单元一屏看完 */
@media (min-width: 761px) {
  .unit-pick {
    max-height: none;
    overflow-y: visible;
  }
  .unit-row {
    min-height: 40px;
    padding: 6px 10px;
  }
  .unit-row .unit-name { font-size: 14px; }
}

/* ============================================================
   P18（2026-11-28）：电脑端考场题号条移到右侧，全部显示不滚动
   老师要求：题号一次性全显示、主内容往左移；手机端保持横排滚动
   ============================================================ */

@media (min-width: 761px) {
  /* 整页改成两列：左题目、右题号 */
  body.exam-mode #view {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 212px;
    grid-template-rows: auto 1fr auto;
    column-gap: 18px;
    align-items: start;
  }
  body.exam-mode .exam-top { grid-column: 1; grid-row: 1; }
  body.exam-mode .exam-paper { grid-column: 1; grid-row: 2; }
  body.exam-mode .exam-bar { grid-column: 1; grid-row: 3; }

  /* 题号条：右侧 5 列网格，25 题一屏全显示，不再横向滚动 */
  body.exam-mode .q-nav {
    grid-column: 2;
    grid-row: 1 / span 3;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    align-content: start;
    padding: 2px;
    overflow: visible;
    max-height: none;
  }
  body.exam-mode .q-nav::-webkit-scrollbar { display: none; }
  body.exam-mode .qn { width: auto; }

  /* 主内容整体往左靠，不再居中 */
  body.exam-mode .s-shell {
    max-width: 1080px;
    margin-left: 0;
    margin-right: auto;
  }
}

/* ============================================================
   P19（2026-11-28）：修正 P18 的两个问题
   1) 上一版把 margin-left 设成 0，整块贴左边、右侧空一大片 —— 改回整体居中
   2) 题号顶到最上面，和「返回/测试」同一水平线 —— 下移到与题目卡齐平（中上位置）
   ============================================================ */

@media (min-width: 761px) {
  /* 整块（左题目 + 右题号）作为整体居中，不再贴左 */
  body.exam-mode .s-shell {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
  }

  /* 题号从「题目卡那一行」开始，不再和顶栏抢位置 */
  body.exam-mode .q-nav {
    grid-row: 2 / span 2;
    padding-top: 0;
    margin-top: 4px;
  }
}

/* ============================================================
   P19（2026-11-28）：修正 P18 的两个问题
   1) 上一版把 margin-left 设成 0，整块贴左边、右侧空一大片 —— 改回整体居中
   2) 题号顶到最上面，和「返回/测试」同一水平线 —— 下移到与题目卡齐平（中上位置）
   ============================================================ */

@media (min-width: 761px) {
  /* 整块（左题目 + 右题号）作为整体居中，不再贴左 */
  body.exam-mode .s-shell {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
  }

  /* 题号从「题目卡那一行」开始，不再和顶栏抢位置 */
  body.exam-mode .q-nav {
    grid-row: 2 / span 2;
    padding-top: 0;
    margin-top: 4px;
  }
}

/* ============================================================
   P20（2026-11-28）：藏书阁「出题范围」改成折叠面板
   老师要求：默认收起，学生要调时自己展开；开始练习按钮放到上面
   ============================================================ */

.scope-fold {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.scope-fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.scope-fold > summary::-webkit-details-marker { display: none; }
.scope-fold > summary::before {
  content: '▸';
  flex: none;
  font-size: 11px;
  color: var(--dim);
  transition: transform .15s ease;
}
.scope-fold[open] > summary::before { transform: rotate(90deg); }
.scope-fold .scope-sum { margin-left: auto; white-space: nowrap; }
.scope-fold[open] > summary { margin-bottom: 10px; }

/* 开始练习按钮现在在折叠面板上方，加一点下边距 */
#pStart { margin-bottom: 12px; }
