:root {
  --bg: #eef2eb;
  --bg-warm: #f7f3ec;
  --card: #ffffff;
  --text: #1a2e1f;
  --muted: #6b7c70;
  --primary: #2d6a4f;
  --primary-light: #40916c;
  --primary-dark: #1b4332;
  --accent: #bc6c25;
  --accent-soft: #fff4e6;
  --mock: #9d4edd;
  --mock-soft: #f3e8ff;
  --border: #dde5da;
  --correct: #2d6a4f;
  --wrong: #c1121f;
  --shadow: 0 16px 48px rgba(27, 67, 50, 0.09);
  --shadow-sm: 0 2px 12px rgba(27, 67, 50, 0.05);
  --shadow-hover: 0 20px 56px rgba(27, 67, 50, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(165deg, var(--bg) 0%, var(--bg-warm) 48%, #e8efe4 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body.splash-active .header,
body.splash-active .page {
  visibility: hidden;
}

.splash-panel {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #eef2eb 0%, #f7f3ec 50%, #e8efe4 100%);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  transition: opacity 0.35s var(--ease-out), visibility 0.35s;
}

.splash-panel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  text-align: center;
}

.splash-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(27, 67, 50, 0.18);
  margin-bottom: 16px;
}

.splash-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.splash-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.splash-loader {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 3px solid rgba(45, 106, 79, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
}

/* Header — 全宽顶栏，内容区与 page 同宽居中 */
.header {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #3a8f62 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(27, 67, 50, 0.22);
  padding-top: env(safe-area-inset-top);
}

.header::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.header-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 0;
}

.header-side {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-inner {
  flex: 1;
  text-align: center;
  min-width: 0;
  padding: 0 4px;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitle {
  margin-top: 2px;
  font-size: 0.72rem;
  opacity: 0.9;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitle.hidden { display: none; }

.header-countdown {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 244, 230, 0.95);
  color: #8b4513;
  border: 1px solid rgba(255, 255, 255, 0.35);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-countdown.hidden { display: none; }

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.icon-btn:active { transform: scale(0.96); }

/* 返回键隐藏时保留左侧占位，标题保持居中 */
.header-side-left .icon-btn.hidden {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

.main {
  flex: 1;
  padding: 20px 16px 32px;
}

.panel { animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card);
  border: 1px solid rgba(221, 229, 218, 0.85);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.card.compact,
.quiz-top.compact {
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-head {
  margin-bottom: 16px;
}

.panel-head h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.header-actions-right {
  flex: 0 0 auto;
  width: auto;
  gap: 6px;
}

.header-username {
  font-size: 0.82rem;
  opacity: 0.92;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-card { max-width: 400px; margin: 0 auto; }
.auth-card h1 { font-size: 1.25rem; margin-bottom: 6px; }

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
}
.auth-tab.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #e8f5e9;
}

.field input[type="text"],
.field input[type="password"] {
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--primary);
}

.hint, .field-hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.field-hint { margin: -8px 0 14px; min-height: 1.2em; }

.material-progress {
  margin: -4px 0 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #f4faf6 0%, #eef6f0 100%);
  border: 1px solid rgba(45, 106, 79, 0.12);
}

.material-progress.hidden { display: none; }

.material-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.material-progress-percent {
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.material-progress-track {
  height: 8px;
  background: rgba(45, 106, 79, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.material-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
  transition: width 0.35s var(--ease-out);
}

.material-progress-detail {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Home */
.hero {
  background: linear-gradient(145deg, #ffffff 0%, #f8fcf9 55%, #f4faf6 100%);
  border: 1px solid rgba(45, 106, 79, 0.1);
  margin-bottom: 18px;
  padding: 26px 24px 22px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(64, 145, 108, 0.08);
  pointer-events: none;
}

.hero-kicker {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary-light);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.32;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.hero-desc {
  color: var(--muted);
  font-size: 0.92rem;
}

.countdown-banner {
  margin: -4px -4px 18px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fff8ef 0%, #fff4e6 100%);
  border: 1px solid rgba(188, 108, 37, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: fadeIn 0.4s var(--ease-out);
}

.countdown-banner.hidden { display: none; }

.countdown-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.countdown-days {
  flex: 0 0 auto;
  min-width: 56px;
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(160deg, #d4883a 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
}

.countdown-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.countdown-copy strong {
  font-size: 0.95rem;
  color: var(--primary-dark);
}

.countdown-copy span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.countdown-today strong,
.countdown-over strong {
  font-size: 0.95rem;
  color: var(--primary-dark);
}

.countdown-over span {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.stats-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.stat-chip {
  flex: 1;
  min-width: 90px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
}

.stat-chip strong {
  display: block;
  font-size: 1.25rem;
  color: var(--primary);
}

.stat-chip span {
  font-size: 0.75rem;
  color: var(--muted);
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.mode-card {
  position: relative;
  text-align: left;
  padding: 22px 18px;
  border: 1px solid rgba(221, 229, 218, 0.9);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: transform 0.22s var(--ease-out), border-color 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.mode-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.mode-card:active {
  transform: translateY(-1px);
  transition-duration: 0.08s;
}

.mode-practice:hover { border-color: var(--primary-light); }
.mode-mock:hover { border-color: var(--mock); }
.mode-advice:hover { border-color: #e67e22; }

.mode-advice {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #fffbf5 0%, #fff 60%);
}

.advice-tag {
  background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 100%);
  color: #bf360c;
}

.mode-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 10px;
}

.mode-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.mode-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.mode-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--mock);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
}

.compact-tip {
  padding: 14px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--accent-soft);
  border-color: rgba(188, 108, 37, 0.2);
}

/* Form */
.form-card { margin-top: 4px; }

.field {
  display: block;
  margin-bottom: 16px;
}

.field span,
.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.field select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 1rem;
  color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7c70' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.field select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.15);
}

.preset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.preset-card {
  text-align: left;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.preset-card strong {
  display: block;
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 2px;
}

.preset-card span {
  font-size: 0.82rem;
  color: var(--muted);
}

.preset-card.selected {
  border-color: var(--mock);
  background: var(--mock-soft);
}

.btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s, background 0.15s;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.3);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.btn-mock {
  background: linear-gradient(135deg, #7b2cbf 0%, var(--mock) 100%) !important;
  box-shadow: 0 4px 14px rgba(157, 78, 221, 0.35) !important;
}

.btn.secondary {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
  margin-top: 10px;
}

.btn.ghost {
  width: auto;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  padding: 12px 18px;
}

.error {
  color: var(--wrong);
  margin-top: 12px;
  font-size: 0.88rem;
}

.hidden { display: none !important; }

/* Loading */
.loading-card { text-align: center; padding: 40px 24px; }

.loader {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-detail { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }

/* Quiz top */
.quiz-top-left,
.quiz-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: #e8f5e9;
  color: var(--primary);
}

.mode-badge.mock {
  background: var(--mock-soft);
  color: var(--mock);
}

.mode-badge.wrong {
  background: #fff0f0;
  color: var(--wrong);
}

.exam-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 20px;
}

.exam-timer.urgent {
  color: var(--wrong);
  background: #fde8e8;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% { opacity: 0.75; }
}

.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 14px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-fill.mock {
  background: linear-gradient(90deg, #7b2cbf, var(--mock));
}

.tag {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.tag-single { background: #e8f5e9; color: #2d6a4f; }
.tag-match { background: #fff3e0; color: #e65100; }
.tag-multi { background: #e3f2fd; color: #1565c0; }

.question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.question-head .question-type {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.report-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid #ffcdd2;
  border-radius: 20px;
  background: #fff8f8;
  color: #c62828;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.report-btn:hover:not(:disabled) {
  background: #ffebee;
  border-color: #ef9a9a;
}

.report-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.question-type {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.question-card h2 {
  font-size: 1.12rem;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.75;
}

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

.option-btn {
  text-align: left;
  padding: 15px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 0.94rem;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  line-height: 1.5;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary-light);
  background: #f4faf6;
}

.option-btn.selected { border-color: var(--primary); background: #e8f5e9; }
.option-btn.correct { border-color: var(--correct); background: #e8f5e9; }
.option-btn.wrong { border-color: var(--wrong); background: #fde8e8; }
.option-btn:disabled { cursor: default; }

.option-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option-check input { margin-top: 4px; accent-color: var(--primary); }
.option-check.selected { border-color: var(--primary); background: #e8f5e9; }
.option-check.correct { border-color: var(--correct); background: #e8f5e9; }
.option-check.wrong { border-color: var(--wrong); background: #fde8e8; }
.option-check.disabled { cursor: default; }

.b-pool {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.b-pool-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.b-pool-list { display: flex; flex-direction: column; gap: 4px; }
.b-pool-item { font-size: 0.88rem; }
.b-items { display: flex; flex-direction: column; gap: 14px; }

.b-item-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.b-item-stem {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.b-item-choices { display: flex; flex-wrap: wrap; gap: 8px; }

.b-choice-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.b-choice-btn:hover:not(:disabled) { border-color: var(--primary-light); background: #f4faf6; }
.b-choice-btn.selected { border-color: var(--primary); background: #e8f5e9; color: var(--primary); }
.b-choice-btn.correct { border-color: var(--correct); background: #e8f5e9; }
.b-choice-btn.wrong { border-color: var(--wrong); background: #fde8e8; }
.b-choice-btn:disabled { cursor: default; }

.format-hint {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

.quiz-actions .btn.primary,
.quiz-actions .btn.ghost {
  width: auto;
  flex: 1;
  min-width: 120px;
}

.confirm-btn { min-width: 140px; }

/* Mock nav */
.mock-nav {
  margin-top: 14px;
  padding: 16px 18px;
}

.mock-nav-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}

.mock-nav-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-dot {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}

.nav-dot.current {
  border-color: var(--mock);
  color: var(--mock);
  background: var(--mock-soft);
}

.nav-dot.answered {
  border-color: var(--primary-light);
  color: var(--primary);
  background: #e8f5e9;
}

/* Result */
.result { margin-top: 14px; }

.result-badge {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.result-badge.correct { color: var(--correct); }
.result-badge.wrong { color: var(--wrong); }

.explanation {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  line-height: 1.65;
}

/* Finish */
.finish-card { text-align: center; padding: 32px 24px; }

.finish-mode-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-light);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.finish-card h1 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.score-ring { margin: 24px 0; }

#score-num {
  display: block;
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.finish-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.mock-time-summary {
  margin: 12px 0;
  padding: 12px;
  background: var(--mock-soft);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--mock);
}

.score-label { color: var(--muted); font-size: 0.88rem; }

.footer {
  text-align: center;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.wrong-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  max-height: 45vh;
  overflow-y: auto;
}

.wrong-toolbar {
  margin-bottom: 16px;
  padding: 14px 16px;
}

.wrong-toolbar-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.wrong-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.wrong-count-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.wrong-count-field select {
  min-width: 100px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.9rem;
}

.wrong-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--wrong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--card);
}

.wrong-item h3 {
  font-size: 0.92rem;
  margin-bottom: 8px;
  line-height: 1.6;
}

.wrong-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.wrong-answer-line { font-size: 0.84rem; margin-bottom: 4px; }
.wrong-answer-line.wrong { color: var(--wrong); }
.wrong-answer-line.correct { color: var(--correct); }

.wrong-explanation {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.advice-toolbar {
  padding: 16px 18px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.advice-countdown-hint {
  flex: 1 1 100%;
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: #7a4a1a;
  font-size: 0.85rem;
  line-height: 1.5;
}

.advice-countdown-hint.hidden { display: none; }

.advice-result {
  margin-bottom: 14px;
}

.advice-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.advice-summary {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
  line-height: 1.5;
}

.advice-section {
  margin-bottom: 16px;
}

.advice-section h3 {
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 700;
}

.advice-section p,
.advice-section li {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

.advice-section ul {
  padding-left: 1.2em;
}

.advice-section li { margin-bottom: 6px; }

.advice-time-plan {
  background: var(--accent-soft);
  margin: 0 -4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(188, 108, 37, 0.15);
}

.advice-next {
  background: #e8f5e9;
  border-radius: var(--radius-sm);
  padding: 14px;
  border-left: 4px solid var(--primary);
}

.advice-history-wrap {
  padding: 18px;
}

.advice-history-title {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--muted);
}

.advice-history-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbf9;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.advice-history-item:hover {
  border-color: var(--primary-light);
  background: #f4faf6;
}

.advice-history-item strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.advice-history-item span {
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 520px) {
  .mode-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.38rem; }
  .card { padding: 20px 16px; }
  .question-card h2 { font-size: 1.02rem; }
  .quiz-actions .btn { min-width: 100%; flex: 1 1 100%; }
  .header-countdown { font-size: 0.62rem; padding: 2px 8px; }
  .subtitle { font-size: 0.68rem; }
  .countdown-days { font-size: 2rem; min-width: 48px; }
}
