/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f0f2f5; --surface: #ffffff; --surface-hover: #f8f9fb; --surface-2: #f1f5f9;
  --text: #1e293b; --text-secondary: #64748b; --text-muted: #94a3b8;
  --border: #e2e8f0; --border-light: #f1f5f9;
  --primary: #1e3a5f; --primary-light: #3b82f6; --primary-bg: #dbeafe;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.05);
  --radius: 14px; --radius-sm: 8px; --radius-xs: 6px;
  --header-grad: linear-gradient(135deg, #1a3a6c 0%, #2d5aa0 50%, #1e3a5f 100%);
}
[data-theme="dark"] {
  --bg: #0f172a; --surface: #1e293b; --surface-hover: #334155; --surface-2: #334155;
  --text: #f1f5f9; --text-secondary: #94a3b8; --text-muted: #64748b;
  --border: #334155; --border-light: #1e293b;
  --primary: #60a5fa; --primary-light: #93c5fd; --primary-bg: #1e3a5f;
  --shadow: 0 1px 3px rgba(0,0,0,0.3); --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.75; padding: 0;
  transition: background 0.3s, color 0.3s;
}
/* === Header === */
.header {
  background: var(--header-grad); color: #fff; padding: 40px 20px 32px;
  text-align: center; position: relative; overflow: hidden;
}
.header-content { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; }
.header h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; letter-spacing: 1px; }
.header h1 .emoji { font-size: 30px; }
.header .subtitle { font-size: 14px; opacity: 0.85; margin-bottom: 14px; }
.cover-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; object-position: 50% 10%; border: 3px solid rgba(255,255,255,0.3); box-shadow: 0 4px 12px rgba(0,0,0,0.25); margin-bottom: 12px; }
.footer-logo { height: 22px; vertical-align: middle; margin: 0 6px 4px; border-radius: 4px; }
.footer-version { font-size: 11px; opacity: 0.7; margin-top: 4px; }
.stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; align-items: center; }
.stat-card {
  background: rgba(255,255,255,0.12); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-sm);
  padding: 12px 20px; min-width: 90px; text-align: center;
}
.stat-num { font-size: 28px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 11px; opacity: 0.8; margin-top: 2px; }

/* 进度大盘样式 */
.progress-container {
  background: rgba(255,255,255,0.12); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius-sm);
  padding: 12px 20px; min-width: 200px; display: flex; flex-direction: column; justify-content: center; text-align: left;
}
.progress-text { font-size: 12px; color: rgba(255,255,255,0.9); margin-bottom: 6px; font-weight: 600; display: flex; justify-content: space-between;}
.progress-bar-bg { width: 100%; height: 8px; background: rgba(255,255,255,0.2); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { width: 0%; height: 100%; background: #4ade80; transition: width 0.3s ease; }

.theme-toggle {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.25); transform: scale(1.1); }

/* 模式切换 tab */
.mode-tabs { display: inline-flex; gap: 8px; margin-bottom: 14px; background: rgba(255,255,255,0.12); padding: 4px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.2); }
.mode-tab { padding: 7px 22px; border-radius: 999px; border: none; background: transparent; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; }
.mode-tab.active { background: #fff; color: var(--primary); }
[data-theme="dark"] .mode-tab.active { color: var(--bg); }

/* === Toolbar === */
.toolbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 16px; box-shadow: var(--shadow);
  transition: background 0.3s, border-color 0.3s;
}
.toolbar-inner { max-width: 860px; margin: 0 auto; }
.search-wrap { position: relative; margin-bottom: 10px; }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 16px; pointer-events: none;
}
.search-input {
  width: 100%; padding: 11px 14px 11px 42px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-size: 14px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.3s;
}
.search-input:focus {
  border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  background: var(--surface);
}
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.filter-row .filter-btns { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; flex: 1; }
.filter-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; margin-right: 2px; min-width: 42px; flex-shrink: 0; }
.btn {
  padding: 6px 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); border-radius: 20px; cursor: pointer;
  font-size: 12px; font-weight: 500; transition: all 0.15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary-light); color: var(--primary-light); background: var(--surface-hover); }
.btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
[data-theme="dark"] .btn.active { background: var(--primary-light); border-color: var(--primary-light); color: var(--bg); }
.action-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.action-btn {
  padding: 7px 14px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-secondary); border-radius: var(--radius-xs); cursor: pointer;
  font-size: 12px; font-weight: 500; transition: all 0.15s;
}
.action-btn:hover { background: var(--surface-hover); color: var(--primary); border-color: var(--primary-light); }
.download-offline-btn { background: var(--primary-bg); color: var(--primary-light); border-color: var(--primary-light); font-weight: bold; }
.download-offline-btn:hover { background: var(--primary); color: #fff; }
.exam-enter-btn { background: linear-gradient(135deg,#2563eb,#3b82f6); color:#fff; border-color: transparent; font-weight:700; padding:8px 18px; box-shadow:0 2px 10px rgba(37,99,235,.32); }
.exam-enter-btn:hover { color:#fff; background: linear-gradient(135deg,#1d4ed8,#2563eb); border-color: transparent; box-shadow:0 4px 14px rgba(37,99,235,.42); }
.result-count { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.result-count strong { color: var(--primary); font-weight: 700; }
[data-theme="dark"] .result-count strong { color: var(--primary-light); }
/* === Main === */
.main { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }
.year-section { margin-bottom: 24px; }
.year-title {
  font-size: 18px; font-weight: 700; color: var(--primary);
  padding: 8px 0 12px; border-bottom: 2px solid var(--primary);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .year-title { color: var(--primary-light); border-bottom-color: var(--primary-light); }
.year-count {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: var(--surface-2); padding: 2px 10px; border-radius: 12px;
}
/* === Card === */
.card {
  background: var(--surface); border-radius: var(--radius); margin-bottom: 12px;
  box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s; border: 1px solid var(--border-light);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 16px 18px; cursor: pointer; display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px; transition: background 0.15s;
}
.card-header:hover { background: var(--surface-hover); }
.card-left { flex: 1; min-width: 0; }
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.badge {
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px; line-height: 1.4;
}
.badge-type-zhfx { background: #dbeafe; color: #2563eb; }
.badge-type-yjyb { background: #fee2e2; color: #dc2626; }
.badge-type-zzgl { background: #dcfce7; color: #16a34a; }
.badge-type-zwrz { background: #ede9fe; color: #7c3aed; }
.badge-type-rjgt { background: #cffafe; color: #0891b2; }
[data-theme="dark"] .badge-type-zhfx { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .badge-type-yjyb { background: #3b1414; color: #fca5a5; }
[data-theme="dark"] .badge-type-zzgl { background: #14241a; color: #86efac; }
[data-theme="dark"] .badge-type-zwrz { background: #2d1b4e; color: #c4b5fd; }
[data-theme="dark"] .badge-type-rjgt { background: #0c2730; color: #67e8f9; }
.badge-year { background: var(--surface-2); color: var(--text-secondary); }
.badge-session { background: var(--surface-2); color: var(--text-muted); font-weight: 500; font-size: 10px; }
.tag-badge { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; }
.tag-gp { background: #fee2e2; color: #dc2626; }
.tag-sz { background: #dbeafe; color: #2563eb; }
.tag-rd { background: #ffedd5; color: #ea580c; }
.tag-bs { background: #ffe4e6; color: #be123c; }
[data-theme="dark"] .tag-gp { background: #3b1414; color: #fca5a5; }
[data-theme="dark"] .tag-sz { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .tag-rd { background: #3b2410; color: #fdba74; }
[data-theme="dark"] .tag-bs { background: #3b0f1a; color: #fda4c0; }
.card-title { font-size: 14.5px; color: var(--text); line-height: 1.7; font-weight: 500; }
.card-title mark { background: #fef08a; color: inherit; border-radius: 2px; padding: 0 2px; }
[data-theme="dark"] .card-title mark { background: #854d0e; color: #fef9c3; }
.arrow {
  color: var(--text-muted); transition: transform 0.25s ease;
  font-size: 14px; flex-shrink: 0; margin-top: 4px;
}
.card.open .arrow { transform: rotate(180deg); }
.card-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease;
}
.card.open .card-body { max-height: 6000px; }
.card-body-inner { padding: 0 18px 18px; border-top: 1px solid var(--border-light); margin-top: 0; }
.hint-bar {
  padding: 10px 14px; margin: 12px 0; background: var(--surface-2);
  border-radius: var(--radius-xs); font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px; justify-content: space-between;
}
/* 卡片掌握按钮 */
.study-actions { display: flex; gap: 6px; }
.study-btn { padding: 4px 10px; border-radius: 12px; font-size: 11px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 500; color: var(--text-secondary); transition: all 0.2s; }
.study-btn.not-mastered.active { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.study-btn.mastered.active { background: #dcfce7; color: #16a34a; border-color: #86efac; }

.answer-section {
  border-left: 3px solid var(--primary-light); padding: 12px 16px;
  background: var(--surface-2); border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
[data-theme="dark"] .answer-section { border-left-color: var(--primary); }
.answer-title {
  font-size: 13px; font-weight: 700; color: var(--primary);
  margin-bottom: 8px; display: flex; align-items: center; gap: 5px;
}
[data-theme="dark"] .answer-title { color: var(--primary-light); }
.answer-content { font-size: 13.5px; line-height: 1.85; color: var(--text); }
.answer-content mark { background: #fef08a; color: inherit; border-radius: 2px; padding: 0 2px; }
[data-theme="dark"] .answer-content mark { background: #854d0e; color: #fef9c3; }
.framework-box { background:#f1f5f9; border-left:4px solid var(--primary); border-radius:8px; padding:10px 14px; margin-bottom:12px; font-size:12.5px; line-height:1.7; color:#334155; }
[data-theme="dark"] .framework-box { background:#1e293b; color:#cbd5e1; }
.fw-title { font-weight:700; color:var(--primary); margin-bottom:6px; font-size:13px; }
.fw-line { white-space:pre-wrap; }

/* 笔试选项 */
.opt-row { display: flex; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface-2); font-size: 14px; align-items: flex-start; }
.opt-row .opt-letter { font-weight: 700; color: var(--primary); min-width: 18px; }
[data-theme="dark"] .opt-row { background: var(--surface); }
/* 按板块刷：先作答后核对 */
.opt-row.study-opt { cursor: pointer; transition: all .15s; }
.opt-row.study-opt:hover { border-color: var(--primary-light); }
.opt-row.study-opt.selected { border-color: var(--primary); background: rgba(37,99,235,.10); box-shadow: 0 0 0 2px rgba(37,99,235,.25); font-weight: 600; }
.opt-row.study-opt.ok { border-color: #16a34a; background: rgba(22,163,74,.12); }
.opt-row.study-opt.bad { border-color: #dc2626; background: rgba(220,38,38,.1); }
.opt-row.study-opt.right { border-color: #16a34a; box-shadow: inset 0 0 0 2px rgba(22,163,74,.45); }
.opt-row.study-opt.locked { cursor: default; pointer-events: none; }
.opt-row.rand-opt { cursor: pointer; transition: all .15s; }
.opt-row.rand-opt:hover { border-color: var(--primary-light); }
.opt-row.rand-opt.selected { border-color: var(--primary-light); background: var(--primary-bg); }
.opt-row.rand-opt.ok { border-color: #16a34a; background: rgba(22,163,74,.12); }
.opt-row.rand-opt.bad { border-color: #dc2626; background: rgba(220,38,38,.1); }
.opt-row.rand-opt.right { border-color: #16a34a; box-shadow: inset 0 0 0 2px rgba(22,163,74,.45); }
.opt-row.rand-opt.locked { cursor: default; pointer-events: none; }
.study-check { margin: 2px 0 12px; }
.study-check-btn { cursor: pointer; border: 1px solid var(--primary-light); background: var(--primary-bg); font-weight: 700; padding: 8px 16px; border-radius: 10px; font-size: 13.5px; transition: filter .15s; }
.study-check-btn:hover { filter: brightness(.97); }
.answer-correct-tag { display: inline-block; font-size: 12px; font-weight: 700; color: #16a34a; margin-left: 4px; }
[data-theme="dark"] .answer-correct-tag { color: #4ade80; }

.no-result { text-align: center; color: var(--text-muted); padding: 60px 20px; font-size: 15px; }
/* === Back to Top === */
.back-to-top {
  position: fixed; bottom: 28px; right: 28px; z-index: 200;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  font-size: 20px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: all 0.3s ease; display: flex; align-items: center; justify-content: center;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: scale(1.1); }
[data-theme="dark"] .back-to-top { background: var(--primary-light); color: var(--bg); }
/* === Footer === */
.footer { text-align: center; color: var(--text-muted); padding: 24px 20px; font-size: 12px; }
.footer a { color: var(--primary-light); text-decoration: none; }
/* === Focus / Full-screen study mode === */
body.focus-mode header,
body.focus-mode .toolbar,
body.focus-mode .promo-banner { display: none !important; }
body.focus-mode .main { padding-top: 16px; min-height: 100vh; max-width: none; margin: 0; padding-left: 16px; padding-right: 16px; }
.focus-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 300;
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  padding: 9px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 6px;
}
.focus-toggle:hover { filter: brightness(1.08); }
body.focus-mode .focus-toggle { background: var(--danger); }
.build-version {
  position: fixed; bottom: 6px; right: 10px; z-index: 100;
  font-size: 11px; color: var(--text-muted); opacity: 0.7; pointer-events: none;
}
/* === Responsive === */
@media (max-width: 640px) {
  .header { padding: 30px 16px 24px; }
  .header h1 { font-size: 20px; }
  .header h1 .emoji { font-size: 24px; }
  .stats { flex-direction: column; gap: 8px; width: 100%; }
  .stat-card, .progress-container { width: 100%; min-width: 0; }
  .stat-num { font-size: 22px; }
  .toolbar { padding: 12px 12px; }
  .filter-label { min-width: 0; }
  .card-header { padding: 14px 14px; }
  .card-body-inner { padding: 0 14px 14px; }
  .card-title { font-size: 14px; }
  .main { padding: 16px 12px 32px; }
  .back-to-top { bottom: 20px; right: 20px; width: 42px; height: 42px; }
}

/* === Random Modal === */
.random-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  z-index: 500; display: none; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity 0.25s ease;
}
.random-modal-overlay.show { display: flex; opacity: 1; }
.random-modal {
  background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 580px;
  max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  transform: translateY(30px) scale(0.96); transition: transform 0.3s ease;
  border: 1px solid var(--border);
}
.random-modal-overlay.show .random-modal { transform: translateY(0) scale(1); }
.random-modal-header {
  padding: 16px 20px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border-light); background: var(--header-grad); color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}
.random-modal-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.random-modal-close {
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2); color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s, transform 0.2s;
}
.random-modal-close:hover { background: rgba(255,255,255,0.3); transform: rotate(90deg); }
.random-modal-body { padding: 20px; }
.random-modal-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.random-modal-question {
  font-size: 16px; line-height: 1.8; color: var(--text); font-weight: 500;
  padding: 16px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 12px;
}

/* 全真模拟倒计时系统 */
.timer-box { margin-bottom: 14px; background: var(--surface-2); padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.timer-header { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.timer-bar { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.timer-bar-fill { width: 100%; height: 100%; background: var(--primary-light); transition: width 1s linear, background-color 0.3s; }
.timer-bar-fill.warning { background: #ef4444; animation: pulse 1s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

/* 本地语音录音系统 */
.audio-recorder-zone { background: var(--surface-2); border: 1px dashed var(--border); padding: 12px; border-radius: var(--radius-sm); margin-bottom: 14px; text-align: center; }
.record-ctrl-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 20px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.record-ctrl-btn.idle { background: var(--primary-bg); color: var(--primary-light); }
.record-ctrl-btn.recording { background: #fee2e2; color: #dc2626; animation: alertPulse 1.5s infinite; }
@keyframes alertPulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); } 70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.local-audio-player { width: 100%; margin-top: 10px; display: none; height: 36px; }
.transcript-box { margin-top: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xs); text-align: left; font-size: 13px; color: var(--text-secondary); line-height: 1.6; min-height: 20px; display: none; }
.transcript-box.show { display: block; }
.transcript-box .transcript-title { font-size: 12px; font-weight: 700; color: var(--primary-light); margin-bottom: 4px; }
.transcript-box .transcript-content { color: var(--text); }
.transcript-box .transcript-interim { color: var(--text-muted); }
.transcript-note { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* 闲鱼获取口令弹层 */
.xianyu-toast-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.xianyu-toast-overlay.show { display: flex; }
.xianyu-toast { background: var(--surface); border-radius: var(--radius); max-width: 340px; width: 100%; padding: 28px 24px 22px; text-align: center; box-shadow: var(--shadow-lg); animation: fadeIn 0.25s ease; }
.xianyu-toast .xt-icon { font-size: 40px; margin-bottom: 10px; }
.xianyu-toast .xt-title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.xianyu-toast .xt-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.7; }
.xianyu-toast .xt-code { display: inline-block; font-size: 20px; font-weight: 800; letter-spacing: 2px; color: #fff; background: var(--header-grad); padding: 8px 22px; border-radius: 999px; margin-bottom: 16px; }
.xianyu-toast .xt-btn { display: block; width: 100%; padding: 12px; border: none; border-radius: 999px; background: var(--header-grad); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; margin-bottom: 10px; }
.xianyu-toast .xt-btn.secondary { background: var(--surface-2); color: var(--text-secondary); }
.xianyu-toast .xt-copied { font-size: 12px; color: #16a34a; margin-bottom: 10px; display: none; }
.xianyu-toast .xt-copied.show { display: block; }
.xianyu-toast .xt-qr { width: 190px; max-width: 72%; border-radius: 10px; margin: 6px auto 14px; display: block; box-shadow: var(--shadow); }

.random-modal-hint {
  text-align: center; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.random-modal-answer {
  border-left: 3px solid var(--primary-light); padding: 14px 16px; background: var(--surface-2);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0; display: none;
}
.random-modal-answer.show { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.random-modal-answer-title { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
[data-theme="dark"] .random-modal-answer-title { color: var(--primary-light); }
.random-modal-answer-content { font-size: 14px; line-height: 1.9; color: var(--text); }
.random-modal-footer { padding: 14px 20px; border-top: 1px solid var(--border-light); display: flex; gap: 8px; }
.random-modal-btn {
  flex: 1; padding: 10px 16px; border: none; border-radius: var(--radius-xs); cursor: pointer;
  font-size: 14px; font-weight: 600; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 5px;
}
.random-modal-btn-reveal { background: var(--primary); color: #fff; }
.random-modal-btn-reveal:hover { background: var(--primary-light); }
.random-modal-btn-next { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.random-modal-btn-next:hover { background: var(--surface-hover); border-color: var(--primary-light); color: var(--primary); }
.random-modal-btn-close { background: transparent; color: var(--text-muted); border: 1px solid var(--border); flex: 0 0 auto; width: 44px; }
.random-modal-btn-close:hover { color: var(--text); }
[data-theme="dark"] .random-modal-btn-reveal { background: var(--primary-light); color: var(--bg); }

/* 加载更多 */
.load-more-wrap { display: flex; justify-content: center; padding: 22px 16px 8px; }
.load-more-btn { font-size: 14px; padding: 11px 26px; box-shadow: var(--shadow); }

/* 顶部宣传 banner */
.written-ended-banner { display: flex; gap: 12px; align-items: flex-start; margin: 0 16px 10px; padding: 12px 16px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(251,191,36,0.05)); border: 1px solid rgba(245,158,11,0.30); color: var(--text); }
.written-ended-banner .web-icon { font-size: 20px; line-height: 1.2; flex-shrink: 0; }
.written-ended-banner .web-body { flex: 1; min-width: 0; font-size: 13px; line-height: 1.6; }
.written-ended-banner strong { color: #b45309; }
.written-ended-banner a { color: #2563eb; font-weight: 700; text-decoration: none; cursor: pointer; }
.written-ended-banner a:hover { text-decoration: underline; }
[data-theme="dark"] .written-ended-banner { background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(251,191,36,0.06)); border-color: rgba(245,158,11,0.35); }
[data-theme="dark"] .written-ended-banner strong { color: #fbbf24; }
.promo-banner { position: relative; display: flex; gap: 14px; align-items: center; margin: 0 16px 10px; padding: 12px 18px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(59,130,246,0.04)); border: 1px solid rgba(59,130,246,0.15); color: var(--text); box-shadow: none; }
[data-theme="dark"] .promo-banner { background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(37,99,235,0.05)); border-color: rgba(59,130,246,0.2); }
.promo-close { position: absolute; top: 8px; right: 10px; width: 22px; height: 22px; border: none; background: transparent; color: var(--text-muted); border-radius: 50%; font-size: 15px; line-height: 1; cursor: pointer; transition: background 0.15s; }
.promo-close:hover { background: rgba(0,0,0,0.06); color: var(--text); }
[data-theme="dark"] .promo-close:hover { background: rgba(255,255,255,0.08); }
.promo-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.promo-body { flex: 1; min-width: 0; }
.promo-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; color: #1e3a5f; }
[data-theme="dark"] .promo-title { color: #93c5fd; }
.promo-text { font-size: 12.5px; line-height: 1.65; color: var(--text-secondary); }
.promo-text b { color: var(--primary); font-weight: 600; }
.promo-actions { margin-top: 7px; }
.promo-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid rgba(59,130,246,0.35); background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; font-weight: 600; font-size: 12px; padding: 5px 14px; border-radius: 999px; cursor: pointer; box-shadow: 0 2px 8px rgba(37,99,235,0.2); transition: transform 0.12s, box-shadow 0.12s; }
.promo-btn:hover { box-shadow: 0 4px 14px rgba(37,99,235,0.32); }
.promo-btn:active { transform: translateY(1px); }

/* ===== 趣味化：撒花 (纯视觉反馈) ===== */
.fx-confetti { position: fixed; top: -10px; font-size: 18px; pointer-events: none; z-index: 9999; animation: fx-fall linear forwards; }
@keyframes fx-fall { 0% { transform: translateY(-10px) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(540deg); opacity: 0; } }



/* ===== merged from 3 <style> blocks (extracted from sz) ===== */


.exam-view{max-width:860px;margin:0 auto;padding:0 16px 40px}
.exam-bar{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px 18px;margin:14px 0;box-shadow:var(--shadow)}
.exam-title{font-size:17px;margin:0;color:var(--text)}
.exam-sub{font-size:12.5px;color:var(--text-secondary);margin:4px 0 0}
.exam-bar-right{display:flex;gap:8px;flex-wrap:wrap}
.exam-btn{border:none;border-radius:999px;padding:9px 18px;font-size:13px;font-weight:700;cursor:pointer;transition:transform .12s,box-shadow .12s}
.exam-btn:active{transform:translateY(1px)}
.exam-btn-primary{background:linear-gradient(135deg,#2563eb,#3b82f6);color:#fff;box-shadow:0 2px 10px rgba(37,99,235,.3)}
.exam-setup-overlay{position:fixed;inset:0;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;z-index:1200;padding:20px;backdrop-filter:blur(3px)}
.exam-setup-card{background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:26px 28px;width:min(460px,100%);box-shadow:0 18px 50px rgba(0,0,0,.28)}
.exam-setup-title{margin:0 0 6px;font-size:18px;color:var(--text)}
.exam-setup-tip{margin:0 0 18px;font-size:13px;color:var(--text-secondary);line-height:1.6}
.exam-setup-row{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.exam-setup-row label{width:72px;font-size:13.5px;font-weight:700;color:var(--text);flex:none}
.exam-setup-select{flex:1;padding:10px 12px;border:1px solid var(--border);border-radius:10px;font-size:14px;background:var(--surface);color:var(--text);outline:none}
.exam-setup-select:focus{border-color:var(--primary)}
.exam-setup-info{font-size:12.5px;color:var(--text-secondary);background:var(--bg);border-radius:10px;padding:10px 12px;margin-bottom:18px;line-height:1.6}
.exam-setup-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.exam-setup-actions .exam-btn{padding:10px 22px}
.exam-setup-actions #examSetupPreset{padding:10px 16px}
.exam-setup-grid{display:grid;grid-template-columns:1fr;gap:12px;margin:4px 0 12px}
.exam-setup-cell{background:var(--bg);border:1px solid var(--border);border-radius:12px;padding:12px 14px}
.exam-setup-cell label{display:block;font-size:13px;font-weight:700;color:var(--text);margin-bottom:8px}
.exam-setup-input-wrap{display:flex;align-items:center;gap:8px}
.exam-setup-input-wrap .exam-setup-input{flex:1;min-width:0}
.exam-setup-input-wrap .es-unit{font-size:12.5px;color:var(--text-secondary);flex:none}
.exam-setup-input{width:100%;padding:9px 10px;border:1px solid var(--border);border-radius:9px;font-size:15px;font-weight:700;background:var(--surface);color:var(--text);outline:none;text-align:center}
.exam-setup-input:focus{border-color:var(--primary)}
.exam-setup-time{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--bg);border:1px solid var(--border);border-radius:12px;padding:12px 14px;margin:0 0 12px}
.est-row{display:flex;align-items:center;gap:10px}
.exam-setup-time label{font-size:13px;font-weight:700;color:var(--text);flex:none}
.exam-setup-time .exam-setup-input-wrap{width:160px}
.exam-setup-time .es-hint{font-size:12px;color:var(--text-secondary)}
.exam-setup-cell-wide{grid-column:1 / -1;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.exam-setup-check{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:700;color:var(--text);margin:0;cursor:pointer}
.exam-setup-check input{width:16px;height:16px;accent-color:var(--primary);cursor:pointer}
.exam-setup-typing-min{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text-secondary)}
.exam-setup-input-sm{width:64px;text-align:center}
@media(max-width:520px){.exam-setup-time{flex-direction:column;align-items:flex-start}.exam-setup-time .es-hint{display:none}}
.exam-timer-bar{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:10px 16px;margin:0 0 14px}
.exam-timer-label{font-size:12.5px;font-weight:700;color:var(--text-secondary);white-space:nowrap}
.exam-timer-digits{font-size:18px;font-weight:800;color:var(--primary-light);font-variant-numeric:tabular-nums;min-width:74px;white-space:nowrap}
.exam-timer-track{flex:1;height:8px;background:var(--bg);border-radius:999px;overflow:hidden}
.exam-timer-fill{height:100%;width:100%;background:linear-gradient(90deg,#16a34a,#22c55e);border-radius:999px;transition:width 1s linear}
.exam-timer-fill.warning{background:linear-gradient(90deg,#dc2626,#ef4444)}
.typing-q{background:var(--surface-2)}
.typing-passage{font-size:13.5px;line-height:1.9;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:12px 14px;margin:8px 0;white-space:pre-wrap}
.typing-area{width:100%;min-height:120px;resize:vertical;padding:12px 14px;border:1px solid var(--border);border-radius:10px;font-size:15px;line-height:1.8;background:var(--surface);color:var(--text);outline:none}
.typing-area:focus{border-color:var(--primary)}
.exam-btn-ghost{background:var(--surface-2);color:var(--text-secondary)}
.exam-result{background:linear-gradient(135deg,rgba(37,99,235,.08),rgba(59,130,246,.05));border:1px solid rgba(59,130,246,.2);border-radius:var(--radius);padding:16px 20px;margin:0 0 16px}
.exam-result-score{font-size:28px;font-weight:800;color:var(--primary-light)}
.exam-result-detail{font-size:13px;color:var(--text-secondary);margin-top:6px;line-height:1.7}
.exam-q{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px 20px;margin:14px 0;box-shadow:var(--shadow)}
.exam-q.graded-correct{border-color:#16a34a;box-shadow:0 0 0 1px rgba(22,163,74,.3)}
.exam-q.graded-wrong{border-color:#dc2626;box-shadow:0 0 0 1px rgba(220,38,38,.3)}
/* 文字判定横幅：消除"只看颜色分不清对错"的歧义 */
.ans-result{margin:10px 0 0;padding:9px 14px;border-radius:10px;font-size:14px;font-weight:700;line-height:1.5;border:1px solid transparent}
.ans-result.ans-correct{background:rgba(22,163,74,.10);color:#15803d;border-color:rgba(22,163,74,.35)}
.ans-result.ans-wrong{background:rgba(220,38,38,.10);color:#b91c1c;border-color:rgba(220,38,38,.35)}
.ans-result b{font-weight:800}
[data-theme="dark"] .ans-result.ans-correct{background:rgba(34,197,94,.16);color:#86efac;border-color:rgba(34,197,94,.45)}
[data-theme="dark"] .ans-result.ans-wrong{background:rgba(248,113,113,.16);color:#fca5a5;border-color:rgba(248,113,113,.45)}
.exam-q-head{display:block;margin-bottom:12px}
.exam-q-meta{display:flex;align-items:center;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.exam-q-tag{display:inline-block;font-size:12px;font-weight:800;letter-spacing:.5px;padding:3px 11px;border-radius:999px;color:#fff;background:linear-gradient(135deg,#2563eb,#3b82f6)}
.exam-q-tag.tag-multi{background:linear-gradient(135deg,#7c3aed,#a855f7)}
.exam-q-tag.tag-bool{background:linear-gradient(135deg,#0891b2,#06b6d4)}
.exam-q-num{font-size:12.5px;font-weight:700;color:var(--text-secondary)}
.exam-q-stem{font-size:15.5px;font-weight:600;color:var(--text);line-height:1.7}
.exam-opts{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.exam-opt{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border:1px solid var(--border);border-radius:10px;cursor:pointer;background:var(--surface-2);transition:all .15s}
.exam-opt:hover{border-color:var(--primary-light)}
.exam-opt.selected{border-color:var(--primary-light);background:var(--primary-bg)}
.exam-opt.correct{border-color:#16a34a;background:rgba(22,163,74,.1)}
.exam-opt.wrong{border-color:#dc2626;background:rgba(220,38,38,.08)}
.exam-opt-letter{font-weight:800;color:var(--primary-light);min-width:18px}
.exam-opt-text{flex:1;line-height:1.55}
.exam-mark{margin-left:auto;font-size:15px}
.exam-explain{margin-top:10px;padding:10px 12px;background:var(--surface-2);border-radius:10px;font-size:13px;color:var(--text-secondary);line-height:1.7;display:none}
.exam-q.graded .exam-explain{display:block}


/* ===== merged from 3 <style> blocks (extracted from sz) ===== */

.loader{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:60px 20px;color:var(--text-secondary);font-size:15px}.spinner{width:34px;height:34px;border:4px solid var(--border);border-top-color:var(--primary-light);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
