/* ============================================================
   quiz.css —— 题库模块样式（主页 / 练习 / 考试 / 错题本 / 成绩单）
   风格：克制、浅色为主、复用 variables 令牌；触控区 ≥44px
   ============================================================ */

/* ---------- 通用：下拉选择框（与 .input 一致） ---------- */
.select {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 15px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s ease;
}
.select:focus { border-color: var(--primary); }

/* ---------- 通用标签 ---------- */
.qz-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.qz-tag.qz-type { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.qz-tag.qz-subj { background: var(--surface-2); }
.qz-tag.qz-chapter { background: transparent; padding-left: 0; }
.qz-tag.diff-easy { background: #e3f4ea; color: #2c8a55; }
.qz-tag.diff-mid { background: #fbf0d9; color: #b07d1f; }
.qz-tag.diff-hard { background: #fbe2e2; color: #c2403f; }
.qz-tag.qz-count { background: var(--accent-soft); color: var(--accent); }

/* ============================================================
   主页：三大入口卡片
   ============================================================ */
.qz-entries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.qz-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.qz-entry:hover { border-color: var(--primary); transform: translateY(-1px); }
.qz-entry-icon { width: 40px; height: 40px; flex: none; }
.qz-entry-icon svg { width: 100%; height: 100%; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qz-entry-warn .qz-entry-icon svg { stroke: var(--accent); }
.qz-entry-title { font-size: 16.5px; font-weight: 700; }
.qz-entry-desc { font-size: 13.5px; color: var(--text-2); margin-top: 3px; }

/* ---------- 筛选栏 ---------- */
.qz-filter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

/* ---------- 题目列表 ---------- */
.qz-list-head { font-size: 14px; color: var(--text-2); margin: 6px 0 10px; }
.qz-list { display: flex; flex-direction: column; gap: 10px; }
.qz-row {
  padding: 14px 16px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s ease;
}
.qz-row:hover { border-color: var(--primary); }
.qz-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 7px; }
.qz-row-chapter { font-size: 12.5px; color: var(--text-3); }
.qz-row-stem { font-size: 15.5px; line-height: 1.65; color: var(--text); }

/* ============================================================
   练习 / 考试 通用：题卡
   ============================================================ */
.qz-p-top, .qz-t-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.qz-back { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; }
.qz-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qz-p-progress, .qz-p-mode { font-size: 14.5px; color: var(--text-2); }
.qz-p-mode { margin-left: auto; }
.qz-timer {
  margin-left: auto;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: .02em;
}
.qz-timer.qz-timer-warn { color: var(--danger); }

/* 进度条 */
.qz-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 16px;
}
.qz-progress-in { height: 100%; background: var(--primary); border-radius: 999px; transition: width .2s ease; }

/* 题卡 */
.qz-qcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.qz-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.qz-stem { font-size: 17.5px; line-height: 1.7; font-weight: 600; margin-bottom: 18px; }

/* ---------- 选项 ---------- */
.qz-opts { display: flex; flex-direction: column; gap: 10px; }
.qz-opts-judge { flex-direction: row; }
.qz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.qz-opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.qz-opt.selected { border-color: var(--primary); background: var(--primary-soft); }
.qz-opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  font-weight: 700;
  font-size: 14px;
}
.qz-opt.selected .qz-opt-letter { background: var(--primary); color: #fff; }
.qz-opt-text { font-size: 15.5px; line-height: 1.55; }
.qz-opt-box {
  width: 20px; height: 20px;
  flex: none;
  border: 2px solid var(--border);
  border-radius: 5px;
  position: relative;
}
.qz-opt.selected .qz-opt-box { border-color: var(--primary); background: var(--primary); }
.qz-opt.selected .qz-opt-box::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.qz-opt-judge { flex: 1; justify-content: center; }

/* ---------- 填空题 ---------- */
.qz-fill-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.qz-fill-item { display: flex; align-items: center; gap: 12px; }
.qz-fill-num { font-size: 14px; color: var(--text-2); width: 42px; flex: none; }
.qz-fill-input { flex: 1; }

/* ---------- 主观题 ---------- */
.qz-textarea { width: 100%; margin-bottom: 12px; }
.qz-subj-row { display: flex; }
.qz-submit { margin-top: 4px; }
.qz-refanswer {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}
.qz-ref-title { font-size: 13.5px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.qz-ref-body { font-size: 15px; line-height: 1.7; }
.qz-self { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.qz-self-tip { font-size: 14.5px; color: var(--text-2); margin-right: 4px; }
.qz-self-wrong { min-width: 110px; }
.qz-self-ok { min-width: 110px; }

/* ---------- 判分结果 ---------- */
.qz-resultbox { margin-top: 4px; }
.qz-result {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 14px;
}
.qz-result.ok { background: #e3f4ea; color: #2c8a55; }
.qz-result.wrong { background: #fbe2e2; color: #c2403f; }

.qz-key { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.qz-key-row { display: flex; gap: 8px; font-size: 15px; flex-wrap: wrap; }
.qz-key-label { color: var(--text-2); }
.qz-key-val { font-weight: 600; }
.qz-key-val.val-ok { color: var(--success); }
.qz-key-val.val-wrong { color: var(--danger); }

.qz-analysis {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.qz-analysis-body { font-size: 14.5px; line-height: 1.7; color: var(--text); }

/* 回溯链接 */
.qz-links { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.qz-link {
  padding: 8px 14px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--primary-strong);
  font-size: 14px;
  cursor: pointer;
}
.qz-link:hover { border-color: var(--primary); }
.qz-redo { margin-top: 4px; }

/* ---------- 底部翻页 ---------- */
.qz-p-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.qz-p-foot .btn { min-height: 46px; flex: 1; }

/* ============================================================
   考试：题卡导航
   ============================================================ */
.qz-nav {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.qz-nav-cell {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
}
.qz-nav-cell.answered { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); }
.qz-nav-cell.current { outline: 2px solid var(--accent); }

/* ============================================================
   考试设置
   ============================================================ */
.qz-resume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 14.5px;
}
.qz-exam-form { padding: 20px 22px; }
.qz-field { margin-bottom: 16px; }
.qz-field-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.qz-dist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  margin-bottom: 16px;
}
.qz-dist-row { display: flex; align-items: center; gap: 10px; }
.qz-dist-label { font-size: 14px; flex: 1; color: var(--text-2); }
.qz-dist-in { width: 80px; }
.qz-start { width: 100%; min-height: 48px; margin-top: 6px; }

/* ============================================================
   成绩单
   ============================================================ */
.qz-score-card {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 24px 28px;
  margin-bottom: 18px;
}
.qz-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: var(--primary-soft);
  flex: none;
}
.qz-score-num { font-size: 42px; font-weight: 800; color: var(--primary-strong); line-height: 1; }
.qz-score-label { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.qz-score-stats { display: flex; gap: 26px; flex: 1; }
.qz-stat { text-align: center; }
.qz-stat-num { font-size: 30px; font-weight: 800; line-height: 1; }
.qz-stat-label { font-size: 13.5px; color: var(--text-2); margin-top: 6px; }

.qz-card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.qz-pending { padding: 20px 22px; margin-bottom: 18px; }
.qz-pending-tip { font-size: 14.5px; color: var(--accent); margin-bottom: 14px; font-weight: 600; }
.qz-pending-item { padding: 14px 0; border-top: 1px solid var(--border); }
.qz-pending-item .qz-stem { font-size: 15.5px; margin-bottom: 10px; }

.qz-weak { padding: 20px 22px; margin-bottom: 18px; }
.qz-weak-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.qz-weak-name { width: 130px; flex: none; font-size: 14px; }
.qz-weak-bar { flex: 1; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.qz-weak-in { height: 100%; background: var(--danger); border-radius: 999px; }
.qz-weak-n { width: 44px; flex: none; font-size: 13.5px; color: var(--danger); text-align: right; }

.qz-wronglist { padding: 20px 22px; margin-bottom: 18px; }
.qz-wrong-item { padding: 12px 0; border-top: 1px solid var(--border); }
.qz-wrong-t { font-size: 15px; line-height: 1.65; font-weight: 600; }
.qz-wrong-a { font-size: 13.5px; color: var(--text-2); margin-top: 6px; }
.qz-wrong-an { font-size: 13.5px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }

.qz-result-actions { display: flex; gap: 12px; }
.qz-result-actions .btn { flex: 1; min-height: 46px; }

/* ============================================================
   错题本
   ============================================================ */
.qz-wrong-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.qz-wrong-toolbar .btn { min-height: 44px; }
.qz-wrong-record { padding: 18px 20px; margin-bottom: 12px; }
.qz-wrong-record.ghost { display: flex; align-items: center; justify-content: space-between; }
.qz-note-wrap { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.qz-note-wrap .qz-ref-title { margin: 0; flex: none; }
.qz-note { flex: 1; }
.qz-wrong-ops { display: flex; gap: 10px; margin-top: 14px; }
.qz-wrong-ops .btn { min-height: 42px; }

/* ============================================================
   移动端适配（≤640px）
   ============================================================ */
@media (max-width: 640px) {
  .qz-entries { grid-template-columns: 1fr; }
  .qz-filter { grid-template-columns: repeat(2, 1fr); }
  .qz-qcard { padding: 18px 16px; }
  .qz-stem { font-size: 16.5px; }
  .qz-nav { grid-template-columns: repeat(6, 1fr); }
  .qz-score-card { flex-direction: column; gap: 18px; text-align: center; }
  .qz-score-stats { justify-content: center; gap: 18px; }
  .qz-dist { grid-template-columns: 1fr; }
  .qz-weak-name { width: 90px; }
  .qz-result-actions, .qz-p-foot { flex-direction: column; }
  .qz-timer { font-size: 18px; }
  .qz-t-top { flex-wrap: wrap; }
  .qz-timer { margin-left: 0; }
}
