:root {
  --bg: #ece6da;
  --app-bg: #f7f3eb;
  --surface: #fffdf8;
  --surface-2: #f1ece2;
  --ink: #203038;
  --ink-soft: #40535c;
  --muted: #7d8a90;
  --line: #e6dfd3;
  --primary: #1f5f5b;
  --primary-2: #2d7b74;
  --primary-soft: #e2efec;
  --primary-ink: #143f3c;
  --accent: #df7b43;
  --accent-soft: #fbe9dd;
  --danger: #c45454;
  --danger-soft: #f8e4e2;
  --warn: #c99534;
  --warn-soft: #fbf0d8;
  --ok: #4c8b64;
  --ok-soft: #e4f0e7;
  --shadow: 0 12px 32px rgba(34, 53, 53, 0.08);
  --shadow-soft: 0 4px 16px rgba(34, 53, 53, 0.05);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(223, 123, 67, 0.10), transparent 28%),
    radial-gradient(circle at 88% 2%, rgba(31, 95, 91, 0.10), transparent 32%),
    var(--bg);
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}

button, input, select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100dvh;
  background: var(--app-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(28, 45, 45, 0.12);
}

@media (min-width: 560px) {
  body { padding: 22px 0; }
  .app-shell {
    min-height: calc(100dvh - 44px);
    border-radius: 30px;
    overflow: hidden;
  }
}

.app-header {
  height: 68px;
  padding: 14px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(247, 243, 235, 0.92);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 13px;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 18px; letter-spacing: -1px;
  box-shadow: 0 8px 18px rgba(31, 95, 91, 0.24);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: 0.5px; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.8px; margin-top: 2px; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.stage-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}
.stage-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 999px;
  line-height: 1;
}
.stage-tab.active { background: var(--primary); color: #fff; }
.stage-tab:active { opacity: 0.8; }
.icon-btn {
  width: 36px; height: 36px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft);
  border-radius: 12px; display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  border: 1px solid #f2d8c5;
}

.screen {
  flex: 1;
  padding: 6px 18px 104px;
  overflow-x: hidden;
}

.page-head { padding: 12px 2px 16px; }
.page-eyebrow {
  font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 6px;
}
.page-title { font-size: 25px; line-height: 1.18; margin: 0; letter-spacing: -0.5px; font-weight: 800; }
.page-sub { color: var(--muted); font-size: 12.5px; line-height: 1.65; margin: 8px 0 0; }

