/* ═══════════════════════════════════════════════
   在线刷题系统 — 响应式样式（移动端 + 桌面端）
   ═══════════════════════════════════════════════ */

:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
}

/* ── 通用按钮 ── */
.btn-primary, .btn-secondary, .btn-submit, .btn-large {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
.btn-submit { background: var(--danger); color: #fff; }
.btn-submit:hover { background: #b91c1c; }
.btn-large { padding: 14px 32px; font-size: 16px; width: 100%; }

.btn-confirm {
  display: block; margin: 16px auto 0; padding: 10px 28px;
  background: var(--primary); color: #fff; border: none;
  border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s ease;
}
.btn-confirm:hover { background: var(--primary-dark); }

.back-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 15px; cursor: pointer; padding: 4px 0;
}
.back-btn:hover { color: var(--primary); }

.section-title {
  font-size: 18px; font-weight: 700; margin: 24px 0 12px;
  padding-left: 10px; border-left: 4px solid var(--primary);
}

/* ── 首页 ── */
.home-screen { padding-bottom: 40px; }
.home-hero {
  text-align: center; padding: 40px 0 28px;
}
.home-hero h1 { font-size: 28px; color: var(--text); }
.home-hero p { color: var(--text-muted); margin-top: 8px; }

.bank-list { display: flex; flex-direction: column; gap: 12px; }
.bank-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px; cursor: pointer; box-shadow: var(--shadow);
  transition: all .2s ease; border: 2px solid transparent;
}
.bank-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.bank-icon { font-size: 36px; }
.bank-info h3 { font-size: 18px; margin-bottom: 4px; }
.bank-info p { font-size: 14px; color: var(--text-muted); }

.arch-note {
  margin-top: 28px; padding: 16px; background: #eef2ff;
  border-radius: 8px; font-size: 13px; color: var(--text-muted);
  border-left: 4px solid var(--primary);
}
.arch-note code {
  background: #ddd6fe; padding: 2px 6px; border-radius: 4px;
  font-size: 12px; color: var(--primary-dark);
}

/* ── 题库详情页 ── */
.bank-header { text-align: center; padding: 20px 0; }
.bank-header h1 { font-size: 24px; }
.bank-header p { color: var(--text-muted); font-size: 14px; margin-top: 8px; }
.bank-meta { margin-top: 8px; font-size: 13px; color: var(--text-muted); }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.mode-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 24px 20px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow); transition: all .2s ease;
  border: 2px solid transparent;
}
.mode-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.mode-icon { font-size: 40px; margin-bottom: 12px; }
.mode-card h3 { font-size: 17px; margin-bottom: 6px; }
.mode-card p { font-size: 13px; color: var(--text-muted); }

