/* =========================================================
   学力星图 · 设计系统
   ========================================================= */
:root {
  --bg: #f4f6fc;
  --bg-deep: #eef1f9;
  --card: #ffffff;
  --ink: #17203a;
  --ink-2: #333e5c;
  --muted: #6f7a92;
  --faint: #97a1b6;
  --line: #e7ebf5;
  --line-2: #dfe5f1;
  --brand: #4f46e5;
  --brand-2: #7c6cf6;
  --brand-soft: #eeeeff;
  --math: #2f6bff;
  --math-soft: #edf2ff;
  --chinese: #e2623d;
  --chinese-soft: #fdf0ea;
  --english: #0f9d76;
  --english-soft: #e8f8f2;
  --ok: #0f9d76;
  --warn: #f59e0b;
  --danger: #e5484d;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 50px -38px rgba(23, 32, 58, 0.5);
  --shadow-sm: 0 10px 24px -20px rgba(23, 32, 58, 0.45);
  --font: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Noto Serif CJK SC", "Songti SC", "STSong", serif;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2em; }
svg { display: block; }

/* ---------- 布局 ---------- */
.menu-mask { display: none; }
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px 18px;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px; z-index: 40; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 8px; }
.logo {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  background: linear-gradient(140deg, var(--brand) 10%, var(--brand-2) 60%, #59c8ff 130%);
  display: grid; place-items: center; color: #fff; font-size: 19px;
  box-shadow: 0 8px 18px -8px rgba(79, 70, 229, 0.8);
}
.brand b { font-size: 17px; letter-spacing: 0.5px; display: block; line-height: 1.25; }
.brand span { font-size: 11.5px; color: var(--faint); letter-spacing: 1px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { font-size: 11px; color: var(--faint); letter-spacing: 1.4px; padding: 8px 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 11px; color: var(--ink-2); font-size: 14px; position: relative;
  transition: background 0.16s, color 0.16s;
}
.nav-item .ico { color: var(--faint); transition: color 0.16s; }
.nav-item:hover { background: #f6f7fc; color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item.active .ico { color: var(--brand); }
.nav-item.active::before {
  content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-badge {
  margin-left: auto; font-size: 10.5px; background: var(--danger); color: #fff;
  border-radius: 20px; padding: 1px 6px; font-weight: 600;
}
.side-foot { margin-top: auto; }
.student-card {
  border: 1px solid var(--line); background: linear-gradient(180deg, #fbfcff, #f7f8fd);
  border-radius: 16px; padding: 14px;
}
.student-top { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; background: #fff;
  border: 1px solid var(--line); display: grid; place-items: center; font-size: 19px;
}
.student-name { font-weight: 650; line-height: 1.2; }
.student-meta { font-size: 11.5px; color: var(--muted); }
.xpbar { height: 6px; border-radius: 6px; background: var(--line); margin-top: 12px; overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), #59c8ff); }
.student-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; padding: 20px 36px 16px;
  background: rgba(244, 246, 252, 0.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(231, 235, 245, 0.7);
}
.topbar h1 { font-size: 21px; letter-spacing: -0.2px; line-height: 1.3; }
.topbar p { font-size: 12.5px; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar .menu-btn { display: none; }
.view { padding: 22px 36px 64px; max-width: 1340px; width: 100%; }

/* ---------- 通用元件 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px 22px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 15.5px; letter-spacing: 0.1px; }
.card-head .muted { margin-left: auto; }
.card-sub { font-size: 12.5px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack > * { min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-2-1 { grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); align-items: start; }
.layout-1-2 { grid-template-columns: minmax(280px, 1fr) minmax(0, 1.75fr); align-items: start; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nums { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 11px; padding: 9px 16px;
  font-size: 13.5px; font-weight: 550; background: #f3f5fb; color: var(--ink-2);
  transition: transform 0.12s, box-shadow 0.16s, background 0.16s, border-color 0.16s;
  white-space: nowrap;
}
.btn:hover { background: #eceffa; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #6b5cf0); color: #fff;
  box-shadow: 0 10px 22px -12px rgba(79, 70, 229, 0.9);
}
.btn-primary:hover { background: linear-gradient(135deg, #453bd6, #5f50e6); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: #e4e3ff; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { background: #f7f8fd; }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-danger:hover { background: #fbdcdc; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 13px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
}
.icon-btn:hover { color: var(--ink); background: #f8f9fd; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 4px 10px; font-size: 11.5px; background: #f3f5fb; color: var(--muted);
  border: 1px solid transparent; white-space: nowrap;
}
.chip.solid { background: var(--brand-soft); color: var(--brand); }
.chip.ok { background: #e8f8f2; color: var(--ok); }
.chip.warn { background: #fef4e2; color: #b8730a; }
.chip.danger { background: #fdecec; color: var(--danger); }
.chip.line { background: #fff; border-color: var(--line-2); }
.chip[data-subject="math"] { background: var(--math-soft); color: var(--math); }
.chip[data-subject="chinese"] { background: var(--chinese-soft); color: var(--chinese); }
.chip[data-subject="english"] { background: var(--english-soft); color: var(--english); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.tabs { display: flex; gap: 6px; padding: 5px; background: #eef0f8; border-radius: 13px; width: fit-content; }
.tab {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 9px;
  font-size: 13px; color: var(--muted); font-weight: 550;
}
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 4px 12px -8px rgba(23, 32, 58, 0.5); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 6px 12px; font-size: 12.5px; color: var(--muted); }
.seg button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.progress { height: 7px; background: var(--line); border-radius: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 8px; background: var(--brand); transition: width 0.5s; }
.progress[data-subject="math"] i { background: var(--math); }
.progress[data-subject="chinese"] i { background: var(--chinese); }
.progress[data-subject="english"] i { background: var(--english); }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; align-items: center; gap: 8px; background: #fff9ec; border: 1px solid #f5e3bd;
  color: #8a5b00; padding: 9px 14px; border-radius: 12px; font-size: 12.5px; margin-bottom: 14px;
}
.notice a { margin-left: auto; font-weight: 600; text-decoration: underline; color: #8a5b00; white-space: nowrap; }

/* ---------- 首页 ---------- */
.hero {
  position: relative; overflow: hidden; border: 0; color: #fff;
  background: radial-gradient(120% 160% at 0% 0%, #6a5cf5 0%, #4f46e5 45%, #3a2fb8 100%);
  display: flex; align-items: center; gap: 28px; padding: 28px 30px;
  box-shadow: 0 30px 60px -40px rgba(79, 70, 229, 0.9);
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, rgba(89, 200, 255, 0.35), transparent 65%);
}
.hero::before {
  content: ""; position: absolute; right: 90px; bottom: -110px; width: 240px; height: 240px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 65%);
}
.hero-left { flex: 1; min-width: 0; position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; letter-spacing: 1.4px; color: rgba(255, 255, 255, 0.72); text-transform: uppercase; }
.hero h2 { font-size: 27px; margin: 8px 0 6px; letter-spacing: -0.4px; }
.hero p { color: rgba(255, 255, 255, 0.78); font-size: 13.5px; max-width: 520px; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; }
.hero .btn-primary { background: #fff; color: var(--brand); box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.5); }
.hero .btn-primary:hover { background: #f4f2ff; }
.hero .btn-ghost { border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.hero-right { position: relative; z-index: 1; flex: none; }
.hero .ring-label b { color: #fff; font-size: 24px; }
.hero .ring-label span { color: rgba(255, 255, 255, 0.7); }

.ring { position: relative; display: inline-grid; place-items: center; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; line-height: 1.15; }
.ring-label b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 10.5px; color: var(--muted); }

.stat { display: flex; gap: 14px; align-items: center; padding: 16px 18px; }
.stat-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat-ico.subject-math { background: var(--math-soft); color: var(--math); }
.stat-ico.subject-chinese { background: var(--chinese-soft); color: var(--chinese); }
.stat-ico.subject-english { background: var(--english-soft); color: var(--english); }
.stat-ico.brand { background: var(--brand-soft); color: var(--brand); }
.stat-ico.warn { background: #fef4e2; color: var(--warn); }
.stat-ico.ok { background: #e8f8f2; color: var(--ok); }
.stat b { font-size: 22px; letter-spacing: -0.5px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat small { display: block; font-size: 11.5px; color: var(--muted); }
.stat .trend { font-size: 11px; color: var(--ok); }

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task {
  display: flex; align-items: center; gap: 13px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.task:hover { border-color: #d8ddf0; box-shadow: 0 12px 26px -24px rgba(23, 32, 58, 0.6); transform: translateY(-1px); }
.task-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; background: var(--brand-soft); color: var(--brand);
}
.task-ico[data-subject="math"] { background: var(--math-soft); color: var(--math); }
.task-ico[data-subject="chinese"] { background: var(--chinese-soft); color: var(--chinese); }
.task-ico[data-subject="english"] { background: var(--english-soft); color: var(--english); }
.task-main { flex: 1; min-width: 0; }
.topbar > div { min-width: 0; }
.task-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-title .lv { font-size: 10.5px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 5px; padding: 1px 5px; }
.task p { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-time { font-size: 11.5px; color: var(--faint); flex: none; }

.subject-row { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.subject-row:last-child { border-bottom: 0; }
.subject-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.subject-mark[data-subject="math"] { background: var(--math-soft); color: var(--math); }
.subject-mark[data-subject="chinese"] { background: var(--chinese-soft); color: var(--chinese); }
.subject-mark[data-subject="english"] { background: var(--english-soft); color: var(--english); }
.subject-row .meta { flex: 1; min-width: 0; }
.subject-row .meta b { font-size: 13px; font-weight: 600; display: block; }
.subject-row .meta span { font-size: 11px; color: var(--muted); }

.mini-list { display: flex; flex-direction: column; gap: 9px; }
.mini-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 11px; background: #f8f9fd; }
.mini-item .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--warn); }
.mini-item .txt { min-width: 0; flex: 1; }
.mini-item b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item span { font-size: 11px; color: var(--muted); }

/* ---------- 知识星图 ---------- */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0; }
.search {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: 11px; padding: 8px 12px; min-width: 220px; color: var(--faint);
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 13px; color: var(--ink); }
.unit { margin-bottom: 26px; }
.unit-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 12px; }
.unit-head h3 { font-size: 15px; letter-spacing: 0.1px; }
.unit-head .unit-meta { font-size: 11.5px; color: var(--muted); }
.unit-progress { width: 160px; margin-left: auto; }
.unit-progress .progress { height: 6px; }
.unit-progress span { font-size: 10.5px; color: var(--faint); display: block; text-align: right; margin-top: 3px; }
.kp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kp-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; position: relative; overflow: hidden;
}
.kp-card:hover { border-color: #d5daf0; box-shadow: 0 16px 32px -28px rgba(23, 32, 58, 0.7); transform: translateY(-2px); }
.kp-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); opacity: 0.9; }
.kp-card[data-subject="math"]::after { background: var(--math); }
.kp-card[data-subject="chinese"]::after { background: var(--chinese); }
.kp-card[data-subject="english"]::after { background: var(--english); }
.kp-card .kp-top { display: flex; align-items: center; gap: 8px; }
.kp-card h4 { font-size: 13.5px; font-weight: 620; flex: 1; min-width: 0; line-height: 1.45; }
.exam { font-size: 9.5px; letter-spacing: 0.5px; color: #f0a020; }
.kp-card .kp-core { font-size: 11.5px; color: var(--muted); margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.ladder { display: flex; gap: 4px; margin-top: 11px; }
.ladder-seg { flex: 1; height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; }
.ladder-seg i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.kp-card[data-subject="math"] .ladder-seg i { background: var(--math); }
.kp-card[data-subject="chinese"] .ladder-seg i { background: var(--chinese); }
.kp-card[data-subject="english"] .ladder-seg i { background: var(--english); }
.kp-foot { display: flex; align-items: center; margin-top: 8px; font-size: 11px; color: var(--faint); }
.kp-foot .state { margin-left: auto; }
.state { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: #f3f5fb; color: var(--muted); }
.state.mastered { background: #e8f8f2; color: var(--ok); }
.state.learning { background: var(--brand-soft); color: var(--brand); }
.state.due { background: #fef4e2; color: #b8730a; }
.state.new { background: #f3f5fb; color: var(--faint); }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }

/* ---------- 知识点详情 ---------- */
.crumbs { font-size: 12px; color: var(--faint); margin-bottom: 14px; display: flex; gap: 6px; align-items: center; }
.crumbs a:hover { color: var(--brand); }
.kp-hero { display: flex; gap: 24px; align-items: center; }
.kp-hero .main-info { flex: 1; min-width: 0; }
.kp-hero h2 { font-size: 24px; letter-spacing: -0.3px; margin: 7px 0 8px; }
.kp-hero .core { font-size: 13.5px; color: var(--ink-2); background: #f8f9fd; border-left: 3px solid var(--brand); padding: 9px 12px; border-radius: 0 8px 8px 0; }
.kp-hero .meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.kp-hero .side { flex: none; display: flex; gap: 20px; align-items: center; }
.big-num { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; }
.lv-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

.level-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.level-row:last-child { border-bottom: 0; }
.lv-badge {
  width: 34px; height: 34px; border-radius: 10px; background: #f3f5fb; color: var(--muted);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none;
}
.lv-badge.done { background: #e8f8f2; color: var(--ok); }
.lv-badge.now { background: var(--brand-soft); color: var(--brand); }
.lv-body { flex: 1; min-width: 0; }
.lv-body .lv-name { font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.lv-body .lv-goal { font-size: 11.5px; color: var(--muted); margin: 2px 0 6px; }
.level-row .btn { flex: none; align-self: center; }
.card-title { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-title .ico { color: var(--brand); }
.micro-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 9px; background: #fcfcff; }
.micro-card h5 { margin: 0 0 4px; font-size: 12.5px; color: var(--brand); letter-spacing: 0.3px; }
.micro-card p { font-size: 13px; color: var(--ink-2); }
.example-step { display: flex; gap: 10px; font-size: 13px; padding: 6px 0; }
.example-step .n { width: 20px; height: 20px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; display: grid; place-items: center; flex: none; margin-top: 2px; }
.answer-box { background: #f0fbf6; border: 1px dashed #b9e6d4; border-radius: 10px; padding: 9px 12px; font-size: 13px; color: #0b6b50; margin-top: 8px; }
.pitfall { display: flex; gap: 9px; font-size: 12.5px; color: var(--ink-2); padding: 5px 0; }
.pitfall .ico { color: var(--warn); flex: none; margin-top: 2px; }

/* ---------- 练习 ---------- */
.quiz-wrap { max-width: 860px; margin: 0 auto; }
.quiz-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.quiz-head .qtitle b { font-size: 15px; display: block; line-height: 1.3; }
.quiz-head .qtitle span { font-size: 11.5px; color: var(--muted); }
.quiz-progress { flex: 1; }
.quiz-progress .progress { height: 7px; }
.quiz-timer { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 4px 10px; }
.q-card { padding: 26px 28px; }
.passage {
  font-family: var(--serif); font-size: 14px; line-height: 1.9; color: var(--ink-2);
  background: #faf9f4; border: 1px solid #efece0; border-radius: 12px; padding: 16px 18px; margin-bottom: 18px;
  white-space: pre-wrap;
}
.q-stem { font-size: 16.5px; line-height: 1.75; font-weight: 550; white-space: pre-wrap; }
.q-meta { font-size: 11px; color: var(--faint); margin-top: 6px; letter-spacing: 0.3px; }
.options { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%;
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px;
  font-size: 14px; transition: border-color 0.14s, background 0.14s;
}
.option:hover { border-color: #c9cfee; background: #fbfbff; }
.option .letter {
  width: 24px; height: 24px; border-radius: 7px; background: #f3f5fb; color: var(--muted);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; margin-top: 1px;
}
.option.sel { border-color: var(--brand); background: var(--brand-soft); }
.option.sel .letter { background: var(--brand); color: #fff; }
.option.correct { border-color: var(--ok); background: #effbf6; }
.option.correct .letter { background: var(--ok); color: #fff; }
.option.wrong { border-color: var(--danger); background: #fdf1f1; }
.option.wrong .letter { background: var(--danger); color: #fff; }
.option[disabled] { cursor: default; }
.fill-line { margin-top: 20px; }
.fill-line input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 15px;
  font-size: 17px; outline: none; background: #fff; letter-spacing: 0.5px;
}
.fill-line input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }
.hint-row { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hint-btn { white-space: nowrap; border: 1px dashed var(--line-2); background: #fff; color: var(--muted); border-radius: 9px; padding: 6px 11px; font-size: 12px; }
.hint-btn:hover { color: var(--brand); border-color: var(--brand); }
.hint-box { margin-top: 10px; background: #fffaf0; border: 1px solid #f5e3bd; border-radius: 10px; padding: 10px 13px; font-size: 13px; color: #8a5b00; }
.hint-box + .hint-box { margin-top: 7px; }
.quiz-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.quiz-foot .spacer { flex: 1; }
.feedback { border-radius: 14px; padding: 16px 18px; margin-top: 16px; border: 1px solid; }
.feedback.ok { background: #f1fbf6; border-color: #c9ecdc; }
.feedback.bad { background: #fdf3f3; border-color: #f4d4d4; }
.feedback .fb-head { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 6px; }
.feedback.ok .fb-head { color: #0b7d5b; }
.feedback.bad .fb-head { color: #b52a2e; }
.feedback p { font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }
.selfcheck { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.check-item { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.check-item input { margin-top: 3px; accent-color: var(--brand); }
.result-hero { text-align: center; padding: 30px 20px 10px; }
.result-hero .emoji { font-size: 46px; }
.result-hero h2 { font-size: 24px; margin: 8px 0 4px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.result-stat { background: #f8f9fd; border-radius: 12px; padding: 12px; text-align: center; }
.result-stat b { font-size: 22px; display: block; letter-spacing: -0.5px; }
.result-stat span { font-size: 11px; color: var(--muted); }

/* ---------- 综合任务 ---------- */
.comp-card { display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.comp-card .comp-top { display: flex; align-items: center; gap: 8px; }
.comp-card h3 { font-size: 15px; }
.comp-card .scene { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kp-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.kp-pill { font-size: 10.5px; background: #f4f6fc; border-radius: 6px; padding: 2px 7px; color: var(--muted); max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-pill.ready { background: #e8f8f2; color: var(--ok); }
.kp-pill.low { background: #fdf3e6; color: #b8730a; }
.comp-lock { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--warn); }
.scene-box { background: linear-gradient(180deg, #fbfaff, #f6f5ff); border: 1px solid #e6e2ff; border-radius: 13px; padding: 16px 18px; font-size: 13.5px; color: var(--ink-2); }
.materials { margin: 14px 0; }
.materials h4 { font-size: 12.5px; margin-bottom: 8px; color: var(--muted); }
table.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.table th, table.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.table th { color: var(--muted); font-weight: 550; background: #fafbfe; }
table.table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

/* ---------- 作业 / 试卷 ---------- */
.dropzone {
  border: 1.5px dashed #cfd6e8; border-radius: 14px; padding: 26px; text-align: center;
  background: #fbfcff; color: var(--muted); transition: border-color 0.15s, background 0.15s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.dropzone b { display: block; color: var(--ink); font-size: 13.5px; margin-bottom: 3px; }
.dropzone .ico { margin: 0 auto 8px; color: var(--brand); }
.file-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-chip { display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; font-size: 11.5px; max-width: 100%; }
.file-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 5px; }
.file-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.file-chip button { border: 0; background: transparent; color: var(--faint); padding: 0 2px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.field > label { font-size: 11.5px; color: var(--muted); font-weight: 550; letter-spacing: 0.2px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-2); background: #fff; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; outline: none; transition: border-color 0.14s, box-shadow 0.14s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.09); }
.textarea { min-height: 74px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 11px; color: var(--faint); }

.list-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .main { flex: 1; min-width: 0; }
.list-row h4 { font-size: 13px; font-weight: 600; }
.list-row p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.thumb { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); background: #f3f5fb; flex: none; display: grid; place-items: center; color: var(--faint); }
.empty { text-align: center; padding: 26px 10px; color: var(--faint); font-size: 12.5px; }
.empty .ico { margin: 0 auto 8px; }

.error-row { display: grid; grid-template-columns: 1.4fr 90px 1fr 34px; gap: 8px; align-items: center; margin-bottom: 8px; }

/* ---------- 错题 / 试卷 ---------- */
.score-badge {
  width: 58px; height: 58px; border-radius: 14px; background: linear-gradient(150deg, #eef2ff, #e7e9ff);
  border: 1px solid #dfe4ff; display: grid; place-items: center; align-content: center;
  flex: none; color: var(--brand); line-height: 1.05;
}
.score-badge b { font-size: 21px; letter-spacing: -0.5px; }
.score-badge span { font-size: 9.5px; color: var(--muted); }
.box-dots { display: inline-flex; gap: 3px; }
.box-dots i { width: 10px; height: 5px; border-radius: 3px; background: var(--line-2); }
.box-dots i.on { background: var(--ok); }
.mistake-card { transition: border-color .15s, box-shadow .15s; }
.mistake-card:hover { box-shadow: 0 16px 34px -30px rgba(23,32,58,.7); }

/* ---------- 能力画像 ---------- */
.level-pill {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px;
  padding: 3px 11px; font-size: 11.5px; font-weight: 650; letter-spacing: .3px;
}
.ability-top { display: flex; align-items: center; gap: 16px; }
.ability-mini { transition: border-color .15s, box-shadow .15s, transform .15s; }
.ability-mini:hover { border-color: #d5daf0; box-shadow: 0 16px 32px -28px rgba(23,32,58,.7); transform: translateY(-1px); }
.ok-text { color: var(--ok); font-weight: 600; }
.bad-text { color: var(--danger); font-weight: 600; }

/* ---------- 题库 ---------- */
.bank-q { border-left: 3px solid var(--brand); }
.bank-q[data-subject="math"] { border-left-color: var(--math); }
.bank-q[data-subject="chinese"] { border-left-color: var(--chinese); }
.bank-q[data-subject="english"] { border-left-color: var(--english); }
.bank-q .q-stem { font-size: 13.5px; font-weight: 500; }
.bank-q details summary { cursor: pointer; color: var(--brand); font-size: 12px; }
.bank-q .answer-box { font-size: 12.5px; }
.bank-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- 报告 ---------- */
.report-head { display: flex; align-items: flex-start; gap: 20px; }
.report-head h2 { font-size: 22px; }
.predict { display: flex; align-items: baseline; gap: 6px; }
.predict b { font-size: 26px; letter-spacing: -1px; }
.chart-label { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart-sub { font-size: 10px; fill: var(--faint); font-family: var(--font); }
.chart-tick { font-size: 10px; fill: var(--faint); font-family: var(--font); }
.bar-rows { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.bar-label { width: 108px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.bar-track { flex: 1; height: 7px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 6px; }
.bar-val { width: 48px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; flex: none; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 12px 6px; font-size: 12.5px; }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }

.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge-item { text-align: center; padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.badge-item .em { font-size: 24px; }
.badge-item b { display: block; font-size: 11.5px; margin-top: 4px; }
.badge-item span { font-size: 10px; color: var(--faint); }
.badge-item.locked { opacity: 0.4; filter: grayscale(1); }

/* ---------- 设置 ---------- */
.settings-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row .desc { flex: 1; }
.settings-row .desc b { font-size: 13px; }
.settings-row .desc p { font-size: 11.5px; color: var(--muted); }
.switch { position: relative; width: 42px; height: 24px; background: var(--line-2); border-radius: 20px; border: 0; transition: background 0.2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(18px); }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(18, 24, 45, 0.42); display: grid; place-items: center;
  z-index: 100; opacity: 0; transition: opacity 0.18s; padding: 20px; backdrop-filter: blur(2px);
}
.modal-backdrop.show { opacity: 1; }
.modal {
  background: #fff; border-radius: 18px; width: min(520px, 100%); max-height: 88vh; overflow: auto;
  padding: 24px; position: relative; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.4);
  transform: translateY(8px); transition: transform 0.2s;
}
.modal-backdrop.show .modal { transform: translateY(0); }
.modal.wide { width: min(780px, 100%); }
.modal-close { position: absolute; right: 14px; top: 14px; border: 0; background: #f3f5fb; border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); }
.modal-title { font-size: 17px; margin-bottom: 6px; }
.modal-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: #1c2540; color: #fff; padding: 10px 16px; border-radius: 11px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 200;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.7);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok .toast-dot { background: #4ade80; }
#toast.bad .toast-dot { background: #f87171; }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: #93c5fd; }

/* ---------- 动效 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view > * { animation: fadeUp 0.28s ease both; }
.view > *:nth-child(2) { animation-delay: 0.03s; }
.view > *:nth-child(3) { animation-delay: 0.06s; }
.view > *:nth-child(4) { animation-delay: 0.09s; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .kp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-2-1, .layout-1-2 { grid-template-columns: minmax(0, 1fr); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  :root { --sidebar: 0px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-104%);
    transition: transform 0.24s ease; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  }
  .shell.menu-open .sidebar { transform: none; }
  .shell.menu-open .menu-mask { display: block; position: fixed; inset: 0; background: rgba(18,24,45,.35); z-index: 35; }
  .topbar .menu-btn { display: grid; }
  .topbar { padding: 16px 20px 12px; }
  .view { padding: 18px 20px 80px; }
  .nav-item.active::before { display: none; }
  .cols-3 { grid-template-columns: 1fr; }
  .kp-hero { flex-direction: column; align-items: stretch; }
  .kp-hero .side { justify-content: space-between; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .topbar h1 { font-size: 18px; }
  .top-actions .chip.hide-sm { display: none; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero h2 { font-size: 22px; }
  .hero-right { align-self: flex-end; margin-top: 0; }
  .cols-2 { grid-template-columns: 1fr; }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-time { display: none; }
  .task { padding: 11px 12px; gap: 10px; }
  .task-title { font-size: 13px; }
  .task-main p { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
  .kp-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .q-card { padding: 18px; }
  .q-stem { font-size: 15.5px; }
  .modal { padding: 20px 16px; }
  .error-row { grid-template-columns: 1fr 1fr; }
  .error-row .del { justify-self: end; }
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-label { font-size: 10px; }
  .bar-label { width: 84px; }
}
@media print {
  .sidebar, .topbar, .hero-actions, .btn { display: none !important; }
  .shell { display: block; }
  .view { padding: 0; }
  body { background: #fff; }
  .card { break-inside: avoid; box-shadow: none; }
}
