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

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #eef1f6;
  color: #222;
  font-size: 16px;
}

.hidden { display: none !important; }

/* 顶部条 */
.topbar {
  height: 52px;
  background: linear-gradient(90deg, #123a6d, #1f5aa8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.topbar-title { font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.topbar-right { font-size: 14px; opacity: .95; }

.view { padding: 24px; max-width: 1200px; margin: 0 auto; }

/* 登录 */
.login-box {
  max-width: 620px;
  margin: 30px auto;
  background: #fff;
  border-radius: 8px;
  padding: 32px 36px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 24px; color: #123a6d; }
.login-field { display: flex; align-items: center; margin-bottom: 16px; }
.login-field label { width: 90px; color: #444; flex-shrink: 0; }
.login-field input {
  flex: 1; height: 38px; padding: 0 10px;
  border: 1px solid #c9d2e0; border-radius: 4px; font-size: 15px;
}
.login-field input:focus { outline: none; border-color: #1f5aa8; }

.notice { margin-top: 26px; border-top: 1px dashed #ccc; padding-top: 16px; }
.notice h2 { font-size: 15px; color: #123a6d; margin-bottom: 8px; }
.notice ol { padding-left: 20px; font-size: 13.5px; color: #555; line-height: 1.9; }
.disclaimer { margin-top: 10px; font-size: 12.5px; color: #999; }

/* 按钮 */
.btn {
  height: 36px; padding: 0 22px; border: 1px solid #b9c4d6; border-radius: 4px;
  background: #fff; color: #333; font-size: 15px; cursor: pointer;
}
.btn:hover { background: #f2f5fa; }
.btn-primary { background: #1f5aa8; border-color: #1f5aa8; color: #fff; }
.btn-primary:hover { background: #1a4d91; }
.btn-danger { background: #c0392b; border-color: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-block { width: 100%; }

/* 考试布局 */
.exam-layout { display: flex; gap: 16px; align-items: flex-start; }
.exam-main {
  flex: 1; background: #fff; border-radius: 8px; padding: 24px 28px;
  min-height: 480px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.exam-side { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }

.side-card {
  background: #fff; border-radius: 8px; padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; color: #123a6d; }

.timer-card { text-align: center; }
.timer-label { font-size: 13px; color: #666; }
.timer { font-size: 30px; font-weight: 700; color: #c0392b; font-variant-numeric: tabular-nums; }
.timer.warn { animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: .35; } }

.q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.q-type {
  background: #1f5aa8; color: #fff; font-size: 13px;
  padding: 3px 12px; border-radius: 12px;
}
.q-progress { color: #777; font-size: 14px; }

.q-stem { font-size: 17px; line-height: 1.8; margin-bottom: 20px; }

.q-options .opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; margin-bottom: 10px;
  border: 1px solid #dde3ec; border-radius: 6px; cursor: pointer;
  line-height: 1.6;
}
.q-options .opt:hover { background: #f4f7fc; }
.q-options .opt.selected { border-color: #1f5aa8; background: #eaf1fb; }
.q-options .opt input { margin-top: 5px; }
.q-options .opt .opt-letter { font-weight: 600; flex-shrink: 0; }

.q-nav { margin-top: 24px; display: flex; gap: 12px; }

/* 答题卡 */
.sheet { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sheet .cell {
  height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid #c9d2e0; border-radius: 4px; font-size: 14px;
  cursor: pointer; background: #fff; user-select: none;
}
.sheet .cell.done { background: #1f5aa8; border-color: #1f5aa8; color: #fff; }
.sheet .cell.cur { outline: 2px solid #f39c12; }
.sheet .cell .cell-mark { font-size: 10px; color: #f39c12; margin-left: 1px; }
.sheet .cell.done .cell-mark { color: #ffd27a; }

.legend { display: flex; gap: 14px; margin-top: 12px; font-size: 12.5px; color: #666; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.dot-done { background: #1f5aa8; }
.dot-todo { background: #fff; border: 1px solid #c9d2e0; }
.dot-cur { background: #f39c12; }

/* 成绩 */
.result-box {
  max-width: 860px; margin: 20px auto; background: #fff; border-radius: 8px;
  padding: 32px 40px; box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.result-box h1 { text-align: center; font-size: 20px; color: #123a6d; margin-bottom: 18px; }
.score-line { text-align: center; margin-bottom: 22px; }
.score-num { font-size: 56px; font-weight: 700; color: #c0392b; }
.score-unit { font-size: 18px; color: #666; margin-right: 14px; }
.score-pass { font-size: 18px; font-weight: 600; }
.score-pass.ok { color: #1e8449; }
.score-pass.no { color: #c0392b; }

.stat-table { width: 100%; border-collapse: collapse; margin-bottom: 22px; }
.stat-table th, .stat-table td {
  border: 1px solid #dde3ec; padding: 8px 10px; text-align: center; font-size: 14.5px;
}
.stat-table th { background: #f4f7fc; }

.result-actions { display: flex; gap: 12px; justify-content: center; }

/* 答卷回顾 */
.review { margin-top: 28px; border-top: 1px dashed #ccc; padding-top: 18px; }
.review .rv-item { padding: 14px 0; border-bottom: 1px solid #eee; }
.review .rv-stem { font-size: 15.5px; line-height: 1.7; margin-bottom: 8px; }
.review .rv-stem .rv-badge { font-size: 12px; padding: 1px 8px; border-radius: 10px; margin-right: 8px; color: #fff; }
.rv-badge.right { background: #1e8449; }
.rv-badge.wrong { background: #c0392b; }
.review .rv-opt { padding: 3px 0 3px 18px; font-size: 14.5px; color: #444; line-height: 1.6; }
.review .rv-opt.correct { color: #1e8449; font-weight: 600; }
.review .rv-opt.picked-wrong { color: #c0392b; }
.review .rv-ans { margin-top: 6px; font-size: 14px; color: #666; }
.review .rv-ans b { color: #1e8449; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 99;
}
.modal-box { background: #fff; border-radius: 8px; padding: 28px 32px; width: 380px; }
.modal-text { font-size: 15.5px; line-height: 1.8; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

@media (max-width: 900px) {
  .exam-layout { flex-direction: column; }
  .exam-side { width: 100%; }
}