/* ── 考试设置 ── */
.exam-config {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-top: 16px;
}
.exam-controls {
  display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0;
}
.exam-controls label {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.exam-controls input {
  width: 70px; padding: 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; text-align: center;
}

/* ── 题型筛选 ── */
.type-toggle-group { display: flex; flex-wrap: wrap; gap: 10px; }
.type-toggle {
  display: flex; align-items: center; gap: 6px;
  background: var(--card-bg); padding: 8px 14px; border-radius: 8px;
  cursor: pointer; font-size: 14px; box-shadow: var(--shadow);
  border: 2px solid transparent; transition: all .15s ease;
}
.type-toggle:hover { border-color: var(--primary-light); }
.type-toggle input { accent-color: var(--primary); }
.type-toggle em { font-style: normal; color: var(--text-muted); font-size: 12px; }

/* ── 答题界面 ── */
.quiz-screen { display: flex; flex-direction: column; min-height: 100vh; }

.quiz-topbar {
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; background: var(--bg);
  padding: 8px 0; z-index: 10;
}
.quiz-progress-bar {
  flex: 1; height: 8px; background: var(--border);
  border-radius: 4px; overflow: hidden;
}
.quiz-progress-fill {
  height: 100%; background: var(--primary);
  border-radius: 4px; transition: width .3s ease;
}
.timer {
  font-weight: 700; font-size: 18px; color: var(--primary);
  font-variant-numeric: tabular-nums; min-width: 56px; text-align: right;
}
.timer-warning { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.answered-count { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

/* ── 顶栏开关组（自动下一题 / 选项乱序） ── */
.quiz-toggles {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.toggle-switch {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  user-select: none;
}
.toggle-switch input { display: none; }
.switch-track {
  position: relative; width: 32px; height: 18px; border-radius: 9px;
  background: var(--border); transition: background .2s ease;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .switch-track { background: var(--primary); }
.toggle-switch input:checked + .switch-track .switch-thumb { transform: translateX(14px); }
.switch-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.toggle-switch input:checked ~ .switch-label { color: var(--primary); }

/* ── 题目卡片 ── */
.question-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 24px; margin: 16px 0; box-shadow: var(--shadow);
  flex: 1;
}
.question-card.is-correct { border: 2px solid var(--success); }
.question-card.is-wrong { border: 2px solid var(--danger); }

.question-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.question-index { font-size: 14px; color: var(--text-muted); font-weight: 600; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-single { background: #dbeafe; color: #1e40af; }
.badge-multiple { background: #fce7f3; color: #9d174d; }
.badge-judge { background: #fef3c7; color: #92400e; }
.badge-fill { background: #d1fae5; color: #065f46; }
.badge-short { background: #ede9fe; color: #5b21b6; }

.question-text { font-size: 17px; font-weight: 600; margin-bottom: 20px; line-height: 1.7; }
.hint { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

/* ── 选项 ── */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 10px;
  border: 2px solid var(--border); cursor: pointer;
  transition: all .15s ease; background: var(--bg);
}
.option:hover { border-color: var(--primary-light); background: #eef2ff; }
.option-selected { border-color: var(--primary); background: #eef2ff; }
.option-correct { border-color: var(--success); background: var(--success-light); }
.option-wrong { border-color: var(--danger); background: var(--danger-light); }
.option-key {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--card-bg); border: 1px solid var(--border);
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.option-selected .option-key { background: var(--primary); color: #fff; border-color: var(--primary); }
.option-correct .option-key { background: var(--success); color: #fff; border-color: var(--success); }
.option-wrong .option-key { background: var(--danger); color: #fff; border-color: var(--danger); }
.option-key-check { border: none; background: none; font-size: 18px; }
.option-text { flex: 1; padding-top: 3px; }

/* ── 判断题 ── */
.judge-group { display: flex; gap: 16px; }
.judge-btn {
  flex: 1; padding: 20px; border-radius: 10px; border: 2px solid var(--border);
  font-size: 16px; font-weight: 600; cursor: pointer; background: var(--bg);
  transition: all .15s ease;
}
.judge-btn:hover { border-color: var(--primary-light); background: #eef2ff; }
.judge-btn.is-selected { border-color: var(--primary); background: #eef2ff; color: var(--primary); }
.judge-btn.is-correct { border-color: var(--success); background: var(--success-light); color: var(--success); }
.judge-btn.is-wrong { border-color: var(--danger); background: var(--danger-light); color: var(--danger); }

/* ── 填空题 ── */
.fill-group { margin-top: 8px; }
.fill-input {
  width: 100%; padding: 14px; font-size: 16px;
  border: 2px solid var(--border); border-radius: 10px;
  transition: border-color .15s ease;
}
.fill-input:focus { outline: none; border-color: var(--primary); }
.fill-input.is-correct { border-color: var(--success); background: var(--success-light); }
.fill-input.is-wrong { border-color: var(--danger); background: var(--danger-light); }

/* ── 简答题 ── */
.short-group { margin-top: 8px; }
.short-input {
  width: 100%; min-height: 120px; padding: 14px; font-size: 15px;
  border: 2px solid var(--border); border-radius: 10px; resize: vertical;
  font-family: inherit; transition: border-color .15s ease;
}
.short-input:focus { outline: none; border-color: var(--primary); }
.short-answer {
  margin-top: 16px; padding: 14px; background: #f0fdf4;
  border-radius: 8px; border-left: 4px solid var(--success);
  font-size: 14px; line-height: 1.8;
}

/* ── 答案反馈 ── */
.feedback {
  margin-top: 16px; padding: 12px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
}
.feedback-correct { background: var(--success-light); color: var(--success); }
.feedback-wrong { background: var(--danger-light); color: var(--danger); }
.feedback-pending { background: #fef3c7; color: var(--warning); }

/* ── 底部导航 ── */
.quiz-nav {
  display: flex; gap: 10px; padding: 16px 0; justify-content: space-between;
  position: sticky; bottom: 0; background: var(--bg);
}
.quiz-nav .btn-secondary { flex: 0 0 auto; }
.quiz-nav .btn-primary, .quiz-nav .btn-submit { flex: 1; }

/* ── 答题卡 ── */
.nav-title { font-weight: 700; flex: 1; text-align: center; }
.nav-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 10px; margin: 16px 0;
}
.nav-cell {
  display: flex; align-items: center; justify-content: center;
  height: 44px; border-radius: 8px; font-weight: 600; font-size: 15px;
  background: var(--card-bg); border: 2px solid var(--border); cursor: pointer;
  transition: all .15s ease;
}
.nav-cell:hover { border-color: var(--primary-light); }
.nav-answered { background: #eef2ff; border-color: var(--primary-light); color: var(--primary); }
.nav-current { background: var(--primary); color: #fff; border-color: var(--primary); }
.nav-legend {
  display: flex; gap: 20px; justify-content: center;
  font-size: 13px; color: var(--text-muted); margin-bottom: 16px;
}
.dot {
  display: inline-block; width: 14px; height: 14px; border-radius: 4px;
  margin-right: 4px; vertical-align: middle;
}
.dot-current { background: var(--primary); }
.dot-answered { background: #eef2ff; border: 1px solid var(--primary-light); }
.dot-unanswered { background: var(--card-bg); border: 1px solid var(--border); }

/* ── 结果页 ── */
.results-screen { padding-bottom: 40px; }
.results-hero {
  text-align: center; padding: 36px 20px; border-radius: var(--radius);
  margin-bottom: 20px; color: #fff;
}
.results-hero.pass { background: linear-gradient(135deg, #16a34a, #15803d); }
.results-hero.fail { background: linear-gradient(135deg, #dc2626, #991b1b); }
.results-hero.practice { background: linear-gradient(135deg, #4f46e5, #3730a3); }
.results-score { font-size: 48px; font-weight: 800; }
.results-pass { font-size: 18px; margin-top: 8px; }
.results-time { font-size: 14px; margin-top: 8px; opacity: .9; }

.results-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.summary-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 16px; text-align: center; box-shadow: var(--shadow);
}
.summary-num { font-size: 28px; font-weight: 800; }
.summary-num.correct { color: var(--success); }
.summary-num.wrong { color: var(--danger); }
.summary-num.blank { color: var(--text-muted); }
.summary-num.pending { color: var(--warning); }
.summary-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.type-stats {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.stat-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.stat-row:last-child { border-bottom: none; }
.stat-type { width: 70px; font-weight: 600; flex-shrink: 0; }
.stat-bar {
  flex: 1; height: 8px; background: var(--border);
  border-radius: 4px; overflow: hidden;
}
.stat-bar i {
  display: block; height: 100%; background: var(--primary);
  border-radius: 4px; transition: width .5s ease;
}
.stat-rate { width: 110px; text-align: right; color: var(--text-muted); flex-shrink: 0; }

/* ── 错题回顾 ── */
.no-wrong {
  text-align: center; padding: 32px; font-size: 18px;
  background: var(--success-light); border-radius: var(--radius);
  color: var(--success); font-weight: 600;
}
.review-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px; margin-bottom: 12px; box-shadow: var(--shadow);
  border-left: 4px solid var(--danger);
}
.review-header { margin-bottom: 12px; }
.review-question { font-size: 15px; font-weight: 600; margin-bottom: 12px; line-height: 1.6; }
.review-option { padding: 6px 10px; border-radius: 6px; margin: 4px 0; font-size: 14px; }
.review-correct { background: var(--success-light); }
.review-wrong { background: var(--danger-light); }
.review-answers {
  margin-top: 12px; padding: 12px; background: var(--bg);
  border-radius: 8px; font-size: 14px;
}
.review-your { margin-bottom: 6px; }
.wrong-text { color: var(--danger); font-weight: 600; }
.correct-text { color: var(--success); font-weight: 600; }
.review-analysis {
  margin-top: 10px; padding: 10px; background: #fef9c3;
  border-radius: 6px; font-size: 13px; color: #713f12;
}

.results-actions {
  display: flex; gap: 12px; margin-top: 28px;
}
.results-actions button { flex: 1; }

/* ── 错误页 ── */
.error-screen {
  text-align: center; padding: 60px 20px;
}
.error-screen h2 { color: var(--danger); margin-bottom: 12px; }
.error-screen p { color: var(--text-muted); margin-bottom: 8px; }

/* ════════════ 移动端适配 ════════════ */
@media (max-width: 480px) {
  #app { padding: 12px; }
  .home-hero h1 { font-size: 22px; }
  .question-text { font-size: 15px; }
  .question-card { padding: 16px; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { padding: 18px; }
  .judge-group { flex-direction: column; }
  .exam-controls { flex-direction: column; gap: 10px; }
  .quiz-nav { flex-wrap: wrap; }
  .quiz-nav .btn-secondary { flex: 1; }
  .results-actions { flex-direction: column; }
  .results-score { font-size: 36px; }
  .stat-type { width: 56px; font-size: 13px; }
  .stat-rate { width: 90px; font-size: 12px; }
  .nav-grid { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
  .nav-cell { height: 38px; font-size: 14px; }
  .switch-label { display: none; } /* 极窄屏隐藏开关文字，仅保留滑块 */
  .quiz-toggles { gap: 8px; }
}

/* ════════════ 桌面端增强 ════════════ */
@media (min-width: 769px) {
  #app { padding: 24px; }
  .home-hero { padding: 56px 0 36px; }
  .home-hero h1 { font-size: 32px; }
  .question-card { padding: 32px; }
  .mode-card { padding: 32px 24px; }
}

/* ── 滚动条美化 ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════
   AI 智能解析模块
   ═══════════════════════════════════════════════ */

/* ── 首页设置按钮 ── */
.home-topbar {
  display: flex; justify-content: flex-end;
  padding: 4px 0;
}
.settings-btn {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 16px; font-size: 14px;
  cursor: pointer; box-shadow: var(--shadow); transition: all .15s ease;
}
.settings-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── AI 解析按钮 ── */
.ai-section { margin-top: 16px; }
.ai-section-review { margin-top: 12px; }

.btn-ai {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 100%; padding: 14px; border: 2px dashed var(--primary-light);
  border-radius: 10px; background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  color: var(--primary); font-size: 16px; font-weight: 700; cursor: pointer;
  transition: all .2s ease;
}
.btn-ai:hover {
  border-style: solid; background: linear-gradient(135deg, #e0e7ff, #ede9fe);
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.15);
}
.btn-ai .ai-icon { font-size: 20px; }
.btn-ai .ai-sub { font-size: 12px; font-weight: 400; color: var(--text-muted); }

.btn-ai-sm {
  flex-direction: row; width: auto; padding: 8px 18px;
  font-size: 14px; gap: 6px;
}

/* ── AI 加载动画 ── */
.ai-loading {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 24px; color: var(--primary); font-size: 15px;
}
.ai-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  animation: ai-bounce 1.2s infinite ease-in-out;
}
.ai-dot:nth-child(2) { animation-delay: .15s; }
.ai-dot:nth-child(3) { animation-delay: .3s; }
@keyframes ai-bounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── AI 内容区域 ── */
.ai-content {
  margin-top: 12px; padding: 20px; border-radius: 12px;
  background: linear-gradient(135deg, #fafaff, #f5f3ff);
  border: 1px solid #e0e7ff; font-size: 14px; line-height: 1.8;
  animation: ai-fade-in .3s ease;
}
@keyframes ai-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-error {
  padding: 12px 16px; background: var(--danger-light); border-radius: 8px;
  color: var(--danger); font-size: 14px; margin-bottom: 8px;
}
.btn-ai-retry {
  padding: 8px 20px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.btn-ai-retry:hover { background: var(--primary-dark); }

/* ── Markdown 渲染样式 ── */
.ai-content .md-h3 { font-size: 16px; font-weight: 700; margin: 16px 0 8px; color: var(--primary-dark); }
.ai-content .md-h4 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; color: var(--primary); }
.ai-content .md-h4:first-child { margin-top: 0; }
.ai-content .md-p { margin: 8px 0; color: var(--text); }
.ai-content .md-list { margin: 8px 0; padding-left: 20px; list-style: disc; }
.ai-content .md-list li { margin: 4px 0; color: var(--text); }
.ai-content .md-quote {
  margin: 10px 0; padding: 8px 14px; background: #fef9c3;
  border-left: 4px solid var(--warning); border-radius: 6px;
  color: #713f12; font-size: 13px;
}
.ai-content .md-code {
  background: #1e293b; color: #e2e8f0; padding: 12px;
  border-radius: 8px; overflow-x: auto; font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace; margin: 8px 0;
}
.ai-content .md-inline-code {
  background: #e0e7ff; padding: 2px 6px; border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px;
  color: var(--primary-dark);
}
.ai-content strong { color: var(--primary-dark); font-weight: 700; }

/* ── 设置弹窗 ── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; animation: modal-fade .2s ease;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--card-bg); border-radius: 16px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: modal-slide .25s ease;
}
@keyframes modal-slide {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; }
.modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--text-muted); padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 20px 24px; }
.modal-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }

.form-row { margin-bottom: 14px; }
.form-row label {
  display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text);
}
.form-row input, .form-row select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; transition: border-color .15s ease;
}
.form-row input:focus, .form-row select:focus {
  outline: none; border-color: var(--primary);
}

.modal-status {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  background: var(--bg); font-size: 13px; color: var(--text-muted);
}
.modal-status.status-ok {
  background: var(--success-light); color: var(--success); font-weight: 600;
}

.modal-footer {
  display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border);
}
.modal-footer button { flex: 1; }

/* ── 移动端 AI 适配 ── */
@media (max-width: 480px) {
  .btn-ai { padding: 12px; font-size: 15px; }
  .ai-content { padding: 16px; font-size: 13px; }
  .ai-content .md-h3 { font-size: 15px; }
  .ai-content .md-h4 { font-size: 14px; }
  .modal-box { border-radius: 12px; }
  .modal-header, .modal-body, .modal-footer { padding-left: 16px; padding-right: 16px; }
}

/* ═══════════════════════════════════════════════
   页脚备案号（固定底部居中）
   ═══════════════════════════════════════════════ */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  font-size: 12px;
  z-index: 50;
}
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s ease;
}
.site-footer a:hover { color: var(--primary); text-decoration: underline; }

/* 主内容区域底部留白，避免页脚遮挡内容 */
#app { padding-bottom: 40px; }
