:root {
  --bg: #f1f5fa;
  --surface: #ffffff;
  --ink: #10233f;
  --muted: #5d7088;
  --brand: #0b6e69;
  --brand-strong: #064f4b;
  --brand-soft: #e2f3f0;
  --accent: #d97c05;
  --accent-soft: #fff3dd;
  --line: #dbe5ef;
  --danger: #b42318;
  --danger-soft: #ffebe9;
  --ok: #067647;
  --ok-soft: #e7f6ee;
  --shadow: 0 10px 32px rgba(16, 35, 63, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 10% -10%, #dff1ee 0%, transparent 60%),
    radial-gradient(760px 420px at 100% 0%, #e8eefb 0%, transparent 55%),
    var(--bg);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.65;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), #0f8f86);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(11, 110, 105, 0.28);
}
.brand strong { display: block; font-size: 18px; letter-spacing: 1px; }
.brand small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.page {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 28px clamp(14px, 3.5vw, 34px) 70px;
  display: grid;
  gap: 22px;
}


.eyebrow { margin: 0; font-size: 12px; letter-spacing: 2px; opacity: 0.75; }
.lead { margin: 0; max-width: 60ch; color: rgba(255, 255, 255, 0.86); font-size: 15px; }

.flow { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; align-content: center; }
.flow li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}
.flow b {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #ffd27d;
  color: #0b3b4f;
  font-size: 14px;
}
.flow span { font-weight: 700; font-size: 14px; }
.flow small { display: block; font-weight: 400; font-size: 12px; opacity: 0.72; }

.workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.column { display: grid; gap: 22px; min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.4vw, 26px);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.card-head h2 { margin: 0; font-size: 20px; letter-spacing: 0.3px; }
.card-head .muted { max-width: 46ch; }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.muted { color: var(--muted); font-size: 13px; }
.hint { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); font-size: 13px; }
.hint:empty { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--brand-strong); box-shadow: 0 6px 16px rgba(11, 110, 105, 0.24); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.62; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: #e8f1f5; color: var(--brand-strong); border-color: var(--line); }
.btn-secondary:hover { background: #dcebf0; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--brand-strong); border-color: var(--line); }
.btn-ghost:hover { background: var(--brand-soft); box-shadow: none; }
.btn-danger { background: transparent; color: var(--danger); border-color: #f2c9c6; padding: 4px 10px; font-size: 12px; }
.btn-danger:hover { background: var(--danger-soft); box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; color: #28405e; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 110, 105, 0.12);
}
.field textarea { resize: vertical; }

.field-row { display: grid; gap: 14px; }
.field-row.two { grid-template-columns: 1fr 1fr; }
.field-action { align-content: end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }

.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdff;
  font-size: 13px;
  cursor: pointer;
}
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; }
.check input { accent-color: var(--brand); }

