:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #37445c;
  --muted: #7e8aa0;
  --line: #e9ecf2;
  --primary: #6b76b0;
  --primary-d: #5c669f;
  --ok: #5b9670;
  --err: #b26e6e;
  --shadow: 0 1px 3px rgba(60,72,105,.06), 0 8px 24px rgba(60,72,105,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* 顶部栏 */
.topbar {
  height: 56px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: linear-gradient(90deg, #eef2fa, #f3f0fa);
  color: #3d4a66;
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 2px 12px rgba(60,72,105,.08);
}
.topbar .menu-btn { display: none; background: none; border: none; color: #3d4a66; font-size: 22px; cursor: pointer; }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: .5px; }
.topbar .spacer { flex: 1; }
.topbar .user-pill {
  background: rgba(61,74,102,.07); padding: 6px 12px; border-radius: 999px;
  font-size: 13px; display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.topbar .avatar { width: 24px; height: 24px; border-radius: 50%; background: #6b76b0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }

/* 布局 */
.shell { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 210px; background: var(--card); border-right: 1px solid var(--line);
  padding: 14px 10px; flex-shrink: 0;
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px; cursor: pointer; color: var(--muted);
  font-size: 14px; margin-bottom: 4px; font-weight: 500;
}
.sidebar .nav-item:hover { background: #f4f6f9; color: var(--text); }
.sidebar .nav-item.active { background: #eef1fa; color: var(--primary); font-weight: 700; }
.content { flex: 1; padding: 22px; max-width: 1100px; }
.sidebar.open { display: block; }

/* 卡片与通用 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.page-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.grid { display: grid; gap: 14px; }
.grid.subjects { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.subject-card {
  border-radius: 16px; padding: 18px; color: #43506b; cursor: pointer; min-height: 96px;
  display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.subject-card:hover { transform: translateY(-3px); }
.subject-card .ico { font-size: 30px; }
.subject-card .nm { font-size: 17px; font-weight: 700; }
.subject-card .sc { font-size: 12px; opacity: .85; }

.grid.quick { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.quick-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 18px; cursor: pointer;
  background: var(--card); box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center;
  transition: transform .12s ease;
}
.quick-card:hover { transform: translateY(-2px); }
.quick-card .qi { font-size: 26px; }
.quick-card .qt { font-weight: 700; }
.quick-card .qd { font-size: 12px; color: var(--muted); }

/* 按钮 */
.btn {
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .12s;
}
.btn:hover { background: var(--primary-d); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.danger { background: #fff; color: var(--err); border: 1px solid var(--err); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
label { font-size: 13px; color: var(--muted); display: block; margin: 10px 0 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }

/* 标签页 */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 10px 16px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* 知识点 / 列表项 */
.kp {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  cursor: pointer; background: #fff; transition: border-color .12s;
}
.kp:hover { border-color: var(--primary); }
.kp .kt { font-weight: 700; }
.kp .ksub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tag { display: inline-block; background: #eef1fa; color: var(--primary); font-size: 11px; padding: 2px 8px; border-radius: 999px; margin: 4px 4px 0 0; }

/* 练习 */
.q-box { background:#fff; border:1px solid var(--line); border-radius:14px; padding:20px; box-shadow: var(--shadow); }
.q-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.q-content { font-size: 17px; line-height: 1.7; margin-bottom: 16px; white-space: pre-wrap; }
.option { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.option:hover { border-color: var(--primary); }
.option.sel { border-color: var(--primary); background: #eef1fa; }
.option.correct { border-color: var(--ok); background: #f3faf5; }
.option.wrong { border-color: var(--err); background: #fbf6f6; }
.answer-line { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #f8fafc; font-size: 14px; }
.answer-line b { color: var(--primary); }
.explain { margin-top: 10px; color: #4a566d; line-height: 1.6; white-space: pre-wrap; }
.result-ok { color: var(--ok); font-weight: 700; }
.result-err { color: var(--err); font-weight: 700; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#eef2fa,#f5f0fa); padding: 20px; }
.login-card { background: #fff; border-radius: 18px; padding: 32px; width: 360px; max-width: 100%; border: 1px solid #e9ecf2; box-shadow: 0 20px 60px rgba(60,72,105,.14); }
.login-card h2 { margin: 0 0 4px; font-size: 22px; }
.login-card p.sub { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.login-card .or { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; letter-spacing: 4px; text-align: center; }
.login-err { color: var(--err); font-size: 13px; margin-top: 8px; min-height: 16px; }

/* 计划 */
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.plan.done { opacity: .65; }
.plan .pt { font-weight: 700; }
.plan .pd { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; }
.badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: #fbf4e4; color: #9b7849; }
.badge.done { background: #eaf5ee; color: #527f61; }
.plan .acts { margin-top: 10px; display: flex; gap: 8px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #4a5570; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px;
  z-index: 100; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw;
}
.toast.show { opacity: .95; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ===== 知识库 v2 ===== */
.topsearch {
  width: 220px; padding: 7px 12px; border-radius: 999px; border: none;
  background: rgba(255,255,255,.82); color: #3d4a66; font-size: 13px;
}
.topsearch::placeholder { color: #8b95a8; }
.topsearch:focus { outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(107,118,176,.14); }
.sidebar .ni { width: 16px; text-align: center; opacity: .9; }

.statbar {
  display: flex; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.statbar > div { flex: 1; text-align: center; }
.statbar b { display: block; font-size: 22px; color: var(--primary); }
.statbar span { font-size: 12px; color: var(--muted); }
.statbar.small { padding: 12px; margin-bottom: 16px; }
.statbar.small b { font-size: 18px; }

.sec-title { font-size: 15px; font-weight: 700; margin: 22px 0 12px; color: var(--text); }

.lib-list { display: flex; flex-direction: column; gap: 10px; }
.lib-row {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  cursor: pointer; transition: border-color .12s, transform .12s;
}
.lib-row:hover { border-color: var(--primary); transform: translateX(2px); }
.lib-badge {
  width: 44px; height: 44px; border-radius: 12px; color: #43506b; font-size: 20px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lib-main { flex: 1; min-width: 0; }
.lib-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.lib-go { color: var(--muted); font-size: 20px; }
.pill {
  font-size: 11px; font-weight: 500; color: var(--primary); background: #eef1fa;
  padding: 2px 8px; border-radius: 999px;
}

.crumb { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--primary); }
.subject-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.sh-badge {
  width: 52px; height: 52px; border-radius: 14px; color: #43506b; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
}

.book { margin-bottom: 22px; }
.book-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.book-tag {
  font-size: 13px; font-weight: 700; color: var(--primary);
  background: #eef1fa; padding: 4px 12px; border-radius: 999px;
}
.book-meta { font-size: 12px; color: var(--muted); }
.ch-row {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px;
  margin-bottom: 8px; cursor: pointer; transition: border-color .12s;
}
.ch-row:hover { border-color: var(--primary); }
.ch-t { flex: 1; font-weight: 600; font-size: 14px; }
.ch-m { font-size: 12px; color: var(--muted); }
.ch-go { color: var(--muted); }

.kp-top { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.heat { font-size: 11px; color: #d8ad63; letter-spacing: 1px; white-space: nowrap; }
.kp-head { margin-bottom: 14px; }
.kp-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.blk {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--primary);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.blk h4 { margin: 0 0 8px; font-size: 13px; color: var(--primary); font-weight: 700; }
.blk.quick { border-left-color: #68a37c; background: #f7fbf8; }
.blk.quick h4 { color: #5b9670; }
.blk.warn { border-left-color: #c17c7c; background: #fdf8f8; }
.blk.warn h4 { color: #b26e6e; }
.pre { white-space: pre-wrap; line-height: 1.85; font-size: 14.5px; color: #4a566d; }

.exam-box {
  background: #fdf9ee; border: 1px solid #f2e4bf; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 16px;
}
.exam-box b { font-size: 13px; color: #9b7849; display: block; margin-bottom: 6px; }

.q-mini {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  margin-bottom: 8px; cursor: pointer; background: #fff;
}
.q-mini:hover { border-color: var(--primary); }
.qm-t { font-size: 14px; line-height: 1.6; }
.qm-m { font-size: 12px; color: var(--muted); margin-top: 4px; }

.modal-ov {
  position: fixed; inset: 0; background: rgba(17,24,39,.5); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: #fff; border-radius: 16px; max-width: 660px; width: 100%;
  max-height: 85vh; overflow: auto; padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { font-size: 14.5px; }

.quiz-score { flex: 0 0 auto; min-width: 0; color: var(--muted); font-size: 13px; text-align: right; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.result-card { text-align: center; }
.plan-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ===== 年级分层 ===== */
.grid.grades { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grade-card {
  background: #fff; border-radius: 14px; padding: 16px 18px; cursor: pointer;
  border-top: 4px solid var(--primary); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.grade-card:hover { transform: translateY(-3px); box-shadow: 0 6px 22px rgba(0,0,0,.1); }
.gc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gc-name { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.gc-tag { font-size: 11px; color: var(--muted); background: #f4f6f9; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.gc-meta { font-size: 12.5px; color: var(--muted); margin-top: 9px; }
.gc-go { font-size: 12.5px; color: var(--primary); font-weight: 700; margin-top: 10px; }

.grade-panels { display: flex; flex-direction: column; gap: 14px; }
.grade-panel {
  background: #fff; border-radius: 14px; padding: 18px 20px; cursor: pointer;
  border-left: 4px solid var(--primary); box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.grade-panel:hover { transform: translateX(3px); }
.gp-head { display: flex; align-items: center; gap: 10px; }
.gp-name { font-size: 19px; font-weight: 800; }
.gp-desc { font-size: 13.5px; line-height: 1.8; color: var(--muted); margin-top: 8px; }
.gp-meta { font-size: 12.5px; color: var(--primary); font-weight: 700; margin-top: 10px; }

.g-tabs { display: flex; gap: 8px; margin: 2px 0 14px; flex-wrap: wrap; }
.g-tab {
  padding: 7px 17px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 13.5px; cursor: pointer; color: var(--muted); font-weight: 600;
  transition: all .15s ease;
}
.g-tab:hover { border-color: var(--primary); color: var(--primary); }
.g-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.g-badge {
  display: inline-block; font-size: 11px; color: #3f4b62; padding: 2px 9px;
  border-radius: 6px; vertical-align: middle; font-weight: 600; line-height: 1.7;
  white-space: nowrap;
}
.g-badge.all { background: #aeb8c8; }

@media (max-width: 720px) {
  .menu-btn { display: block; }
  .sidebar { display: none; position: fixed; top: 56px; left: 0; bottom: 0; z-index: 25; width: 220px; box-shadow: 4px 0 20px rgba(0,0,0,.12); }
  .content { padding: 16px; }
  .topsearch { display: block; flex: 1 1 80px; min-width: 0; margin: 0 6px; font-size: 13px; }
  .topbar h1 { font-size: 14px; max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fs-ctl { display: none; }
  .statbar b { font-size: 18px; }
}

/* ============ 整卷模拟 ============ */
.note-card { border-left: 3px solid #c39b60; }
.paper-list { display: grid; gap: 12px; }
.paper-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.paper-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pc-title { font-size: 16px; font-weight: 700; }
.pc-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.pc-note { font-size: 13px; color: #5c6780; margin-top: 8px; line-height: 1.65; }
.pc-best { color: var(--ok); font-weight: 700; }

.paper-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 10px 2px; margin: -8px 0 14px;
}
.pb-title { font-weight: 700; font-size: 15px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.pb-time {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px;
  padding: 2px 9px; border-radius: 8px; background: #f4f6fa;
}
.pb-time-warn { color: #a87e4b; background: #fbf4e4; }
.pb-time-up { color: #b26e6e; background: #f9eded; }
.pb-prog { font-size: 12px; color: var(--muted); }

.paper-sec { margin-bottom: 20px; }
.ps-name { font-size: 15px; font-weight: 700; margin: 18px 0 4px; }
.ps-note { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

.pq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.pq-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pq-no {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.pq-meta { font-size: 11px; color: var(--muted); }
.pq-q { font-size: 16px; line-height: 1.75; white-space: pre-wrap; margin-bottom: 12px; }
.pq-opts .option:last-child { margin-bottom: 0; }
.pq-fill {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 15px; font-family: inherit; resize: vertical;
}
.pq-fb { margin-top: 10px; }
.pq-fb:empty { display: none; }
.result-part { color: #a87e4b; font-weight: 700; }

@media (max-width: 720px) {
  .paper-bar { flex-wrap: wrap; }
  .pb-title { flex-basis: 100%; }
  .pb-right { width: 100%; justify-content: space-between; }
  .pc-title { font-size: 15px; }
}

/* ============ 学情 · 今日练习 ============ */
.hero-card {
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  background: linear-gradient(135deg, #eef1fa, #f8fafc);
  border: 1px solid #e5e9f5; border-radius: 14px;
  padding: 16px 18px; margin: 4px 0 18px;
}
.hc-main { min-width: 0; }
.hc-t { font-size: 16px; font-weight: 700; }
.hc-d { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.hero-card .btn { flex: 0 0 auto; }

.ch-stat { font-size: 13px; color: var(--muted); margin: -6px 0 12px; display: flex; align-items: center; gap: 8px; }
.kp-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.m-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 700; white-space: nowrap;
}
.m-badge.m-ok { background: #eaf5ee; color: #5b9670; }
.m-badge.m-mid { background: #fbf4e4; color: #a87e4b; }
.m-badge.m-bad { background: #f9eded; color: #b26e6e; }
.m-badge.m-few { background: #e5e9f5; color: #5c669f; }
.m-badge.m-none { background: #f4f6fa; color: #8b96a8; }

.pre-box {
  background: #fdf7ef; border: 1px solid #f4e4d0; border-radius: 14px;
  padding: 14px 16px; margin: 0 0 18px;
}
.pre-h { font-size: 14px; font-weight: 700; color: #a47155; margin-bottom: 4px; }
.pre-list { display: grid; gap: 8px; margin-top: 10px; }
.pre-item {
  display: block; background: #fff; border: 1px solid #f4e4d0; border-radius: 10px;
  padding: 9px 12px; transition: border-color .15s;
}
.pre-item:hover { border-color: #d0966a; }
.pre-sub { display: block; font-size: 11px; color: var(--muted); }
.pre-t { display: block; font-size: 14px; font-weight: 600; margin: 2px 0; }
.pre-n { display: block; font-size: 11px; color: var(--muted); }

.bar-list { display: grid; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-name { flex: 0 0 84px; color: var(--muted); }
.bar-track { flex: 1 1 auto; height: 8px; background: #f0f3f8; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-fill.g-ok { background: #84bd96; }
.bar-fill.g-mid { background: #d8ad63; }
.bar-fill.g-bad { background: #c58484; }
.bar-val { flex: 0 0 34px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 200;
}
.modal {
  width: 100%; max-width: 520px; max-height: 86vh; background: #fff; border-radius: 16px;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-wide { max-width: 720px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.modal-head b { font-size: 15px; }
.modal-x {
  border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted);
  cursor: pointer; padding: 0 4px;
}
.modal-body { padding: 16px; overflow: auto; }

.rp-list { display: grid; gap: 6px; margin-bottom: 12px; }
.rp-item { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 4px; cursor: pointer; }
.rp-item input { accent-color: var(--primary); }
#rpText, .pq-fill {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-family: inherit; font-size: 14px; resize: vertical;
}

.ask-q {
  font-size: 14px; line-height: 1.7; background: #f8fafc; border-left: 3px solid var(--primary);
  border-radius: 8px; padding: 10px 12px; color: #4b5872;
}
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 13px; cursor: pointer; color: #4a566d;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.ask-out { min-height: 40px; max-height: 42vh; overflow: auto; font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.ask-a:empty { display: none; }
.ask-tip { font-size: 12px; color: var(--muted); }
.ask-err { color: var(--err); font-size: 13px; margin-top: 8px; }
.ask-input { display: flex; gap: 8px; margin-top: 12px; }
.ask-input input {
  flex: 1 1 auto; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-family: inherit;
}
.q-tools { margin-left: auto; display: flex; gap: 14px; font-size: 12px; color: var(--primary); }
.q-tools a { cursor: pointer; }

/* ============ 后台 ============ */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 16px; }
.tab {
  padding: 6px 12px; border-radius: 999px; font-size: 13px; background: #fff;
  border: 1px solid var(--line); color: #5c6780;
}
.tab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tab-dot {
  display: inline-block; margin-left: 5px; background: #c58484; color: #fff;
  border-radius: 999px; font-size: 10px; padding: 0 5px; vertical-align: 1px;
}
.tb { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.tb th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px;
  padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tb td { padding: 9px 6px; border-bottom: 1px solid #f4f6fa; vertical-align: top; }
.tb tbody tr:hover { background: #fafbfe; }
.tb-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.t-ok { color: #5b9670; } .t-mid { color: #a87e4b; } .t-bad { color: #b26e6e; }

.rp-queue { display: grid; gap: 8px; margin-top: 12px; }
.rp-row {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.rp-row.done { opacity: .55; }
.rp-main { min-width: 0; }
.rp-reason { font-size: 14px; line-height: 1.5; }
.rp-act { flex: 0 0 auto; }

@media (max-width: 720px) {
  .bar-name { flex-basis: 64px; }
  .q-tools { margin-left: 0; width: 100%; order: 5; }
  .rp-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hero-card { flex-direction: column; align-items: stretch; gap: 10px; }
  .tb { font-size: 12px; }
  .tb th, .tb td { padding: 7px 4px; }
}

/* ============ 图库 ============ */
.fig-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.fig-chips .chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.fig-search {
  width: 100%; max-width: 420px; padding: 9px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.fig-group { margin-bottom: 20px; }
.fig-group-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.fig-group-h b { font-size: 14px; }
.fig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.fig-card {
  margin: 0; padding: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; cursor: zoom-in; transition: border-color .15s, box-shadow .15s;
}
.fig-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.fig-box { background: #fbfcfe; border-radius: 8px; overflow: hidden; }
.fig-svg { display: block; width: 100%; height: auto; }
.fig-card figcaption {
  display: flex; justify-content: space-between; align-items: baseline; gap: 6px;
  margin-top: 8px; font-size: 12.5px; font-weight: 600; color: #4b5872; line-height: 1.4;
}
.fig-loose { font-weight: 400; font-size: 11px; color: #aeb8c8; flex: 0 0 auto; }
.fig-big { background: #fbfcfe; border-radius: 10px; padding: 6px; }
.fig-big .fig-svg { max-height: 60vh; }
.fig-cap {
  margin-top: 10px; padding: 9px 12px; font-size: 13.5px; line-height: 1.8;
  color: #4b5872; background: #f8fafc; border-left: 3px solid var(--primary); border-radius: 8px;
}
.fig-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.kp-figs { margin-bottom: 4px; }

/* 题目配图 */
.q-fig {
  margin: 0 0 14px; padding: 10px 12px 8px; background: #f8fafc;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.q-fig:hover { border-color: var(--primary); }
.q-fig .fig-svg { max-height: 240px; width: 100%; }
.q-fig-cap { margin-top: 6px; font-size: 12px; color: var(--muted); text-align: center; }
.pq .q-fig { margin: 8px 0 12px; }

/* ============ 批改 ============ */
.mark-list { display: grid; gap: 8px; }
.mark-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.mark-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.mi-main { min-width: 0; }
.mi-t { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.mi-q { font-size: 14px; color: #37445c; line-height: 1.5; }
.mi-right { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.mi-go { font-size: 13px; color: var(--primary); white-space: nowrap; }
.mark-q {
  font-size: 15px; line-height: 1.9; color: #37445c; white-space: pre-wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px;
}
.mark-full { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.mark-input {
  width: 100%; min-height: 190px; padding: 14px; font-size: 15px; line-height: 1.9;
  font-family: inherit; color: #37445c; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; resize: vertical;
}
.mark-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(107,118,176,.14); }
.mark-wait { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.mark-raw {
  margin-top: 10px; padding: 12px; font-size: 12.5px; line-height: 1.8; white-space: pre-wrap;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; color: #606d84;
  max-height: 40vh; overflow: auto;
}
.mark-err { margin-top: 14px; padding: 12px; font-size: 13px; color: #b26e6e; background: #fbf6f6; border-radius: 10px; }
.mark-result { margin-top: 18px; }
.ms-head { display: flex; align-items: center; gap: 16px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.ms-score {
  flex: 0 0 auto; display: flex; align-items: baseline; gap: 2px;
  padding: 10px 16px; border-radius: 12px; font-weight: 700;
}
.ms-score.m-ok { background: #eaf5ee; color: #5b9670; }
.ms-score.m-mid { background: #fbf4e4; color: #a87e4b; }
.ms-score.m-bad { background: #f9eded; color: #b26e6e; }
.ms-num { font-size: 30px; line-height: 1; }
.ms-full { font-size: 14px; opacity: .75; }
.ms-rate { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.ms-pts { margin-top: 10px; display: grid; gap: 6px; }
.ms-pt {
  font-size: 13.5px; line-height: 1.7; padding: 9px 12px; border-radius: 9px;
  border-left: 3px solid #dde3ec; background: #f8fafc; color: #4b5872;
}
.ms-pt.hit { border-left-color: #68a37c; background: #f3faf5; }
.ms-pt.part { border-left-color: #d8ad63; background: #fdf9ee; }
.ms-pt.miss { border-left-color: #c17c7c; background: #fbf6f6; }
.ms-advice, .ms-ref {
  margin-top: 10px; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.8;
}
.ms-advice { background: #eef1fa; color: #5c5f96; }
.ms-advice b, .ms-ref b { display: block; font-size: 12px; margin-bottom: 4px; opacity: .8; }
.ms-ref { background: #f3faf5; color: #4d7359; }
.ms-rubric { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ms-rubric summary { cursor: pointer; padding: 10px 14px; font-size: 13px; color: #5c6780; }
.ms-rubric-row { display: flex; gap: 10px; padding: 8px 14px; font-size: 12.5px; line-height: 1.6; border-top: 1px solid #f4f6fa; }
.ms-rubric-row span:first-child { flex: 0 0 16px; color: var(--muted); }
.ms-rubric-row span:nth-child(2) { flex: 1 1 auto; }
.ms-rubric-row b { flex: 0 0 auto; color: var(--primary); }

@media (max-width: 720px) {
  .fig-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
  .fig-card { padding: 7px; }
  .fig-card figcaption { font-size: 11.5px; }
  .mark-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .mi-right { width: 100%; justify-content: space-between; }
  .ms-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .mark-input { min-height: 160px; }
}

/* ============ 薄弱诊断 · 提分路径 ============ */
.diag-how { border-left: 3px solid var(--primary); }
.diag-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.diag-step { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.diag-step b { display: block; color: var(--primary); font-size: 13px; margin-bottom: 4px; }
.diag-step span { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.diag-rule { font-size: 12.5px; line-height: 1.8; color: #4b5872; background: #f8fafc; border-radius: 10px; padding: 10px 12px; }
.diag-rule b { color: var(--primary); }
.diag-list { display: grid; gap: 8px; }
.diag-row { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; background: #fff; }
.diag-rank { flex: 0 0 26px; height: 26px; border-radius: 50%; background: #eef1fa; color: var(--primary); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.diag-main { flex: 1; min-width: 0; }
.diag-name { font-weight: 700; font-size: 14.5px; color: var(--text); }
.diag-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.diag-root { font-size: 12px; color: #a87e4b; margin-top: 5px; }
.diag-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.diag-acts { display: flex; gap: 12px; font-size: 12px; color: var(--primary); }
.diag-acts a { cursor: pointer; }
.diag-acts a:hover { text-decoration: underline; }
.diag-quiz { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.diag-quiz-h { font-weight: 700; font-size: 14px; margin-bottom: 12px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.diag-quiz-h span { font-weight: 400; font-size: 12px; color: var(--muted); }
.diag-q { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.dq-t { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.dq-m { font-size: 11px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.dq-opts { display: grid; gap: 6px; margin-top: 10px; }
.dq-opt { border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; font-size: 13px; cursor: pointer; }
.dq-opt:hover { border-color: var(--primary); }
.dq-opt.on { border-color: var(--primary); background: #eef1fa; }
.diag-plan { display: grid; gap: 10px; }
.diag-day { border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 10px; padding: 11px 14px; background: #fff; }
.dd-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.dd-head b { color: var(--primary); font-size: 13px; }
.dd-title { font-weight: 700; font-size: 14px; margin: 5px 0; }
.dd-detail { font-size: 12.5px; color: var(--muted); line-height: 1.75; }
@media (max-width: 720px) {
  .diag-row { flex-wrap: wrap; }
  .diag-side { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .diag-steps { grid-template-columns: 1fr 1fr; }
}
.diag-init { display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 600; color: #9b7849; background: #fbf4e4; border-radius: 999px; padding: 1px 7px; vertical-align: 1px; }


/* 打印：只留正文，去掉导航与按钮 */
@media print {
  .topbar, .sidebar, .menu-btn, .user-pill, .topsearch, .fs-ctl,
  .row, .nav-item, .btn, .page-sub a { display: none !important; }
  .shell { display: block !important; }
  .content { padding: 0 !important; max-width: none !important; }
  body, .card, .kp, .box { background: #fff !important; box-shadow: none !important; border-color: #ddd !important; }
  .kp, .q-card, .card { break-inside: avoid; page-break-inside: avoid; }
  a { color: #000 !important; text-decoration: none !important; }
  .fs-s .content, .fs-l .content { zoom: 1 !important; }
}

/* 字号三档 */
.fs-s .content { zoom: 0.92; }
.fs-l .content { zoom: 1.1; }
.fs-ctl { display: flex; gap: 4px; margin-left: 8px; }
.fs-ctl button { border: 1px solid #d7dbe0; background: #fff; border-radius: 6px; width: 30px; height: 26px; font-size: 12px; cursor: pointer; }
