/* ============================================================
   小蓝专属经济师备考神器 · 样式表
   移动优先 · 蓝色主题 · 无依赖
   ============================================================ */

:root {
  --pri: #2563eb;
  --pri-700: #1d4ed8;
  --pri-600: #2563eb;
  --pri-500: #3b82f6;
  --pri-300: #93c5fd;
  --pri-100: #dbeafe;
  --pri-50: #eff6ff;
  --cyan: #06b6d4;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --bg: #f2f6ff;
  --card: #ffffff;
  --ok: #16a34a;
  --ok-bg: #ecfdf5;
  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --bad: #ef4444;
  --bad-bg: #fef2f2;
  --purple: #7c3aed;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(37, 99, 235, .10);
  --shadow-lg: 0 14px 40px rgba(15, 23, 42, .16);
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  --ink: #e8eefc;
  --ink-2: #c7d3e8;
  --muted: #93a4c0;
  --muted-2: #6b7d9c;
  --line: #22304a;
  --bg: #070d1a;
  --card: #101a2e;
  --pri-50: #101f3d;
  --pri-100: #16305c;
  --ok-bg: #0d2a1e;
  --warn-bg: #2c2008;
  --bad-bg: #2c1113;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: calc(15px * var(--font-scale, 1));
  line-height: 1.65;
  overscroll-behavior-y: none;
}
body { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px); }
img { max-width: 100%; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
a { color: var(--pri); text-decoration: none; }

/* ---------- 顶部标题栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #3b82f6 100%);
  color: #fff;
  padding: 14px 16px 16px;
  border-radius: 0 0 22px 22px;
  box-shadow: var(--shadow);
}
.topbar .row { display: flex; align-items: center; gap: 10px; }
.topbar .logo { font-size: 1.5em; }
.topbar h1 { font-size: 1.02em; margin: 0; font-weight: 700; letter-spacing: .3px; }
.topbar .sub { font-size: .68em; opacity: .8; margin-top: 2px; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 11px;
  background: rgba(255, 255, 255, .16);
  display: grid; place-items: center; font-size: .95em;
  transition: background .18s, transform .12s;
}
.icon-btn:active { transform: scale(.92); background: rgba(255, 255, 255, .3); }
.topbar .page-title { font-size: 1.16em; font-weight: 800; margin-top: 10px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: .64em; color: var(--muted); font-weight: 600;
  transition: color .18s, transform .12s;
}
.tabbar button .ic { font-size: 1.55em; line-height: 1; filter: grayscale(.55); transition: filter .2s; }
.tabbar button.on { color: var(--pri); }
.tabbar button.on .ic { filter: none; transform: translateY(-1px) scale(1.06); }
.tabbar button:active { transform: scale(.94); }

/* ---------- 通用容器 ---------- */
.wrap { padding: 14px 14px 4px; max-width: 720px; margin: 0 auto; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .96em; font-weight: 800; margin: 18px 2px 10px;
}
.section-title .bar { width: 4px; height: 15px; border-radius: 3px; background: linear-gradient(180deg, var(--pri-500), var(--cyan)); }
.section-title .more { margin-left: auto; font-size: .78em; font-weight: 600; color: var(--pri); }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.card.tight { padding: 12px; }

/* ---------- 仪表盘 ---------- */
.hero {
  background: linear-gradient(135deg, #1e3a8a, #2563eb 60%, #38bdf8);
  border-radius: var(--radius); padding: 16px; color: #fff;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px;
  border-radius: 50%; background: rgba(255, 255, 255, .12);
}
.hero .ring-wrap { flex: 0 0 auto; position: relative; width: 92px; height: 92px; }
.hero .ring-txt {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: .95em; font-weight: 800;
}
.hero .ring-txt small { display: block; font-size: .42em; font-weight: 600; opacity: .8; text-align: center; }
.hero .info { flex: 1; min-width: 0; }
.hero .info h2 { margin: 0 0 4px; font-size: 1.02em; }
.hero .info p { margin: 0; font-size: .74em; opacity: .9; }
.hero .chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.hero .chip {
  background: rgba(255, 255, 255, .2); border-radius: 999px;
  padding: 3px 9px; font-size: .64em; font-weight: 700;
}

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat {
  background: var(--card); border-radius: var(--radius-sm); padding: 12px 10px; text-align: center;
  box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.stat b { display: block; font-size: 1.28em; font-weight: 800; color: var(--pri-700); line-height: 1.25; }
html[data-theme="dark"] .stat b { color: var(--pri-300); }
.stat span { font-size: .66em; color: var(--muted); font-weight: 600; }

/* 快速操作 */
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.qbtn {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: linear-gradient(135deg, var(--pri-50), color-mix(in srgb, var(--pri-100) 70%, transparent));
  border: 1px solid color-mix(in srgb, var(--pri-300) 45%, transparent);
  border-radius: var(--radius-sm); padding: 12px;
  transition: transform .12s, box-shadow .18s;
}
.qbtn:active { transform: scale(.97); }
.qbtn .ic { font-size: 1.5em; }
.qbtn b { display: block; font-size: .82em; }
.qbtn span { font-size: .64em; color: var(--muted); }

/* ---------- 章节列表 ---------- */
.ch-card { display: flex; align-items: center; gap: 12px; }
.ch-badge {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.3em;
  background: var(--pri-100); color: var(--pri-700);
}
.ch-meta { flex: 1; min-width: 0; }
.ch-meta h3 { margin: 0; font-size: .92em; font-weight: 800; }
.ch-meta .desc { font-size: .66em; color: var(--muted); margin-top: 2px; }
.ch-progress { margin-top: 7px; height: 6px; border-radius: 4px; background: var(--pri-50); overflow: hidden; }
.ch-progress i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--pri-500), var(--cyan)); transition: width .4s; }
.ch-right { flex: 0 0 auto; text-align: right; font-size: .62em; color: var(--muted); font-weight: 700; }

