/* 基础样式：党政风底色、排版、按钮、表单、表格、提示 */

:root {
  --red-bright: #ee1c25;
  --red: #dc241f;
  --red-mid: #cc0000;
  --red-deep: #990000;
  --red-dark: #6d0000;
  --gold: #c8a24a;
  --gold-soft: #e6cf9d;
  --ink: #241a16;
  --ink-2: #4a3a33;
  --text: #3a2c26;
  --muted: #7d6c60;
  --line: #e3d8c7;
  --line-2: #d5c6b2;
  --paper: #f6f0e5;
  --surface: #fffdf8;
  --green: #2f6b45;
  --green-soft: #eff7f1;
  --danger: #a93325;
  --danger-soft: #fdf1ef;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 520px at 88% -8%, rgba(220, 36, 31, 0.06), transparent 62%),
    radial-gradient(900px 480px at -8% 18%, rgba(193, 154, 75, 0.1), transparent 60%),
    repeating-linear-gradient(0deg, rgba(90, 60, 40, 0.016) 0 1px, transparent 1px 4px);
  background-attachment: fixed;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

a {
  color: var(--red-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: none;
  font-size: 14px;
  line-height: 1;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  border-color: var(--red-deep);
  color: #fff;
  background: linear-gradient(180deg, #dc241f, #b51312);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #ee1c25, #c41513);
}

.btn-gold {
  border-color: #b8924a;
  color: #6b1c10;
  background: linear-gradient(180deg, #f4e2b6, #dfc185);
}

.btn-gold:hover {
  background: linear-gradient(180deg, #f9ebc8, #e8ce96);
}

.btn-outline {
  border-color: var(--line-2);
  color: var(--red-deep);
  background: var(--surface);
}

.btn-outline:hover {
  border-color: var(--red-mid);
  background: #fdf6ee;
}

.btn-text {
  height: auto;
  padding: 2px 4px;
  border: 0;
  color: var(--muted);
}

.btn-text:hover {
  color: var(--red-deep);
}

.btn-lg {
  height: 46px;
  padding: 0 26px;
  font-size: 15px;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 表单 */

.field {
  margin-bottom: 18px;
}

.field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--ink-2);
}

.input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: #fffdf9;
  color: var(--ink);
  font-size: 14px;
}

.input::placeholder {
  color: #b3a394;
}

.input:focus {
  outline: none;
  border-color: var(--red-mid);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.09);
}

.form-error {
  display: none;
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--danger);
}

.form-error.show {
  display: block;
}

/* 提示 */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  max-width: 90vw;
  padding: 9px 16px;
  border: 1px solid rgba(230, 207, 157, 0.3);
  background: #3a1411;
  color: #ffe9d0;
  font-size: 13px;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: #7c0b10;
  border-color: #e0a49a;
}

/* 加载与空状态 */

.loading {
  padding: 64px 0;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  padding: 40px 0;
  color: var(--muted);
  font-size: 13px;
}

/* 表格 */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  background: #f7efe3;
  color: #6b4a3c;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr.clickable {
  cursor: pointer;
}

.table tbody tr.clickable:hover td {
  background: #fbf4ea;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* 题目回顾 */

.review-list {
  border-top: 1px solid var(--line);
}

.review-item {
  padding: 20px 22px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-left: 3px solid #cfc2ad;
}

.review-item.is-wrong {
  border-left-color: var(--red-mid);
}

.review-item.is-right {
  border-left-color: #3f7d4e;
}

.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.review-status {
  margin-left: auto;
  font-size: 12px;
}

.review-status.ok {
  color: var(--green);
}

.review-status.bad {
  color: var(--danger);
}

.review-no {
  font-family: var(--serif);
  font-size: 18px;
  color: #b99d78;
}

.review-stem {
  margin: 10px 0 12px;
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.8;
  color: var(--ink);
}

.review-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-opt {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

.review-opt .k {
  flex: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.review-opt.correct {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.review-opt.wrong {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.review-opt .flag {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.review-opt.correct .flag {
  color: var(--green);
}

.review-opt.wrong .flag {
  color: var(--danger);
}

.review-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.review-answer b {
  color: var(--ink-2);
  font-weight: 600;
}

.review-empty {
  padding: 32px 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .review-item {
    padding: 16px 14px;
  }

  .review-stem {
    font-size: 14.5px;
  }

  .review-opt {
    font-size: 13px;
  }

  .review-opt .flag {
    display: none;
  }
}