:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1b2233;
  --text-2: #5a6478;
  --muted: #929bad;
  --line: #ebedf3;
  --primary: #3f6df5;
  --primary-soft: #eaf0ff;
  --ok: #11a06a;
  --ok-soft: #e8f8f0;
  --bad: #e5484d;
  --bad-soft: #fdeced;
  --warn: #d98600;
  --warn-soft: #fff6e5;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(26, 40, 80, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: linear-gradient(160deg, #e9eefb 0%, #f4f6fb 45%, #eef2fa 100%);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* 仅供屏幕阅读器的标签（配 label for 使用，U-15） */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- 手机容器 ---------- */
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100%;
  max-height: 940px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

@media (min-width: 760px) {
  .phone {
    height: calc(100% - 48px);
    border-radius: 26px;
    box-shadow: 0 24px 70px rgba(24, 38, 80, 0.18), 0 2px 0 rgba(255,255,255,.9) inset;
    border: 1px solid rgba(255,255,255,.8);
  }
}

/* ---------- 顶栏 ---------- */
.appbar {
  flex: none;
  min-height: 52px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding-top: calc(10px + env(safe-area-inset-top));
}
.appbar.plain { background: transparent; border-bottom: 0; }
.appbar[hidden] { display: none; }
.appbar h1 {
  font-size: 17px; font-weight: 600; margin: 0; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.appbar .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.appbar .act { font-size: 13px; color: var(--primary); padding: 6px 8px; border-radius: 8px; }
.appbar .act:active { background: var(--primary-soft); }
.icon-btn {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px; color: var(--text-2);
  background: #f2f4f9;
  flex: none;
  touch-action: manipulation;
}
.icon-btn:active { transform: scale(.94); }
/* 答题页顶栏按钮：加大点击区域，避免手机上点不到 */
.icon-btn.tap-lg { width: 40px; height: 40px; font-size: 21px; }
a.icon-btn { text-decoration: none; }

/* ---------- 内容区 ---------- */
.view {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px calc(74px + env(safe-area-inset-bottom));
}
.view.no-tab { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.view.quiz-view { padding: 0 0 calc(78px + env(safe-area-inset-bottom)); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  /* 按 Tab 数量均分：以前写死 repeat(4,1fr)，删掉一个 Tab 后剩下的图标会挤在左侧 */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: #fff;
  border-top: 1px solid var(--line);
}
.tabbar[hidden] { display: none; }
.tab {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; color: var(--muted);
}
.tab-ico {
  font-size: 17px; line-height: 1; opacity: .75;
  height: 19px; display: flex; align-items: center; justify-content: center;
}
.tab.on { color: var(--primary); font-weight: 600; }
.tab.on .tab-ico { opacity: 1; }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
form.card { margin-top: 0; }
.card.tight { padding: 10px 12px; }
.card-title { font-size: 14px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; }
.card-title .more { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr { height: 1px; background: var(--line); margin: 12px -14px; }

/* ---------- 首页头部 ---------- */
.hero {
  position: relative;
  border-radius: 18px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(135deg, #4b74f7 0%, #6a5bf0 55%, #8b5cf6 100%);
  box-shadow: 0 10px 24px rgba(74, 105, 240, .28);
  margin-bottom: 14px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; right: -30px; top: -40px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.hero::before {
  content: "";
  position: absolute; right: 30px; bottom: -60px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero h2 { margin: 0 0 2px; font-size: 19px; font-weight: 600; }
.hero .hello { font-size: 12.5px; opacity: .82; }
.hero-stats { display: flex; gap: 0; margin-top: 16px; position: relative; z-index: 1; }
.hero-stat { flex: 1; text-align: center; }
.hero-stat b { display: block; font-size: 20px; font-weight: 600; letter-spacing: .3px; }
.hero-stat span { font-size: 11.5px; opacity: .8; }

/* ---------- 快捷入口 ---------- */
.quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.quick a {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 4px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.quick a:active { transform: scale(.97); }
.quick .q-ico { font-size: 19px; display: block; margin-bottom: 4px; }
.quick .q-txt { font-size: 12px; color: var(--text-2); }
/* 无题库时的「随机练习」：disabled 展示，仍可点击弹出引导（U-20） */
.quick .q-off {
  display: block; width: 100%;
  background: var(--card); border: 0;
  border-radius: 12px; padding: 12px 4px 10px;
  text-align: center; box-shadow: var(--shadow);
  opacity: .5; cursor: not-allowed;
}
.quick .q-off .q-txt { color: var(--muted); }
body.night .quick .q-off { background: var(--card); }

/* ---------- 题库卡片 ---------- */
.bank-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #fbfcff;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.bank-item:last-child { margin-bottom: 0; }
.bank-badge {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-size: 18px; flex: none;
}
.bank-item h3 { margin: 0 0 3px; font-size: 14.5px; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  height: 38px; padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  background: #f1f3f9; color: var(--text-2);
  transition: transform .08s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(63,109,245,.28); }
.btn.block { display: flex; width: 100%; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { background: var(--primary-soft); color: var(--primary); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn[disabled] { opacity: .5; }

/* ---------- 章节 ---------- */
.chap {
  border-radius: 12px;
  background: #fbfcff;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  overflow: hidden;
}
.chap-head {
  display: flex; align-items: center; gap: 8px;
  padding: 0;
  cursor: pointer;
}
/* 章节头本体是按钮（R-26），让键盘/读屏能展开；右侧「练习」是它的兄弟节点，
   不能再嵌套按钮，否则 HTML 非法、点击目标也会互相抢。 */
.chap-toggle {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 12px; text-align: left; color: inherit;
}
.chap-toggle:disabled { cursor: default; }
.chap-head .arrow { font-size: 11px; color: var(--muted); transition: transform .15s; }
.chap.open > .chap-head .arrow { transform: rotate(90deg); }
.chap-head b { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; }
.chap-meta { font-size: 11.5px; color: var(--muted); flex: none; }
.chap-body { padding: 0 12px 8px 12px; }
.chap-body .chap { background: #fff; }
.chap-body .chap:last-child { margin-bottom: 8px; }
.chap-go {
  font-size: 12px; color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 9px; border-radius: 7px; flex: none;
  margin-right: 12px;
}

/* ---------- 答题页 ---------- */
.quiz-top {
  padding: 8px 14px 10px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  padding-top: calc(14px + env(safe-area-inset-top));
}
.quiz-progress { height: 5px; border-radius: 3px; background: #eef1f7; overflow: hidden; margin-top: 8px; }
.quiz-progress i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #4b74f7, #8b5cf6); transition: width .25s; }
.quiz-count { font-size: 12px; color: var(--muted); flex: none; }

/* 考试进行中隐藏答案的提示：不能只留空白 */
.quiz-notice {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 10px 14px 0;
  padding: 9px 11px;
  font-size: 12.5px; line-height: 1.55;
  color: #8a5a00;
  background: var(--warn-soft);
  border: 1px solid #ffe6b8;
  border-radius: 10px;
}
.quiz-notice b { flex: none; font-weight: 600; }
.quiz-notice span { flex: 1; min-width: 0; }
.quiz-notice a { flex: none; color: var(--primary); text-decoration: none; font-weight: 600; white-space: nowrap; }
.quiz-notice .qn-acts { display: flex; align-items: center; gap: 10px; flex: none; }
.quiz-notice .qn-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--bad); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
body.night .quiz-notice { color: #ffd591; background: rgba(255,180,60,.12); border-color: rgba(255,180,60,.28); }

.q-card { padding: 16px 14px 8px; }
.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.type-tag {
  font-size: 11.5px; padding: 2px 8px; border-radius: 6px; font-weight: 500;
  background: var(--primary-soft); color: var(--primary);
}
.type-tag.multiple { background: #f1eaff; color: #7c4dff; }
.type-tag.judge { background: #e6f7f4; color: #0c9b86; }
.type-tag.fill { background: var(--warn-soft); color: var(--warn); }
.type-tag.essay { background: #fdecf3; color: #d6457c; }
.q-no { font-size: 12px; color: var(--muted); }
.stem {
  font-size: 16.5px;
  line-height: 1.72;
  font-weight: 500;
  margin: 0 0 16px;
  word-break: break-word;
}
.stem .blank-inline {
  display: inline-block;
  width: 84px;
  border: 0;
  border-bottom: 1.5px solid var(--primary);
  text-align: center;
  font-size: 15px;
  padding: 0 2px 1px;
  background: transparent;
  color: var(--text);
  margin: 0 3px;
  border-radius: 0;
}
.stem .blank-inline:focus { outline: 0; background: var(--primary-soft); }
.stem .blank-inline.ok { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.stem .blank-inline.bad { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }

/* 选项 */
.opts { display: grid; gap: 9px; margin-bottom: 8px; }
.opt {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: #fff;
  text-align: left;
  width: 100%;
  transition: border-color .12s, background .12s;
}
.opt:active { background: #fafbff; }
.opt .k {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid #d6dbe6; color: var(--text-2);
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600; flex: none;
  margin-top: -1px;
}
.opt .t { flex: 1; font-size: 14.5px; line-height: 1.55; padding-top: 1px; }
.opt.on { border-color: var(--primary); background: var(--primary-soft); }
.opt.on .k { background: var(--primary); border-color: var(--primary); color: #fff; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.err { border-color: var(--bad); background: var(--bad-soft); }
.opt.err .k { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt .mark { font-size: 11px; color: var(--muted); margin-left: 4px; }

/* 判断题 */
.judge-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.judge-btn {
  height: 58px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 14px; color: var(--text-2);
}
.judge-btn .j-ico { font-size: 19px; }
.judge-btn.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.judge-btn.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.judge-btn.err { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }

/* 填空 / 问答 */
.fill-rows { display: grid; gap: 10px; margin-bottom: 8px; }
.fill-row { display: flex; align-items: center; gap: 8px; }
.fill-row .no { font-size: 12px; color: var(--muted); flex: none; width: 42px; }
.fill-input {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  padding: 0 12px;
  background: #fbfcff;
  font-size: 14.5px;
}
.fill-input:focus { outline: 0; border-color: var(--primary); background: #fff; }
.fill-input.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.fill-input.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.essay-input {
  width: 100%;
  min-height: 120px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: #fbfcff;
  padding: 12px;
  font-size: 14.5px;
  line-height: 1.65;
  resize: vertical;
  margin-bottom: 8px;
}
.essay-input:focus { outline: 0; border-color: var(--primary); background: #fff; }

/* 判定反馈 */
.feedback {
  border-radius: 12px;
  padding: 12px;
  margin: 4px 0 10px;
  border: 1px solid transparent;
}
.feedback.ok { background: var(--ok-soft); border-color: #c9f0de; }
.feedback.bad { background: var(--bad-soft); border-color: #fbd5d7; }
.feedback.warn { background: var(--warn-soft); border-color: #ffe6b8; }
/* 作答反馈：一行结论（对错 / 得分 / 通过率 / 难度）+ 两列答案对照 + 解析。
   旧版把「你的答案」「正确答案」各占一整块，一张卡就吃掉半屏。 */
.fb-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fb-verdict { font-weight: 600; font-size: 14.5px; }
.feedback.ok .fb-verdict { color: var(--ok); }
.feedback.bad .fb-verdict { color: var(--bad); }
.feedback.warn .fb-verdict { color: var(--warn); }
.feedback.reveal .fb-verdict { color: var(--primary); }
.fb-score, .fb-note { font-size: 12.5px; color: var(--text-2); }
.fb-rate { font-size: 11.5px; color: var(--text-2); background: rgba(255,255,255,.72); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.fb-stars { display: inline-flex; gap: 1px; font-size: 12px; color: #d8dee9; white-space: nowrap; }
.fb-stars i { font-style: normal; }
.fb-stars i.on { color: #f0a219; }
.fb-stars.none { font-size: 11.5px; color: var(--muted); }
.fb-cmp { display: flex; gap: 8px; margin-top: 9px; }
.fb-cell { flex: 1; min-width: 0; background: rgba(255,255,255,.78); border-radius: 8px; padding: 7px 10px; }
.fb-cell span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.fb-cell b { font-size: 14.5px; font-weight: 600; color: var(--text); word-break: break-word; }
.fb-cell b.mine { color: var(--text-2); font-weight: 500; }
.fb-an { margin-top: 9px; font-size: 13px; line-height: 1.6; color: var(--text-2); }
.fb-an b { color: var(--text); font-weight: 600; margin-right: 6px; }
.fb-an.empty { color: var(--muted); }
/* 折叠：默认截 3 行，点「展开」加 .open 放开。是否真的截断由 JS 实测决定按钮显隐 */
.fb-an.fold:not(.open) .fb-an-t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fb-more { display: block; margin-top: 2px; font-size: 12px; color: var(--primary); }
.fb-acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.fb-act { font-size: 12.5px; color: var(--text-2); background: rgba(255,255,255,.85); border-radius: 8px; padding: 5px 10px; }
.fb-act.done { color: var(--muted); background: transparent; padding: 0; }
.q-extra { display: flex; justify-content: flex-end; padding: 2px 0 10px; }
.fb-blanks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fb-blanks span { font-size: 12px; background: rgba(255,255,255,.8); border-radius: 6px; padding: 2px 8px; }

/* 底部操作条 */
.quiz-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 10px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.quiz-bar .btn { flex: 1; height: 44px; border-radius: 12px; font-size: 15px; }
.quiz-bar .btn.narrow { flex: 0 0 88px; }
/* 底栏最左的「设置」：固定宽度，不参与均分，避免把「上一题」挤窄 */
.quiz-bar .btn.gear { flex: 0 0 46px; padding: 0; display: grid; place-items: center; background: #f2f4f9; }
.quiz-bar .btn.gear .gear-ico { font-size: 18px; line-height: 1; color: var(--text-2); display: grid; place-items: center; }
body.night .quiz-bar .btn.gear { background: #1f2836; }

/* 答题页标题：题库名 + 当前模式，两行居中 */
.quiz-head { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.quiz-head b { font-size: 14.5px; font-weight: 600; }
.quiz-head span { font-size: 11.5px; color: var(--muted); }
.quiz-head .ellipsis { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 多选题工具条：挪到选项下方（拇指够得着），未开「一键全选」时只留一行提示 */
.multi-tools { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
.mt-hint { flex: 1; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.mt-btn { flex: none; font-size: 12.5px; color: var(--primary); background: var(--primary-soft); border-radius: 8px; padding: 6px 12px; }

/* 答题卡 */
.answer-card { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }
.ac-item {
  aspect-ratio: 1;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 13px;
  background: #f3f5fa; color: var(--text-2);
  border: 1.5px solid transparent;
}
.ac-item.ok { background: var(--ok-soft); color: var(--ok); }
.ac-item.bad { background: var(--bad-soft); color: var(--bad); }
.ac-item.done { background: var(--warn-soft); color: var(--warn); }
.ac-item.cur { border-color: var(--primary); color: var(--primary); font-weight: 600; background: #fff; }
.ac-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 14px; }
.ac-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; }

/* ---------- 结果页 ---------- */
.result-hero { text-align: center; padding: 26px 16px 22px; }
.score-ring {
  width: 132px; height: 132px; border-radius: 50%;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  background: conic-gradient(var(--primary) var(--p), #e8ecf6 0);
  position: relative;
}
.score-ring::before {
  content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--card);
}
.score-inner { position: relative; text-align: center; }
.score-inner b { font-size: 34px; font-weight: 600; display: block; line-height: 1.1; }
.score-inner span { font-size: 11.5px; color: var(--muted); }
.result-stats { display: flex; margin-top: 4px; }
.result-stats > div { flex: 1; text-align: center; padding: 4px 0; }
.result-stats b { display: block; font-size: 19px; font-weight: 600; }
.result-stats span { font-size: 11.5px; color: var(--muted); }
.result-list .r-item { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.result-list .r-item:last-child { border-bottom: 0; }
.r-no { width: 22px; color: var(--muted); font-size: 12px; flex: none; }
.r-stem { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.r-flag { font-size: 11.5px; flex: none; padding: 1px 7px; border-radius: 5px; }
.r-flag.ok { color: var(--ok); background: var(--ok-soft); }
.r-flag.bad { color: var(--bad); background: var(--bad-soft); }
.r-flag.warn { color: var(--warn); background: var(--warn-soft); }

/* ---------- 列表 ---------- */
.list-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .li-stem { font-size: 14.5px; line-height: 1.6; margin-bottom: 6px; }
.list-item .li-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: #f2f4f9; color: var(--text-2); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- 我的 ---------- */
.profile-head { display: flex; align-items: center; gap: 13px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #5b82f8, #8b5cf6);
  color: #fff; font-size: 22px; font-weight: 600; flex: none;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-box { background: #fbfcff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat-box b { display: block; font-size: 20px; font-weight: 600; }
.stat-box span { font-size: 11.5px; color: var(--muted); }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.menu-item:last-child { border-bottom: 0; }
.menu-item .mi-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 14px; }
.menu-item .mi-arrow { margin-left: auto; color: #c6ccd9; font-size: 16px; }
/* 菜单项也可能是 <button>（弹层里的危险操作），统一成同一副样子 */
button.menu-item { width: 100%; text-align: left; background: none; -webkit-appearance: none; }
.menu-item.mi-danger .grow, .menu-item.mi-danger .mi-arrow { color: var(--bad); }
.menu-item.mi-danger .mi-ico { background: var(--bad-soft); color: var(--bad); }
/* 弹层里的列表：标题 + 若干项 + 取消，与「题库操作」页同一套观感 */
.sheet-menu { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin-top: 12px; }
.sheet-menu .menu-item { padding: 13px 0; }
.sheet-meta { margin: 0 0 2px; }
.bm-name { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
/* 账号动作（退出登录 / 登录）放页尾：和上面的设置项拉开距离，避免在列表里被误触 */
.mine-foot { margin-top: 24px; }
/* 修改资料页：头像 + 只读用户名 */
.pf-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.pf-name { font-size: 15px; font-weight: 600; }
.form-input[readonly], .form-input[disabled] { background: #f5f7fb; color: var(--muted); }
body.night .form-input[readonly], body.night .form-input[disabled] { background: #1b2330; }

/* ---------- 报告 ---------- */
/* 高度交给内容：旧版写死 116px，柱高 78 + 两行标签正好超出去，
   标签会溢出卡片压到下一张卡上（学习报告页的那个红框）。 */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; padding-top: 10px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; justify-content: flex-end; }
.bar { width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: var(--primary-soft); position: relative; min-height: 3px; }
.bar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0 0 3px 3px; background: linear-gradient(180deg, #5b82f8, #4568e8); }
/* 当日无作答：柱体用更浅的底色，但同样走变量，夜间才不会变成亮棒（R-20） */
.bar.empty { background: #f0f2f7; }
.bar-label { font-size: 10px; color: var(--muted); letter-spacing: -.2px; }
.rate-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 13px; }
.rate-row .rn { width: 92px; flex: none; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rate-track { flex: 1; height: 7px; border-radius: 4px; background: #eef1f7; overflow: hidden; }
.rate-track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #5b82f8, #8b5cf6); }
.rate-num { width: 46px; text-align: right; font-size: 12px; color: var(--text-2); flex: none; }

/* 空态 / 载入 */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
/* 图标必须是 flex 居中：.ico 是 display:block 的 SVG，放在普通块级 span 里会贴左边，
   看起来就是「图标在左上、文字在中间」的错位（模拟考试空态踩过）。 */
.empty .e-ico {
  font-size: 34px; opacity: .35;
  display: flex; justify-content: center;
  margin: 0 auto 10px;
}
/* 统一图标（R-22）：描边 SVG，颜色跟随 currentColor，尺寸跟随 font-size */
.ico {
  width: 1em; height: 1em; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.empty p { margin: 0 0 14px; font-size: 13.5px; }
.loading { text-align: center; padding: 40px 0; color: var(--muted); font-size: 13px; }
.spinner {
  width: 22px; height: 22px; margin: 0 auto 10px;
  border: 2.5px solid #e3e8f4; border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 弹层 / 提示 ---------- */
/* 弹层一律居中（U-48）：菜单、确认、表单都从屏幕中间弹出。
   以前贴底上滑像手机原生的 action sheet，但在同一屏里既要点底部又要点顶部按钮，
   手指要来回跑；居中之后确认框和触发它的按钮距离一致，看起来也更像「提示」。 */
.mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 28, 48, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade .16s ease;
}
.mask[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 400px;
  background: #fff;
  border-radius: 18px;
  padding: 20px 18px;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  animation: pop .18s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.sheet:focus { outline: none; }
.sheet h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; text-align: center; }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 8px);
  background: rgba(28, 34, 51, .9);
  color: #fff; font-size: 13px;
  padding: 9px 16px; border-radius: 20px;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 100;
  max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 成功 / 失败语义色（U-18） */
.toast.ok { background: rgba(17, 160, 106, .96); color: #fff; }
.toast.err { background: rgba(229, 72, 77, .96); color: #fff; }
body.night .toast.ok { background: rgba(23, 138, 94, .96); }
body.night .toast.err { background: rgba(196, 58, 63, .96); }

/* 宽屏提示（避免被误认为手机页面） */
.desktop-hint {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  font-size: 11.5px; color: #9aa3b5; letter-spacing: .3px;
}
@media (max-width: 759px) { .desktop-hint { display: none; } }

/* ---------- 刷题设置面板 ---------- */
.set-group-title {
  font-size: 12.5px; color: var(--muted);
  margin: 0 0 6px 4px;
}
.set-card {
  background: #f7f9fd;
  border-radius: 12px;
  padding: 4px 12px;
  margin-bottom: 14px;
}
.set-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #e8ecf5;
  cursor: pointer;
}
.set-item:last-child { border-bottom: 0; }
.set-item .si-main { flex: 1; min-width: 0; }
.si-name { font-size: 14.5px; color: var(--text); }
.si-desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.switch {
  flex: none;
  width: 46px; height: 27px;
  border-radius: 14px;
  background: #dde3ee;
  position: relative;
  transition: background .18s;
  touch-action: manipulation;
}
.switch b {
  position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 35, 70, .2);
  transition: transform .18s;
}
.switch.on { background: var(--primary); }
.switch.on b { transform: translateX(19px); }
.seg {
  display: flex; gap: 4px;
  background: #eaeef7;
  border-radius: 10px;
  padding: 4px;
  margin: 8px 0 2px;
}
.seg button {
  flex: 1; height: 34px; border-radius: 8px;
  font-size: 13.5px; color: var(--text-2);
  transition: background .16s, color .16s;
  touch-action: manipulation;
}
.seg button.on {
  background: #fff; color: var(--primary); font-weight: 600;
  box-shadow: 0 1px 4px rgba(24, 38, 80, .14);
}
.set-note {
  font-size: 12px; color: var(--muted);
  margin-top: 4px; line-height: 1.6;
}
/* 管理员锁定 / 全锁时的只读项：置灰、不可点 */
.set-item.ro { cursor: default; opacity: .62; }
.switch.ro { pointer-events: none; }
body.night .set-item.ro { opacity: .5; }

/* 数值型设置（随机抽题数量）：减 / 值 / 加，点一次记一次，不用键盘 */
.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper button {
  width: 30px; height: 30px; border-radius: 9px;
  background: #fff; color: var(--primary);
  border: 1px solid var(--line);
  font-size: 17px; line-height: 1;
  display: grid; place-items: center;
}
.stepper button:disabled { color: #c3cbd8; }
.stepper b {
  min-width: 34px; text-align: center;
  font-size: 15px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}
body.night .stepper button { background: #232c3b; border-color: #2b3648; }
body.night .stepper button:disabled { color: #4b5769; }

/* ---------- 题库管理（移动端） ---------- */
.admin-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.q-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.q-row:last-of-type { border-bottom: 0; }
.q-row .qr-main { flex: 1; min-width: 0; }
.q-row .qr-stem {
  font-size: 14px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.q-row .qr-meta { font-size: 12px; color: var(--muted); margin-top: 5px; }
.q-row .qr-arrow { color: #c6ccd9; font-size: 16px; flex: none; }
.tag-mini {
  display: inline-block; font-size: 11px;
  padding: 1px 6px; border-radius: 5px;
  background: var(--primary-soft); color: var(--primary);
  margin-right: 4px;
}
.form-label { font-size: 12.5px; color: var(--muted); margin: 16px 0 7px 2px; }
.form-input, .form-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14.5px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .16s;
}
.form-area { min-height: 88px; resize: vertical; line-height: 1.6; }
.form-input:focus, .form-area:focus { border-color: var(--primary); }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-row .ok { width: 22px; text-align: center; font-size: 13px; color: var(--muted); flex: none; }
.opt-row .del {
  width: 32px; height: 32px; border-radius: 9px;
  color: var(--bad); background: var(--bad-soft);
  flex: none; font-size: 16px; line-height: 1;
}
.ans-keys { display: flex; flex-wrap: wrap; gap: 8px; }
.ans-key {
  width: 42px; height: 42px; border-radius: 10px;
  background: #f1f3f9; color: var(--text-2);
  font-size: 14.5px;
  touch-action: manipulation;
}
.ans-key.on { background: var(--primary); color: #fff; font-weight: 600; }
.sheet-desc {
  font-size: 13.5px; color: var(--text-2);
  text-align: center; margin: -4px 0 4px;
}

/* ---------- 答题页：案例 / 闪卡 / 背题 ---------- */
.case-head {
  display: flex; gap: 8px;
  font-size: 13px; line-height: 1.65;
  color: var(--text-2);
  background: var(--primary-soft);
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 12px;
}
.case-head span {
  flex: none; font-size: 11px; font-weight: 600;
  color: var(--primary);
  background: #fff;
  border-radius: 5px; padding: 1px 6px; height: 18px; line-height: 16px;
}
.flash-tip {
  text-align: center;
  font-size: 13px; color: var(--muted);
  padding: 30px 10px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
}
.fill-reveal {
  font-size: 13.5px; line-height: 1.7;
  background: var(--ok-soft); color: var(--ok);
  border-radius: 10px; padding: 10px 12px;
  margin: 4px 0 10px;
}
.feedback.reveal { background: var(--primary-soft); border-color: #d3dffd; }
.feedback.reveal .fb-title { color: var(--primary); }
.fb-ans.mine { background: rgba(255,255,255,.9); color: var(--text-2); }

/* ---------- 夜间模式 ---------- */
body.night {
  --bg: #0f141c;
  --card: #171e29;
  --text: #e7ebf3;
  --text-2: #b3bccb;
  --muted: #7d8798;
  --line: #263041;
  --primary: #6c8cff;
  --primary-soft: #1d2740;
  --ok: #2fbf8b;
  --ok-soft: #14312a;
  --bad: #ff7a7f;
  --bad-soft: #3a2027;
  --warn: #e0a33a;
  --warn-soft: #352c18;
  --shadow: 0 2px 12px rgba(0, 0, 0, .4);
  background: #0a0e14;
}
body.night .phone { background: var(--bg); }
body.night .icon-btn { background: #232c3b; }
body.night .btn:not(.primary):not(.ghost):not(.danger) { background: #232c3b; color: var(--text-2); }
body.night .bank-item,
body.night .chap,
body.night .stat-box,
body.night .fill-input,
body.night .essay-input,
body.night .ac-item { background: #1b2330; }
body.night .chap-body .chap,
body.night .opt,
body.night .ac-item.cur,
body.night .case-head span { background: #212b3a; }
body.night .opt:active { background: #253043; }
body.night .quiz-bar { background: #141a24; }
body.night .tabbar { background: #141a24; }
body.night .sheet { background: #171e29; }
body.night .fb-cell,
body.night .fb-rate,
body.night .fb-act,
body.night .fb-blanks span { background: rgba(255, 255, 255, .08); }
body.night .fb-act.done { background: transparent; }
body.night .fb-blanks span { background: rgba(255, 255, 255, .1); }
body.night .quiz-progress,
body.night .rate-track,
body.night .bar { background: #232c3b; }
body.night .bar.empty { background: #1a2230; }
body.night .mask { background: rgba(0, 0, 0, .6); }
body.night .toast { background: rgba(60, 70, 90, .95); }
body.night .card[style*="#fbfcff"] { background: #1b2330 !important; }
body.night .desktop-hint { color: #5b6678; }
body.night .set-card { background: #1b2330; }
body.night .set-item { border-bottom-color: #26303f; }
body.night .seg { background: #141a24; }
body.night .seg button { color: #8894a8; }
body.night .seg button.on { background: #26303f; color: #8fb0ff; box-shadow: none; }
body.night .switch { background: #35404f; }
body.night .switch.on { background: var(--primary); }
body.night .switch b { background: #f3f6fb; }
body.night .form-input,
body.night .form-area { background: #1b2330; border-color: #2a3546; color: #e6ebf5; }
body.night .form-input::placeholder,
body.night .form-area::placeholder { color: #64708a; }
body.night .q-row { border-bottom-color: #26303f; }
body.night .ans-key { background: #26303f; color: #8894a8; }
body.night .ans-key.on { background: var(--primary); color: #fff; }
body.night .opt-row .del { background: rgba(229, 72, 77, .18); }

/* ---------- 题库详情（二级页） ---------- */
.bank-hero { padding: 16px 16px 14px; margin-bottom: 14px; }
.bank-hero-name { position: relative; z-index: 1; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.bank-hero-type { position: relative; z-index: 1; font-size: 11.5px; opacity: .82; margin-top: 4px; }
.bank-hero .hero-stats { margin-top: 14px; }
.hero-stat b .hs-sub { font-size: 12px; font-weight: 400; opacity: .72; }
.bank-hero .hero-bar {
  position: relative; z-index: 1;
  height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, .26);
  margin-top: 12px; overflow: hidden;
}
.hero-bar i { display: block; height: 100%; border-radius: 2px; background: #fff; }

.main-cta { height: 46px; font-size: 15px; font-weight: 600; margin-bottom: 7px; }
.cta-sub { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 14px; }

.exam-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px dashed #c9d6f5;
}
.exam-ico {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-size: 17px;
}
.exam-title { font-size: 14.5px; font-weight: 600; }

.chap-main { min-width: 0; }
.chap-t1 { display: flex; align-items: baseline; gap: 6px; }
.chap-t1 b { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; }
.chap-t1 .chap-meta { flex: none; }
.chap-bar { height: 4px; margin-top: 7px; }
.chap-body .chap-head { padding: 10px 12px; }

.set-summary { background: #fbfcff; }

.exam-clock {
  flex: none;
  font-size: 12.5px; font-weight: 600; color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 9px; border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.exam-clock.urgent { color: #fff; background: var(--bad); }

.exam-verdict {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
}
.exam-verdict.pass { color: var(--ok); background: var(--ok-soft); }
.exam-verdict.fail { color: var(--bad); background: var(--bad-soft); }
.ac-item.answered { background: #e6efff; color: var(--primary); }

body.night .exam-card { border-color: #2c3a52; }
body.night .exam-clock { background: #1d2b45; color: #8fb0ff; }
body.night .exam-clock.urgent { background: var(--bad); color: #fff; }
body.night .set-summary { background: #1b2330; }
body.night .ac-item.answered { background: #1d2b45; color: #8fb0ff; }
body.night .quick a { background: var(--card); }

/* 答题卡底部操作条：100 题也能随时交卷 */
.ac-actions {
  gap: 10px;
  position: sticky;
  bottom: 0;
  padding: 12px 0 2px;
  background: var(--card);
  box-shadow: 0 -8px 12px -8px rgba(20, 30, 60, .12);
}
body.night .ac-actions { background: #171e29; }

/* ---------- 题库列表（一级页） ---------- */
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 2px 12px;
  font-size: 13px;
}
.list-head b { font-size: 17px; font-weight: 600; }

/* 批量导入引导（手机端没有导入能力，指到电脑端后台） */
.import-url {
  margin-top: 14px; padding: 12px 14px;
  background: #f4f6fb; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13.5px; color: var(--text); word-break: break-all;
  user-select: all; -webkit-user-select: all;
}
body.night .import-url { background: #1b2230; }
.import-tip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: -2px 2px 10px; font-size: 12.5px; color: var(--muted);
}
.import-tip a { flex: none; color: var(--primary); text-decoration: none; font-weight: 600; }

/* 题库页顶部概览卡：总量 + 三个学习指标 + 一键随机练习 */
.bank-summary {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 14px 12px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}
.bank-summary .list-head { margin: 0 0 4px; }
.bs-done {
  font-size: 11.5px; color: var(--text-2);
  background: #f4f6fb; border-radius: 8px; padding: 3px 9px;
  font-variant-numeric: tabular-nums;
}
/* 顶部概览第二行（R-23）：一句进度，替代原来三块指标卡 */
.bs-line {
  margin-top: 7px; padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.bs-line b { color: var(--text); font-weight: 650; }
.bs-line i { font-style: normal; margin: 0 6px; color: #c9d0dc; }
.bs-rand {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin-top: 12px; padding: 9px 12px;
  border-radius: 12px; text-align: left;
  background: linear-gradient(100deg, #eff4ff, #f5f1ff);
  transition: transform .1s;
}
.bs-rand:active { transform: scale(.99); }
.bsr-ico {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 14px;
  background: #fff; color: #f0a020;
  box-shadow: 0 2px 6px rgba(63, 109, 245, .12);
}
.bsr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bsr-text b { font-size: 13.5px; font-weight: 600; color: var(--primary); }
.bsr-text i {
  font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bsr-go { flex: none; font-size: 16px; line-height: 1; color: var(--primary); opacity: .65; }

.bank-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 6px 18px -12px rgba(22, 36, 74, .38);
  border: 1px solid rgba(20, 30, 60, .035);
  padding: 14px 15px 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform .1s;
}
.bank-card:active { transform: scale(.99); }
.bc-top { display: flex; align-items: flex-start; gap: 12px; }
.bank-card .bank-badge {
  width: 40px; height: 40px; border-radius: 13px; font-size: 17px;
  background: linear-gradient(140deg, #eff4ff, #e3ebff);
}
.bc-main { min-width: 0; padding-top: 1px; }
.bc-name {
  font-size: 15px; font-weight: 600; line-height: 1.38; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 第二行：作者 + 题数 + 进度条。不再放来源角标（「未推送」这类词对学员没意义，
   超管也不需要靠列表判断推送状态——推送在题库管理里做） */
.bc-sub { display: flex; align-items: center; gap: 8px; margin-top: 5px; min-width: 0; }
.bc-author {
  flex: 1; min-width: 0;
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 进度条并进第二行（R-23）：卡片从 4 行压到 2 行 */
.bc-sub .rate-track { flex: none; width: 56px; height: 5px; }
.bc-sub .bc-num { font-size: 11px; }
.bc-desc {
  flex: 1; min-width: 0; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bc-more {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: #f4f6fb; color: #98a1b0;
  font-size: 15px; line-height: 1; margin-top: 1px;
  touch-action: manipulation;
}
.bc-bar-row { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.bc-bar-row .rate-track { height: 6px; }
.bc-num { font-size: 11.5px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.bc-meta {
  display: flex; align-items: center;
  margin-top: 9px;
  font-size: 12px; color: var(--muted);
}
.bc-stat { white-space: nowrap; }
.bc-stat + .bc-stat::before { content: '·'; margin: 0 7px; color: #ccd3e0; }
.bc-meta b { color: var(--text); font-weight: 600; }
.bc-go {
  margin-left: auto; display: inline-flex; align-items: center; gap: 3px;
  color: var(--primary); font-size: 12.5px; font-weight: 600;
}
.bc-go i { font-style: normal; font-size: 14px; line-height: 1; opacity: .75; }

/* ---------- 题库页磁贴：一行两个，背题/闪卡/快捷练习/设置/考试统一 ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.tile {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 11px 12px;
  text-align: left;
  color: var(--text);
  touch-action: manipulation;
  transition: transform .1s;
}
.tile:active { transform: scale(.98); }
.tile.dim { opacity: .42; pointer-events: none; }
.t-ico {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-size: 15px;
}
.tile.dim .t-ico { background: #f1f3f8; color: var(--muted); }
.t-txt { min-width: 0; flex: 1; }
.t-txt b { display: block; font-size: 14px; font-weight: 600; }
.t-txt small {
  display: block;
  font-size: 11px; color: var(--muted);
  margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.night .tile.dim .t-ico { background: #232c3b; }

/* 小屏（iPhone SE 一类 320px）压缩一档，描述仍能完整显示 */
@media (max-width: 350px) {
  .tile { padding: 10px; gap: 8px; }
  .t-ico { width: 28px; height: 28px; border-radius: 9px; font-size: 13px; }
  .t-txt b { font-size: 13.5px; }
  .t-txt small { font-size: 10px; margin-top: 2px; }
}

/* ---------- 模拟考试 ---------- */
.exam-tip { background: #fbfcff; margin-bottom: 12px; }
.exam-item {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.ei-name { font-size: 15px; font-weight: 600; line-height: 1.4; }
/* 学员自建的个人考试标记 */
.ei-own {
  display: inline-block; vertical-align: 2px;
  margin-left: 6px; padding: 1px 6px;
  font-size: 10.5px; font-weight: 600; line-height: 1.6;
  color: var(--text-2); background: var(--bg-2, rgba(0,0,0,.05));
  border: 1px solid var(--line); border-radius: 5px;
}
.ei-best {
  flex: none; font-size: 11.5px; font-weight: 600;
  color: var(--primary); background: var(--primary-soft);
  padding: 3px 8px; border-radius: 20px;
}
.ei-meta { font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.ei-rules {
  display: inline-block;
  font-size: 11.5px; color: var(--primary);
  background: var(--primary-soft);
  border-radius: 7px; padding: 3px 8px;
  margin-top: 8px;
}
.ei-sub { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.ei-link {
  display: block;
  margin-top: 7px;
  padding: 0;
  font-size: 12px;
  color: var(--primary);
  background: none;
  text-align: left;
}
.ei-actions { display: flex; gap: 8px; margin-top: 12px; }
.ei-actions .btn.primary { flex: 1; }

/* ---------- 考试记录 ---------- */
.rec-sum {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  padding: 14px 6px;
}
.rec-sum-item b { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
.rec-sum-item span { font-size: 11px; color: var(--muted); }
.rec-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: none;
}
.rec-row:last-child { border-bottom: none; }
.rec-main { flex: 1; min-width: 0; }
.rec-top { display: flex; align-items: baseline; gap: 5px; }
.rec-top b { font-size: 20px; font-weight: 600; }
.rec-top i { font-style: normal; font-size: 12px; color: var(--muted); }
.rec-flag {
  margin-left: auto; font-size: 11px;
  padding: 2px 8px; border-radius: 999px;
}
.rec-flag.pass { background: var(--ok-soft); color: var(--ok); }
.rec-flag.fail { background: var(--bad-soft); color: var(--bad); }
.rec-sub {
  display: block; margin-top: 3px;
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rec-arrow { flex: none; color: #c6ccd9; font-size: 17px; }

.rec-q { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rec-q:last-child { border-bottom: none; }
.rec-q-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--muted);
  margin-bottom: 6px;
}
.rec-badge { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.rec-badge.bad { background: var(--bad-soft); color: var(--bad); }
.rec-badge.miss { background: #f1f3f7; color: var(--muted); }
.rec-stem { font-size: 14px; line-height: 1.55; margin-bottom: 6px; }
.rec-line { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.6; margin-top: 4px; }
.rec-line > span:first-child { flex: none; width: 62px; color: var(--muted); }
.rec-line b { font-weight: 500; }
.rec-line b.bad { color: var(--bad); }
.rec-line b.ok { color: var(--ok); }
.rec-analysis {
  margin-top: 8px; padding: 9px 10px;
  background: #f7f9fc; border-radius: 9px;
  font-size: 12.5px; line-height: 1.65;
}

.exam-rules { padding: 2px 12px; }
.rule-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #e8ecf5;
}
.rule-row:last-child { border-bottom: 0; }
.rule-row.dim { opacity: .5; }
.rr-name { flex: 1; min-width: 0; font-size: 13.5px; }
.rr-name small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.rr-in {
  width: 54px; height: 34px; flex: none;
  border: 1px solid #dde3ee; border-radius: 8px;
  text-align: center; font-size: 14px;
  background: #fff; color: var(--text);
  outline: none;
}
.rr-in:focus { border-color: var(--primary); }
.rr-in[disabled] { background: #f3f5fa; color: var(--muted); }
.rr-unit { font-size: 11.5px; color: var(--muted); flex: none; }
.exam-total {
  font-size: 12.5px; color: var(--text-2);
  background: var(--primary-soft);
  border-radius: 10px;
  padding: 9px 12px;
  margin-top: 8px;
}
.exam-total b { color: var(--primary); font-size: 14px; }
.warn-txt { color: var(--warn); }

.rank-head { background: #fbfcff; }
.rank-me {
  margin-top: 10px; font-size: 13px;
  background: var(--primary-soft); color: var(--text-2);
  border-radius: 9px; padding: 8px 11px;
}
.rank-me b { color: var(--primary); }
.rank-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: 0; }
.rank-row.me {
  background: var(--primary-soft);
  border-radius: 10px;
  padding-left: 8px; padding-right: 8px;
  border-bottom-color: transparent;
}
.rk-no { width: 30px; flex: none; text-align: center; font-size: 15px; color: var(--muted); }
.rk-main { min-width: 0; }
.rk-main b { display: block; font-size: 14px; font-weight: 500; }
.rk-main small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.rk-score {
  flex: none; font-size: 18px; font-weight: 600; color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.rk-score small { font-size: 11px; color: var(--muted); font-weight: 400; }

/* 夜间模式补充 */
body.night .bank-card,
body.night .tile,
body.night .exam-item,
body.night .quick a { background: var(--card); }
body.night .bc-more { background: #232c3b; color: #8894a8; }
body.night .bs-rand { background: linear-gradient(100deg, #1b2433, #221d31); border: 1px solid rgba(255, 255, 255, .05); }
body.night .bs-done { background: #232c3b; color: #b3bccb; }
body.night .bsr-ico { background: rgba(255, 255, 255, .08); box-shadow: none; }
body.night .bank-card { border-color: rgba(255, 255, 255, .05); }
body.night .bank-card .bank-badge { background: linear-gradient(140deg, #1f2a3d, #1a2434); }
body.night .exam-tip,
body.night .rank-head { background: #1b2330; }
body.night .rule-row { border-bottom-color: #26303f; }
body.night .rr-in { background: #1b2330; border-color: #2a3546; color: #e6ebf5; }
body.night .rr-in[disabled] { background: #202834; }
body.night .exam-total { background: #1d2740; color: #b3bccb; }
body.night .rank-row { border-bottom-color: #26303f; }
body.night .rank-row.me { background: #1d2740; }
body.night .rec-analysis { background: #1b2331; }
body.night .rec-badge.miss { background: #232c3b; color: #8894a8; }


/* ================= 题库来源与分组（V2） ================= */
.src-badge {
  display: inline-block; font-size: 10px; line-height: 16px;
  padding: 0 6px; border-radius: 5px; margin-right: 6px;
  vertical-align: 2px; font-weight: 500; letter-spacing: .2px;
}
.src-own { background: #e8f0ff; color: #2f62d4; }
.src-push { background: #fff1e3; color: #c2681a; }
.src-join { background: #eef1f5; color: #66707e; }
.src-none { background: #f4f5f7; color: #8b93a1; }

.bank-badge.gray { background: #eef1f5; color: #98a1ae; }
.bank-card.dim { opacity: .72; background: #fafbfd; }
.bank-card.dim .bc-name { color: var(--ink-2); }

/* 详情页作者行：头像 + 作者名；来源/权限/题型分布不再展示（学员只关心「谁的、多少题、什么时候加的」） */
.bank-hero-author {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 7px;
  margin-top: 9px; font-size: 12px; color: rgba(255,255,255,.9);
}
.bh-avatar {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: rgba(255,255,255,.24);
  font-size: 11px; font-weight: 600;
}
.bank-hero-meta {
  position: relative; z-index: 1;
  margin-top: 6px; font-size: 11.5px; color: rgba(255,255,255,.8);
  font-variant-numeric: tabular-nums;
}
.bank-hero-meta i { font-style: normal; margin: 0 6px; opacity: .55; }

/* 分享链接是唯一加入方式：做成可整段选中的地址块 */
.share-link {
  margin-top: 14px; padding: 12px 14px;
  font-size: 12.5px; color: var(--text); line-height: 1.6;
  word-break: break-all; text-align: left;
  background: #f3f6fd; border-radius: 10px;
  user-select: all; -webkit-user-select: all;
}
.notice.ok { background: #eef7f1; color: #11a06a; }

body.night .src-own { background: #1c2b4d; color: #7ea6f5; }
body.night .src-push { background: #3a2b1c; color: #e0a468; }
body.night .src-join { background: #232c3b; color: #9aa6b8; }
body.night .src-none { background: #1e2531; color: #8b93a1; }
body.night .share-link { background: #1b2230; }
body.night .bank-card.dim { background: #171e2b; }

/* 破坏性操作的实心按钮（确认层用） */
.btn.danger-solid { background: var(--bad); color: #fff; }