/* ---------- 知识点列表 ---------- */
.pt-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.pt-row:last-child { border-bottom: none; }
.pt-row .idx {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  background: var(--pri-50); color: var(--pri-700); font-size: .64em; font-weight: 800;
  display: grid; place-items: center;
}
.pt-row .t { flex: 1; font-size: .82em; font-weight: 700; }
.pt-row .t small { display: block; font-size: .8em; color: var(--muted); font-weight: 500; }
.pt-row.done .idx { background: var(--ok); color: #fff; }
.chev { color: var(--muted-2); font-size: .9em; }

/* ---------- 徽标 / 星级 / 标签 ---------- */
.chip {
  display: inline-block; border-radius: 999px; padding: 2px 9px;
  font-size: .62em; font-weight: 700; background: var(--pri-50); color: var(--pri-700);
  border: 1px solid color-mix(in srgb, var(--pri-300) 40%, transparent);
}
.chip.gray { background: var(--pri-50); color: var(--muted); border-color: var(--line); }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.chip.warn { background: var(--warn-bg); color: #b45309; border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.chip.purple { background: #f5f3ff; color: var(--purple); border-color: #ddd6fe; }
html[data-theme="dark"] .chip.purple { background: #1e1b3a; color: #c4b5fd; border-color: #3730a3; }
.chip.cyan { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
html[data-theme="dark"] .chip.cyan { background: #083344; color: #67e8f9; border-color: #155e75; }
.stars { color: #f59e0b; letter-spacing: -1px; font-size: .78em; }

/* ---------- 知识点详情 ---------- */
.detail-head { display: flex; align-items: flex-start; gap: 10px; }
.detail-head h2 { margin: 0; font-size: 1.06em; font-weight: 800; flex: 1; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tabs { display: flex; gap: 6px; margin: 14px 0 10px; overflow-x: auto; padding-bottom: 2px; }
.tabs button {
  flex: 0 0 auto; border-radius: 999px; padding: 6px 13px; font-size: .74em; font-weight: 700;
  background: var(--pri-50); color: var(--muted); border: 1px solid transparent; transition: all .18s;
}
.tabs button.on { background: linear-gradient(135deg, var(--pri-600), var(--pri-500)); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .28); }
.body-text { font-size: .86em; color: var(--ink-2); }
.body-text strong { color: var(--pri-700); font-weight: 800; }
html[data-theme="dark"] .body-text strong { color: var(--pri-300); }
.key-list { margin: 0; padding: 0; list-style: none; }
.key-list li {
  position: relative; padding: 9px 12px 9px 32px; margin-bottom: 8px;
  background: var(--pri-50); border-radius: var(--radius-sm); font-size: .82em; font-weight: 600;
  border-left: 3px solid var(--pri-500);
}
.key-list li::before {
  content: '★'; position: absolute; left: 11px; top: 8px; color: var(--pri); font-size: .8em;
}
.case-box {
  background: linear-gradient(135deg, #ecfeff, #eff6ff); border-radius: var(--radius-sm);
  padding: 13px; font-size: .84em; color: #0e7490; border: 1px dashed #67e8f9;
}
html[data-theme="dark"] .case-box { background: #082f3a; color: #a5f3fc; border-color: #155e75; }
.tip-box {
  background: var(--warn-bg); border-radius: var(--radius-sm); padding: 12px;
  font-size: .82em; color: #92400e; border-left: 3px solid var(--warn); margin-top: 10px;
}
html[data-theme="dark"] .tip-box { color: #fcd34d; }

/* ---------- 记忆卡 ---------- */
.fc-scene { perspective: 1200px; margin: 6px 0 12px; }
.flashcard { position: relative; width: 100%; min-height: 240px; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.4, .2, .2, 1); }
.flashcard.flipped { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius);
  padding: 22px 18px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; box-shadow: var(--shadow-lg);
}
.fc-front { background: linear-gradient(135deg, #1e40af, #2563eb 55%, #38bdf8); color: #fff; }
.fc-back { background: var(--card); color: var(--ink); transform: rotateY(180deg); border: 1px solid var(--line); }
.fc-face .q { font-size: 1.12em; font-weight: 800; line-height: 1.5; }
.fc-face .a { font-size: .9em; font-weight: 600; line-height: 1.7; }
.fc-face .hint { margin-top: 12px; font-size: .66em; opacity: .75; }
.fc-face .src { position: absolute; left: 0; right: 0; bottom: 10px; font-size: .6em; opacity: .7; }
.grade-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.grade-btn { border-radius: var(--radius-sm); padding: 13px 8px; font-weight: 800; font-size: .78em; color: #fff; transition: transform .12s; }
.grade-btn:active { transform: scale(.95); }
.grade-btn.g1 { background: linear-gradient(135deg, #ef4444, #f87171); }
.grade-btn.g2 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.grade-btn.g3 { background: linear-gradient(135deg, #16a34a, #34d399); }

/* ---------- 测验 ---------- */
.opt {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 9px; font-size: .84em; transition: all .18s;
}
.opt .k {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px; background: var(--pri-50);
  color: var(--pri-700); font-weight: 800; font-size: .82em; display: grid; place-items: center;
}
.opt:active { transform: scale(.985); }
.opt.picked { border-color: var(--pri); background: var(--pri-50); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.right .k { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.wrong .k { background: var(--bad); color: #fff; }
.opt .exp { font-size: .92em; color: var(--muted); margin-top: 6px; display: block; }
.quiz-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.quiz-bar .p { flex: 1; height: 8px; border-radius: 5px; background: var(--pri-50); overflow: hidden; }
.quiz-bar .p i { display: block; height: 100%; background: linear-gradient(90deg, var(--pri-500), var(--cyan)); transition: width .3s; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--pri-700); font-size: .9em; }
.timer.low { color: var(--bad); animation: pulse .8s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.q-num { font-size: .68em; color: var(--muted); font-weight: 700; }

/* 结果页 */
.result-hero { text-align: center; padding: 22px 14px; border-radius: var(--radius); background: linear-gradient(135deg, #1e3a8a, #2563eb 60%, #38bdf8); color: #fff; box-shadow: var(--shadow-lg); }
.result-hero .score { font-size: 2.6em; font-weight: 900; line-height: 1; }
.result-hero .lbl { font-size: .74em; opacity: .9; margin-top: 6px; }
.wrong-item { border-left: 3px solid var(--bad); background: var(--card); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; font-size: .8em; }
.wrong-item .qq { font-weight: 700; margin-bottom: 6px; }
.wrong-item .mine { color: var(--bad); font-weight: 700; }
.wrong-item .right { color: var(--ok); font-weight: 700; }
.wrong-item .why { color: var(--muted); margin-top: 6px; font-size: .95em; }

/* ---------- 知识地图 ---------- */
.mm-scene { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); height: 62vh; touch-action: none; }
.mm-svg { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.mm-node { cursor: pointer; }
.mm-node text { font-family: var(--font); }
.mm-ctl { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.mm-ctl button {
  width: 34px; height: 34px; border-radius: 10px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-weight: 800; color: var(--pri-700);
}
.mm-tip { position: absolute; left: 10px; bottom: 10px; font-size: .62em; color: var(--muted); background: color-mix(in srgb, var(--card) 80%, transparent); padding: 4px 8px; border-radius: 8px; }

/* ---------- 搜索 ---------- */
.search-input {
  width: 100%; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  padding: 12px 14px; font-size: .86em; color: var(--ink);
}
.search-input:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-100); }
.hit { padding: 12px; border-radius: var(--radius-sm); background: var(--card); margin-bottom: 9px; border: 1px solid var(--line); }
.hit .h { font-size: .84em; font-weight: 800; }
.hit .sn { font-size: .74em; color: var(--muted); margin-top: 3px; }
.hit mark { background: #fef08a; color: #713f12; border-radius: 3px; padding: 0 2px; }
html[data-theme="dark"] .hit mark { background: #854d0e; color: #fef9c3; }

/* ---------- 工具箱 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tool {
  background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); text-align: left;
}
.tool .ic { font-size: 1.6em; }
.tool b { display: block; font-size: .84em; margin-top: 6px; }
.tool span { font-size: .64em; color: var(--muted); }

/* 番茄钟 */
.pomo-num { font-size: 3.2em; font-weight: 900; text-align: center; color: var(--pri-700); font-variant-numeric: tabular-nums; line-height: 1.1; }
html[data-theme="dark"] .pomo-num { color: var(--pri-300); }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: .76em; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; }
.tbl th { background: var(--pri-50); font-weight: 800; color: var(--pri-700); }
html[data-theme="dark"] .tbl th { color: var(--pri-300); }

/* ---------- 进度环 ---------- */
.ring-svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .25); }
.ring-fg { fill: none; stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring-fg.blue { stroke: var(--pri); }
.ring-bg.blue { stroke: var(--pri-100); }

/* ---------- 徽章 ---------- */
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge { text-align: center; font-size: .6em; color: var(--muted); font-weight: 700; }
.badge .b {
  width: 100%; aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center;
  font-size: 2.1em; background: var(--pri-50); filter: grayscale(1); opacity: .45; margin-bottom: 4px;
}
.badge.got .b { filter: none; opacity: 1; background: linear-gradient(135deg, var(--pri-100), #e0f2fe); box-shadow: var(--shadow); }
.badge.got { color: var(--pri-700); }

/* ---------- 弹层 / 提示 ---------- */
.sheet-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 60; display: none; }
.sheet-mask.on { display: block; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + var(--safe-b));
  box-shadow: var(--shadow-lg); max-height: 84vh; overflow-y: auto;
  transform: translateY(101%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.sheet.on { transform: translateY(0); }
.sheet h3 { margin: 0 0 12px; font-size: .96em; font-weight: 800; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, .92); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: .76em; font-weight: 700; z-index: 70; opacity: 0; transition: all .25s; pointer-events: none; white-space: nowrap;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 12px; padding: 12px 16px; font-size: .84em; font-weight: 800;
  background: linear-gradient(135deg, var(--pri-700), var(--pri-500)); color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28); transition: transform .12s;
}
.btn:active { transform: scale(.96); }
.btn.ghost { background: var(--pri-50); color: var(--pri-700); box-shadow: none; border: 1px solid color-mix(in srgb, var(--pri-300) 45%, transparent); }
html[data-theme="dark"] .btn.ghost { color: var(--pri-300); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: .76em; border-radius: 10px; }
.row-btns { display: flex; gap: 9px; }
.row-btns > * { flex: 1; }

/* ---------- 列表项通用 ---------- */
.li { display: flex; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.li:last-child { border-bottom: none; }
.li .ic { font-size: 1.2em; }
.li .txt { flex: 1; min-width: 0; }
.li .txt b { display: block; font-size: .84em; font-weight: 700; }
.li .txt small { color: var(--muted); font-size: .76em; }

.empty { text-align: center; padding: 30px 12px; color: var(--muted); font-size: .8em; }
.empty .ic { font-size: 2.4em; display: block; margin-bottom: 8px; }

/* ---------- 顶部搜索框（固定在 wrap 内） ---------- */
.fixed-search { position: sticky; top: 0; z-index: 30; background: var(--bg); padding: 12px 0; }

/* ---------- 进度条动画 ---------- */
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.pop { animation: pop .3s; }

/* ---------- 彩带 ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .2; } }

/* ---------- 竞速模式 ---------- */
.speed-hud { display: flex; align-items: center; justify-content: space-between; font-size: .74em; font-weight: 800; color: var(--pri-700); }
.combo { color: var(--warn); }

/* ---------- 桌面端适配 ---------- */
@media (min-width: 760px) {
  body { font-size: calc(16px * var(--font-scale, 1)); }
  .wrap { max-width: 820px; }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .badges { grid-template-columns: repeat(6, 1fr); }
  .tabbar { max-width: 820px; left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
