/* ==========================================================================
   TIKI 自习室 · 新界面
   设计基调：暖纸底 + 墨绿主色 + 衬线标题。像一张摊开的数学草稿纸，
   而不是后台管理模板。
   ========================================================================== */
:root {
  --paper: #f6f3ec;
  --paper-2: #fbf9f4;
  --surface: #ffffff;
  --ink: #191c1a;
  --ink-2: #3d433f;
  --muted: #7b7f76;
  --faint: #a7aa9f;
  --line: #e4ded1;
  --line-2: #efeae0;
  --primary: #1e4b43;
  --primary-2: #2d6a5e;
  --primary-soft: #e7f0eb;
  --amber: #ce8f32;
  --amber-soft: #fbf1dd;
  --red: #bd4d3a;
  --red-soft: #fbeae5;
  --blue: #3c5c8a;
  --blue-soft: #e9eef6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(35, 30, 20, .05);
  --shadow: 0 18px 50px -24px rgba(35, 30, 20, .24);
  --font-body: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sidebar-w: 252px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 88% -10%, rgba(206, 143, 50, .10), transparent 60%),
    radial-gradient(700px 500px at 6% 100%, rgba(30, 75, 67, .07), transparent 55%),
    linear-gradient(rgba(25, 28, 26, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 28, 26, .022) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(206, 143, 50, .25); }