.import-block { padding: 14px 0; border-top: 1px dashed var(--line); }
.import-block:first-of-type { border-top: 0; padding-top: 0; }
.import-block h3, .list-head h3, .explanation-card h3 { margin: 0 0 10px; font-size: 15px; }
.import-block .btn { margin-top: 10px; }
.count { color: var(--muted); font-weight: 400; font-size: 13px; }
.list-head { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

.material-list { display: grid; gap: 10px; }
.material-card { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: #fbfdff; }
.material-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.material-head strong { font-size: 14px; }
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.material-body { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 13px; color: #33475f; }
.material-foot { margin-top: 6px; color: var(--muted); font-size: 12px; }

details.citations, details.material-details, details.adjust-panel { margin-top: 8px; }
details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-strong);
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; display: inline-block; transition: transform 0.15s ease; }
details[open] > summary::before { transform: rotate(90deg); }
.citation-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.citation-list li { padding: 9px 11px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 9px 9px 0; font-size: 12px; }
.citation-list strong { display: block; font-size: 13px; }
.citation-list p { margin: 4px 0 0; color: #33475f; }

.empty { margin: 0; color: var(--muted); font-size: 14px; padding: 10px 0; }

.chat-card { display: flex; flex-direction: column; min-height: 520px; }
.chat-messages { flex: 1; overflow: auto; display: grid; gap: 12px; align-content: start; padding-right: 4px; max-height: 540px; }
.chat-empty { display: grid; gap: 7px; justify-items: start; padding: 8px 0; }
.chat-empty p { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.chip-btn {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdff;
  color: var(--brand-strong);
  font-size: 13px;
}
.chip-btn:hover { background: var(--brand-soft); }

.message { padding: 11px 14px; border-radius: 14px; font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.message.user { justify-self: end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; max-width: 88%; }
.message.agent { justify-self: start; background: #f6f9fc; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.message.error { background: var(--danger-soft); border-color: #f2c9c6; color: var(--danger); }
.message h4 { margin: 0 0 5px; font-size: 12px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.message .quote { margin: 0 0 10px; padding: 9px 11px; border-radius: 10px; background: #fff; border: 1px dashed var(--line); }
.message .explain { margin: 0; }
.message .notice { margin: 9px 0 0; padding: 7px 10px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.message .not-covered { margin: 0 0 7px; font-weight: 800; }

.chat-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.chat-form-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 9px; }
.chat-form-row .compact { flex: 1; }
.chat-form-row .btn { flex: 0 0 auto; }

.rules { margin: 0; padding-left: 18px; color: #33475f; font-size: 13px; }
.rules li { margin-bottom: 6px; }

.plan-day { margin-top: 16px; }
.plan-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.plan-day-head h3 { margin: 0; font-size: 16px; }
.plan-day-head span { color: var(--muted); font-size: 12px; }

.task { margin-top: 12px; padding: 13px 15px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; background: #fbfdff; }
.task.done { border-left-color: var(--ok); background: var(--ok-soft); }
.task.skipped { border-left-color: #98a2b3; opacity: 0.8; }
.task-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.task-head h4 { margin: 0; font-size: 15px; }
.task dl { margin: 9px 0 0; display: grid; grid-template-columns: 76px 1fr; gap: 5px 10px; font-size: 13px; }
.task dt { color: var(--muted); }
.task dd { margin: 0; overflow-wrap: anywhere; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.status-tag { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #eef2f6; color: var(--muted); }
.status-tag.done { background: var(--ok-soft); color: var(--ok); }
.status-tag.skipped { background: #eef2f6; color: var(--muted); }

.strategy {
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f6f9fc;
  border: 1px solid var(--line);
  font-size: 13px;
}
.strategy h3 { margin: 0 0 7px; font-size: 14px; }
.strategy ul { margin: 0; padding-left: 17px; }
.strategy li { margin-bottom: 4px; }
.strategy .reason { color: var(--muted); }

.adjust-panel { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.adjust-result { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid #f0d7ab; font-size: 13px; }
.adjust-result h4 { margin: 0 0 6px; }
.adjust-result ul { margin: 4px 0 8px; padding-left: 18px; }

.quiz-list { display: grid; gap: 14px; margin-top: 16px; }
.quiz-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; }
.quiz-meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.quiz-question { margin: 0 0 10px; font-weight: 700; }
.quiz-options { display: grid; gap: 7px; }
.quiz-option { display: flex; gap: 9px; align-items: flex-start; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; cursor: pointer; }
.quiz-option:hover { border-color: var(--brand); }
.quiz-option input { margin-top: 4px; accent-color: var(--brand); }
.quiz-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }
.quiz-card textarea { margin-top: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.quiz-feedback { margin-top: 11px; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: #f6f9fc; border: 1px solid var(--line); }
.quiz-feedback.correct { background: var(--ok-soft); border-color: #b7e4cb; }
.quiz-feedback.wrong { background: var(--danger-soft); border-color: #f2c9c6; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  padding: 11px 18px;
  border-radius: 12px;
  background: #10233f;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(16, 35, 63, 0.3);
}
.toast.error { background: var(--danger); }

@media (max-width: 980px) {

  .workspace { grid-template-columns: 1fr; }
  .chat-card { min-height: 440px; }
}

@media (max-width: 640px) {
  .page { padding: 16px 12px 50px; gap: 16px; }

  .card { padding: 16px 14px; border-radius: 16px; }
  .field-row.two, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .task dl { grid-template-columns: 68px 1fr; }
  .chat-form-row { flex-direction: column; align-items: stretch; }
  .chat-form-row .btn { width: 100%; }
  .topbar { align-items: flex-start; }
  .brand small { display: none; }
}
/* 学习聊天与专注模式 */
.nav-link {
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}
.nav-link:hover { background: var(--brand-soft); }

.chat-layout { grid-template-columns: 270px minmax(0, 1fr) 300px; align-items: start; }
.chat-sidebar { position: sticky; top: 80px; }
.chat-sidebar .btn { width: 100%; margin-top: 10px; }
.chat-main-card { display: flex; flex-direction: column; min-height: 640px; min-width: 0; }
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.chat-head h2 { margin: 0 0 3px; font-size: 18px; }
.chat-head .muted { margin: 0; }
.chat-thread { flex: 1; max-height: 560px; overflow: auto; display: grid; gap: 12px; padding: 14px 2px; align-content: start; }
.message-row { display: flex; }
.message-row.user { justify-content: flex-end; }
.message-row.assistant { justify-content: flex-start; }
.message-bubble { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: 14px; overflow-wrap: anywhere; }
.message-bubble.user { background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.message-bubble.assistant { background: #f6f9fc; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.message-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.message-body { line-height: 1.65; }
.message-bubble .notice { margin: 8px 0 0; padding: 6px 9px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.to-task { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.to-task select, .to-task input { padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; }
.quick-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chat-side .focus-start-link { width: 100%; margin-top: 12px; }
.checkin-form { gap: 10px; }
.advice-box { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid #f0d7ab; font-size: 13px; }
.advice-box strong { display: block; margin-bottom: 5px; }
.advice-box p { margin: 4px 0; }

.session-list { display: grid; gap: 8px; margin-top: 12px; max-height: 420px; overflow: auto; }
.session-item { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; overflow: hidden; }
.session-item.active { border-color: var(--brand); background: var(--brand-soft); }
.session-open { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 10px; text-align: left; cursor: pointer; }
.session-open strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-open small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-delete { border: 0; background: transparent; color: var(--danger); font-size: 18px; padding: 0 9px; cursor: pointer; }

.focus-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; }
.focus-card { text-align: center; }
.timer { margin: 8px 0 14px; font-size: clamp(56px, 12vw, 96px); font-weight: 800; letter-spacing: 3px; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.focus-modes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.inline-field { flex-direction: row; align-items: center; gap: 6px; }
.inline-field span { font-size: 12px; }
.inline-field input { width: 82px; }
.focus-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-card { padding: 12px; border-radius: 12px; background: #f6f9fc; border: 1px solid var(--line); }
.stat-card span { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { font-size: 28px; color: var(--brand-strong); }
.stat-card small { margin-left: 3px; color: var(--muted); }
.course-stats { display: grid; gap: 6px; }
.course-stat-row { display: flex; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }

@media (max-width: 1100px) {
  .chat-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .chat-side { grid-column: span 2; }
}

@media (max-width: 900px) {
  .chat-layout, .focus-layout { grid-template-columns: 1fr; }
  .chat-side { grid-column: auto; }
  .chat-sidebar { position: static; }
}

@media (max-width: 640px) {
  .message-bubble { max-width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .nav-link { padding: 5px 7px; font-size: 12px; }
  .topbar-actions { gap: 4px; }
}
/* ===== 东方治学主题 ===== */
:root {
  --bg: #f1eadc;
  --surface: #fbf8ee;
  --ink: #20251f;
  --muted: #6d6759;
  --brand: #2e5a4c;
  --brand-strong: #1d3d33;
  --brand-soft: #e5eee7;
  --accent: #a33b2b;
  --accent-soft: #f4e3da;
  --line: #d8cdb8;
  --danger: #8c2e25;
  --radius: 5px;
  --shadow: 0 1px 0 rgba(94, 75, 45, 0.06), 0 16px 40px rgba(53, 45, 27, 0.05);
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-kai: "KaiTi", "STKaiti", "Kaiti SC", "楷体", "Noto Serif SC", serif;
}

html { background: #e9e1d2; }

body {
  font-family: var(--font-serif);
  color: var(--ink);
  background:
    radial-gradient(820px 420px at 8% -8%, rgba(255, 252, 241, 0.9), transparent 60%),
    radial-gradient(680px 380px at 100% 0%, rgba(228, 236, 224, 0.7), transparent 55%),
    repeating-linear-gradient(0deg, rgba(90, 72, 40, 0.022) 0 1px, transparent 1px 4px),
    var(--bg);
}

h1, h2, h3, .brand strong, .timer {
  font-family: var(--font-serif);
  letter-spacing: 0.03em;
}

.topbar {
  background: rgba(250, 246, 236, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.brand-mark {
  width: 40px;
  height: 46px;
  border-radius: 2px;
  background: var(--accent);
  color: #fff8ea;
  font-family: var(--font-kai);
  font-size: 22px;
  box-shadow: 0 0 0 3px #f7f1e4, 0 0 0 4px rgba(163, 59, 43, 0.55);
}
.brand strong { font-size: 20px; letter-spacing: 0.18em; }
.brand small { font-family: var(--font-kai); letter-spacing: 0.06em; }
.nav-link {
  border-radius: 0;
  border-bottom: 2px solid transparent;
  font-family: var(--font-serif);
  color: var(--ink);
  letter-spacing: 0.08em;
}
.nav-link:hover { background: transparent; color: var(--accent); border-bottom-color: var(--accent); }
.badge {
  border: 1px solid #d7b5a8;
  border-radius: 2px;
  background: var(--accent-soft);
  color: var(--accent);
  letter-spacing: 0.08em;
}
.btn {
  border-radius: 2px;
  background: var(--brand-strong);
  font-family: var(--font-serif);
  letter-spacing: 0.08em;
  box-shadow: none;
}
.btn:hover { background: var(--accent); box-shadow: none; }
.btn-secondary { background: #e9e2d3; color: var(--brand-strong); border-color: var(--line); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--brand-strong); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); }

.card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  width: 30px;
  height: 2px;
  background: var(--accent);
  opacity: 0.75;
}
.card-head { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.card-head h2 { font-weight: 600; }
.card-head h2::before {
  content: "〇";
  margin-right: 8px;
  color: var(--accent);
  font-size: 11px;
  vertical-align: 2px;
}


.flow li { border-radius: 2px; border-color: rgba(255, 248, 232, 0.18); background: rgba(255, 248, 232, 0.06); }
.flow b { border-radius: 2px; background: #e8cc92; color: #182722; font-family: var(--font-serif); }
.flow small { font-family: var(--font-kai); }

.chat-main-card, .chat-side, .chat-sidebar { background: var(--surface); }
.chat-main-card { border-top: 3px solid var(--brand-strong); }
.chat-head h2 { font-size: 22px; }
.chat-thread .message-body,
.chat-thread .answer-quote,
.chat-thread .answer-explain,
.chat-thread .message-bubble { font-family: var(--font-kai); }
.chat-thread { background: linear-gradient(180deg, rgba(255, 253, 246, 0.7), transparent 80%); }
.message-bubble { border-radius: 2px; }
.message-bubble.user { background: var(--brand-strong); border-bottom-right-radius: 0; }
.message-bubble.assistant {
  background: #faf5e9;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-bottom-left-radius: 0;
}
.message-meta .chip { border-radius: 2px; }
.chip-btn { border-radius: 2px; font-family: var(--font-serif); background: #faf6ec; }
.quick-actions { border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 8px 0; }
.sidebar-seal {
  margin: 16px 0 0;
  color: var(--accent);
  font-family: var(--font-kai);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-align: center;
  opacity: 0.75;
}
.answer-quote {
  margin: 8px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #fffaf0;
  font-size: 17px;
  line-height: 1.9;
}
.answer-explain {
  margin: 8px 0 0;
  color: #4d4a41;
  font-size: 16px;
  line-height: 1.9;
}
.viz-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.seal-chip {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #d7b5a8;
  color: var(--accent);
  background: #fff9f1;
  font-size: 11px;
  font-family: var(--font-serif);
}

.summary-panel { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.summary-head h3 { margin: 0; font-size: 17px; }
.summary-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.summary-stats b { color: var(--accent); font-size: 16px; }
.summary-provider { margin: 0 0 8px; }
.summary-block { margin-top: 12px; }
.summary-block h4 { margin: 0 0 7px; font-size: 13px; color: var(--brand-strong); font-weight: 600; }
.viz-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 24px;
  gap: 7px;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}
.viz-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-track { height: 6px; background: #eee6d7; border-radius: 1px; overflow: hidden; }
.viz-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.viz-row b { text-align: right; color: var(--accent); font-weight: 600; }
.similar-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.similar-list li { padding: 8px 10px; border: 1px solid var(--line); background: #faf6ec; font-size: 12px; }
.similar-list strong { display: block; font-weight: 600; }
.similar-list span { color: var(--accent); margin-left: 4px; }
.similar-list small { display: block; color: var(--muted); margin-top: 3px; }

.timer {
  width: min(260px, 68vw);
  height: min(260px, 68vw);
  margin: 12px auto 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, #fffdf6 0 52%, transparent 53%),
    repeating-radial-gradient(circle at 50% 50%, rgba(163, 59, 43, 0.12) 0 1px, transparent 1px 8px);
  color: var(--ink);
  font-size: clamp(48px, 10vw, 72px);
  letter-spacing: 2px;
  box-shadow: inset 0 0 0 8px rgba(255, 252, 242, 0.6);
}
.focus-card { background: linear-gradient(180deg, #fbf8ee, #f7f1e3); }
.focus-card .eyebrow { color: var(--accent); letter-spacing: 0.3em; }
.stat-card { border-radius: 2px; background: #faf6ec; border-color: var(--line); }
.stat-card strong { font-family: var(--font-serif); }
.citation-list li { border-left-color: var(--accent); background: #faf5e9; border-radius: 0 2px 2px 0; }
details summary { color: var(--brand-strong); font-family: var(--font-serif); }
.hint { background: #f7f1e3; color: #5b5446; }

@media (max-width: 640px) {
  .timer { width: 210px; height: 210px; font-size: 48px; }
  .brand strong { letter-spacing: 0.1em; }
}
/* 模块中心与独立练习题 */
.module-page { gap: 18px; }
.module-intro { padding: 28px 8px 8px; }
.module-intro h1 { margin: 8px 0; font-size: clamp(28px, 5vw, 44px); letter-spacing: 0.12em; }
.module-intro .lead { font-family: var(--font-kai); color: var(--muted); font-size: 16px; }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.module-card { display: block; padding: 22px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.module-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(53, 45, 27, 0.12); }
.module-card h2 { margin: 10px 0 6px; font-size: 22px; letter-spacing: 0.08em; }
.module-card p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.module-seal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  background: var(--accent);
  color: #fff8ea;
  font-family: var(--font-kai);
  font-size: 18px;
  border: 1px solid #f1d8cd;
}
.module-arrow { color: var(--accent); font-size: 13px; letter-spacing: 0.1em; }
.module-note { text-align: center; color: var(--muted); font-family: var(--font-kai); font-size: 13px; }
.module-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 2px;
  color: var(--muted);
  font-size: 13px;
}
.module-banner a { color: var(--accent); }
.module-banner span { letter-spacing: 0.2em; color: var(--brand-strong); }

.practice-layout { grid-template-columns: 360px minmax(0, 1fr); align-items: start; }
.practice-config { position: sticky; top: 80px; }
.practice-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.analysis-note {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #faf5e9;
  font-size: 12px;
}
.analysis-note strong { display: block; margin-bottom: 4px; }
.analysis-note p { margin: 3px 0; color: var(--muted); }
.type-grid { display: grid; gap: 7px; }
.type-option {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #faf6ec;
  cursor: pointer;
}
.type-option input { margin-top: 4px; accent-color: var(--accent); }
.type-option b { display: block; font-size: 13px; font-weight: 600; }
.type-option small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.practice-list-card { min-height: 500px; }

@media (max-width: 1050px) {
  .practice-layout { grid-template-columns: 1fr; }
  .practice-config { position: static; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .module-grid { grid-template-columns: 1fr; }
  .module-card { padding: 16px; }
}
/* 原文预览 / 复习原文按钮：保留功能所需的基础样式 */
.source-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.35);
}

.source-modal-backdrop.is-open {
  display: grid;
}

.source-modal {
  width: min(720px, 100%);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}

.source-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.source-modal-title {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.source-modal-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.source-modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.source-modal-body {
  margin: 0;
  padding: 20px 22px 28px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  font: 14px/1.8 var(--font-serif);
}

.review-source-preview {
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
}