/* quiz.css — 刷题 & 模拟考试专属样式（复用 style.css 的 CSS 变量） */

.loading, .empty { padding: 40px; text-align: center; color: var(--text-soft); }

/* 首页统计 + 模式卡 */
.quiz-stats { display: flex; gap: 12px; margin: 14px 0; }
.quiz-stat-card { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.quiz-stat-card .qs-ic { font-size: 22px; }
.stat-value { font-size: 20px; font-weight: 800; display: block; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-soft); }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.mode-card { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 16px;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius);
  cursor: pointer; box-shadow: var(--shadow); }
.mode-card:active { transform: scale(.98); }
.mode-ic { font-size: 28px; line-height: 1; }
.mode-t b { display: block; font-size: 16px; }
.mode-t small { color: var(--text-soft); }

.bank-overview { margin: 10px 0 4px; padding: 12px 14px; background: var(--accent-soft);
  border-radius: 12px; font-size: 14px; }

/* 通用页头 / 按钮 */
.page-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 14px; }
.page-head h2 { margin: 0; font-size: 20px; }

.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface-2); }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 22px; font-size: 16px; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 筛选 chip */
.filter-bar { margin: 10px 0; }
.filter-options { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  padding: 7px 12px; border-radius: 999px; font-size: 14px; cursor: pointer; }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-chip .fc-n { opacity: .7; margin-left: 3px; }

/* 知识点筛选下拉 */
.topic-filter { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.topic-filter label { font-size: 13px; color: var(--text-soft); flex: none; }
.topic-select { flex: 1; max-width: 340px; padding: 9px 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); border-radius: 10px; font-size: 14px; }

/* 考试范围按钮（复用 setup 视觉） */
.scope-btn { border: 1px solid var(--border); background: var(--surface); padding: 8px 16px;
  border-radius: 10px; cursor: pointer; font-weight: 600; }
