:root {
  --bg: #f5f6f8; --card: #fff; --primary: #4a6cf7; --ok: #18a058; --bad: #e5484d;
  --warn: #d97706; --text: #1f2329; --muted: #6b7280; --line: #e5e7eb; --radius: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }   /* 防止 .resume{display:flex} 之类的规则盖掉 hidden 属性 */
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px; line-height: 1.6;
}
a { color: var(--primary); }

/* ============ 顶栏：只有数字 + ☰ ============ */
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 8px 10px;
}
.iconbtn {
  flex: 0 0 auto; width: 34px; height: 34px; padding: 0; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; line-height: 1; background: #f1f3f9; border: 1px solid var(--line); color: var(--text);
}
.iconbtn.ghost { background: transparent; color: var(--muted); }
.chips { display: flex; gap: 5px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; background: #eef2ff; color: #334; border-radius: 999px;
  padding: 3px 9px; font-size: 11.5px; white-space: nowrap;
}
.chip b { color: var(--primary); }
.chip.ok b { color: var(--ok); }
.chip.bad b { color: var(--bad); }
.chip.warn { background: #fff7e6; }
.chip.warn b { color: var(--warn); }

main { max-width: 820px; margin: 0 auto; padding: 12px 12px 40px; }
body.practice-mode main { padding-bottom: 104px; }

/* ============ 侧边抽屉 ============ */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(15,20,30,.42); z-index: 40;
}
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 45; width: min(330px, 88vw);
  background: #fff; box-shadow: 6px 0 24px rgba(16,24,40,.16);
  transform: translateX(-102%); transition: transform .22s ease;
  overflow-y: auto; padding: 14px 14px 64px;
}
.drawer.open { transform: translateX(0); }
.drawer-h {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 17px; margin-bottom: 10px;
}
.dsec { border-top: 1px solid var(--line); padding: 12px 0; }
.dsec:first-of-type { border-top: none; }
.dsec-h { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.fl { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; margin: 8px 0; }
.fl select, .fl input { flex: 1 1 auto; max-width: 68%; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 10px 0; }
.switch input { width: 18px; height: 18px; }
.dstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.dstat { background: #f8fafc; border-radius: 10px; padding: 8px; text-align: center; }
.dstat span { display: block; font-size: 11px; color: var(--muted); }
.dstat b { font-size: 16px; }
.dops { display: flex; flex-wrap: wrap; gap: 8px; }
.small-note { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.center { text-align: center; margin-top: 14px; }

/* ============ 模式选择 ============ */
.mode-head h2 { font-size: 16px; margin: 6px 2px 8px; }
.range-tip {
  font-size: 12px; color: #3b4a8c; background: #eef2ff; border-radius: 10px;
  padding: 8px 11px; margin-bottom: 12px; cursor: pointer;
}
.mode-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.modecard {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; box-shadow: 0 1px 3px rgba(16,24,40,.05);
}
.modecard .mi {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; color: #fff; background: var(--primary);
}
.mi.ic-timed, .mini.ic-timed { background: linear-gradient(135deg, #4a6cf7, #7a8cff); }
.mi.ic-free, .mini.ic-free { background: linear-gradient(135deg, #18a058, #4ec97f); }
.mi.ic-queue, .mini.ic-queue { background: linear-gradient(135deg, #d97706, #f2a33c); }
.mi.ic-random, .mini.ic-random { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.mi.ic-wrong, .mini.ic-wrong { background: linear-gradient(135deg, #e5484d, #f57c80); }
.mi.ic-replay, .mini.ic-replay { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.rec-main .mini {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px; background: var(--primary);
}
.mk { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center;
  border-radius: 5px; font-size: 12px; font-weight: 600; color: #fff; }
.mk.ok { background: var(--ok); }
.mk.bad { background: var(--bad); }
.modecard .mt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.modecard .mt b { font-size: 15px; }
.modecard .mt i { font-style: normal; font-size: 12px; color: var(--muted); }
.modecard .mn { flex: 0 0 auto; font-size: 20px; font-weight: 600; color: var(--primary); }
.modecard .mn small { font-size: 11px; color: var(--muted); margin-left: 2px; font-weight: 400; }
.modecard.empty { opacity: .45; }

/* ============ 做题 ============ */
.pr-bar {
  position: sticky; top: 52px; z-index: 20; display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 7px 2px; margin-bottom: 10px; font-size: 13px;
}
.pr-mode { font-weight: 600; }
.pr-pos { color: var(--muted); }
.pr-clock { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.pr-clock b { color: var(--primary); font-size: 15px; }
.pr-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 22;
  display: flex; gap: 10px; max-width: 820px; margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.pr-nav button { flex: 1; padding: 12px 0; font-size: 15px; }

/* ============ 通用组件 ============ */
.card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  margin-bottom: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.tag { background: #eef2ff; color: var(--primary); border-radius: 5px; padding: 1px 7px; font-size: 12px; }
.tag.set { background: #fff7e6; color: #b45309; }
.tag.mastered { background: #e8f8ef; color: var(--ok); }
.stem { margin: 10px 0 6px; }
.stem img, .opt img { max-width: 100%; height: auto; border-radius: 6px; }
.stem p { margin: 6px 0; }
.subbox { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.subbox .sub-title { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.opt {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; margin: 7px 0; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.opt:hover { border-color: #c7d2fe; }
.opt input { margin-top: 5px; flex: 0 0 auto; width: 17px; height: 17px; }
.opt .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt .txt p { margin: 0; }
.opt.correct { border-color: var(--ok); background: #f3fdf7; }
.opt.wrong { border-color: var(--bad); background: #fff5f5; }
.opt.chosen { border-color: #a5b4fc; background: #f5f7ff; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
button {
  font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer;
}
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.ghost { background: transparent; color: var(--muted); }
button:disabled { opacity: .45; cursor: default; }
button.small { font-size: 12px; padding: 5px 10px; }
select, input[type="text"], input[type="number"], textarea {
  font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--text); max-width: 100%;
}
input[type="number"] { width: 76px; }
.result { margin-top: 10px; padding: 9px 12px; border-radius: 9px; font-size: 14px; display: none; }
.result.ok { display: block; background: #e8f8ef; color: #0f7a42; }
.result.bad { display: block; background: #fdecec; color: #b3282d; }
.result.pending { display: block; background: #f1f5f9; color: #475569; }
.result button { margin-left: 8px; }
.analysis { display: none; margin-top: 10px; padding: 10px 12px; background: #f8fafc; border-radius: 9px; font-size: 14px; }
.analysis p { margin: 6px 0; }
.card-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.notebox { margin-top: 8px; }
.notebox textarea { width: 100%; min-height: 56px; resize: vertical; }
.pager { text-align: left; color: var(--muted); font-size: 12px; margin: 8px 0 2px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  background: #1f2329; color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60;
}
.toast.show { opacity: .94; }

/* ============ 答题卡 ============ */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(15,20,30,.45); z-index: 70;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: #fff; width: 100%; max-width: 560px; border-radius: 16px 16px 0 0;
  padding: 16px 16px 22px; max-height: 82vh; overflow: auto;
}
.rv-h { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.rv-h.wrong-h { color: var(--bad); }
.rv-h.ok-h { color: var(--ok); }
.sheet-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0; }
.sheetcell { padding: 10px 0; font-size: 14px; border-radius: 9px; border: 1px solid var(--line); background: #f8fafc; }
.sheetcell.done { background: #e8f8ef; border-color: var(--ok); color: #0f7a42; font-weight: 600; }
.sheetcell.bad { background: #fdecec; border-color: var(--bad); color: #b3282d; font-weight: 600; }
.sheetcell.part { background: #fff7e6; border-color: var(--warn); color: #a35a00; }
.sheetcell.cur { outline: 2px solid var(--primary); outline-offset: 1px; }
.sheet-legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.sheet-legend .dot { width: 10px; height: 10px; border-radius: 3px; background: #f8fafc; border: 1px solid var(--line); display: inline-block; }
.sheet-legend .dot.done { background: #e8f8ef; border-color: var(--ok); }
.sheet-legend .dot.bad { background: #fdecec; border-color: var(--bad); }
.sheet-legend .dot.part { background: #fff7e6; border-color: var(--warn); }

/* ============ 成绩 ============ */
.rs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.rs-cell { background: #f8fafc; border-radius: 10px; padding: 10px 8px; text-align: center; }
.rs-cell span { display: block; font-size: 12px; color: var(--muted); }
.rs-cell b { font-size: 17px; }
.ritem { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin: 8px 0; background: #fff; }
.ritem summary { cursor: pointer; font-size: 14px; }
.ritem.ok summary { color: #0f7a42; }
.ritem .small-stem { font-size: 13px; color: #374151; margin: 8px 0; max-height: 180px; overflow: auto; }
.ritem .analysis.open { display: none; }
.ritem[open] .analysis.open { display: block; }
.rvline { font-size: 13px; margin: 4px 0 4px 4px; }
.rvline.bad { color: var(--bad); }
.rvline code { background: #f1f5f9; border-radius: 4px; padding: 0 4px; font-size: 13px; }

/* ============ 记录 ============ */
.records { display: flex; flex-direction: column; gap: 8px; }
.rec { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; }
.rec-main { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; }
.rec-main b { font-size: 14px; }
.rec-ops { display: flex; gap: 6px; flex: 0 0 auto; }

/* 继续上次练习 */
.resume {
  display: flex; align-items: center; gap: 8px; background: #fff7e6; border: 1px solid #fadc9c;
  border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
}
.resume-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.resume-main b { font-size: 14px; color: #6b4a00; }
.badge {
  display: inline-block; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 999px;
  background: #eef1f6; color: var(--muted); margin-left: 4px; vertical-align: 1px;
}
.badge.warn { background: #fff3d6; color: var(--warn); }

/* 日期筛选 + 当天汇总 */
.datebar { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.datebar input[type=date] {
  flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.day-sum { margin: 6px 0 12px; }

/* 记录详情：题目卡片 */
.qdetail { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; background: #fff; }
.qdetail.bad { border-left: 3px solid var(--bad); }
.qdetail.ok { border-left: 3px solid var(--ok); }
.qdetail .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.qdetail .opt { cursor: default; }
.qdetail .opt:hover { border-color: var(--line); }
.qdetail .ana-d { margin-top: 8px; }
.qdetail .ana-d summary { cursor: pointer; font-size: 13px; color: var(--primary); }
.qdetail .analysis.open { display: block; margin-top: 6px; }
.picked {
  display: inline-block; font-size: 11px; line-height: 1.5; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: #eef2ff; color: var(--primary); vertical-align: 1px;
}

@media (min-width: 620px) {
  .mode-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .sheet-grid { grid-template-columns: repeat(5, 1fr); }
  .rs-grid { grid-template-columns: repeat(2, 1fr); }
  .dstats { grid-template-columns: repeat(3, 1fr); }
}

/* ============ 全新练习 · 题集选择（v5） ============ */
.modecard.newcard { margin-top: 10px; border-style: dashed; background: linear-gradient(180deg,#fbfcff,#f4f7ff); }
.mi.ic-set, .mini.ic-set { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.set-tools { gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.switch.inline { margin: 0; font-size: 12.5px; }
.fl.inline { margin: 0; font-size: 12.5px; gap: 6px; }
.fl.inline input { width: 62px; }
.setlist { margin: 8px 0 4px; }  /* 不限制高度：页面整体滚动，避免行被容器边缘切一半 */
.setrow {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; background: #fff;
}
.setrow.on { border-color: var(--primary); background: #f7f9ff; }
.setrow input { width: 18px; height: 18px; flex: 0 0 auto; }
.setrow .sr-main { flex: 1; min-width: 0; }
.setrow .sr-main b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setrow .sr-main span { font-size: 11.5px; color: var(--muted); }
.setrow .sr-n { flex: 0 0 auto; font-size: 13px; color: var(--primary); font-variant-numeric: tabular-nums; }
.setrow .go { flex: 0 0 auto; padding: 6px 11px; font-size: 12.5px; white-space: nowrap; }
.setrow .more { flex: 0 0 auto; padding: 4px 8px; font-size: 14px; line-height: 1; color: var(--muted); }
.setrow.replayrow { cursor: pointer; }
.setrow.replayrow .sr-main span { line-height: 1.5; }
.bad-txt { color: var(--bad); font-weight: 600; }
.setrow { flex-wrap: wrap; }
.sr-acts {
  flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line);
}
.sr-acts .small-note { flex: 1 1 100%; }
.sr-acts .danger { color: var(--bad); border-color: rgba(229,72,77,.35); }
.setfoot {
  display: flex; align-items: center; gap: 10px;
  justify-content: space-between; padding: 10px 0 2px; background: #fff;
  border-top: 1px solid var(--line); margin-top: 8px;
}

/* ============ 同步面板（v5） ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,20,30,.45); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.modal {
  background: #fff; width: 100%; max-width: 640px; max-height: 88vh; overflow: auto;
  border-radius: 16px; padding: 14px; box-shadow: 0 12px 40px rgba(16,24,40,.3);
}
.modal-h { display: flex; align-items: center; justify-content: space-between; font-size: 16px; margin-bottom: 6px; }
.syncrow {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; font-size: 13px; background: #fff;
}
.syncrow.on { border-color: var(--primary); background: #f7f9ff; }
.syncrow input[type=checkbox] { width: 17px; height: 17px; flex: 0 0 auto; }
.syncrow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syncrow .mt2 { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tag2 { font-size: 11px; padding: 1px 6px; border-radius: 5px; flex: 0 0 auto; white-space: nowrap; }
.tag2.new { background: #e8f8ef; color: var(--ok); }
.tag2.partial { background: #fff7e6; color: #b45309; }
.tag2.same { background: #f1f3f9; color: var(--muted); }
.synclist { max-height: 40vh; overflow: auto; margin: 8px 0; }
.prog { height: 8px; background: #eef0f6; border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.prog > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .25s; }
.logbox {
  max-height: 170px; overflow: auto; background: #0f172a; color: #cbd5e1; border-radius: 10px;
  padding: 8px 10px; font-size: 11.5px; line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.logbox div { white-space: pre-wrap; overflow-wrap: anywhere; }
.cookiebox { border: 1px dashed var(--line); border-radius: 12px; padding: 10px; margin-top: 8px; background: #fbfcff; }
.cookiebox textarea { width: 100%; min-height: 62px; resize: vertical; font-size: 12px; }
.warnbox { background: #fff7e6; color: #92400e; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; margin: 6px 0; }
.okbox { background: #e8f8ef; color: #0f7a42; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; margin: 6px 0; }
.setpreview { font-size: 12px; color: var(--muted); padding: 2px 4px 10px; }
.setpreview li { margin: 3px 0; overflow-wrap: anywhere; }

/* 同步弹窗细节调整（v5.1） */
.nowrap { white-space: nowrap; }
.cookie-tip { line-height: 1.8; }
.sync-note { margin-top: 10px; margin-bottom: 2px; }
.sy-go { margin-top: 10px; }
.sy-go #syGo { width: 100%; padding: 11px 0; font-size: 15px; }

/* ============ 全新练习：分类折叠（v6） ============ */
.catgrp { margin-bottom: 8px; }
.cath {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-size: 13.5px; font-weight: 600; color: var(--text);
}
.cath .catchev { flex: 0 0 auto; width: 12px; color: var(--muted); font-size: 12px; }
.cath .catname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cath .catmeta { flex: 0 0 auto; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.catbody { padding: 6px 0 2px 4px; }
.setrow.dim { opacity: .55; }
.setrow .sr-main span .tag2 { margin-right: 4px; }
.tag2.see { background: #f1f3f9; color: var(--muted); }
#setSearch { padding: 6px 9px; font-size: 13px; }
.setrow .imp { flex: 0 0 auto; padding: 3px 8px; font-size: 11.5px; color: var(--primary); border-color: #c7d2fe; }
.setrow { cursor: pointer; }
.fl select { text-overflow: ellipsis; }

/* ============ 数据看板 / 笔记（v6.4） ============ */
.dash-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 14px; }
.dash-top .rs-cell { background: #f8fafc; border-radius: 10px; padding: 8px; text-align: center; }
.dash-top .rs-cell span { display: block; font-size: 11px; color: var(--muted); }
.dash-top .rs-cell b { font-size: 17px; }
.dash-top .rs-cell b small { font-size: 10px; color: var(--muted); margin-left: 2px; font-weight: 400; }
.dash-sec { margin: 10px 0 6px; }
.bars { margin-top: 6px; }
.barrow { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 12px; }
.barlabel { flex: 0 0 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bartrack { flex: 1 1 auto; height: 9px; background: #eef0f6; border-radius: 99px; overflow: hidden; }
.bartrack > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bartrack > i.bad { background: linear-gradient(90deg, #e5484d, #f57c80); }
.barval { flex: 0 0 34px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.trendbars { display: flex; align-items: flex-end; gap: 3px; height: 96px; margin-top: 8px; }
.trendbars .tb { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; height: 100%; }
.trendbars .tb i { width: 100%; max-width: 16px; background: #c7d2fe; border-radius: 4px 4px 0 0; display: block; }
.trendbars .tb span { font-size: 9px; color: var(--muted); margin-top: 3px; white-space: nowrap; transform: scale(.9); }
.dashrow { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 9px; margin-bottom: 6px; font-size: 12.5px; }
.dashrow .ds-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashrow .ds-meta { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.dashrow .del-set { flex: 0 0 auto; color: var(--bad); border-color: #f3c9ca; }
.notes .noteitem { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 9px; }
.note-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.note-stem { font-size: 13px; color: var(--text); line-height: 1.55; }
.note-body { margin-top: 7px; background: #fffbea; border-left: 3px solid #f2c94c; border-radius: 6px;
  padding: 7px 9px; font-size: 13px; color: #6b4b00; white-space: pre-wrap; }
.trendbars .tb:nth-child(even) span { visibility: hidden; }
.dashrow { flex-direction: column; align-items: stretch; gap: 3px; }
.dashrow .ds-top { display: flex; align-items: center; gap: 8px; }
.dashrow .ds-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashrow .ds-meta { font-size: 11px; color: var(--muted); }

/* 笔记二级页（v6.5） */
.noteitem { cursor: pointer; }
.noteitem:active { background: #fbfcff; }
.note-more { margin-top: 6px; font-size: 11.5px; color: var(--primary); text-align: right; }
.note-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.note-edit { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.note-edit textarea { width: 100%; min-height: 90px; font-size: 14px; line-height: 1.6; }
#noteQ .opt { cursor: default; }
#noteQ .opt .mk { flex: 0 0 auto; color: var(--ok); font-weight: 700; }
#noteQ .opt.wrong .mk { color: var(--bad); }
#noteQ .opt .txt img { max-width: 100%; }
#noteQ .sub-title { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* v8：答案显示时机锁定（练习中不可切换） */
.fl.locked { opacity: .68; }
.fl.locked select { cursor: not-allowed; }
#revealNote { margin-top: 2px; }
.rvsum { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.rvsum code { font-size: 12px; }

/* v8.4 直接搜题 */
.mi.ic-search, .mini.ic-search { background: linear-gradient(135deg, #4a6cf7, #8ea2ff); }
.search-chips { gap: 6px; flex-wrap: wrap; }
.search-chips button.on { background: var(--primary); color: #fff; border-color: transparent; }
.searchlist .search-snip { margin-top: 6px; font-size: 12.5px; color: #4b5563; background: #f6f8fc;
  border-radius: 8px; padding: 6px 9px; line-height: 1.6; word-break: break-all; }
.searchlist .qdetail { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; cursor: default; }
.searchlist .qdetail .opt { cursor: default; }
.searchlist .qdetail .opt .mk { flex: 0 0 auto; color: var(--ok); font-weight: 700; }
.searchlist .qdetail .opt.wrong .mk { color: var(--bad); }
.searchlist .qdetail .opt .txt img { max-width: 100%; }
.searchlist .qdetail .sub-title { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* v9 多用户：登录 + 账号 + 用户管理 */
.login-mask { position: fixed; inset: 0; z-index: 90; background: rgba(20, 26, 46, .55);
  display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(2px); }
.login-card { width: 100%; max-width: 340px; background: #fff; border-radius: 18px; padding: 20px 18px;
  box-shadow: 0 18px 50px rgba(20, 30, 60, .28); display: flex; flex-direction: column; gap: 10px; }
.login-h { font-size: 22px; font-weight: 700; color: var(--ink); }
.login-f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.login-f input { font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcff; color: var(--text); }
.login-f input:focus { outline: 2px solid rgba(74, 108, 247, .25); border-color: var(--primary); }
.login-go { margin-top: 4px; padding: 11px; font-size: 15px; border-radius: 11px; }
.login-err { color: var(--bad); }
.who { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.who-name { font-size: 13.5px; color: var(--text); font-weight: 600; }
.user-new { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.user-new input { flex: 1 1 40%; min-width: 0; font-size: 13.5px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fbfcff; }
.user-new button { flex: 0 0 100%; min-height: 38px; margin-top: 2px; }
@media (min-width: 520px) { .user-new button { flex: 0 0 auto; margin-top: 0; } }
.login-f input::placeholder { color: #9aa3b8; }
.userrow .small-note { font-size: 11.5px; line-height: 1.5; }
.userrow .u-main .tag { margin-left: 3px; }
.userrow { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 9px; }
.userrow.off { opacity: .6; }
.userrow .u-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.userrow .u-ops { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