.section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 10px; margin: 22px 2px 11px;
}
.section-title { font-size: 16px; font-weight: 800; margin: 0; letter-spacing: -0.2px; }
.section-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.section-link {
  border: 0; background: transparent; color: var(--primary);
  font-size: 12px; font-weight: 700; padding: 6px 0;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(230, 223, 211, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* ---------- Home ---------- */
.greeting { padding: 8px 2px 2px; }
.greeting h1 { font-size: 27px; margin: 0; letter-spacing: -0.7px; }
.greeting p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }

.hero-card {
  margin-top: 16px;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1c5753, #2d7b74 62%, #478e85);
  border-radius: var(--radius-xl);
  padding: 22px;
  color: white;
  box-shadow: 0 18px 34px rgba(31, 95, 91, 0.26);
}
.hero-card::before {
  content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%;
  border: 28px solid rgba(255,255,255,0.06); right: -60px; top: -76px;
}
.hero-card::after {
  content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%;
  background: rgba(255,255,255,0.05); right: 34px; bottom: -36px;
}
.hero-kicker { font-size: 10.5px; letter-spacing: 1.6px; opacity: .68; font-weight: 700; }
.hero-title { font-size: 22px; font-weight: 800; line-height: 1.3; margin: 8px 0 6px; letter-spacing: -0.3px; }
.hero-sub { font-size: 12px; line-height: 1.7; opacity: .76; max-width: 195px; }
.hero-footer { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 20px; position: relative; z-index: 1; }
.hero-stats { display: flex; flex: 0 0 auto; gap: 16px; }
.hero-stat { min-width: max-content; }
.hero-stat strong { display: block; font-size: 18px; line-height: 1; white-space: nowrap; }
.hero-stat span { display: block; font-size: 10px; opacity: .65; letter-spacing: .4px; white-space: nowrap; }
.hero-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
.hero-cta {
  border: 0; border-radius: 999px; padding: 11px 17px;
  background: rgba(255,255,255,.92); color: var(--primary-ink);
  font-weight: 800; font-size: 12px; display: flex; align-items: center; gap: 6px;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}
.hero-cta-secondary {
  background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.34); box-shadow: none;
}
.hero-ring {
  position: absolute; right: 20px; top: 74px;
  width: 92px; height: 92px; border-radius: 50%;
  background: conic-gradient(#f0c06d 0 72%, rgba(255,255,255,.16) 72% 100%);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.hero-ring::before {
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  background: #225f5b;
}
.hero-ring span { position: relative; z-index: 1; font-size: 22px; font-weight: 800; }
.hero-ring small { position: relative; z-index: 1; font-size: 9px; opacity: .65; display: block; text-align: center; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat-card { padding: 14px 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.stat-value { font-size: 19px; font-weight: 800; letter-spacing: -0.5px; }
.stat-value small { font-size: 10px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.stat-label { font-size: 10.5px; color: var(--muted); margin-top: 3px; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-card {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-md); padding: 15px 13px;
  display: flex; align-items: center; gap: 11px; text-align: left;
  box-shadow: var(--shadow-soft);
}
.action-icon {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto;
}
.action-icon.teal { background: var(--primary-soft); color: var(--primary); }
.action-icon.orange { background: var(--accent-soft); color: var(--accent); }
.action-icon.yellow { background: var(--warn-soft); color: var(--warn); }
.action-icon.red { background: var(--danger-soft); color: var(--danger); }
.action-title { display: block; font-size: 13px; font-weight: 800; line-height: 1.3; }
.action-sub { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

.weak-list { display: flex; flex-direction: column; gap: 9px; }
.weak-item { padding: 14px 15px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.weak-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.weak-name { font-size: 13px; font-weight: 750; }
.weak-meta { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.weak-bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 9px; }
.weak-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--danger), var(--accent)); }
.weak-footer { display: flex; justify-content: space-between; margin-top: 7px; font-size: 10px; color: var(--muted); }
.weak-footer b { color: var(--ink-soft); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 9.5px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.orange { background: var(--accent-soft); color: var(--accent); }
.badge.yellow { background: var(--warn-soft); color: var(--warn); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.gray { background: var(--surface-2); color: var(--muted); }

.recent-list { display: flex; flex-direction: column; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.recent-item:last-child { border-bottom: 0; }
.recent-date { font-size: 10px; color: var(--muted); width: 38px; flex: 0 0 auto; }
.recent-title { flex: 1; font-size: 12.5px; font-weight: 650; }
.recent-score { font-size: 16px; font-weight: 850; color: var(--primary); }
.recent-score small { font-size: 9px; color: var(--muted); font-weight: 600; }

/* ---------- Diagnosis ---------- */
.choice-grid { display: flex; flex-direction: column; gap: 9px; }
.choice-card {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-md); padding: 13px 14px;
  display: flex; align-items: center; gap: 12px; text-align: left;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.choice-card.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.choice-icon {
  width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2);
  color: var(--primary); display: grid; place-items: center; flex: 0 0 auto;
  font-weight: 800; font-size: 14px;
}
.choice-card.active .choice-icon { background: var(--primary); color: #fff; }
.choice-body { flex: 1; min-width: 0; }
.choice-title { display: block; font-size: 13px; font-weight: 800; }
.choice-sub { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.choice-card .badge { flex: 0 0 auto; }

.segmented {
  display: flex; padding: 3px; background: var(--surface-2); border-radius: 13px; gap: 3px;
}
.segment {
  flex: 1; border: 0; background: transparent; border-radius: 10px;
  padding: 9px 4px; font-size: 11.5px; color: var(--muted); font-weight: 700;
}
.segment.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(30,50,50,.08); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: 8px 14px; font-size: 11.5px; font-weight: 650;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: white; }

.summary-card { padding: 16px; margin-top: 14px; background: linear-gradient(160deg, #f0f7f5, #fffdf8); border: 1px solid #d7e8e4; }
.summary-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 5px 0; color: var(--muted); }
.summary-row b { color: var(--ink); }
.sticky-action { position: static; margin-top: 18px; padding-bottom: 2px; }
.btn {
  border: 0; border-radius: 15px; padding: 13px 18px; font-size: 13.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; box-shadow: 0 12px 22px rgba(31,95,91,.22); }
.btn-ghost { background: var(--surface); color: var(--primary); border: 1px solid #cfe1de; }
.btn-white { background: white; color: var(--primary-ink); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; box-shadow: none; }

/* ---------- Paper layout settings ---------- */
.layout-field { display: block; margin-bottom: 15px; }
.layout-field > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.layout-field b { color: var(--primary); font-size: 12px; }
.layout-field input[type="range"] { width: 100%; accent-color: var(--primary); }
.layout-check { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink); padding: 10px 0 2px; }
.layout-check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ---------- Paper ---------- */
.paper-toolbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 6px 0 14px;
}
.paper-toolbar > div:first-child { flex: 1 1 200px; min-width: 0; }
.paper-toolbar-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.paper-toolbar .btn { flex: 0 0 auto; }
@media (max-width: 430px) {
  .paper-toolbar-actions { width: 100%; justify-content: flex-start; }
}
.paper-stage { width: 100%; overflow: visible; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.paper-sheet {
  width: 210mm;
  min-height: 297mm;
  padding: 18mm 16mm;
  box-sizing: border-box;
  background: #fff;
  color: #111;
  border-radius: 0;
  border: 0;
  box-shadow: 0 14px 30px rgba(30, 50, 50, 0.10);
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 11pt;
  line-height: 1.8;
  transform-origin: top left;
}
.paper-title { text-align: center; font-size: 18pt; font-weight: 800; margin: 0 0 3mm; letter-spacing: 1px; }
.paper-sub { text-align: center; font-size: 10.5pt; color: #555; margin-bottom: 5mm; }
.paper-meta { display: flex; justify-content: space-between; font-size: 10pt; color: #444; border-bottom: 1px solid #999; padding-bottom: 3mm; margin-bottom: 5mm; }
.paper-section { font-weight: 800; font-size: 12pt; margin: 5mm 0 3mm; }
.paper-question { margin-bottom: var(--paper-question-gap, 7mm); page-break-inside: avoid; }
/* 选择/填空不需要大量演算，题间距按比例收紧，允许上下紧挨着其他题 */
.paper-question[data-type="选择"],
.paper-question[data-type="填空"] { margin-bottom: calc(var(--paper-question-gap, 7mm) * 0.4); }
.paper-q-head { display: flex; gap: 2.5mm; align-items: baseline; }
.paper-q-num { font-weight: 800; min-width: 8mm; }
.paper-q-body { flex: 1; font-size: var(--paper-font-size, 11pt); font-weight: var(--paper-font-weight, 400); line-height: 1.9; }
.paper-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1mm 8mm; margin-top: 2mm; font-size: calc(var(--paper-font-size, 11pt) - 0.5pt); }
.paper-lines { margin-top: 3mm; }
.paper-lines div { border: 0; height: 9mm; background: transparent; }
.paper-score { font-size: 9pt; color: #666; white-space: nowrap; }
.paper-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ---------- Grade ---------- */
.grade-progress-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 13px 14px; margin-bottom: 14px; box-shadow: var(--shadow-soft);
}
.grade-progress-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.grade-progress-top b { color: var(--primary); font-size: 15px; }
.duration-field { display: flex; align-items: center; gap: 5px; font-size: 10.5px; }
.duration-field input {
  width: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 5px;
  font-size: 12px; text-align: center; color: var(--ink); background: var(--surface-2);
}
.grade-progress { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.grade-progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #7bb3a9); transition: width .2s; }
.grade-list { display: flex; flex-direction: column; gap: 11px; }
.grade-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px; box-shadow: var(--shadow-soft);
}
.grade-card-head { display: flex; align-items: flex-start; gap: 9px; }
.grade-qnum {
  width: 28px; height: 28px; border-radius: 9px; background: var(--primary-soft);
  color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: 0 0 auto;
}
.grade-card-title { flex: 1; min-width: 0; }
.grade-kp { font-size: 12.5px; font-weight: 800; line-height: 1.4; }
.grade-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.grade-state { font-size: 9.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 4px 8px; flex: 0 0 auto; }
.grade-state.ok { color: var(--ok); background: var(--ok-soft); }
.grade-state.half { color: var(--warn); background: var(--warn-soft); }
.grade-state.bad { color: var(--danger); background: var(--danger-soft); }
.grade-question { font-size: 12px; line-height: 1.8; margin-top: 10px; }

/* ---------- 题目配图（几何 SVG） ---------- */
.question-figure { margin: 10px 0 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.question-figure img { display: block; width: min(100%, 360px); height: auto; margin: 0 auto; }
.grade-card .question-figure img, .practice-card .question-figure img { width: min(100%, 320px); }
.paper-question .question-figure { margin: 2mm 0 1mm; padding: 0; border: 0; border-radius: 0; }
.paper-question .question-figure img { width: 62mm; max-height: 62mm; }
.paper-question .question-figure.side-figure {
  float: right;
  width: 55mm;
  max-width: 55mm;
  margin: 0 0 2mm 4mm;
  padding: 0;
  border: 0;
}
.paper-question .question-figure.side-figure img { width: 100%; max-height: 55mm; }
.paper-q-body::after { content: ""; display: block; clear: both; }
.grade-options { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 7px; font-size: 11px; color: var(--ink-soft); }
.grade-answer {
  margin-top: 10px; padding: 9px 11px; border-radius: 9px;
  background: var(--primary-soft); color: var(--primary-ink); font-size: 11px; line-height: 1.7;
  word-break: break-word;
}
.grade-answer b { color: var(--primary); }
.grade-solution { margin-top: 6px; font-size: 10.5px; color: var(--muted); }
.grade-solution summary { cursor: pointer; color: var(--primary); font-weight: 700; padding: 3px 0; }
.grade-solution div { padding: 8px 10px; background: var(--surface-2); border-radius: 8px; line-height: 1.7; margin-top: 4px; color: var(--ink-soft); }
.mark-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 7px; margin-top: 11px; }
.mark-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 10px; padding: 9px 6px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.mark-btn.active.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.mark-btn.active.half { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.mark-btn.active.bad { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.error-tag-row { display: none; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.error-tag-row.show { display: flex; }
.error-tag-label { font-size: 9.5px; color: var(--muted); margin-right: 2px; }
.error-chip {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  border-radius: 999px; padding: 5px 9px; font-size: 9.5px;
}
.error-chip.active { background: var(--danger-soft); border-color: #efc8c4; color: var(--danger); font-weight: 700; }

@media print {
  body { background: #fff !important; margin: 0; padding: 0; }
  .app-header, .tabbar, .paper-toolbar, .paper-actions, .toast, .modal-backdrop { display: none !important; }
  .katex-mathml { display: none !important; }
  .app-shell { width: auto !important; max-width: none; min-height: 0; box-shadow: none; border-radius: 0; background: #fff !important; }
  .screen { padding: 0; background: #fff !important; }
  .paper-stage { display: block !important; width: auto; overflow: visible; margin: 0; background: #fff !important; }
  .paper-sheet {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    zoom: 1 !important;
    overflow: visible !important;
  }
  .paper-question { break-inside: avoid; page-break-inside: avoid; }
  .paper-section-title { break-after: avoid; page-break-after: avoid; }
  .paper-sheet { break-after: page; page-break-after: always; }
  .paper-sheet:last-child { break-after: auto; page-break-after: auto; }
  @page { size: A4; margin: 22mm 16mm 22mm; }
}

.settings-card { padding: 4px 16px 16px; }
.setting-field { display: block; padding: 7px 0 0; }
.setting-field span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.setting-field input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px;
  font-size: 11px; color: var(--ink); background: var(--surface-2); outline: none;
}
.setting-field input:focus { border-color: var(--primary); background: #fff; }
.setting-divider { border-top: 1px solid var(--line); margin: 12px 0 4px; }

/* ---------- Photo archive ---------- */
.photo-upload-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 13px 14px; margin-bottom: 14px; box-shadow: var(--shadow-soft); }
.photo-upload-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.photo-upload-head .section-title { margin: 0; font-size: 13px; }
.photo-upload-head .section-sub { margin-top: 3px; }
.btn-small { padding: 8px 11px; font-size: 10.5px; border-radius: 10px; }
.photo-input { display: none; }
.photo-gallery { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; }
.photo-gallery:has(.photo-empty) { display: block; }
.photo-empty { font-size: 10.5px; color: var(--muted); padding: 4px 0; }
.photo-thumb { position: relative; width: 76px; height: 96px; border-radius: 9px; overflow: hidden; flex: 0 0 auto; background: var(--surface-2); border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-delete { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(32,48,56,.72); color: white; font-size: 13px; line-height: 1; display: grid; place-items: center; padding: 0; }

.answer-locked {
  margin-top: 10px; padding: 11px 12px; border-radius: 9px;
  background: var(--warn-soft); color: #8a641f; font-size: 10.5px; line-height: 1.7;
  border: 1px dashed #e7d2a9;
}
.answer-lock-banner {
  margin-bottom: 12px; padding: 11px 12px; border-radius: 9px;
  background: var(--warn-soft); color: #8a641f; font-size: 10.5px; line-height: 1.7;
  border: 1px dashed #e7d2a9;
}
.answer-unlocked {
  margin-bottom: 12px; padding: 10px 12px; border-radius: 9px;
  background: var(--ok-soft); color: var(--ok); font-size: 10.5px; font-weight: 700;
}
.mark-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Practice ---------- */
.practice-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.practice-summary b { color: var(--primary); }
.practice-progress { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.practice-progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #7bb3a9); transition: width .2s; }
.knowledge-card {
  background: linear-gradient(160deg, #f0f7f5, #fffdf8);
  border: 1px solid #d7e8e4; border-radius: var(--radius-lg);
  padding: 17px; box-shadow: var(--shadow-soft);
}
.knowledge-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.knowledge-kicker { font-size: 9px; letter-spacing: 1.3px; color: var(--primary); font-weight: 800; }
.knowledge-title { font-size: 18px; font-weight: 850; margin-top: 6px; letter-spacing: -0.2px; }
.knowledge-definition { font-size: 12px; line-height: 1.85; color: var(--ink-soft); margin: 11px 0 0; }
.knowledge-section { margin-top: 13px; }
.knowledge-label { font-size: 10px; font-weight: 800; letter-spacing: .8px; color: var(--primary); margin-bottom: 5px; }
.formula-list { display: flex; flex-wrap: wrap; gap: 6px; }
.formula-list > span { font-size: 11px; background: #fff; border: 1px solid #d7e8e4; border-radius: 8px; padding: 7px 9px; color: var(--primary-ink); }
.knowledge-section ul { margin: 0; padding-left: 18px; font-size: 11.5px; line-height: 1.75; color: var(--ink-soft); }
.knowledge-section li { margin-bottom: 3px; }
.knowledge-section .error-points li { color: var(--danger); }
.practice-example { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; }
.practice-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-soft); }
.practice-list { display: flex; flex-direction: column; gap: 10px; }
.practice-card-head { display: flex; align-items: flex-start; gap: 9px; }
.practice-qnum { width: 28px; height: 28px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: 0 0 auto; }
.practice-card-title { flex: 1; }
.practice-solution { margin-top: 9px; font-size: 10.5px; color: var(--muted); }
.practice-solution summary { cursor: pointer; color: var(--primary); font-weight: 750; padding: 4px 0; }
.grade-solution-body { padding: 8px 10px; background: var(--surface-2); border-radius: 8px; line-height: 1.75; margin-top: 5px; color: var(--ink-soft); }
.path-start { margin-top: 8px; border: 0; background: var(--primary-soft); color: var(--primary); border-radius: 8px; padding: 6px 9px; font-size: 10px; font-weight: 750; display: inline-flex; align-items: center; gap: 4px; }
.practice-history { padding: 2px 14px; }
.practice-history-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.practice-history-row:last-child { border-bottom: 0; }
.practice-history-row b { display: block; font-size: 11.5px; }
.practice-history-row span { display: block; font-size: 9px; color: var(--muted); margin-top: 3px; }
.practice-history-row strong { font-size: 17px; color: var(--primary); }
.practice-history-row strong small { font-size: 9px; color: var(--muted); }
.practice-result-card { background: linear-gradient(135deg, #1c5753, #2d7b74); border-radius: var(--radius-xl); padding: 21px; color: white; display: flex; align-items: center; gap: 18px; box-shadow: 0 16px 30px rgba(31,95,91,.23); }
.practice-result-score { font-size: 38px; font-weight: 850; line-height: 1; }
.practice-result-score small { font-size: 10px; opacity: .7; margin-left: 3px; }
.practice-result-card h2 { font-size: 18px; margin: 0 0 5px; }
.practice-result-card p { font-size: 11px; opacity: .78; line-height: 1.7; margin: 0; }

/* ---------- Report ---------- */
.score-card {
  background: linear-gradient(135deg, #1c5753, #2d7b74);
  border-radius: var(--radius-xl); padding: 20px; color: white;
  display: flex; align-items: center; gap: 20px; box-shadow: 0 16px 30px rgba(31,95,91,.23);
}
.score-ring {
  width: 108px; height: 108px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(#f0c06d 0 72%, rgba(255,255,255,.15) 72% 100%);
  display: grid; place-items: center; position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #225f5b; }
.score-ring-inner { position: relative; text-align: center; }
.score-ring-inner strong { display: block; font-size: 31px; line-height: 1; font-weight: 850; }
.score-ring-inner span { font-size: 9px; opacity: .65; }
.score-copy h2 { margin: 0 0 5px; font-size: 19px; font-weight: 800; }
.score-copy p { margin: 0; font-size: 11px; opacity: .75; line-height: 1.7; }
.score-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.score-tag { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 4px 9px; font-size: 9.5px; }

.mastery-list { display: flex; flex-direction: column; gap: 9px; }
.mastery-item { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.mastery-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.mastery-name { font-weight: 700; }
.mastery-value { font-weight: 850; color: var(--primary); }
.mastery-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.mastery-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #7bb3a9); }
.mastery-item.weak .mastery-bar span { background: linear-gradient(90deg, var(--danger), var(--accent)); }
.mastery-item.weak .mastery-value { color: var(--danger); }

.error-list { padding: 15px; }
.error-row { display: grid; grid-template-columns: 68px 1fr 38px; align-items: center; gap: 10px; margin-bottom: 11px; font-size: 11px; }
.error-row:last-child { margin-bottom: 0; }
.error-label { color: var(--ink-soft); font-weight: 650; }
.error-track { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.error-track span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--danger)); }
.error-val { text-align: right; color: var(--muted); }

.path-list { display: flex; flex-direction: column; gap: 10px; }
.path-item { display: flex; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.path-index { width: 28px; height: 28px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: 0 0 auto; }
.path-body { flex: 1; }
.path-title { font-size: 12.5px; font-weight: 800; }
.path-detail { font-size: 10.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.path-chain { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chain-node { font-size: 9.5px; background: var(--surface-2); color: var(--ink-soft); border-radius: 7px; padding: 4px 7px; }
.chain-node.bad { background: var(--danger-soft); color: var(--danger); font-weight: 700; }

/* ---------- Graph / bank ---------- */
.search-bar {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; margin-bottom: 12px;
}
.search-bar input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 12px; color: var(--ink); }
.search-bar input::placeholder { color: #aab2b5; }
.semester-tabs, .filter-tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.semester-tabs::-webkit-scrollbar, .filter-tabs::-webkit-scrollbar { display: none; }
.semester-tab, .filter-tab {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 8px 13px; font-size: 11px; white-space: nowrap; font-weight: 650;
}
.semester-tab.active, .filter-tab.active { background: var(--primary); border-color: var(--primary); color: white; }
.semester-tab:disabled { opacity: .5; }

.review-session-row { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.review-session-label { font-size: 10px; color: var(--muted); font-weight: 650; }
.review-session-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.review-session-chip { display: flex; align-items: baseline; gap: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 5px 10px; font-size: 10.5px; }
.review-session-chip b { color: var(--text); font-size: 11px; }
.review-session-chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.review-session-chip.active b { color: var(--primary); }

.chapter-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.chapter-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.chapter-head { display: flex; align-items: center; gap: 10px; padding: 14px; width: 100%; border: 0; background: transparent; text-align: left; }
.chapter-index { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: 0 0 auto; }
.chapter-title-wrap { flex: 1; }
.chapter-name { font-size: 12.5px; font-weight: 800; }
.chapter-sub { font-size: 10px; color: var(--muted); margin-top: 3px; }
.chapter-chevron { color: var(--muted); transition: transform .2s; }
.chapter-card.open .chapter-chevron { transform: rotate(90deg); }
.kp-list { border-top: 1px solid var(--line); padding: 9px 14px 12px; display: none; }
.chapter-card.open .kp-list { display: block; }
.kp-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed #eee8dc; }
.kp-row:last-child { border-bottom: 0; }
.kp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary-2); flex: 0 0 auto; }
.kp-name { flex: 1; font-size: 11px; color: var(--ink-soft); }
.kp-level { font-size: 9px; color: var(--muted); }
.kp-mastery { font-size: 9.5px; font-weight: 700; color: var(--primary); }

.question-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.question-card { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.question-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.question-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.question-id { font-size: 9px; color: #a0a8ab; }
.question-text { font-size: 12px; line-height: 1.75; }
.question-options { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; margin-top: 8px; font-size: 11px; color: var(--ink-soft); }
.answer-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); font-size: 11px; line-height: 1.7; display: none; }
.answer-box.show { display: block; }
.answer-box b { color: var(--primary); }
.summary-meta { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.question-toggle { margin-top: 9px; border: 0; background: transparent; color: var(--primary); font-size: 10.5px; font-weight: 700; padding: 0; }
.load-more { margin: 14px auto 4px; display: block; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); border-radius: 999px; padding: 9px 18px; font-size: 11px; }

/* ---------- Mistakes ---------- */
.mistake-card { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.mistake-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.mistake-title { font-size: 12px; font-weight: 800; }
.mistake-question { font-size: 11.5px; line-height: 1.7; color: var(--ink-soft); }
.mistake-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.mistake-date { font-size: 9.5px; color: var(--muted); }

/* ---------- Profile / settings ---------- */
.profile-card { padding: 20px; display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #fffdf8, #eef7f4); }
.profile-avatar { width: 58px; height: 58px; border-radius: 20px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 23px; font-weight: 800; box-shadow: 0 8px 18px rgba(31,95,91,.2); }
.profile-name { font-size: 18px; font-weight: 800; }
.profile-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.profile-stats { display: flex; gap: 20px; margin-top: 12px; }
.profile-stats div { font-size: 10px; color: var(--muted); }
.profile-stats strong { display: block; font-size: 15px; color: var(--ink); }
.menu-list { display: flex; flex-direction: column; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.menu-item:last-child { border-bottom: 0; }
.menu-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); flex: 0 0 auto; }
.menu-label { flex: 1; font-size: 12.5px; font-weight: 650; }
.menu-value { font-size: 10px; color: var(--muted); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-label { font-size: 12px; font-weight: 650; }
.setting-desc { font-size: 10px; color: var(--muted); margin-top: 3px; }
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-2); position: relative; border: 0; }
.switch::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: white; position: absolute; top: 3px; left: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.15); transition: left .2s; }
.switch.on { background: var(--primary); }
.switch.on::after { left: 21px; }
.input-like { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 11px; color: var(--muted); background: var(--surface-2); }

.empty-state { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty-state .emoji { font-size: 38px; margin-bottom: 10px; }
.empty-state p { font-size: 12px; line-height: 1.7; margin: 0; }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(226, 218, 205, 0.9);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 9px 8px calc(10px + env(safe-area-inset-bottom));
  z-index: 30;
}
.tab-item { border: 0; background: transparent; color: #99a3a6; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 3px 0; }
.tab-icon { width: 22px; height: 22px; display: grid; place-items: center; }
.tab-label { font-size: 9px; font-weight: 650; }
.tab-item.active { color: var(--primary); }
.tab-item.active .tab-icon { transform: translateY(-1px); }

/* ---------- Toast / modal ---------- */
.toast {
  position: fixed; left: 50%; bottom: 104px; transform: translate(-50%, 12px);
  background: rgba(32, 48, 56, 0.92); color: white; font-size: 11.5px;
  padding: 10px 16px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; z-index: 50; white-space: nowrap;
  max-width: calc(100vw - 40px); overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(21, 33, 38, 0.38);
  display: grid; place-items: center; z-index: 60; padding: 22px;
  backdrop-filter: blur(3px);
}
.modal {
  width: min(100%, 420px); max-height: 80dvh; overflow-y: auto;
  background: var(--surface); border-radius: 22px; padding: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.modal-title { font-size: 15px; font-weight: 800; }
.modal-close { border: 0; background: var(--surface-2); width: 30px; height: 30px; border-radius: 9px; color: var(--muted); display: grid; place-items: center; }
.modal-body { font-size: 12px; line-height: 1.8; color: var(--ink-soft); }
.modal-body .question-text { font-size: 12.5px; }

/* ---------- Pending papers（待诊断） ---------- */
.pending-list { display: flex; flex-direction: column; gap: 12px; }
.pending-card { padding: 15px 16px; }
.pending-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pending-title { font-size: 13.5px; font-weight: 800; line-height: 1.45; color: var(--ink); }
.pending-meta { margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.pending-saved { margin-top: 5px; font-size: 10px; color: var(--muted); }
.pending-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.pending-photo-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 4px; }
.pending-photo-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Question review（题库审校） ---------- */
.review-entry {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; padding: 13px 15px;
  background: linear-gradient(135deg, #fdf7ec, #f4ede1);
  border: 1px solid #eadfcd; border-radius: 18px;
}
.review-entry-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.review-entry-text b { font-size: 13px; letter-spacing: -.2px; }
.review-entry-text span { font-size: 10.5px; color: var(--muted); }

.review-intro { padding: 18px; }
.review-intro-hero { text-align: center; padding: 6px 0 14px; }
.review-intro-hero strong { display: block; font-size: 40px; line-height: 1; letter-spacing: -1.5px; color: var(--primary); }
.review-intro-hero span { font-size: 11px; color: var(--muted); }
.review-plan-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.review-plan-table th { text-align: left; font-size: 10px; color: var(--muted); font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.review-plan-table td { padding: 7px 4px; border-bottom: 1px solid var(--surface-2); color: var(--ink-soft); }
.review-plan-table td:last-child, .review-plan-table th:last-child { text-align: right; }
.review-rules { margin: 16px 0 18px; padding: 12px 14px; background: var(--primary-soft); border-radius: 14px; }
.review-rules-title { font-size: 11px; font-weight: 800; color: var(--primary-ink); margin-bottom: 6px; }
.review-rules ul { margin: 0; padding-left: 16px; }
.review-rules li { font-size: 11px; line-height: 1.75; color: var(--ink-soft); }

.review-progress { padding: 14px 16px; margin-bottom: 12px; }
.review-progress-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.review-progress-top b { font-size: 18px; color: var(--primary); }
.review-progress-top span { font-size: 11px; color: var(--muted); }
.review-progress-counts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.review-progress-bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.review-progress-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #7bb3a9); transition: width .2s; }
.review-toolbar { display: flex; justify-content: space-between; margin-top: 10px; }
.review-toolbar button { border: 0; background: none; color: var(--primary); font-size: 11.5px; font-weight: 700; padding: 4px 0; }

.review-card { padding: 16px; }
.review-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.review-index { font-size: 10.5px; font-weight: 800; letter-spacing: .8px; color: var(--muted); text-transform: uppercase; }
.review-kp { font-size: 10.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.review-kp span { color: #a8b0b3; }
.review-question { font-size: 14px; margin-top: 9px; line-height: 1.85; }

.review-decision { margin-top: 12px; padding: 9px 12px; border-radius: 12px; font-size: 11.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-decision.pass { background: var(--ok-soft); color: var(--ok); }
.review-decision.issue { background: var(--danger-soft); color: var(--danger); }
.review-decision.skip { background: var(--surface-2); color: var(--muted); }
.review-decision small { font-size: 10.5px; opacity: .85; }
.review-decision button { margin-left: auto; border: 0; background: transparent; color: inherit; font-size: 10.5px; font-weight: 700; text-decoration: underline; padding: 2px; }

.review-actions { display: grid; grid-template-columns: 1fr 1fr .72fr; gap: 8px; margin-top: 14px; }
.review-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 4px; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.review-btn.pass { color: var(--ok); border-color: #cfe3d4; background: var(--ok-soft); }
.review-btn.issue { color: var(--danger); border-color: #eccfcc; background: var(--danger-soft); }
.review-btn.skip { color: var(--muted); }
.review-btn.active { box-shadow: inset 0 0 0 2px currentColor; }
.review-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }

.review-issue-panel { margin-top: 12px; padding: 13px; border-radius: 14px; background: var(--danger-soft); border: 1px solid #eccfcc; }
.review-issue-title { font-size: 11px; font-weight: 800; color: var(--danger); margin-bottom: 8px; }
.review-issue-panel .chip { background: rgba(255,255,255,.7); border-color: #e6c4c0; color: var(--danger); }
.review-issue-panel .chip.active { background: var(--danger); border-color: var(--danger); color: white; }
.review-note { width: 100%; margin-top: 10px; border: 1px solid #e6c4c0; border-radius: 10px; padding: 10px; font: inherit; font-size: 12px; background: white; resize: vertical; color: var(--ink); }
.review-issue-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

.review-list-wrap { margin-top: 16px; }
.review-list-wrap summary { font-size: 11.5px; font-weight: 700; color: var(--primary); padding: 8px 2px; cursor: pointer; }
.review-list { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.review-list-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: transparent; border: 0; border-bottom: 1px solid var(--surface-2); text-align: left; }
.review-list-row:last-child { border-bottom: 0; }
.review-list-row.active { background: var(--primary-soft); }
.review-list-num { width: 22px; font-size: 10px; color: var(--muted); flex: none; }
.review-list-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.review-list-main b { font-size: 11.5px; color: var(--ink); }
.review-list-main small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.review-summary { padding: 20px; }
.review-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 18px; text-align: center; }
.review-summary-grid strong { display: block; font-size: 21px; line-height: 1.2; }
.review-summary-grid .ok { color: var(--ok); }
.review-summary-grid .danger { color: var(--danger); }
.review-summary-grid span { font-size: 10px; color: var(--muted); }
.review-export-hint { font-size: 10.5px; color: var(--muted); line-height: 1.7; margin: 12px 0 0; text-align: left; }
.review-export-hint code { background: var(--surface-2); padding: 2px 5px; border-radius: 5px; font-size: 10px; word-break: break-all; }
.review-issue-item { width: 100%; text-align: left; border: 0; border-left: 3px solid var(--danger); background: var(--danger-soft); border-radius: 0 10px 10px 0; margin-bottom: 8px; padding: 9px 12px; display: block; }
.review-issue-item:last-child { margin-bottom: 0; }
.review-issue-item b { font-size: 11.5px; color: var(--danger); }
.review-issue-item p { font-size: 11px; margin: 4px 0 0; color: var(--ink-soft); line-height: 1.6; }
.review-issue-open { display: inline-block; margin-top: 5px; font-size: 10px; color: var(--danger); opacity: .8; }
.review-empty { font-size: 11.5px; color: var(--muted); text-align: center; margin: 8px 0; }
.review-summary-links { margin-top: 12px; text-align: center; }

@media (max-width: 380px) {
  .screen { padding-left: 14px; padding-right: 14px; }
  .hero-ring { right: 14px; width: 82px; height: 82px; }
  .hero-title { font-size: 20px; }
  .paper-options { grid-template-columns: 1fr; }
}

/* ---------- Model interface / AI review / AI generate ---------- */
.model-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.model-test-result { font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.model-picker { margin-top: 10px; }
.model-picker:empty { display: none; }
.model-picker-head { font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.model-picker-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--surface-2); }
.model-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid transparent; border-radius: 8px; background: var(--surface); padding: 8px 10px; text-align: left; font-size: 11px; color: var(--ink-soft); }
.model-option:hover, .model-option.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.model-option-check { font-size: 9px; color: var(--primary); font-weight: 800; white-space: nowrap; }
.model-picker-empty { font-size: 10.5px; color: var(--danger); line-height: 1.6; padding: 8px 10px; border-radius: 10px; background: var(--danger-soft); }
.model-test-result.ok { color: var(--ok); }
.model-test-result.error { color: var(--danger); }
.model-test-result.running { color: var(--warn); }

.ai-review-tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ai-review-tools span { font-size: 10px; color: var(--muted); }
.ai-review-panel:empty { display: none; }
.ai-review-card { margin-top: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.ai-review-card.running { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; }
.ai-review-card.error { background: var(--danger-soft); border-color: #eccfcc; color: var(--danger); }
.ai-review-card.error p { margin: 6px 0 0; font-size: 11px; line-height: 1.6; }
.ai-review-card.pass { background: var(--ok-soft); border-color: #cfe3d4; }
.ai-review-card.issue { background: var(--danger-soft); border-color: #eccfcc; }
.ai-review-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-review-meta { font-size: 10px; color: var(--muted); }
.ai-check-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; font-size: 11px; }
.ai-check-grid .ok { color: var(--ok); }
.ai-check-grid .bad { color: var(--danger); }
.ai-issue-list { margin: 8px 0 0; padding-left: 16px; font-size: 11px; color: var(--danger); line-height: 1.7; }
.ai-suggestion { margin: 8px 0 0; font-size: 11px; color: var(--ink-soft); line-height: 1.7; }
.ai-review-foot { margin: 8px 0 0; font-size: 9.5px; color: var(--muted); }
.ai-spinner { width: 14px; height: 14px; border: 2px solid rgba(31, 95, 91, .2); border-top-color: var(--primary); border-radius: 50%; animation: ai-spin .8s linear infinite; flex: none; }
@keyframes ai-spin { to { transform: rotate(360deg); } }

.bank-self-grade { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted); }
.bank-self-result { font-size: 11px; font-weight: 750; }
.bank-self-result.ok { color: var(--ok); }
.bank-self-result.bad { color: var(--danger); }
.bank-tools { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.bank-tools span { font-size: 10.5px; color: var(--muted); }
.ai-bank-generator { padding: 16px; margin-bottom: 16px; }
.ai-bank-generator-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ai-bank-generator-head .section-sub { margin-top: 3px; }
.ai-bank-generator .ai-gen-form { margin-top: 12px; }
.ai-bank-status:empty { display: none; }
.ai-bank-progress {
  margin-top: 10px; padding: 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
}
.ai-bank-progress-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--ink-soft); font-weight: 650;
}
.ai-bank-progress-head b { margin-left: auto; color: var(--primary); font-size: 12px; }
.ai-progress-track {
  height: 7px; margin-top: 9px; border-radius: 999px;
  background: rgba(31, 95, 91, .12); overflow: hidden;
}
.ai-progress-fill {
  position: relative; width: 0%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #4ea69d);
  transition: width .35s ease; overflow: hidden;
}
.ai-progress-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transform: translateX(-100%); animation: ai-progress-sheen 1.2s ease-in-out infinite;
}
@keyframes ai-progress-sheen { to { transform: translateX(100%); } }
.ai-progress-meta {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 7px; font-size: 10px; color: var(--muted);
}
.ai-progress-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-progress-step {
  padding: 2px 8px; border-radius: 999px;
  background: rgba(31, 95, 91, .06); color: var(--muted); font-size: 9.5px;
}
.ai-progress-step.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.ai-gen-tip { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.ai-gen-form .setting-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.ai-gen-form .setting-field > span { font-size: 10.5px; color: var(--muted); }
.ai-gen-form select, .ai-gen-form textarea, .setting-field select {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  font: inherit; font-size: 12px; background: var(--surface); color: var(--ink); width: 100%;
}
.ai-gen-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-gen-result:empty { display: none; }
.ai-gen-preview { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ai-gen-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ai-gen-actions { display: flex; gap: 8px; margin-top: 10px; }
.model-error-raw { margin-top: 8px; font-size: 10px; }
.model-error-raw summary { cursor: pointer; color: var(--danger); }
.model-error-raw pre { white-space: pre-wrap; word-break: break-word; background: rgba(255,255,255,.65); padding: 8px; border-radius: 8px; max-height: 160px; overflow: auto; font-size: 9.5px; line-height: 1.5; margin: 6px 0 0; }

/* ---------- Batch AI review ---------- */
.batch-setup { padding: 16px; margin-bottom: 12px; }
.batch-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.batch-form-grid .setting-field { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.batch-form-grid .setting-field:first-child { grid-column: 1 / -1; }
.batch-form-grid .setting-field > span { font-size: 10.5px; color: var(--muted); }
.batch-form-grid select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 12px; background: var(--surface); color: var(--ink); width: 100%; }
.batch-check { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); margin: 10px 0 8px; }
.batch-estimate { font-size: 11px; color: var(--primary); font-weight: 700; margin-bottom: 10px; }
.batch-warning { font-size: 10px; color: var(--muted); line-height: 1.6; margin: 10px 0 0; }
.batch-progress { padding: 14px 16px; margin-bottom: 12px; }
.batch-progress-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.batch-progress-top b { font-size: 18px; color: var(--primary); }
.batch-progress-top span { font-size: 11px; color: var(--muted); }
.batch-counts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.batch-current { font-size: 10.5px; color: var(--muted); margin: 8px 0; }
.batch-list-card { padding: 4px 0; }
.batch-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--surface-2); background: transparent; text-align: left; }
.batch-row:last-child { border-bottom: 0; }
.batch-row-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.batch-row-main b { font-size: 11.5px; color: var(--ink); }
.batch-row-main small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-row-arrow { color: var(--primary); font-size: 10px; font-weight: 700; flex: none; }

/* ---------- Vision answer-sheet recognition ---------- */
.vision-card { margin: 10px 0 14px; padding: 14px 16px; background: linear-gradient(135deg, #f3f0fa, #ede9f5); border: 1px solid #dcd2ea; border-radius: 18px; }
.vision-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vision-head > div:first-child { flex: 1; min-width: 0; }
.vision-head .btn { flex: 0 0 auto; }
.vision-head .section-title { font-size: 14px; }
.vision-head .section-sub { margin-top: 3px; }
.vision-status { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 10px; }
.vision-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--primary-ink); }
.vision-hint { font-size: 10.5px; color: var(--muted); line-height: 1.6; margin: 9px 0 0; }
.vision-suggestion { margin-top: 9px; padding: 9px 11px; border-radius: 12px; font-size: 11px; line-height: 1.6; background: var(--surface-2); border: 1px solid var(--line); }
.vision-suggestion.ok { background: var(--ok-soft); border-color: #cfe3d4; }
.vision-suggestion.half { background: var(--warn-soft); border-color: #ead9b2; }
.vision-suggestion.bad { background: var(--danger-soft); border-color: #eccfcc; }
.vision-suggestion.unknown { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.vision-answer b { color: var(--ink-soft); }
.vision-answer span { color: var(--muted); }
.vision-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--ink-soft); font-weight: 700; }

/* ---------- Grade filters & photo viewer ---------- */
.grade-filter-tabs { margin: 0 0 10px; }
.photo-thumb { cursor: pointer; }
.photo-page { position: absolute; left: 3px; bottom: 3px; padding: 1px 5px; border-radius: 999px; background: rgba(32,48,56,.68); color: white; font-size: 8px; font-weight: 700; }
.photo-viewer { display: flex; flex-direction: column; gap: 10px; }
.photo-viewer-toolbar { display: flex; justify-content: space-between; gap: 6px; }
.photo-viewer-stage { max-height: 65dvh; overflow: auto; border-radius: 12px; background: var(--surface-2); display: flex; align-items: flex-start; justify-content: center; }
.photo-viewer-stage img { max-width: 100%; height: auto; display: block; }
.photo-viewer-stage.zoomed img { max-width: none; width: 200%; cursor: zoom-out; }

/* 自选 / 中考卷型 */
.whole-scope-card { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.custom-scope-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.custom-scope-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.custom-scope-title { font-size: 13px; font-weight: 800; }
.custom-scope-sub { margin-top: 3px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.custom-chapter-list { display: flex; flex-direction: column; gap: 7px; }
.custom-chapter-row {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 10px 12px; text-align: left; transition: border-color .18s, background .18s;
}
.custom-chapter-row.active { border-color: var(--primary); background: var(--primary-soft); }
.custom-chapter-row:disabled { opacity: .5; }
.custom-check {
  width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface-2); color: white; display: grid; place-items: center; flex: 0 0 auto;
}
.custom-chapter-row.active .custom-check { background: var(--primary); border-color: var(--primary); }
.custom-chapter-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 750; }
.custom-chapter-meta { font-size: 10px; color: var(--muted); white-space: nowrap; }
.custom-scope-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.custom-scope-actions span { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.paper-section-title { margin: 18px 0 8px; font-size: 13px; font-weight: 800; color: #1b2430; border-left: 3px solid #4a7fb5; padding-left: 8px; }

/* 错题本分组 / 重练 / 复习 */
.mistake-toolbar { display: flex; gap: 8px; margin: 4px 0 12px; flex-wrap: wrap; }
.mistake-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 12px; overflow: hidden; }
.mistake-group-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--primary-soft); }
.mistake-group-name { font-size: 12.5px; font-weight: 800; color: var(--primary); flex: 1; }
.mistake-group-meta { font-size: 10.5px; color: var(--muted); }
.mistake-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0 12px 11px; }
.mistake-due { font-size: 10.5px; color: var(--muted); }
.mistake-group .mistake-card { border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; margin: 0; }
.mistake-group .mistake-card:last-child { border-bottom: 0; }
.retry-card { padding: 16px; }
.retry-error-picker { margin-top: 12px; }
.retry-change { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.retry-change:last-child { border-bottom: 0; }
.review-plan-card { margin-top: 12px; }
.review-plan-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.review-plan-row:last-child { border-bottom: 0; }

/* 学生档案 */
.student-list { padding: 4px 0; }
.student-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 10px 16px; text-align: left; }
.student-row + .student-row { border-top: 1px solid var(--line); }
.student-row.active { background: var(--primary-soft); }
.student-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.student-main { flex: 1; display: flex; flex-direction: column; }
.student-main b { font-size: 13px; }
.student-main small { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.student-actions { display: flex; gap: 8px; margin-top: 10px; }
.profile-demo-hint { margin-top: 8px; font-size: 10.5px; color: var(--muted); line-height: 1.6; }
.recent-empty { padding: 16px 0; text-align: center; color: var(--muted); font-size: 11.5px; }

/* 学生头像（图片 / 首字） */
.student-avatar.has-image, .profile-avatar.has-image, .edit-avatar.has-image, .avatar.avatar-img { padding: 0; overflow: hidden; }
.student-avatar img, .profile-avatar img, .edit-avatar img, .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.avatar-img { background: transparent; }
.edit-avatar, .edit-avatar.has-image { width: 72px; height: 72px; border-radius: 22px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 800; overflow: hidden; }
.edit-student { display: flex; flex-direction: column; gap: 12px; }
.edit-avatar-row { display: flex; align-items: center; gap: 14px; }
.edit-avatar-actions { display: flex; flex-direction: column; gap: 8px; }
.edit-student-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* 知识图谱：知识点点击与详情 */
.kp-row-btn { width: 100%; border: 0; background: transparent; text-align: left; display: flex; align-items: center; gap: 8px; padding: 9px 4px; border-radius: 8px; }
.kp-row-btn:active { background: var(--primary-soft); }
.kp-row-btn .kp-name { flex: 1; }
.kp-arrow { color: var(--muted); display: inline-flex; align-items: center; }
.kp-detail { display: flex; flex-direction: column; gap: 12px; }
.kp-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kp-detail-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kp-detail-row:last-child { border-bottom: 0; }
.kp-detail-row span { color: var(--muted); }
.kp-detail-block { font-size: 12px; line-height: 1.7; }
.kp-detail-block p { margin: 4px 0 0; }
.kp-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.kp-link { border: 1px solid var(--line); background: var(--surface); color: var(--primary); border-radius: 999px; padding: 4px 10px; font-size: 11px; }
.muted-text { color: var(--muted); font-size: 11px; }
.kp-detail-actions { display: flex; gap: 8px; margin-top: 4px; }

/* 选择题点选判分 */
.practice-choices { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.choice-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 13px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; font-size: 13px; line-height: 1.5; }
.choice-btn .choice-letter { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-soft, #eef3f2); color: var(--ink-soft); display: grid; place-items: center; font-weight: 800; font-size: 11.5px; flex: 0 0 auto; }
.choice-btn .choice-text { flex: 1; }
.choice-btn.chosen { border-color: var(--primary); background: var(--primary-soft); }
.choice-btn.correct { border-color: var(--success, #2e9e6b); background: rgba(46,158,107,.1); }
.choice-btn.wrong { border-color: var(--danger, #d9534f); background: rgba(217,83,79,.08); }
.choice-btn:disabled { opacity: .95; }
.choice-mark { font-weight: 800; }
.choice-mark.ok { color: var(--success, #2e9e6b); }
.choice-mark.bad { color: var(--danger, #d9534f); }
.choice-result { font-size: 12.5px; font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.choice-result.ok { background: rgba(46,158,107,.12); color: var(--success, #2e9e6b); }
.choice-result.bad { background: rgba(217,83,79,.1); color: var(--danger, #d9534f); }
.practice-open { margin-top: 10px; }
.practice-hint { font-size: 11.5px; color: var(--muted); margin: 6px 0 10px; line-height: 1.6; }
.practice-photo-note { font-size: 11.5px; color: var(--success, #2e9e6b); margin: 6px 0 10px; }
.practice-photo-note.checking { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.practice-photo-btn.is-disabled { opacity: .62; pointer-events: none; }
.bank-photo-warning { display: flex; gap: 12px; padding: 12px; border: 1px solid #ead9b5; border-radius: 14px; background: var(--warn-soft); }
.bank-photo-warning-icon { flex: none; color: var(--warn); margin-top: 2px; }
.bank-photo-warning p { margin: 0 0 6px; }
.bank-photo-warning p:last-child { margin-bottom: 0; }
.bank-photo-warning-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.practice-open-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.practice-photo-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 4px; }
.practice-photo-input, .bank-photo-input, .retry-photo-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.practice-review-panel { margin-top: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--bg-soft, #f7f9f8); }
.practice-review-answers { font-size: 12.5px; margin-bottom: 6px; }
.practice-review-title { font-size: 12px; font-weight: 700; margin: 10px 0 8px; }

/* ---------- 手写答案板 ---------- */
.handwriting-board { display: flex; flex-direction: column; gap: 10px; }
.hw-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hw-colors { display: flex; gap: 7px; align-items: center; }
.hw-color { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--hw-color); padding: 0; box-shadow: 0 0 0 1px var(--line); }
.hw-color.active { outline: 2px solid var(--ink); outline-offset: 2px; }
.hw-tools { display: flex; gap: 6px; }
.hw-tool.active { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary); }
.hw-canvas-wrap { position: relative; width: 100%; height: clamp(240px, 40dvh, 380px); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.hw-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; background: #fff; }
.hw-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #a9b6b4; font-size: 13px; pointer-events: none; }
.hw-placeholder.hidden { display: none; }
.hw-hint { margin: 0; font-size: 10.5px; color: var(--muted); line-height: 1.65; }
.hw-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 软件更新 ---------- */
.update-status { padding: 10px 0 2px; font-size: 12px; color: var(--muted); line-height: 1.65; }
.update-note { padding: 6px 0; }
.update-available { background: var(--primary-soft); border: 1px solid rgba(48, 112, 102, .18); border-radius: 14px; padding: 12px 14px; margin: 8px 0 2px; color: var(--ink); }
.update-available-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.update-available-title b { color: var(--primary-ink); font-size: 15px; }
.update-available-title span { color: var(--muted); font-size: 11px; }
.update-available-meta { margin-top: 6px; font-size: 11px; color: var(--muted); }
.update-notes { margin: 7px 0 0; padding-left: 18px; font-size: 11.5px; line-height: 1.65; }
.update-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.update-download { padding: 8px 0; }
.update-download-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink); }
.update-download-top b { color: var(--primary-ink); }
.update-download-meta { margin-top: 7px; font-size: 10.5px; color: var(--muted); }
.update-error { color: var(--danger); background: #fff6f4; border: 1px solid rgba(176, 63, 50, .18); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.update-error b { font-size: 12.5px; }
.update-error p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }

/* ---------- 桌面宽屏适配（平板/电脑预览） ---------- */
@media (min-width: 1000px) {
  .app-shell {
    width: min(100% - 72px, 1180px);
    border-radius: 26px;
  }
  .screen { padding: 10px 28px 120px; }
  .app-header { padding: 14px 26px 10px; }
  .tabbar { width: min(100% - 72px, 1180px); border-radius: 0 0 26px 26px; }
  .page-title { font-size: 30px; }
  .page-sub { font-size: 13px; line-height: 1.75; max-width: 760px; }
  .action-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .chapter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .question-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .practice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .stat-grid { gap: 14px; }
  .modal { width: min(100%, 620px); }
  .summary-card { max-width: none; }
  .sticky-action { max-width: 1180px; }
  .paper-stage { max-width: 900px; }
}

/* ===== 问题反馈 ===== */
.feedback-form { display: flex; flex-direction: column; gap: 10px; }
.feedback-hint { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.feedback-text { width: 100%; min-height: 110px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13px; color: var(--ink); background: #fff; box-sizing: border-box; }
.feedback-text:focus { outline: none; border-color: var(--primary, #3b6ef5); }
.feedback-images { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-images:empty { display: none; }
.feedback-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.feedback-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feedback-thumb-del { position: absolute; top: -1px; right: -1px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.feedback-add { position: relative; display: inline-flex; align-self: flex-start; }
.feedback-add input.feedback-image-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.feedback-status { font-size: 12px; color: var(--ink-soft); }
.feedback-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.feedback-actions .btn { flex: 0 0 auto; }