.scope-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 徽章 */
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft); margin-right: 6px; }
.badge-cka { background: #e7f0ff; color: #1d4ed8; }
.badge-cks { background: #fde8ef; color: #be185d; }
.badge-easy { background: #e7f7ee; color: #1f9d55; }
.badge-medium { background: #fff3e0; color: #d9822b; }
.badge-hard { background: #fdeaea; color: #d64545; }

/* 进度条 */
.progress-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }
.progress-fill.good { background: #1f9d55; }
.progress-fill.mid { background: #d9822b; }
.progress-fill.bad { background: #d64545; }

/* 题目卡片 + 选项 */
.question-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-top: 10px; }
.question-badges { margin-bottom: 8px; }
.question-text { font-size: 18px; margin: 6px 0 4px; line-height: 1.5; }
.options-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.option-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 12px; cursor: pointer; font-size: 15px; color: var(--text); }
.option-item:active { transform: scale(.99); }
.option-item .ol { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; font-weight: 700; flex: none; }
.option-item .ot { flex: 1; }
.option-item .om { margin-left: auto; font-weight: 800; }
.option-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.option-item.correct { border-color: #1f9d55; background: #e7f7ee; }
.option-item.wrong { border-color: #d64545; background: #fdeaea; }
.option-item.correct .om { color: #1f9d55; }
.option-item.wrong .om { color: #d64545; }

.explanation-box { margin-top: 12px; padding: 12px 14px; background: var(--accent-soft);
  border-radius: 12px; border: 1px solid var(--border); }
.explanation-box h3 { margin: 0 0 4px; font-size: 14px; color: var(--accent); }
.explanation-box p { margin: 0; }

.quiz-nav { display: flex; gap: 10px; margin-top: 14px; }
.quiz-nav .btn { flex: 1; }

/* 练习进度头 */
.quiz-progress-bar { margin: 10px 0; }
.quiz-progress-info { display: flex; justify-content: space-between; font-size: 13px;
  color: var(--text-soft); margin-bottom: 6px; }

/* 结果页 */
.result-card { text-align: center; padding: 10px 0; }
.result-stats { display: flex; justify-content: center; gap: 24px; margin: 12px 0; }
.result-stat { text-align: center; }
.result-stat .stat-num { font-size: 24px; font-weight: 800; display: block; }
.result-stat.correct .stat-num { color: #1f9d55; }
.result-stat.wrong .stat-num { color: #d64545; }
.result-actions { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.result-actions .btn { flex: 1; max-width: 200px; }
.result-detail { margin-top: 16px; }
.result-detail h3 { font-size: 16px; }
.result-item { padding: 12px 14px; border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 10px; margin: 8px 0; }
.result-item.correct { border-left-color: #1f9d55; }
.result-item.wrong { border-left-color: #d64545; }
.ri-head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ri-head .badge { margin-left: auto; }
.ri-q { margin: 6px 0; }
.ri-a { font-size: 14px; color: var(--text-soft); margin: 0; }

/* 模拟考试 */
.exam-header-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  position: sticky; top: 64px; z-index: 10; flex-wrap: wrap; }
.exam-title { font-weight: 700; }
.exam-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; color: var(--accent); }
.exam-timer.low-time { color: var(--danger); animation: qpulse 1s infinite; }
@keyframes qpulse { 50% { opacity: .5; } }
.exam-progress-info { color: var(--text-soft); font-size: 14px; }
.exam-header-bar .btn-primary { margin-left: auto; }
.exam-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.nav-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; }
.nav-btn.current { border-color: var(--accent); background: var(--accent); color: #fff; }
.nav-btn.answered { background: var(--accent-soft); }
.exam-question-area .question-header { display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 8px; }
.question-number { color: var(--text-soft); font-size: 14px; }
.exam-nav-buttons { display: flex; gap: 10px; margin-top: 14px; }
.exam-nav-buttons .btn { flex: 1; }

/* 考试设置 */
.setup-card { max-width: 520px; margin: 10px auto; padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.setup-info { margin: 14px 0; }
.setup-item { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); }
.setup-label { color: var(--text-soft); }
.setup-control { display: flex; gap: 8px; }
.count-btn { border: 1px solid var(--border); background: var(--surface); padding: 8px 14px;
  border-radius: 10px; cursor: pointer; }
.count-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.setup-rules { background: var(--surface-2); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
.setup-rules ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-soft); font-size: 14px; }
.setup-rules h4 { margin: 0; }

/* 成绩 + 错题分析 */
.result-overview { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0; }
.result-score-card { flex: 1; min-width: 240px; display: flex; gap: 16px; align-items: center;
  padding: 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.result-score-card.passed { border-color: #1f9d55; }
.result-score-card.failed { border-color: #d64545; }
.score-circle { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center;
  border: 8px solid var(--accent-soft); background: var(--surface); flex: none; }
.score-circle.good { border-color: #1f9d55; color: #1f9d55; }
.score-circle.mid { border-color: #d9822b; color: #d9822b; }
.score-circle.bad { border-color: #d64545; color: #d64545; }
.score-number { font-size: 30px; font-weight: 800; line-height: 1; }
.score-label { font-size: 13px; }
.score-details { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.difficulty-stats { flex: 1; min-width: 240px; padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.difficulty-stats h3 { margin: 0 0 10px; font-size: 16px; }
.diff-stat-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.diff-stat-row .badge { width: 54px; text-align: center; }
.diff-stat-value { font-size: 13px; color: var(--text-soft); width: 42px; text-align: right; }
.exam-section { margin-top: 18px; }
.exam-section h2 { font-size: 18px; }
.wrong-questions { display: flex; flex-direction: column; gap: 12px; }
.wrong-question-card { padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); }
.wq-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.wq-text { margin: 6px 0; font-weight: 600; }
.wq-options { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.wrong-option { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px; }
.wrong-option.correct { border-color: #1f9d55; background: #e7f7ee; }
.wrong-option.wrong { border-color: #d64545; background: #fdeaea; }
.wrong-option .ol { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.wrong-option .om { margin-left: auto; font-weight: 800; }
.wrong-option.correct .om { color: #1f9d55; }
.wrong-option.wrong .om { color: #d64545; }
.wq-exp { font-size: 14px; color: var(--text-soft); }
.exam-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.exam-actions .btn { flex: 1; min-width: 120px; }

/* ---------- 交互增强（hover / 过渡 / 主题顺滑切换） ---------- */
.mode-card, .btn, .filter-chip, .option-item, .scope-btn, .count-btn, .nav-btn,
.quiz-stat-card, .result-score-card, .difficulty-stats, .setup-card, .question-card {
  transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}
.mode-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); }
.mode-card:hover .mode-ic { transform: scale(1.06); }
.mode-ic { transition: transform .15s ease; }

.btn:hover { border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.05); }

.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.option-item:hover { border-color: var(--accent); background: var(--surface-2); }
.option-item:hover.selected, .option-item.selected:hover { background: var(--accent-soft); }

.scope-btn:hover, .count-btn:hover { border-color: var(--accent); }
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.quiz-stat-card:hover, .result-score-card:hover, .difficulty-stats:hover, .setup-card:hover, .question-card:hover {
  box-shadow: var(--shadow-lg);
}

/* 选项标记圆点过渡 */
.option-item .ol { transition: background-color .18s ease, color .18s ease; }

/* 主题切换顺滑 */
body { transition: background-color .25s ease, color .25s ease; }
.topbar, .bottom-nav { transition: background-color .25s ease, color .25s ease, border-color .25s ease; }

@media (max-width: 560px) {
  .mode-grid { grid-template-columns: 1fr; }
  .quiz-stats { flex-wrap: wrap; }
  .quiz-stat-card { min-width: 100px; }
}
