/* ===== 基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e1e5eb;
  --text: #1a202c;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --error: #dc2626;
  --error-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #334155;
    --border: #475569;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: #1e3a8a;
    --success: #22c55e;
    --success-light: #14532d;
    --error: #ef4444;
    --error-light: #7f1d1d;
    --warning: #f59e0b;
    --warning-light: #78350f;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  display: flex;
  flex-direction: column;
}

/* ===== 顶部导航 ===== */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 17px;
}

.brand-logo { font-size: 22px; }

.book-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: normal;
  padding: 2px 8px;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}

.book-tag:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.switch-book-btn {
  padding: 5px 12px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.switch-book-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.nav-menu {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-item {
  padding: 6px 14px;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.badge {
  background: var(--error);
  color: white;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.mode-label {
  color: var(--text-muted);
}

.mode-btn {
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.mode-btn:hover {
  color: var(--text);
}

.mode-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.quiz-pref-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.quiz-pref-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.quiz-pref-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.quiz-pref-toggle.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quiz-pref-toggle.disabled input {
  cursor: not-allowed;
}

/* ===== 主区域 ===== */
main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

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

/* ===== 通用组件 ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.btn {
  padding: 8px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}

.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-success { background: var(--success); }
.btn-success:hover { filter: brightness(1.1); }

.btn-error { background: var(--error); }

.page-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.book-progress-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -8px 0 22px; }
.book-progress-warning { color: var(--text-muted); font-size: 12px; }
.btn-danger-outline { color: var(--error); border: 1px solid rgba(220, 38, 38, .35); background: transparent; }
.btn-danger-outline:hover { color: #fff; border-color: var(--error); background: var(--error); }

/* ===== 书目选择 ===== */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.book-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  transform: translateY(-2px);
}

.book-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.book-card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.book-card-meta {
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}


.book-picker-section { margin: 0 0 30px; }
.book-picker-section + .book-picker-section { padding-top: 4px; }
.book-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.book-section-title { margin: 0; font-size: 19px; line-height: 1.35; }
.book-section-description { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.book-section-count { flex: 0 0 auto; color: var(--text-muted); font-size: 12px; }
.book-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.book-card-heading .book-card-title { margin-bottom: 8px; }
.book-card-exclusive { border-color: rgba(124, 58, 237, .28); background: linear-gradient(145deg, var(--surface), rgba(124, 58, 237, .055)); }
.book-card-exclusive:hover { border-color: #7c3aed; box-shadow: 0 6px 18px rgba(124, 58, 237, .15); }
.book-card-locked { border-style: dashed; }
.book-card-locked .book-card-title { color: #4338ca; }
.book-card-prediction { border-top: 3px solid #b42318; padding-top: 22px; }
.book-card-prediction:hover { border-color: #b42318; box-shadow: 0 6px 18px rgba(180, 35, 24, .13); }
.prediction-section { padding: 18px 0 4px; border-top: 1px solid rgba(180, 35, 24, .22); }
.prediction-section .book-section-title { color: #8f1d16; }
.prediction-collection-list { display: grid; gap: 12px; margin-top: 16px; }
.prediction-collection { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.prediction-collection[open] { border-color: rgba(180, 35, 24, .35); }
.prediction-collection-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 16px 18px; cursor: pointer; list-style: none; }
.prediction-collection-summary::-webkit-details-marker { display: none; }
.prediction-collection-summary::after { content: '›'; flex: 0 0 auto; color: var(--text-muted); font-size: 24px; transform: rotate(90deg); transition: transform .2s; }
.prediction-collection[open] .prediction-collection-summary::after { transform: rotate(-90deg); }
.prediction-collection-heading { display: grid; gap: 5px; min-width: 0; margin-right: auto; }
.prediction-collection-heading strong { color: var(--text); font-size: 16px; }
.prediction-collection-heading span { color: var(--text-muted); font-size: 12px; }
.prediction-collection-body { padding: 0 18px 18px; border-top: 1px solid var(--border); }
.prediction-collection-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 0; color: var(--text-muted); font-size: 13px; }
.prediction-collection-actions .btn { flex: 0 0 auto; }
.prediction-collection-body .book-grid { margin-top: 14px; }
.book-module-badge { flex: 0 0 auto; padding: 4px 8px; border-radius: 4px; color: #8f1d16; background: #fff1f0; font-size: 11px; font-weight: 700; white-space: nowrap; }
.book-access-badge { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.book-access-badge.locked { color: #6d28d9; background: rgba(124, 58, 237, .1); }
.book-access-badge.unlocked { color: #047857; background: rgba(16, 185, 129, .11); }
.library-custom-service { margin-top: 10px; }

.book-unlock-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .58); backdrop-filter: blur(4px); }
.book-unlock-dialog { width: min(430px, 100%); padding: 28px; border-radius: 18px; background: var(--surface); box-shadow: 0 24px 70px rgba(15, 23, 42, .28); text-align: center; }
.book-unlock-icon { font-size: 34px; line-height: 1; }
.book-unlock-title { margin: 12px 0 5px; font-size: 22px; }
.book-unlock-book { color: #5b21b6; font-size: 15px; font-weight: 700; }
.book-unlock-description { margin: 12px 0 18px; color: var(--text-muted); font-size: 13px; line-height: 1.65; }
.book-unlock-form { text-align: left; }
.book-unlock-input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 15px; letter-spacing: .04em; outline: none; }
.book-unlock-input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.book-unlock-error { min-height: 20px; padding-top: 6px; color: var(--error); font-size: 12px; }
.book-unlock-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.book-unlock-help { margin: 16px 0 0; color: var(--text-muted); font-size: 12px; }

@media (max-width: 640px) {
  .prediction-collection-summary { min-height: 64px; padding: 14px; }
  .prediction-collection-body { padding: 0 14px 14px; }
  .prediction-collection-actions { align-items: stretch; flex-direction: column; }
  .prediction-collection-actions .btn { width: 100%; }
}

@media (max-width: 600px) {
  .book-section-heading { align-items: flex-start; }
  .book-section-description { max-width: 260px; }
  .book-unlock-dialog { padding: 23px 18px; }
  .book-unlock-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

/* ===== 章节树 ===== */
.chapter-list {
  margin-top: 16px;
}

.chapter {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.chapter-header {
  padding: 12px 16px;
  background: var(--surface-2);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  user-select: none;
}

.chapter-header:hover {
  background: var(--border);
}

.chapter-header .arrow {
  transition: transform 0.2s;
  display: inline-block;
}

.chapter.collapsed .arrow {
  transform: rotate(-90deg);
}

.chapter-sections {
  padding: 8px 0;
}

.chapter.collapsed .chapter-sections {
  display: none;
}

.section-item {
  padding: 10px 16px 10px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.section-item:hover {
  background: var(--surface-2);
  border-left-color: var(--primary);
}

.section-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.section-title {
  font-weight: 500;
}

.section-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.section-progress {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 8px;
  background: var(--surface-2);
  border-radius: 10px;
}

.section-progress.done {
  background: var(--success-light);
  color: var(--success);
}

.section-progress.partial {
  background: var(--warning-light);
  color: var(--warning);
}

/* ===== 刷题页 ===== */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.quiz-section-info {
  font-size: 14px;
  color: var(--text-muted);
}

.quiz-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.question-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.question-material-link {
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  padding: 3px 8px;
  font-size: 11px;
}
.material-searching {
  color: var(--text-muted);
  white-space: nowrap;
  font-size: 11px;
}
.material-not-found {
  color: var(--text-muted);
  white-space: nowrap;
  font-size: 11px;
}

.tag {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.tag.type-single { background: var(--primary-light); color: var(--primary); }
.tag.type-multiple { background: var(--warning-light); color: var(--warning); }
.tag.type-case { background: #ede9fe; color: #6d28d9; }
.tag.difficulty-easy { background: var(--success-light); color: var(--success); }
.tag.difficulty-hard { background: var(--error-light); color: var(--error); }

.question-number {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
}

.question-stem {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.case-question-card {
  border-top: 3px solid #8b5cf6;
}

.case-view-only-note {
  margin: 4px 0 16px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #5b21b6;
  background: #f5f3ff;
  font-size: 14px;
}

.case-stem {
  line-height: 1.85;
  margin-bottom: 4px;
  white-space: pre-wrap;
}

.question-image {
  display: block;
  max-width: min(100%, 760px);
  max-height: 560px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 12px auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.option-text .question-image {
  margin: 8px 0;
  max-height: 360px;
}

.question-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.question-table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}

.question-table th,
.question-table td {
  min-width: 72px;
  padding: 8px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.question-table tr:first-child > th,
.question-table tr:first-child > td,
.question-table th {
  background: var(--surface-2);
  font-weight: 600;
}

.question-table tr:last-child > * { border-bottom: 0; }
.question-table tr > *:last-child { border-right: 0; }
.option-text .question-table-wrap { margin: 6px 0; }
.rich-content-error { color: var(--danger); font-size: 13px; }

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.15s;
  user-select: none;
}

.option:hover {
  border-color: var(--primary);
  background: var(--surface-2);
}

.option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option.correct {
  border-color: var(--success);
  background: var(--success-light);
}

.option.wrong {
  border-color: var(--error);
  background: var(--error-light);
}

.option-letter {
  font-weight: 600;
  color: var(--primary);
  min-width: 20px;
}

.option.correct .option-letter { color: var(--success); }
.option.wrong .option-letter { color: var(--error); }

.option-text {
  flex: 1;
  white-space: pre-wrap;
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 12px;
}

.quiz-actions-right {
  display: flex;
  gap: 8px;
}

/* ===== Quick quiz navigation ===== */
.quiz-quick-navigation {
  position: relative;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.quiz-edge-nav {
  display: none;
  position: fixed;
  top: 54%;
  z-index: 80;
  width: 64px;
  min-height: 92px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text-muted);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
  transition: color 0.16s, border-color 0.16s, background 0.16s, transform 0.16s, box-shadow 0.16s;
}

.quiz-edge-prev { left: max(12px, calc((100vw - 1100px) / 2 - 76px)); }
.quiz-edge-next { right: max(12px, calc((100vw - 1100px) / 2 - 76px)); }

.quiz-edge-nav:hover:not(:disabled) {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.18);
  transform: translateY(-50%) scale(1.04);
}

.quiz-edge-nav:focus-visible,
.quiz-mobile-nav:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 32%, transparent);
  outline-offset: 3px;
}

.quiz-edge-nav:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  box-shadow: none;
}

.quiz-edge-arrow {
  display: block;
  font-size: 42px;
  font-weight: 300;
  line-height: 0.8;
}

.quiz-edge-label {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  white-space: nowrap;
}

.quiz-mobile-dock {
  display: none;
}

@media (min-width: 761px) {
  .quiz-mobile-dock { display: none !important; }
}

@media (min-width: 1280px) and (pointer: fine) {
  .quiz-edge-nav { display: block; }
}

@media (max-width: 760px) {
  .quiz-edge-nav { display: none !important; }

  body.quiz-navigation-active main {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .quiz-mobile-dock {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    z-index: 90;
    display: grid;
    width: min(340px, calc(100vw - 16px));
    max-width: none;
    margin: 0;
    grid-template-columns: minmax(78px, 1fr) auto minmax(78px, 1fr);
    align-items: center;
    gap: 6px;
    padding: 6px 7px calc(6px + env(safe-area-inset-bottom, 0px));
    border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
    border-radius: 14px 14px 0 0;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.22);
    pointer-events: auto;
    transform: translateX(-50%);
    backdrop-filter: blur(14px);
  }

  .quiz-mobile-nav {
    min-height: 42px;
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }

  .quiz-mobile-nav:disabled {
    opacity: 0.38;
    cursor: not-allowed;
  }

  .quiz-mobile-next {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
  }

  .quiz-mobile-progress {
    min-width: 58px;
    color: var(--text-muted);
    text-align: center;
    font-size: 13px;
    line-height: 1.15;
  }

  .quiz-mobile-progress strong {
    color: var(--text);
    font-size: 16px;
  }

  .quiz-mobile-progress small {
    display: none;
  }
}

@media (max-width: 380px) {
  .quiz-mobile-dock {
    width: min(324px, calc(100vw - 12px));
    grid-template-columns: minmax(74px, 1fr) auto minmax(74px, 1fr);
    gap: 5px;
    padding-inline: 6px;
  }

  .quiz-mobile-nav {
    padding-inline: 6px;
    font-size: 12px;
  }
}

/* ===== 解析区 ===== */
.analysis-block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}

.analysis-block h4 {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.answer-line {
  padding: 10px 14px;
  background: var(--success-light);
  border-radius: 6px;
  margin-bottom: 12px;
  font-weight: 500;
}

.answer-line.no-answer {
  background: var(--warning-light);
  color: var(--warning);
}

.analysis-text {
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 6px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.trick-text {
  padding: 12px 14px;
  background: var(--primary-light);
  border-radius: 6px;
  color: var(--primary);
  font-weight: 500;
  margin-top: 8px;
}

.extend-block {
  padding: 14px;
  background: var(--surface-2);
  border-radius: 6px;
  margin-top: 8px;
}

.extend-block h5 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.extend-block table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  background: var(--surface);
  margin-top: 8px;
}

.extend-block table td,
.extend-block table th {
  border: 1px solid var(--border);
  padding: 6px 10px;
  vertical-align: top;
}

.extend-block table th,
.extend-block table td:first-child {
  background: var(--surface-2);
  font-weight: 600;
}

/* ===== 批改结果 ===== */
.result-summary {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.result-score {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0;
}

.result-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== 错题本 ===== */
.wrongbook-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.wrongbook-empty .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.wrong-group {
  margin-bottom: 20px;
}

.wrong-group-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wrong-group-title > span {
  min-width: 0;
  flex: 1;
}

.review-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.review-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.wrongbook-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.wrongbook-summary-stat {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.wrongbook-summary-stat strong { display: block; font-size: 23px; line-height: 1.1; color: var(--text); }
.wrongbook-summary-stat span { color: var(--text-muted); font-size: 12px; }
.wrongbook-summary-stat.due { border-color: var(--warning); background: var(--warning-light); }
.wrongbook-summary-stat.due strong { color: var(--warning); }
.wrongbook-summary-stat.mastered { border-color: var(--success); background: var(--success-light); }
.wrongbook-summary-stat.mastered strong { color: var(--success); }
.wrongbook-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.wrongbook-scope-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.wrongbook-order-control {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}
.wrongbook-order-label {
  margin-right: 8px;
  color: var(--text-muted);
  font-size: 12px;
}
.wrongbook-order-btn {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.wrongbook-order-btn:first-of-type { border-radius: 6px 0 0 6px; }
.wrongbook-order-btn:last-child { margin-left: -1px; border-radius: 0 6px 6px 0; }
.wrongbook-order-btn:hover { color: var(--primary); }
.wrongbook-order-btn.active {
  position: relative;
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.wrongbook-attempt-feedback { margin-top: 12px; }
.attempt-progress, .attempt-mastered {
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
}
.attempt-mastered { background: var(--success-light); color: var(--success); }
.error-tag-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.error-tag-label { color: var(--text-muted); font-size: 12px; margin-right: 2px; }
.error-tag-btn, .wrongbook-error-tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}
.error-tag-btn:hover, .error-tag-btn.selected { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.wrongbook-error-tag { cursor: default; border-color: var(--warning); background: var(--warning-light); color: var(--warning); }
.review-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.review-filter-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
}
.review-filter-bar select {
  min-width: 150px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.review-filter-count { margin-left: auto; color: var(--text-muted); font-size: 13px; }
.review-chapter-title { margin: 20px 0 8px; color: var(--text); }
.review-chapter-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 20px; }
.review-chapter-heading .review-chapter-title { margin: 0; }
.question-favorite-btn {
  border: 0;
  padding: 2px 5px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.question-favorite-btn:hover,
.question-favorite-btn.active { color: #d97706; }

.wrong-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.wrong-item-stem {
  flex: 1;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wrong-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.wrongbook-material-link {
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  padding: 2px 8px;
  font-size: 12px;
}

/* ===== 资料索引页 ===== */
.materials-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.materials-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.material-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.material-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.material-row-title h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 650;
}
.material-subject {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 11px;
}
.material-row-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.material-row-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.material-status {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}
.material-status.ready {
  color: var(--success);
  background: var(--success-light);
}
.material-status.missing {
  color: var(--warning);
  background: var(--warning-light);
}
.material-row-actions { display: flex; justify-content: flex-end; }
.materials-message,
.materials-empty {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
}
.materials-message { margin-bottom: 12px; }
.materials-message.error {
  color: var(--error);
  background: var(--error-light);
  border-color: color-mix(in srgb, var(--error) 35%, var(--border));
}

@media (max-width: 760px) {
  .material-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
  }
  .material-row-status { grid-column: 1 / -1; justify-content: flex-start; }
  .material-row-actions { grid-column: 2; grid-row: 1; }
  .material-row-title h2 { white-space: normal; }
}

@media (max-width: 640px) {
  .review-page-actions { width: 100%; justify-content: flex-start; }
  .wrongbook-toolbar, .wrongbook-order-control { width: 100%; }
  .wrongbook-order-btn { flex: 1; }
  .review-filter-count { margin-left: 0; width: 100%; }
  .review-filter-bar select { min-width: 0; max-width: 58vw; }
  .wrongbook-summary { grid-template-columns: 1fr; }
  .wrongbook-summary-stat { display: flex; align-items: baseline; justify-content: space-between; }
}

/* ===== 校验页 ===== */
.error-summary {
  background: var(--warning-light);
  color: var(--warning);
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-weight: 500;
}

.error-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.error-section-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.error-item {
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 13px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.error-kind {
  padding: 2px 8px;
  background: var(--error-light);
  color: var(--error);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.footer-separator { color: var(--border); }

.footer-icp {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-icp:hover { color: var(--primary); }
.footer-icp:focus-visible {
  color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 8px;
  }
  .brand { font-size: 15px; }
  .nav-menu { order: 3; width: 100%; }
  .mode-switch { margin-left: auto; }
  main { padding: 16px 12px 40px; }
  .question-card { padding: 16px; }
  .quiz-actions { flex-direction: column; }
  .quiz-actions .btn { width: 100%; }
}


/* ===== Account authentication ===== */
.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  font-size: 13px;
}


.user-summary {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.account-expiry {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.2;
}

.account-expiry.permanent { color: var(--success); }
.account-expiry.warning { color: #b45309; font-weight: 600; }
.account-expiry.danger,
.account-expiry.expired { color: var(--error); font-weight: 700; }

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.logout-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
}

.auth-page {
  min-height: calc(100vh - 190px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 12px;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.08);
}

.auth-title { margin: 0 0 8px; font-size: 24px; }
.auth-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 22px; line-height: 1.7; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tab {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 9px;
  border-radius: 6px;
  cursor: pointer;
}
.auth-tab.active { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
}
.auth-field input:focus { outline: none; border-color: var(--primary); }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-error {
  background: var(--error-light);
  color: var(--error);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.auth-note { margin-top: 14px; color: var(--text-muted); font-size: 12px; line-height: 1.7; }

@media (max-width: 640px) {
  .user-area { margin-left: auto; }
  .account-expiry { max-width: 190px; font-size: 10px; }
  .auth-card { padding: 22px 18px; }
}


/* ===== 题库持续上新提示 ===== */
.library-coming {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  margin: 0 0 18px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.08));
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.library-coming-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  font-size: 22px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.library-coming-content {
  min-width: 0;
  flex: 1;
}

.library-coming-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.library-coming-text {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.library-coming-badge {
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: 999px;
  color: #1d4ed8;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(37, 99, 235, 0.16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@media (prefers-color-scheme: dark) {
  .library-coming-badge {
    color: #bfdbfe;
    background: rgba(15, 23, 42, 0.56);
  }
}

@media (max-width: 640px) {
  .library-coming {
    align-items: flex-start;
    padding: 16px;
  }

  .library-coming-badge {
    display: none;
  }
}

/* ===== 轻量管理员题库修订后台 ===== */
.admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.admin-tab {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
}

.admin-tab.active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.admin-summary,
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
}

.admin-summary strong { color: var(--warning); }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-list.compact { gap: 7px; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.admin-row.resolved { opacity: 0.72; }
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 650; }
.admin-row-detail { margin-top: 5px; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.admin-row-stem { margin-top: 6px; color: var(--text); font-size: 14px; line-height: 1.55; }
.admin-row-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.admin-muted { color: var(--text-muted); font-size: 12px; }
.admin-result-count { margin: 0 0 8px; color: var(--text-muted); font-size: 12px; }
.mono { font-family: Consolas, "SFMono-Regular", monospace; word-break: break-all; }

.repair-status {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--warning);
  background: var(--warning-light);
  font-size: 11px;
  font-weight: 700;
}

.repair-status.done { color: var(--success); background: var(--success-light); }
.admin-select,
.admin-search {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--text);
}
.admin-select { min-width: 230px; }
.admin-search { flex: 1; min-width: 220px; }

.btn-danger-soft {
  color: var(--error);
  border-color: rgba(220, 38, 38, 0.3);
  background: var(--error-light);
}

/* 修订弹窗 */
.repair-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 16px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.68);
}

.repair-modal {
  width: min(960px, 100%);
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.repair-modal-header,
.repair-modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface);
}

.repair-modal-header { justify-content: space-between; border-bottom: 1px solid var(--border); }
.repair-modal-header h2 { margin: 0; font-size: 20px; }
.repair-modal-subtitle { margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.repair-modal-footer { border-top: 1px solid var(--border); }
.repair-footer-spacer { flex: 1; }
.repair-close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.ocr-paste-box {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--primary-light);
}
.ocr-paste-title { margin-bottom: 7px; color: var(--primary); font-size: 13px; font-weight: 700; }
.ocr-paste-box textarea { width: 100%; box-sizing: border-box; margin-bottom: 8px; }

.repair-form { padding: 18px 20px 24px; overflow-y: auto; }
.repair-grid { display: grid; gap: 14px; }
.repair-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.repair-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.repair-field { display: block; margin-bottom: 14px; }
.repair-label { display: block; margin-bottom: 6px; color: var(--text); font-size: 13px; font-weight: 650; }
.repair-field input,
.repair-field select,
.repair-field textarea,
.ocr-paste-box textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 11px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}
.repair-field textarea { resize: vertical; min-height: 58px; }
.repair-field input:focus,
.repair-field select:focus,
.repair-field textarea:focus,
.ocr-paste-box textarea:focus { outline: none; border-color: var(--primary); }
.repair-hint { display: block; margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.repair-location { margin-bottom: 14px; padding: 9px 12px; border-radius: 7px; background: var(--surface-2); color: var(--text-muted); font-size: 13px; }
.repair-message { margin: 8px 0; padding: 10px 12px; border-radius: 7px; font-size: 13px; }
.repair-message.success { color: var(--success); background: var(--success-light); }
.repair-message.error { color: var(--error); background: var(--error-light); }
.repair-preview { margin-top: 16px; padding: 18px; border: 2px solid var(--primary); border-radius: 9px; background: var(--surface); }
.repair-preview-title { margin-bottom: 14px; color: var(--primary); font-weight: 750; }
.repair-preview-answer { margin-top: 12px; padding: 9px 12px; border-radius: 6px; color: var(--success); background: var(--success-light); font-weight: 700; }
.option.preview-only { cursor: default; }
.option.preview-only:hover { border-color: var(--border); background: transparent; }

@media (max-width: 720px) {
  .admin-heading,
  .admin-row { align-items: stretch; flex-direction: column; }
  .admin-row-actions { justify-content: flex-end; }
  .admin-toolbar > * { width: 100%; }
  .repair-modal-overlay { padding: 0; }
  .repair-modal { max-height: 100vh; min-height: 100vh; border-radius: 0; }
  .repair-grid.two,
  .repair-options-grid { grid-template-columns: 1fr; }
  .repair-modal-footer { flex-wrap: wrap; }
}


/* ===== 用户题目报错 ===== */
.question-meta-spacer { flex: 1; }
.question-report-btn {
  margin-left: auto;
  border: 0;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 11px;
  cursor: pointer;
}
.question-report-btn:hover { color: var(--primary); background: var(--primary-light); }

.feedback-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.68);
}
.feedback-modal {
  width: min(620px, 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.feedback-modal-header,
.feedback-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px;
}
.feedback-modal-header { border-bottom: 1px solid var(--border); }
.feedback-modal-header h2 { margin: 0; font-size: 19px; }
.feedback-modal-footer { justify-content: flex-end; border-top: 1px solid var(--border); }
.feedback-location { margin-top: 4px; color: var(--text-muted); font-size: 12px; }
.feedback-question-preview {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.65;
}
.feedback-form { padding: 16px 18px 18px; }
.feedback-mode-tabs { display: flex; gap: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.feedback-mode-tab { border: 0; border-bottom: 2px solid transparent; padding: 8px 4px 9px; color: var(--text-muted); background: transparent; cursor: pointer; font-size: 13px; }
.feedback-mode-tab.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.feedback-text-fields, .feedback-image-fields { display: grid; gap: 10px; }
.feedback-upload-hint { color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.feedback-message { margin-top: 10px; padding: 10px 12px; border-radius: 7px; font-size: 13px; }
.feedback-message.success { color: var(--success); background: var(--success-light); }
.feedback-message.error { color: var(--error); background: var(--error-light); }
.feedback-report-list { margin-top: 10px; display: grid; gap: 8px; }
.feedback-report-item { padding: 10px 12px; border-radius: 7px; background: var(--surface-2); }
.feedback-report-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--text-muted); font-size: 11px; }
.feedback-report-text { margin-top: 5px; color: var(--text); line-height: 1.6; white-space: pre-wrap; }
.feedback-evidence-meta { margin-top: 6px; color: var(--primary); font-size: 12px; }
.feedback-report-stem { margin-top: 7px; padding: 8px 10px; border-left: 3px solid var(--primary); background: var(--surface); color: var(--text); font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.feedback-evidence-images { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.feedback-evidence-image { display: grid; gap: 4px; color: var(--primary); font-size: 11px; text-decoration: none; }
.feedback-evidence-image img { width: 150px; max-height: 120px; object-fit: cover; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.feedback-admin-row { align-items: flex-start; }

@media (max-width: 640px) {
  .feedback-modal-overlay { padding: 0; align-items: flex-end; }
  .feedback-modal { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; overflow-y: auto; }
}

.admin-checklist-note {
  margin: -4px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}
.checklist-evidence,
.checklist-shot {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.checklist-shot { color: var(--primary); }

/* 2026-07-28 顶部双层布局：避免选择题导航、模式和账号挤在一行 */
.topbar-inner{max-width:1180px;height:auto;display:block;padding:0 18px}
.topbar-primary,.topbar-secondary{display:flex;align-items:center;width:100%;min-width:0}
.topbar-primary{min-height:52px;gap:12px}
.topbar-secondary{min-height:40px;gap:12px;border-top:1px solid var(--border)}
.topbar-spacer{flex:1;min-width:12px}
.topbar-secondary .nav-menu{min-width:0;overflow-x:auto;scrollbar-width:thin}
.topbar-secondary .mode-switch{margin-left:auto;flex:0 0 auto}
.recent-section-shortcut{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-4px 0 16px;padding:10px 14px;border:1px solid var(--primary);background:var(--primary-light);border-radius:10px;color:var(--primary);font-weight:600}
.section-return-highlight{animation:sectionReturnPulse 2.2s ease;border-color:var(--primary)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 18%,transparent)}
.quiz-end-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin-top:22px}
@keyframes sectionReturnPulse{0%,100%{background:var(--surface)}35%{background:var(--primary-light)}}
@media(max-width:760px){
  .topbar-inner{padding:0 10px}
  .topbar-primary{min-height:54px;gap:7px}
  .topbar-secondary{min-height:42px;overflow:hidden}
  .brand-text,.book-tag,.account-expiry,.mode-label{display:none!important}
  .brand{flex:0 0 auto}.product-switch{flex:0 0 auto}.topbar-spacer{min-width:0}
  .user-area{margin-left:auto}.user-summary{max-width:62px}.user-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .topbar-secondary .nav-menu{width:auto;flex:1;order:0;white-space:nowrap}
  .topbar-secondary .mode-switch{order:1;gap:3px}.mode-btn{padding:4px 7px;font-size:12px}.quiz-pref-toggle{padding:3px 5px;font-size:11px}
  .nav-item{flex:0 0 auto;padding:6px 10px}
  .recent-section-shortcut{align-items:flex-start;flex-direction:column}.recent-section-shortcut .btn{width:100%}
}
@media(max-width:420px){.switch-book-btn{padding:5px 7px;min-width:42px;font-size:0}.switch-book-btn::after{content:'换书';font-size:12px}.product-btn{padding:5px 8px}.logout-btn{padding:5px 7px}}

.math-expression {
  display: inline-flex;
  align-items: center;
  gap: 0.08em;
  max-width: 100%;
  margin: 0 0.08em;
  padding: 0 0.12em;
  color: inherit;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  font-size: 1.04em;
  line-height: 1.35;
  vertical-align: -0.08em;
  white-space: nowrap;
}

.math-display {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 10px auto;
  padding: 8px 12px;
  overflow-x: auto;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.math-expression sup,
.math-expression sub {
  font-size: 0.72em;
  line-height: 1;
}

.math-frac {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  min-width: 1.2em;
  text-align: center;
  vertical-align: middle;
}

.math-num {
  padding: 0 0.18em 0.08em;
  border-bottom: 1px solid currentColor;
}

.math-den { padding: 0.08em 0.18em 0; }
.math-sqrt { display: inline-flex; align-items: flex-start; }
.math-radical { font-size: 1.2em; line-height: 1; }
.math-radicand { padding: 0 0.12em; border-top: 1px solid currentColor; }
.math-text { font-family: inherit; font-style: normal; }
.math-underline { text-decoration: underline; text-underline-offset: 0.15em; }
.math-overline { text-decoration: overline; }
.math-underbrace { border-bottom: 1px solid currentColor; }
.math-circled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.82em;
}

.rich-heading {
  display: inline-block;
  margin: 6px 0 2px;
  color: var(--text);
  font-weight: 700;
}
.rich-heading-1,
.rich-heading-2 { font-size: 1.08em; }
.rich-heading-3,
.rich-heading-4 { font-size: 1em; }
.rich-heading-5,
.rich-heading-6 { font-size: 0.95em; }

/* ===== 2026-08-03 登录落地页升级 ===== */
body.auth-active {
  --auth-ink: #172033;
  --auth-muted: #667085;
  --auth-line: rgba(23, 32, 51, 0.10);
  --auth-blue: #246bfd;
  --auth-blue-deep: #1849c6;
  --auth-blue-soft: #edf4ff;
  background:
    radial-gradient(circle at 8% 10%, rgba(36, 107, 253, 0.08), transparent 24rem),
    linear-gradient(180deg, #fbfdff 0%, #f4f7fb 100%);
  color: var(--auth-ink);
}

.auth-active .topbar {
  position: relative;
  border-bottom-color: rgba(23, 32, 51, 0.08);
  box-shadow: none;
  background: rgba(251, 253, 255, 0.88);
  backdrop-filter: blur(14px);
}

.auth-active .topbar-inner {
  max-width: 1240px;
  padding: 0 28px;
}

.auth-active .topbar-primary {
  min-height: 68px;
}

.auth-active .topbar-primary::after {
  content: '高效备考，不止于刷题';
  margin-left: auto;
  color: #7b8498;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.auth-active .topbar-secondary { display: none; }
.auth-active .brand { cursor: default; gap: 10px; color: #172033; font-size: 18px; }
.auth-active .brand-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  background: #246bfd;
  box-shadow: 0 8px 22px rgba(36, 107, 253, 0.24);
}
.auth-active .brand-text { display: inline !important; }
.auth-active main { max-width: none; padding: 0; }
.auth-active .footer {
  border: 0;
  padding: 24px 20px 30px;
  background: transparent;
  color: #98a2b3;
}

.auth-page {
  position: relative;
  min-height: calc(100vh - 118px);
  padding: 54px 28px 68px;
  overflow: hidden;
}

.auth-page::before,
.auth-page::after {
  content: '';
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}

.auth-page::before {
  top: 70px;
  right: -170px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(36, 107, 253, 0.12);
  box-shadow: 0 0 0 70px rgba(36, 107, 253, 0.025), 0 0 0 140px rgba(36, 107, 253, 0.018);
}

.auth-page::after {
  bottom: 180px;
  left: -130px;
  width: 250px;
  height: 250px;
  background: rgba(128, 90, 213, 0.045);
  filter: blur(1px);
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: clamp(48px, 7vw, 104px);
  width: min(1180px, 100%);
  margin: 0 auto;
  align-items: start;
}

.auth-story { min-width: 0; padding-top: 12px; }
.auth-hero { max-width: 720px; }
.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: #246bfd;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.auth-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #246bfd;
  box-shadow: 0 0 0 5px rgba(36, 107, 253, 0.10);
}
.auth-hero-title {
  margin: 0;
  color: #172033;
  font-size: clamp(38px, 4.5vw, 60px);
  line-height: 1.14;
  letter-spacing: -0.055em;
  font-weight: 820;
}
.auth-hero-title span { color: #246bfd; }
.auth-hero-copy {
  max-width: 690px;
  margin-top: 23px;
  color: #667085;
  font-size: 16px;
  line-height: 1.95;
}

.auth-proof-row {
  display: flex;
  gap: 14px;
  margin-top: 29px;
  flex-wrap: wrap;
}
.auth-proof {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-right: 19px;
  border-right: 1px solid rgba(23, 32, 51, 0.12);
}
.auth-proof:last-child { border-right: 0; padding-right: 0; }
.auth-proof strong { color: #172033; font-size: 22px; line-height: 1; letter-spacing: -0.03em; }
.auth-proof span { color: #7b8498; font-size: 12px; }

.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 38px;
}
.auth-feature-card {
  display: flex;
  gap: 14px;
  min-height: 122px;
  padding: 20px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 36px rgba(23, 32, 51, 0.045);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 107, 253, 0.18);
  box-shadow: 0 16px 40px rgba(23, 32, 51, 0.075);
}
.auth-feature-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 800;
}
.auth-feature-icon.blue { color: #1f5ee8; background: #edf4ff; }
.auth-feature-icon.violet { color: #6941c6; background: #f4f0ff; }
.auth-feature-icon.amber { color: #b54708; background: #fff4e5; }
.auth-feature-icon.green { color: #087e5b; background: #e9f8f2; }
.auth-feature-card h3 { margin: 1px 0 6px; color: #263147; font-size: 15px; }
.auth-feature-card p { margin: 0; color: #7b8498; font-size: 12px; line-height: 1.75; }

.auth-flow {
  margin-top: 16px;
  padding: 20px 22px;
  border: 1px solid rgba(36, 107, 253, 0.12);
  border-radius: 17px;
  background: #edf4ff;
}
.auth-flow-title { margin-bottom: 15px; color: #1e3a69; font-size: 13px; font-weight: 700; }
.auth-flow-steps { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; }
.auth-flow-step { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; }
.auth-flow-step span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  color: #246bfd;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}
.auth-flow-step strong { color: #263147; font-size: 13px; line-height: 1.2; }
.auth-flow-step small { color: #7b8498; font-size: 10px; white-space: nowrap; }
.auth-flow-arrow { color: #9db8ef; font-size: 18px; }

.auth-author {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 51, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 42px rgba(23, 32, 51, 0.05);
}
.auth-author-heading {
  display: grid;
  grid-template-columns: 48px 122px 1fr;
  gap: 13px;
  align-items: center;
  padding: 19px 20px;
}
.auth-author-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: #fff;
  font-weight: 800;
  background: #172033;
}
.auth-author-name { display: flex; flex-direction: column; line-height: 1.25; }
.auth-author-name span { color: #98a2b3; font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; }
.auth-author-name strong { margin-top: 3px; color: #263147; font-size: 16px; }
.auth-author-name small { color: #246bfd; font-size: 11px; }
.auth-author-heading > p { color: #667085; font-size: 12px; line-height: 1.7; }
.auth-author-banner {
  display: block;
  width: 100%;
  aspect-ratio: 900 / 383;
  object-fit: cover;
  border-top: 1px solid rgba(23, 32, 51, 0.08);
  background: #192b86;
}
.auth-contact { border-top: 1px solid rgba(23, 32, 51, 0.08); }
.auth-contact summary {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  color: #344054;
}
.auth-contact summary::-webkit-details-marker { display: none; }
.auth-contact-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #087e5b;
  background: #e9f8f2;
  font-size: 18px;
  font-weight: 600;
}
.auth-contact summary > span:nth-child(2) { display: flex; flex-direction: column; }
.auth-contact summary strong { font-size: 13px; }
.auth-contact summary small { color: #98a2b3; font-size: 10px; }
.auth-contact-arrow { color: #98a2b3; transition: transform 0.2s ease; }
.auth-contact[open] .auth-contact-arrow { transform: rotate(180deg); }
.auth-contact-panel {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
  padding: 4px 18px 20px;
}
.auth-contact-panel img {
  width: 150px;
  height: 168px;
  object-fit: cover;
  object-position: center 58%;
  border-radius: 12px;
  border: 1px solid #e4e7ec;
}
.auth-contact-panel strong { color: #263147; font-size: 14px; }
.auth-contact-panel p { margin-top: 7px; color: #7b8498; font-size: 12px; line-height: 1.7; }

.auth-panel { position: sticky; top: 30px; }
.auth-card {
  width: 100%;
  padding: 30px;
  border: 1px solid rgba(23, 32, 51, 0.09);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 30px 80px rgba(32, 48, 80, 0.13), 0 2px 8px rgba(32, 48, 80, 0.04);
}
.auth-card-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 36px; }
.auth-card-logo {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  background: #246bfd;
  box-shadow: 0 8px 20px rgba(36, 107, 253, 0.22);
}
.auth-card-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.auth-card-brand strong { color: #172033; font-size: 16px; }
.auth-card-brand small { margin-top: 4px; color: #98a2b3; font-size: 10px; letter-spacing: 0.12em; }
.auth-card-copy { margin-bottom: 21px; }
.auth-title { margin: 0 0 8px; color: #172033; font-size: 27px; letter-spacing: -0.035em; }
.auth-subtitle { margin: 0; color: #7b8498; font-size: 12px; line-height: 1.8; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 21px;
  padding: 4px;
  border-radius: 11px;
  background: #f2f4f7;
}
.auth-tab {
  border: 0;
  border-radius: 8px;
  padding: 10px 8px;
  color: #7b8498;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.18s ease;
}
.auth-tab.active {
  color: #1849c6;
  border: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.08);
}
.auth-form { display: block; }
.auth-field { margin-bottom: 15px; }
.auth-field label { display: block; margin-bottom: 7px; color: #344054; font-size: 12px; font-weight: 650; }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-field .auth-input-wrap input {
  width: 100%;
  min-height: 46px;
  padding: 11px 52px 11px 45px;
  border: 1px solid #dfe3e9;
  border-radius: 11px;
  color: #172033;
  background: #fff;
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.auth-field .auth-input-wrap input::placeholder { color: #b0b7c3; }
.auth-field .auth-input-wrap input:focus {
  outline: 0;
  border-color: #6c9bff;
  box-shadow: 0 0 0 4px rgba(36, 107, 253, 0.10);
}
.auth-input-icon {
  position: absolute;
  left: 13px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  color: #667085;
  background: #f2f4f7;
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}
.auth-password-toggle {
  position: absolute;
  right: 10px;
  border: 0;
  padding: 5px;
  color: #667085;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: #246bfd;
  box-shadow: 0 11px 24px rgba(36, 107, 253, 0.23);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.auth-submit:hover { transform: translateY(-1px); background: #1849c6; box-shadow: 0 14px 28px rgba(36, 107, 253, 0.28); }
.auth-submit:disabled { transform: none; cursor: wait; opacity: 0.65; }
.auth-error {
  margin-bottom: 15px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #b42318;
  background: #fff1f1;
  font-size: 12px;
}
.auth-trust {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid #eef0f3;
  color: #667085;
  font-size: 10px;
  white-space: nowrap;
}
.auth-trust span::first-letter { color: #12a573; }
.auth-note { margin-top: 13px; color: #98a2b3; font-size: 10px; line-height: 1.7; }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) 370px; gap: 34px; }
  .auth-hero-title { font-size: 42px; }
  .auth-author-heading { grid-template-columns: 48px 1fr; }
  .auth-author-heading > p { grid-column: 1 / -1; }
  .auth-flow-step small { white-space: normal; }
}

@media (max-width: 820px) {
  .auth-active .topbar-inner { padding: 0 18px; }
  .auth-active .topbar-primary::after { display: block; }
  .auth-page { padding: 32px 18px 52px; }
  .auth-shell { grid-template-columns: 1fr; gap: 30px; }
  .auth-panel { position: static; grid-row: 1; }
  .auth-card { width: min(480px, 100%); margin: 0 auto; }
  .auth-story { grid-row: 2; padding-top: 0; }
  .auth-hero { text-align: center; margin: 0 auto; }
  .auth-eyebrow { justify-content: center; }
  .auth-proof-row { justify-content: center; }
  .auth-feature-card { text-align: left; }
}

@media (max-width: 560px) {
  .auth-active .topbar-primary { min-height: 58px; }
  .auth-active .topbar-primary::after { content: '高效备考'; font-size: 11px; }
  .auth-page { min-height: calc(100vh - 100px); padding: 22px 12px 40px; }
  .auth-card { padding: 23px 19px; border-radius: 18px; }
  .auth-card-brand { margin-bottom: 26px; }
  .auth-title { font-size: 24px; }
  .auth-trust { flex-wrap: wrap; justify-content: flex-start; gap: 7px 13px; }
  .auth-hero-title { font-size: 34px; line-height: 1.2; }
  .auth-hero-copy { font-size: 14px; line-height: 1.8; }
  .auth-proof-row { gap: 10px; }
  .auth-proof { padding-right: 10px; gap: 5px; }
  .auth-proof strong { font-size: 18px; }
  .auth-proof span { font-size: 10px; }
  .auth-feature-grid { grid-template-columns: 1fr; }
  .auth-feature-card { min-height: 0; }
  .auth-flow-steps { grid-template-columns: 1fr; }
  .auth-flow-arrow { display: none; }
  .auth-flow-step { grid-template-columns: 31px 1fr; }
  .auth-author-heading { grid-template-columns: 44px 1fr; padding: 16px; }
  .auth-author-avatar { width: 44px; height: 44px; }
  .auth-author-heading > p { grid-column: 1 / -1; }
  .auth-contact-panel { grid-template-columns: 118px 1fr; padding: 4px 14px 16px; }
  .auth-contact-panel img { width: 118px; height: 138px; }
  .auth-active .footer { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-feature-card,
  .auth-submit,
  .auth-contact-arrow { transition: none; }
}

/* ===== 2026-08-03 登录页布局微调：紧凑顶部、下方通栏 ===== */
.auth-active .topbar-inner { max-width: 1240px; padding: 0 24px; }
.auth-active .topbar-primary { min-height: 56px; }
.auth-active .brand-logo { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
.auth-page { padding-top: 22px; }
.auth-shell { align-items: start; row-gap: 18px; }
.auth-story { display: contents; }
.auth-hero { grid-column: 1; grid-row: 1; padding-top: 2px; align-self: center; }
.auth-panel { grid-column: 2; grid-row: 1; top: 18px; }
.auth-feature-grid { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 2px; }
.auth-flow { grid-column: 1 / -1; grid-row: 3; margin-top: 0; }
.auth-author {
  grid-column: 1 / -1;
  grid-row: 4;
  display: grid;
  grid-template-columns: minmax(330px, 0.75fr) minmax(0, 1.25fr);
  grid-template-rows: auto 1fr;
  margin-top: 0;
}
.auth-author-heading { grid-column: 1; grid-row: 1; grid-template-columns: 48px 122px; align-content: start; }
.auth-author-heading > p { grid-column: 1 / -1; margin-top: 2px; }
.auth-author-banner {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 100%;
  height: 100%;
  min-height: 265px;
  border-top: 0;
  border-left: 1px solid rgba(23, 32, 51, 0.08);
  object-fit: cover;
}
.auth-contact { grid-column: 1; grid-row: 2; align-self: end; }
.auth-contact-panel { grid-template-columns: 122px 1fr; }
.auth-contact-panel img { width: 122px; height: 142px; }

@media (max-width: 980px) {
  .auth-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-author { grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr); }
}

@media (max-width: 820px) {
  .auth-active .topbar-primary { min-height: 54px; }
  .auth-page { padding-top: 16px; }
  .auth-shell { display: grid; grid-template-columns: 1fr; gap: 24px; }
  .auth-story { display: contents; }
  .auth-panel { grid-column: 1; grid-row: 1; }
  .auth-hero { grid-column: 1; grid-row: 2; }
  .auth-feature-grid { grid-column: 1; grid-row: 3; }
  .auth-flow { grid-column: 1; grid-row: 4; }
  .auth-author { grid-column: 1; grid-row: 5; }
}

@media (max-width: 680px) {
  .auth-feature-grid { grid-template-columns: 1fr; }
  .auth-author { display: block; }
  .auth-author-banner { width: 100%; min-height: 0; height: auto; border-left: 0; border-top: 1px solid rgba(23, 32, 51, 0.08); }
}

/* ===== 2026-08-03 作者通栏海报 v2 ===== */
.auth-author { display: block; border-radius: 20px; background: #061733; }
.auth-author-heading,
.auth-contact { display: none; }
.auth-author-banner {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1672 / 750;
  border: 0;
  object-fit: contain;
  background: #061733;
}
@media (max-width: 680px) {
  .auth-author { border-radius: 14px; }
  .auth-author-banner { aspect-ratio: 1672 / 750; }
}
.auth-author-link { display: block; cursor: zoom-in; }
.auth-author-link:focus-visible { outline: 3px solid #6c9bff; outline-offset: 3px; border-radius: 20px; }

/* ===== 2026-08-03 作者横幅 v3：3:1 低高度 ===== */
.auth-author-banner { aspect-ratio: 2172 / 724; }
@media (max-width: 680px) {
  .auth-author-banner { aspect-ratio: 2172 / 724; }
}


/* ===== PDF题库定制服务 ===== */
.library-custom-service { align-items: stretch; border-color: rgba(124,58,237,.23); background: linear-gradient(135deg, rgba(124,58,237,.09), rgba(37,99,235,.07)); }
.library-custom-service .library-coming-icon { flex-basis: 52px; width: 52px; height: 52px; font-size: 14px; font-weight: 900; letter-spacing: -.02em; }
.library-custom-service .library-coming-title strong { color: #dc2626; font-size: 22px; }
.library-service-points { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.library-service-points span { padding: 4px 8px; border-radius: 999px; color: #4338ca; background: rgba(255,255,255,.72); border: 1px solid rgba(99,102,241,.14); font-size: 11px; font-weight: 700; }
.library-service-contact { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.library-service-contact img { width: 76px; height: 96px; object-fit: cover; object-position: center 73%; border: 5px solid #fff; border-radius: 10px; box-shadow: 0 6px 16px rgba(15,23,42,.12); }
@media (max-width: 700px) {
  .library-custom-service { flex-direction: column; }
  .library-service-contact { justify-content: space-between; width: 100%; }
  .library-custom-service .library-coming-badge { display: inline-flex; }
}


/* ===== Announcement ===== */
.announcement-btn {
  position: relative;
  flex: 0 0 auto;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--primary);
  background: var(--primary-light);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.announcement-btn:hover { transform: translateY(-1px); border-color: var(--primary); background: var(--surface); }
.announcement-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow-y: auto;
  background: rgba(15, 23, 42, .68);
  backdrop-filter: blur(5px);
}
.announcement-dialog {
  width: min(720px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .38);
}
.announcement-hero {
  position: relative;
  padding: 28px 30px 24px;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 52%, #7c3aed 100%);
}
.announcement-kicker { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.82); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.announcement-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgba(255,255,255,.15); font-size: 16px; }
.announcement-close { position: absolute; top: 18px; right: 20px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.14); font-size: 24px; line-height: 1; cursor: pointer; }
.announcement-close:hover { background: rgba(255,255,255,.25); }
.announcement-title { margin: 18px 0 8px; color: #fff; font-size: 28px; line-height: 1.25; }
.announcement-summary { max-width: 600px; margin: 0; color: rgba(255,255,255,.86); font-size: 14px; line-height: 1.75; }
.announcement-history { display: flex; gap: 8px; padding: 16px 30px 0; overflow-x: auto; }
.announcement-history-item { flex: 0 0 auto; max-width: 280px; overflow: hidden; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); background: var(--surface); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.announcement-history-item:hover { border-color: var(--primary); color: var(--primary); }
.announcement-history-item.active { border-color: var(--primary); color: #fff; background: var(--primary); }
.announcement-content { display: grid; grid-template-columns: 1.3fr .9fr; gap: 18px; padding: 24px 30px 8px; }
.announcement-section { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-2); }
.announcement-section-title { margin: 0 0 12px; color: var(--text); font-size: 16px; }
.announcement-section-1 .announcement-section-title { color: #5b21b6; }
.announcement-section-2 .announcement-section-title { color: #047857; }
.announcement-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.announcement-list li { position: relative; padding-left: 18px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.announcement-list li::before { content: '\2713'; position: absolute; left: 0; top: .04em; color: var(--success); font-weight: 800; }
.announcement-section-1 .announcement-list li::before { content: '\ff0b'; color: #7c3aed; }
.announcement-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 30px 26px; }
.announcement-tip { color: var(--text-muted); font-size: 12px; }
.announcement-confirm { min-width: 112px; }

@media (max-width: 760px) {
  .announcement-btn { padding: 5px 8px; font-size: 0; }
  .announcement-btn::after { content: '\516c\544a'; font-size: 12px; }
  .announcement-overlay { align-items: start; padding: 12px; }
  .announcement-dialog { max-height: calc(100vh - 24px); border-radius: 17px; }
  .announcement-hero { padding: 24px 20px 20px; }
  .announcement-title { font-size: 23px; }
  .announcement-history { padding: 14px 18px 0; }
  .announcement-content { grid-template-columns: 1fr; padding: 18px 18px 4px; }
  .announcement-section { padding: 15px; }
  .announcement-actions { align-items: stretch; flex-direction: column; padding: 16px 18px 20px; }
  .announcement-confirm { width: 100%; }
}