/* ---------- shell ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 18px;
  background: linear-gradient(180deg, #fbf9f4, #f8f5ee 70%, #f6f2e9);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
.brand-mark {
  width: 42px; height: 42px; flex: none;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
  overflow: hidden;
}
.brand-mark img { width: 34px; height: 34px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-copy b {
  font-family: var(--font-display);
  font-size: 19px; letter-spacing: -.02em; font-weight: 700;
  white-space: nowrap;
}
.brand-copy small { font-size: 10.5px; color: var(--muted); letter-spacing: .08em; margin-top: 4px; }

.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 10.5px; letter-spacing: .16em; color: var(--faint);
  padding: 16px 12px 7px; text-transform: uppercase;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10.5px 12px;
  border-radius: 11px;
  color: var(--ink-2);
  font-size: 14px;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item .icon { color: var(--faint); transition: color .16s ease; }
.nav-item:hover { background: rgba(30, 75, 67, .055); color: var(--primary); }
.nav-item:hover .icon { color: var(--primary); }
.nav-item.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px -12px rgba(30, 75, 67, .8);
}
.nav-item.is-active .icon { color: #fff; }
.nav-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--amber); margin-left: auto;
  box-shadow: 0 0 0 3px rgba(206, 143, 50, .18);
}

.side-foot { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.quota-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .68);
  border-radius: 14px;
  padding: 13px 14px 12px;
}
.quota-top { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.quota-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary-2); }
.quota-num { font-size: 18px; font-weight: 650; margin: 6px 0 7px; letter-spacing: -.02em; }
.quota-num small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.quota-track { height: 4px; border-radius: 4px; background: #e7e1d5; overflow: hidden; }
.quota-track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary-2), var(--primary)); transition: width .5s ease; }
.quota-note { font-size: 10.5px; color: var(--faint); margin-top: 7px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 650; font-size: 14px;
  border: 1px solid #d6e3dc;
}
.side-user-copy { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.side-user-copy b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-copy small { font-size: 10px; color: var(--faint); }

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 42px 48px 30px; }

.mobile-top, .mobile-nav, .sidebar-scrim { display: none; }

/* ---------- generic ---------- */
.icon { flex: none; display: inline-block; vertical-align: middle; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--amber); font-weight: 600;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: .7; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.18; letter-spacing: -.025em; font-weight: 700;
  margin-top: 10px;
}
.page-sub { color: var(--muted); font-size: 14px; margin-top: 9px; max-width: 640px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border-radius: 11px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 550; line-height: 1;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 22px -14px rgba(30, 75, 67, .9); }
.btn-primary:hover { background: #163c35; }
.btn-amber { background: var(--amber); color: #241b0c; }
.btn-amber:hover { background: #bd8028; }
.btn-soft { background: var(--primary-soft); color: var(--primary); border-color: #d5e3dc; }
.btn-soft:hover { background: #dcebe3; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: #fff; border-color: #d5cdbb; }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #f0cfc6; }
.btn-danger:hover { background: #f7ddd5; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.7); color: var(--ink-2);
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: #fff; border-color: #d5cdbb; }
.icon-btn.ghost { border-color: transparent; background: transparent; color: var(--muted); width: 32px; height: 32px; }
.icon-btn.ghost:hover { background: rgba(30,75,67,.06); color: var(--primary); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-title { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.card-title .icon { color: var(--amber); }
.card-sub { color: var(--muted); font-size: 12.5px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; line-height: 1.6; font-weight: 550;
  background: #f0ede5; color: var(--ink-2); white-space: nowrap;
}
.tag-green { background: var(--primary-soft); color: var(--primary); }
.tag-amber { background: var(--amber-soft); color: #98641a; }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-blue { background: var(--blue-soft); color: var(--blue); }
.tag-muted { background: #f1eee7; color: var(--muted); }
.tag-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.divider { height: 1px; background: var(--line-2); border: 0; margin: 18px 0; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { margin-left: auto; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.skeleton {
  position: relative; overflow: hidden;
  background: #efece4; border-radius: 10px; color: transparent;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.spinner.dark { border-color: rgba(30,75,67,.2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  padding: 42px 24px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 16px; background: rgba(255,255,255,.45);
}
.empty .empty-icon {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px;
  display: grid; place-items: center; color: var(--primary);
  background: var(--primary-soft);
}
.empty h3 { font-family: var(--font-display); font-size: 18px; color: var(--ink); margin-bottom: 5px; }
.empty p { font-size: 12.5px; max-width: 360px; margin: 0 auto 16px; }

/* ---------- dashboard ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 26px;
  padding: 38px 40px 34px;
  color: #fff;
  background:
    radial-gradient(500px 260px at 85% 0%, rgba(206,143,50,.28), transparent 65%),
    linear-gradient(135deg, #1f4d45 0%, #173a34 55%, #12302b 100%);
  box-shadow: 0 30px 60px -38px rgba(20, 50, 44, .85);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
                    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(120deg, transparent 20%, #000 90%);
  pointer-events: none;
}
.hero::after {
  content: "π"; position: absolute; right: 22px; bottom: -96px;
  font-family: var(--font-display); font-size: 300px; line-height: 1;
  color: rgba(255,255,255,.055); pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero .eyebrow { color: #e7b872; }
.hero .eyebrow::before { background: #e7b872; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.15;
  margin: 12px 0 12px; max-width: 640px;
}
.hero h1 em { font-style: normal; color: #f0c987; }
.hero-sub { color: rgba(255,255,255,.66); font-size: 14px; max-width: 540px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-actions .btn-primary { background: #f2ede2; color: #173a34; box-shadow: none; }
.hero-actions .btn-primary:hover { background: #fff; }
.hero-actions .btn-ghost { border-color: rgba(255,255,255,.22); color: #fff; background: rgba(255,255,255,.05); }
.hero-actions .btn-ghost:hover { background: rgba(255,255,255,.12); }
.hero-stats {
  display: flex; gap: 0; margin-top: 34px; padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.13);
}
.hero-stat { padding-right: 34px; margin-right: 34px; border-right: 1px solid rgba(255,255,255,.13); }
.hero-stat:last-child { border-right: 0; }
.hero-stat b { display: block; font-size: 27px; line-height: 1.1; font-weight: 650; letter-spacing: -.03em; }
.hero-stat b small { font-size: 12px; font-weight: 400; color: rgba(255,255,255,.55); margin-left: 4px; }
.hero-stat span { font-size: 11.5px; color: rgba(255,255,255,.55); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr); gap: 24px; margin-top: 26px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 2px 14px; }
.section-head h2 { font-family: var(--font-display); font-size: 21px; letter-spacing: -.02em; }
.section-head a { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.section-head a:hover { color: var(--primary); }

.quick-card { padding: 10px 0; }
.recent-list { display: flex; flex-direction: column; }
.recent-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-2);
  transition: background .15s;
}
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover { background: #fcfbf7; }
.recent-icon {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-family: var(--font-display); font-size: 15px;
}
.recent-main { min-width: 0; flex: 1; }
.recent-main b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-main span { font-size: 11.5px; color: var(--faint); }
.recent-side { text-align: right; font-size: 12px; color: var(--muted); }
.recent-side b { display: block; color: var(--ink); font-size: 14px; }
.progress-mini { width: 58px; height: 4px; border-radius: 4px; background: #ece7dc; overflow: hidden; margin-left: auto; }
.progress-mini i { display: block; height: 100%; background: var(--amber); }

.side-stack { display: flex; flex-direction: column; gap: 16px; }
.tip-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid #e9dfc9;
  background: linear-gradient(150deg, #fdf6e6, #fbf1dd);
  padding: 22px;
}
.tip-card::after {
  content: "∑"; position: absolute; right: 10px; bottom: -34px;
  font-family: var(--font-display); font-size: 110px; color: rgba(206,143,50,.11);
}
.tip-card h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 8px; }
.tip-card p { font-size: 12.5px; color: #7d6334; line-height: 1.75; max-width: 250px; }
.tip-card .btn { margin-top: 16px; position: relative; z-index: 1; }

.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-stat { padding: 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.mini-stat span { font-size: 11px; color: var(--muted); }
.mini-stat b { display: block; font-size: 24px; font-weight: 650; letter-spacing: -.03em; margin-top: 3px; }
.mini-stat b small { font-size: 11px; font-weight: 400; color: var(--faint); }

/* ---------- compose ---------- */
.compose-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; }
.compose-main { display: flex; flex-direction: column; gap: 18px; }
.step-card { padding: 24px 26px; }
.step-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.step-num {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  font-size: 12.5px; font-weight: 650;
  font-family: var(--font-display);
}
.step-head h2 { font-family: var(--font-display); font-size: 19px; line-height: 1.3; letter-spacing: -.01em; }
.step-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }

.format-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.format-opt {
  position: relative; text-align: left;
  border: 1px solid var(--line); border-radius: 14px;
  background: #fcfbf7; padding: 16px 16px 15px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.format-opt:hover { border-color: #cfc5b2; background: #fff; }
.format-opt.is-on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.format-opt .fo-top { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; }
.format-opt .fo-top .icon { color: var(--primary); }
.format-opt p { font-size: 11.5px; color: var(--muted); margin-top: 7px; line-height: 1.6; }
.format-opt .fo-check {
  position: absolute; top: 13px; right: 13px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center;
  color: transparent; background: #fff;
}
.format-opt.is-on .fo-check { background: var(--primary); border-color: var(--primary); color: #fff; }

.kp-rows { display: flex; flex-direction: column; gap: 12px; }
.kp-row {
  border: 1px solid var(--line); border-radius: 15px;
  background: #fdfcf8; padding: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.kp-row:focus-within { border-color: #b9cfc5; box-shadow: 0 0 0 3px rgba(30,75,67,.06); }
.kp-row-top { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.kp-index {
  width: 24px; height: 24px; flex: none; border-radius: 8px;
  display: grid; place-items: center;
  background: #efece4; color: var(--muted);
  font-size: 11px; font-weight: 650;
}
.kp-selects { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; flex: 1; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 13px; top: 50%;
  width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.select {
  width: 100%; height: 40px; padding: 0 32px 0 12px;
  border-radius: 9px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; appearance: none;
  color: var(--ink-2); text-overflow: ellipsis;
}
.select:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(30,75,67,.08); }
.kp-remove { opacity: .55; }
.kp-remove:hover { opacity: 1; color: var(--red); }

.count-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.count-box {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 9px; border: 1px solid var(--line-2);
  border-radius: 10px; background: #fff;
}
.count-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.count-dot.easy { background: #6b9c7a; }
.count-dot.medium { background: #d3a044; }
.count-dot.hard { background: #bd5b45; }
.count-label { font-size: 11px; color: var(--muted); flex: 1; white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 22px; height: 22px; border-radius: 6px; border: 0;
  background: #f1eee6; color: var(--ink-2); display: grid; place-items: center;
  font-size: 14px; line-height: 1;
}
.stepper button:hover { background: #e7e2d7; }
.stepper input {
  width: 30px; height: 24px; text-align: center; border: 0; background: transparent;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }

.add-kp {
  margin-top: 12px; width: 100%; height: 44px;
  border: 1px dashed #cfc6b4; border-radius: 12px;
  background: transparent; color: var(--muted); font-size: 12.5px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.add-kp:hover { border-color: var(--primary-2); color: var(--primary); background: rgba(30,75,67,.03); }
.form-note { font-size: 11.5px; color: var(--faint); line-height: 1.7; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12px; color: var(--muted); }
.input {
  height: 42px; padding: 0 13px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; font-size: 13px;
}
.input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(30,75,67,.08); }

.summary-panel { position: sticky; top: 28px; }
.summary-card { overflow: hidden; }
.summary-top {
  padding: 22px 24px 20px;
  background: linear-gradient(150deg, #214f47, #173a34);
  color: #fff; position: relative; overflow: hidden;
}
.summary-top::after {
  content: "∑"; position: absolute; right: 10px; bottom: -40px;
  font-family: var(--font-display); font-size: 120px; color: rgba(255,255,255,.06);
}
.summary-top .st-label { font-size: 11px; letter-spacing: .12em; color: rgba(255,255,255,.6); }
.summary-total { display: flex; align-items: baseline; gap: 7px; margin-top: 6px; }
.summary-total b { font-size: 44px; font-weight: 650; line-height: 1; letter-spacing: -.04em; }
.summary-total span { font-size: 13px; color: rgba(255,255,255,.65); }
.summary-mode { margin-top: 12px; }
.summary-body { padding: 20px 22px 22px; }
.sum-bars { display: flex; flex-direction: column; gap: 9px; }
.sum-bar { display: grid; grid-template-columns: 38px 1fr 30px; align-items: center; gap: 9px; font-size: 11px; color: var(--muted); }
.sum-bar .bar { height: 5px; border-radius: 5px; background: #eee9de; overflow: hidden; }
.sum-bar .bar i { display: block; height: 100%; border-radius: 5px; transition: width .35s ease; }
.sum-bar b { text-align: right; font-size: 11.5px; color: var(--ink-2); }
.sum-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.sum-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); }
.sum-row .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); flex: none; }
.sum-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-row b { margin-left: auto; color: var(--muted); font-weight: 500; }
.summary-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.summary-hint { font-size: 10.5px; color: var(--faint); text-align: center; line-height: 1.6; }

/* generation overlay */
.gen-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: rgba(21, 30, 27, .55); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.gen-overlay.is-on { opacity: 1; pointer-events: auto; }
.gen-box {
  width: min(420px, calc(100vw - 32px));
  background: #fff; border-radius: 22px; padding: 30px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.4);
}
.gen-box h2 { font-family: var(--font-display); font-size: 23px; letter-spacing: -.02em; }
.gen-box > p { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.gen-steps { margin: 22px 0 4px; display: flex; flex-direction: column; gap: 13px; }
.gen-step { display: flex; align-items: center; gap: 11px; font-size: 12.5px; color: var(--faint); transition: color .2s; }
.gen-step .gs-dot {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 1.5px solid #ddd6c8; display: grid; place-items: center; color: transparent;
  font-size: 10px;
}
.gen-step.is-now { color: var(--ink); }
.gen-step.is-now .gs-dot { border-color: var(--primary); }
.gen-step.is-now .gs-dot::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); animation: pulse 1s infinite;
}
.gen-step.is-done { color: var(--ink-2); }
.gen-step.is-done .gs-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.7); } }
.gen-bar { height: 4px; border-radius: 4px; background: #efece4; overflow: hidden; margin-top: 22px; }
.gen-bar i { display: block; height: 100%; width: 8%; background: linear-gradient(90deg, var(--primary-2), var(--amber)); border-radius: 4px; transition: width .6s ease; }
.gen-foot { margin-top: 10px; display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); }

/* ---------- papers ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: #ece7dc; border-radius: 12px; }
.tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 15px; border-radius: 9px; font-size: 12.5px; font-weight: 500;
}
.tab.is-on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.paper-card {
  display: flex; flex-direction: column;
  padding: 20px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--line);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.paper-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d6cdbb; }
.paper-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.paper-card h3 { font-size: 15px; font-weight: 650; line-height: 1.45; margin: 12px 0 5px; }
.paper-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11px; color: var(--faint); }
.paper-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.paper-score { display: flex; align-items: baseline; gap: 4px; }
.paper-score b { font-size: 22px; letter-spacing: -.03em; }
.paper-score small { font-size: 10px; color: var(--faint); }
.paper-card .btn { min-height: 36px; font-size: 12px; }
.paper-flag {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.paper-flag.print { background: var(--amber-soft); color: #9a661b; }

/* ---------- answer ---------- */
.answer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 24px; align-items: start; }
.answer-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.answer-head h1 { font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.02em; line-height: 1.3; }
.answer-head .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.q-list { display: flex; flex-direction: column; gap: 14px; }
.q-card { padding: 24px 26px; }
.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.q-index {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  font-size: 11.5px; font-weight: 650;
}
.q-kp { font-size: 11px; color: var(--faint); }
.q-stem { font-size: 15px; line-height: 1.9; color: var(--ink); }
.q-stem p { margin: 0 0 6px; }
.q-stem img { border-radius: 8px; margin: 6px 0; }
.q-options { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.opt-btn {
  display: flex; align-items: flex-start; gap: 11px;
  text-align: left; padding: 11px 14px;
  border-radius: 11px; border: 1px solid var(--line);
  background: #fdfcf8; font-size: 14px; line-height: 1.7;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.opt-btn:hover { border-color: #c7bda9; background: #fff; }
.opt-btn.is-on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.opt-key {
  width: 24px; height: 24px; flex: none; border-radius: 7px;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 650; color: var(--muted);
  margin-top: 1px;
}
.opt-btn.is-on .opt-key { background: var(--primary); border-color: var(--primary); color: #fff; }
.opt-text { min-width: 0; }
.opt-text p { margin: 0; }
.answer-sheet { position: sticky; top: 28px; }
.sheet-body { padding: 20px; }
.sheet-progress { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.sheet-progress b { color: var(--ink); }
.sheet-track { height: 5px; border-radius: 5px; background: #eee9de; overflow: hidden; margin-bottom: 18px; }
.sheet-track i { display: block; height: 100%; background: var(--primary); transition: width .25s; }
.sheet-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.sheet-cell {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line-2);
  background: #fbfaf6; color: var(--muted); font-size: 11.5px;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.sheet-cell.is-done { background: var(--primary); border-color: var(--primary); color: #fff; }
.sheet-cell.is-now { outline: 2px solid var(--amber); outline-offset: 1px; }
.sheet-legend { display: flex; gap: 12px; margin-top: 13px; font-size: 10px; color: var(--faint); }
.sheet-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 3px; background: #e6e1d5; }
.legend-dot.done { background: var(--primary); }
.sheet-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.mobile-answer-bar { display: none; }

/* ---------- result ---------- */
.score-hero {
  display: grid; grid-template-columns: auto 1fr; gap: 34px; align-items: center;
  padding: 32px 36px; border-radius: 24px;
  background: linear-gradient(140deg, #214f47, #173a34);
  color: #fff; position: relative; overflow: hidden;
}
.score-hero::after {
  content: "√"; position: absolute; right: 20px; bottom: -70px;
  font-family: var(--font-display); font-size: 250px; color: rgba(255,255,255,.05);
}
.score-ring {
  --pct: 0;
  width: 146px; height: 146px; border-radius: 50%; flex: none;
  background: conic-gradient(#efc27f calc(var(--pct) * 1%), rgba(255,255,255,.14) 0);
  display: grid; place-items: center; position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #1a423b; }
.score-ring-inner { position: relative; text-align: center; }
.score-ring-inner b { display: block; font-size: 38px; line-height: 1; font-weight: 650; letter-spacing: -.04em; }
.score-ring-inner span { font-size: 10.5px; color: rgba(255,255,255,.6); }
.score-copy h2 { font-family: var(--font-display); font-size: 28px; letter-spacing: -.02em; line-height: 1.3; }
.score-copy p { color: rgba(255,255,255,.62); font-size: 13px; margin-top: 7px; }
.score-chips { display: flex; gap: 20px; margin-top: 18px; flex-wrap: wrap; }
.score-chip { font-size: 11.5px; color: rgba(255,255,255,.55); }
.score-chip b { display: block; font-size: 20px; color: #fff; font-weight: 600; }
.score-chip b.ok { color: #a8d3b8; }
.score-chip b.no { color: #f0b3a3; }

.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; margin-top: 24px; align-items: start; }
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-card { padding: 22px 24px; }
.review-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.review-mark {
  padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600;
}
.review-mark.ok { background: var(--primary-soft); color: var(--primary); }
.review-mark.no { background: var(--red-soft); color: var(--red); }
.review-mark.blank { background: #f1eee7; color: var(--muted); }
.review-ans { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.review-ans b.ok { color: var(--primary); }
.review-ans b.no { color: var(--red); }
.review-orig { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: #fbfaf6; border: 1px solid var(--line-2); }
.review-orig-title { font-size: 11px; color: var(--faint); margin-bottom: 4px; }
.review-orig-body { font-size: 13px; line-height: 1.85; color: var(--ink-2); }
.review-orig-body img { border-radius: 8px; }
.opt-btn.correct { border-color: #9dc4aa; background: #f1f8f3; }
.opt-btn.correct .opt-key { background: #4f8a63; border-color: #4f8a63; color: #fff; }
.opt-btn.wrong { border-color: #e2b0a4; background: #fdf3f0; }
.opt-btn.wrong .opt-key { background: var(--red); border-color: var(--red); color: #fff; }
.opt-btn[disabled] { cursor: default; }

.side-panel { display: flex; flex-direction: column; gap: 16px; }
.analysis-box { padding: 20px; }
.analysis-box h3 { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.analysis-box h3 .icon { color: var(--amber); }
.analysis-box .muted { font-size: 11.5px; line-height: 1.7; margin-top: 6px; }
.ai-result { margin-top: 14px; font-size: 12.5px; line-height: 1.8; }
.ai-result h4 { font-family: var(--font-display); font-size: 14px; margin: 12px 0 4px; }
.ai-result ul, .ai-result ol { padding-left: 18px; margin: 4px 0; }
.ai-result .ai-step { padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.ai-result .ai-step:last-child { border-bottom: 0; }
.ai-tip { background: var(--amber-soft); border-radius: 9px; padding: 9px 11px; color: #7d5b22; margin-top: 8px; font-size: 11.5px; }
.ai-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.learning-card { padding: 20px; }
.learning-card .lc-summary { font-size: 12.5px; line-height: 1.85; color: var(--ink-2); margin-top: 10px; }
.weak-item { padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.weak-item:last-child { border-bottom: 0; }
.weak-item b { font-size: 12.5px; }
.weak-item p { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 2px; }

/* ---------- wrongbook ---------- */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 6px 13px; font-size: 11.5px;
}
.chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.wrong-list { display: flex; flex-direction: column; gap: 12px; }
.wrong-card { padding: 0; overflow: hidden; }
.wrong-card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; cursor: pointer; }
.wrong-card-head:hover { background: #fcfbf7; }
.wrong-num {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  display: grid; place-items: center; background: var(--red-soft); color: var(--red);
  font-weight: 650; font-size: 12.5px;
}
.wrong-card-main { min-width: 0; flex: 1; }
.wrong-card-main b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrong-card-main span { font-size: 11px; color: var(--faint); }
.wrong-card-body { display: none; padding: 0 22px 20px; border-top: 1px dashed var(--line-2); }
.wrong-card.is-open .wrong-card-body { display: block; }
.wrong-card-body .q-stem { margin-top: 16px; }
.wrong-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- scores ---------- */
.score-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.score-summary .mini-stat { background: #fff; }
.chart-card { padding: 24px; }
.curve-wrap { overflow-x: auto; }
.curve-svg { width: 100%; min-width: 520px; height: 300px; display: block; }
.curve-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.curve-legend span { display: inline-flex; align-items: center; gap: 6px; }
.curve-swatch { width: 14px; height: 3px; border-radius: 3px; }
.score-list { display: flex; flex-direction: column; }
.score-row { display: flex; align-items: center; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line-2); }
.score-row:last-child { border-bottom: 0; }
.score-row:hover { background: #fcfbf7; }
.score-row .score-big { width: 58px; flex: none; font-size: 22px; font-weight: 650; letter-spacing: -.03em; }
.score-row .score-big small { font-size: 10px; color: var(--faint); font-weight: 400; }
.score-row-main { flex: 1; min-width: 0; }
.score-row-main b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-row-main span { font-size: 11px; color: var(--faint); }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--paper); }
.login-art {
  position: relative; overflow: hidden; padding: 52px;
  background:
    radial-gradient(700px 420px at 80% 10%, rgba(206,143,50,.24), transparent 60%),
    linear-gradient(145deg, #214f47, #12302b);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(135deg, #000, transparent 80%);
}
.login-art::after {
  content: "π"; position: absolute; right: -18px; bottom: -120px;
  font-family: var(--font-display); font-size: 360px; color: rgba(255,255,255,.06);
}
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { background: rgba(255,255,255,.92); }
.login-brand b { font-family: var(--font-display); font-size: 20px; letter-spacing: -.02em; }
.login-copy { position: relative; z-index: 1; max-width: 480px; }
.login-copy .eyebrow { color: #e7b872; }
.login-copy h1 {
  font-family: var(--font-display); font-size: clamp(36px, 4.4vw, 58px);
  line-height: 1.12; letter-spacing: -.035em; margin: 16px 0 18px;
}
.login-copy h1 em { font-style: normal; color: #f0c987; }
.login-copy p { color: rgba(255,255,255,.6); font-size: 14px; line-height: 1.85; max-width: 390px; }
.login-points { display: flex; gap: 22px; margin-top: 30px; flex-wrap: wrap; }
.login-point { font-size: 11.5px; color: rgba(255,255,255,.62); display: flex; align-items: center; gap: 7px; }
.login-point .icon { color: #e7b872; }
.login-form-wrap { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(400px, 100%); }
.login-card h2 { font-family: var(--font-display); font-size: 30px; letter-spacing: -.025em; }
.login-card .login-sub { color: var(--muted); font-size: 13px; margin-top: 7px; margin-bottom: 28px; }
.login-card .field { margin-bottom: 16px; }
.login-card .input { height: 48px; border-radius: 12px; }
.login-error {
  background: var(--red-soft); color: var(--red); border: 1px solid #f0cfc6;
  padding: 10px 13px; border-radius: 10px; font-size: 12px; margin-bottom: 16px;
}
.login-help { text-align: center; font-size: 11px; color: var(--faint); margin-top: 18px; line-height: 1.7; }
.login-foot { text-align: center; font-size: 10.5px; color: var(--faint); margin-top: 34px; }

/* ---------- misc ---------- */
.toast-root { position: fixed; right: 22px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  min-width: 240px; max-width: 380px;
  background: #1b2a26; color: #fff; border-radius: 12px;
  padding: 12px 15px; font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.5);
  animation: toastIn .22s ease;
}
.toast.err { background: #7f2f22; }
.toast.ok { background: #1e4b43; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.modal-scrim {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  background: rgba(20, 26, 24, .45); backdrop-filter: blur(4px);
  padding: 20px; animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(440px, 100%); background: #fff; border-radius: 18px;
  padding: 26px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.4);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal h3 { font-family: var(--font-display); font-size: 21px; letter-spacing: -.02em; }
.modal p { color: var(--muted); font-size: 12.5px; line-height: 1.75; margin-top: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.modal.wide { width: min(620px, 100%); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 1120px) {
  :root { --sidebar-w: 224px; }
  .page { padding: 34px 32px 26px; }
  .compose-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .result-grid { grid-template-columns: minmax(0, 1fr) 290px; }
}
@media (max-width: 960px) {
  .dash-grid { grid-template-columns: 1fr; }
  .compose-grid { grid-template-columns: 1fr; }
  .summary-panel { position: static; }
  .answer-layout { grid-template-columns: 1fr; }
  .answer-sheet { display: block; position: static; }
  .mobile-answer-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 64px; z-index: 30;
    padding: 10px 16px; gap: 10px; align-items: center;
    background: rgba(251,249,244,.94); border-top: 1px solid var(--line);
    backdrop-filter: blur(8px);
  }
  .mobile-answer-bar .grow { font-size: 11.5px; color: var(--muted); }
  .result-grid { grid-template-columns: 1fr; }
  .score-hero { grid-template-columns: 1fr; gap: 22px; text-align: center; justify-items: center; }
  .score-copy p { max-width: 420px; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-104%); transition: transform .26s ease; box-shadow: 0 0 60px rgba(0,0,0,.2); }
  .sidebar.is-open { transform: none; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(20,26,24,.4); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sidebar-scrim.is-on { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .mobile-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; position: sticky; top: 0; z-index: 25;
    background: rgba(246,243,236,.9); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .brand-mobile { padding: 0; }
  .brand-mobile .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mobile .brand-mark img { width: 27px; height: 27px; }
  .brand-mobile .brand-copy b { font-size: 16px; }
  .brand-mobile .brand-copy small { font-size: 9px; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(251,249,244,.96); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: blur(10px);
  }
  .mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 5px 0; font-size: 9.5px; color: var(--faint); border-radius: 9px;
  }
  .mobile-nav a.is-active { color: var(--primary); }
  .mobile-nav a.is-active .icon { stroke-width: 2.2; }
  .page { padding: 24px 18px 92px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
  .page-head h1 { font-size: 30px; }
  .hero { padding: 28px 24px 26px; border-radius: 22px; }
  .hero h1 { font-size: 30px; }
  .hero-stats { flex-wrap: wrap; gap: 14px 0; }
  .hero-stat { padding-right: 20px; margin-right: 20px; }
  .hero-stat b { font-size: 23px; }
  .format-pick { grid-template-columns: 1fr; }
  .kp-selects { grid-template-columns: 1fr; }
  .count-grid { grid-template-columns: 1fr 1fr 1fr; }
  .count-box { padding: 7px 8px; }
  .count-label { font-size: 10px; }
  .paper-grid { grid-template-columns: 1fr; }
  .score-summary { grid-template-columns: 1fr; }
  .login-body { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-form-wrap { min-height: 100vh; padding: 28px 22px; }
  .toast-root { left: 16px; right: 16px; bottom: 84px; }
  .toast { min-width: 0; max-width: none; }
}
@media (max-width: 480px) {
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .hero-stat { border-right: 0; padding: 0; margin: 0; }
  .count-grid { grid-template-columns: 1fr; }
  .step-card { padding: 20px 18px; }
  .summary-top, .summary-body { padding-left: 18px; padding-right: 18px; }
  .q-card, .review-card { padding: 18px; }
  .score-hero { padding: 26px 20px; }
  .score-ring { width: 124px; height: 124px; }
  .score-ring-inner b { font-size: 32px; }
}

/* ---------- 试卷预览 ---------- */
.preview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.paper-doc { padding: 30px 34px 36px; }
.paper-doc-head { padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.paper-doc-kicker { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 10.5px; letter-spacing: .12em; color: var(--faint); text-transform: uppercase; }
.paper-doc-title { font-family: var(--font-display); font-size: 26px; letter-spacing: -.025em; line-height: 1.35; margin: 10px 0 8px; }
.paper-doc-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 11.5px; color: var(--muted); }
.pv-q { padding: 22px 0; border-bottom: 1px dashed var(--line-2); }
.pv-q:last-child { border-bottom: 0; padding-bottom: 4px; }
.pv-q-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; flex-wrap: wrap; }
.pv-q-no { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--primary); min-width: 26px; }
.pv-q-type { font-size: 10.5px; color: var(--faint); }
.preview-side { position: sticky; top: 28px; display: flex; flex-direction: column; gap: 14px; }
.notice-box { border: 1px solid #ecdcb9; background: var(--amber-soft); border-radius: 14px; padding: 15px 17px; font-size: 12px; line-height: 1.75; color: #7c5a22; }
.notice-box.info { border-color: #d4dfef; background: var(--blue-soft); color: #3c536f; }
.notice-box b { display: block; margin-bottom: 3px; color: inherit; }
.preview-actions { display: flex; flex-direction: column; gap: 9px; }
.preview-meta-list { display: flex; flex-direction: column; gap: 9px; font-size: 12px; }
.preview-meta-list div { display: flex; justify-content: space-between; gap: 12px; }
.preview-meta-list span { color: var(--muted); }
.preview-meta-list b { font-weight: 550; }
@media (max-width: 960px) {
  .preview-layout { grid-template-columns: 1fr; }
  .preview-side { position: static; }
}
@media (max-width: 820px) {
  .paper-doc { padding: 22px 18px 26px; }
  .paper-doc-title { font-size: 22px; }
}

/* ---------- 错题本补充 ---------- */
.wrong-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 16px; }
.wrong-check { width: 17px; height: 17px; accent-color: var(--primary); flex: none; cursor: pointer; }
.wrong-select { width: auto; min-width: 210px; max-width: 260px; height: 36px; font-size: 12px; flex: 0 1 240px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.pager span { font-size: 11.5px; color: var(--muted); }
.wrong-empty { margin-top: 6px; }
.wrong-card.is-open { border-color: #d5cdbb; box-shadow: var(--shadow-sm); }
.wrong-card.is-open .wrong-card-head { background: #fcfbf7; }

/* ---------- 页脚与页面高度 ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.site-foot {
  margin-top: auto; padding: 44px 4px 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; font-size: 10.5px; color: var(--faint);
}
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; }
.foot-links a { color: var(--faint); }
.foot-links a:hover { color: var(--primary); }
@media (max-width: 820px) {
  .site-foot { padding-bottom: 8px; font-size: 9.5px; }
}

/* ---------- 学情分析（全宽） ---------- */
.learning-full { margin-top: 20px; padding: 28px 32px; }
.lf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.lf-summary {
  margin-top: 16px; font-size: 13.5px; line-height: 1.95; color: var(--ink-2);
  padding: 16px 18px; border-radius: 12px; background: #fbfaf6; border: 1px solid var(--line-2);
}
.lf-label {
  margin: 24px 0 10px; font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}
.lf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lf-weak { padding: 15px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: #fdfcf8; }
.lf-weak p { font-size: 12px; line-height: 1.8; color: var(--muted); margin-top: 7px; }
.lf-weak .lf-advice { color: var(--ink-2); }
.lf-strengths { display: flex; flex-wrap: wrap; gap: 7px; }
.lf-suggestions { margin: 0; padding-left: 20px; font-size: 12.5px; line-height: 1.9; color: var(--ink-2); }
@media (max-width: 820px) {
  .learning-full { padding: 20px 18px; }
  .lf-grid { grid-template-columns: 1fr; }
  .lf-head { flex-direction: column; }
}

/* ---------- 教师端 ---------- */
.teacher-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.teacher-stats .mini-stat { background: #fff; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.class-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; transition: transform .18s, box-shadow .18s; }
.class-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.class-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.class-icon {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
}
.class-card h3 { font-family: var(--font-display); font-size: 19px; letter-spacing: -.01em; line-height: 1.35; margin-top: 4px; }
.class-card .class-meta { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.class-card-actions { display: flex; gap: 8px; padding-top: 13px; border-top: 1px solid var(--line-2); }
.task-rows { display: flex; flex-direction: column; }
.task-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #fcfbf7; }
.task-row-main { flex: 1; min-width: 0; }
.task-row-main b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-main span { font-size: 11px; color: var(--faint); }
.task-progress { width: 90px; flex: none; text-align: right; }
.task-progress b { font-size: 13px; }
.task-progress span { display: block; font-size: 10px; color: var(--faint); }
.teacher-table-wrap { overflow-x: auto; }
.teacher-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.teacher-table th {
  text-align: left; padding: 10px 14px; font-weight: 500; font-size: 10.5px;
  letter-spacing: .06em; color: var(--faint); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.teacher-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.teacher-table tr:last-child td { border-bottom: 0; }
.teacher-table tbody tr:hover { background: #fcfbf7; }
.no-badge {
  display: inline-grid; place-items: center; min-width: 30px; height: 24px;
  padding: 0 7px; border-radius: 6px; background: #f1eee7; color: var(--muted);
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.group-chip { display: inline-flex; padding: 2px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 10px; margin: 1px 3px 1px 0; }
.task-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.task-q-list { display: flex; flex-direction: column; }
.task-q { padding: 20px 24px; border-bottom: 1px solid var(--line-2); }
.task-q:last-child { border-bottom: 0; }
.task-q-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; flex-wrap: wrap; }
.task-q-ans { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.task-q-ans b { color: var(--primary); }
.board-list { display: flex; flex-direction: column; gap: 10px; }
.board-row { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.board-row .bar { flex: 1; height: 6px; background: #eee9de; border-radius: 6px; overflow: hidden; }
.board-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--amber)); border-radius: 6px; }
.board-row span { width: 140px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row b { width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 960px) {
  .teacher-stats { grid-template-columns: 1fr 1fr; }
  .task-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .teacher-stats { grid-template-columns: 1fr 1fr; }
  .class-grid { grid-template-columns: 1fr; }
  .task-row { flex-wrap: wrap; }
  .task-progress { width: auto; }
}

/* ---------- 解析审核补充 ---------- */
.an-card { padding: 20px 22px; }
.an-analysis { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: #fbfaf6; border: 1px solid var(--line-2); }
.an-analysis .ai-step { font-size: 12px; line-height: 1.8; color: var(--ink-2); padding: 4px 0; border-bottom: 1px dashed var(--line-2); }
.an-analysis .ai-step:last-child { border-bottom: 0; }
.an-card .q-stem { font-size: 13.5px; }

/* ---------- 单题追问 ---------- */
.followup {
  margin-top: 16px; padding: 16px 18px; border-radius: 13px;
  border: 1px solid #dce6e0; background: #f7fbf8;
}
.fu-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fu-head b { font-size: 13px; }
.fu-head span { font-size: 10px; color: var(--faint); }
.fu-list { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.fu-turn { border-left: 2px solid #cfe0d6; padding-left: 11px; }
.fu-q { font-size: 12px; color: var(--ink-2); font-weight: 550; }
.fu-a { font-size: 12.5px; line-height: 1.85; color: var(--ink-2); margin-top: 3px; }
.fu-a p { margin: 0 0 5px; }
.fu-hint { font-size: 11.5px; color: var(--muted); padding: 4px 0; }
.fu-form { display: flex; gap: 8px; margin-top: 12px; }
.fu-form .input { height: 38px; font-size: 12px; flex: 1; }
.fu-form .btn { flex: none; }

.textarea {
  height: auto; min-height: 82px; padding: 10px 13px;
  line-height: 1.7; resize: vertical;
}

/* ---------- 题型多选 ---------- */
.type-checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-chip {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 14px 14px; border: 1px solid var(--line); border-radius: 13px;
  background: #fcfbf7; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.type-chip:hover { border-color: #cfc5b2; background: #fff; }
.type-chip input { position: absolute; opacity: 0; pointer-events: none; }
.type-chip.is-on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.tc-box {
  width: 18px; height: 18px; flex: none; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; position: relative;
}
.type-chip.is-on .tc-box { background: var(--primary); border-color: var(--primary); }
.type-chip.is-on .tc-box::after {
  content: ""; position: absolute; left: 5px; top: 2px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 1.8px 1.8px 0;
  transform: rotate(42deg);
}
.tc-copy { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.tc-copy b { font-size: 13px; font-weight: 600; }
.tc-copy small { font-size: 10px; color: var(--muted); margin-top: 2px; }
@media (max-width: 480px) {
  .type-checks { grid-template-columns: 1fr; }
}

/* ---------- 作答专注模式：隐藏左栏与移动底栏 ---------- */
.focus-mode .sidebar,
.focus-mode .mobile-top,
.focus-mode .mobile-nav,
.focus-mode .sidebar-scrim { display: none; }
.focus-mode .main { margin-left: 0; }
.focus-mode .page {
  max-width: 1240px;
  padding-top: 30px;
  padding-bottom: 110px;
}
.focus-mode .mobile-answer-bar { bottom: 0; }

/* ---------- 错题批量操作栏 ---------- */
.wrong-batch {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 18px; margin: -4px 0 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
}
@media (max-width: 820px) {
  .wrong-batch { padding: 11px 14px; }
  .wrong-batch .btn { flex: 1; }
}

/* ---------- 题型比例 ---------- */
.ratio-box {
  border: 1px solid var(--line); border-radius: 14px;
  background: #fcfbf7; padding: 14px;
}
.ratio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ratio-item {
  display: flex; flex-direction: column; gap: 5px;
  padding: 11px 12px 10px; border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff;
}
.ratio-item > span:first-child { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.ri-input { display: flex; align-items: baseline; gap: 2px; }
.ri-input input {
  width: 54px; height: 30px; padding: 0; border: 0;
  border-bottom: 1px solid var(--line); background: transparent;
  font-size: 20px; font-weight: 650; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.ri-input input::-webkit-outer-spin-button,
.ri-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ri-input input:focus { outline: none; border-bottom-color: var(--primary); }
.ri-input em { font-style: normal; font-size: 11px; color: var(--muted); }
.ratio-item small { font-size: 9.5px; color: var(--faint); }
.ratio-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.ratio-presets button {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 4px 10px; font-size: 10.5px;
}
.ratio-presets button:hover { border-color: var(--primary-2); color: var(--primary); }
.ratio-sum {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--muted);
}
.ratio-sum b { color: var(--ink); font-size: 12px; }
.ratio-sum b.bad { color: var(--red); }
@media (max-width: 480px) {
  .ratio-grid { grid-template-columns: 1fr; }
}

/* ---------- 试卷卡片：状态标签第二行、放弃入口 ---------- */
.paper-card { min-height: 186px; }
.paper-card h3 { margin: 2px 0 9px; }
.paper-card .paper-meta { align-items: center; gap: 6px 10px; }
.paper-card .paper-meta .tag { font-size: 10.5px; padding: 2px 8px; }
.paper-card-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-2); }
.paper-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.paper-abandon {
  border: 0; background: transparent; color: var(--faint);
  font-size: 10.5px; padding: 5px 6px; border-radius: 6px;
}
.paper-abandon:hover { color: var(--red); background: var(--red-soft); }
@media (max-width: 820px) {
  .paper-card { min-height: 0; }
  .paper-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- 多字段弹窗 ---------- */
.form-error { min-height: 16px; margin-top: 8px; color: var(--red); font-size: 11.5px; }
