:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --accent: #3b82f6;
  --accent-2: #1d4ed8;
  --accent-3: #e2e8f0;
  --surface: #f8fafc;
  --surface-strong: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 6px 14px rgba(15, 23, 42, 0.1);
  --ring: 0 0 0 2px rgba(59, 130, 246, 0.16);
  --radius: 12px;
  --brand-size: 36px;
  --brand-radius: 10px;
  --font-body: "IBM Plex Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-display: "IBM Plex Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: #f6f7fb;
  min-height: 100vh;
}

img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid #c7d2fe;
  outline-offset: 2px;
}

.bg-orb {
  display: none;
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 24px 6vw;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: var(--brand-size);
  height: var(--brand-size);
  border-radius: var(--brand-radius);
  background: #ffffff;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  box-shadow: none;
  overflow: hidden;
  padding: 0;
}

.brand-mark img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(22px, 3.6vw, 28px);
  letter-spacing: 1px;
}

.brand-text p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.site-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease,
    transform 0.2s ease;
}

.site-nav a:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--ink);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.mobile-nav-toggle {
  display: none;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
}

body.exam-active .site-nav a {
  opacity: 0.6;
}

.page {
  position: relative;
  z-index: 1;
  padding: 16px 6vw 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: center;
}

.hero-text h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 4.8vw, 34px);
  margin: 0 0 12px;
  line-height: 1.2;
}

.hero-text p {
  margin: 0 0 18px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-card {
  background: var(--surface-strong);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.hero-card.is-clickable {
  cursor: pointer;
}

.hero-card.is-clickable:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.hero-card.is-clickable:focus-visible {
  outline: 2px solid #cbd5e1;
  outline-offset: 2px;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.stat-number {
  font-size: clamp(28px, 4.8vw, 36px);
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
}

.tag-cloud {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.tag:hover {
  background: #e2e8f0;
  text-decoration: none;
  transform: translateY(-1px);
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface-strong);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.grid .card:hover {
  transform: translateY(-2px);
}

.card.is-clickable {
  cursor: pointer;
}

.card.is-clickable:focus-visible {
  outline: 2px solid #cbd5e1;
  outline-offset: 2px;
}

.daily-rate-card {
  display: flex;
  gap: 18px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.daily-rate-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  text-decoration: none;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.daily-rate-card:hover .daily-rate-chart,
.daily-rate-card:focus-visible .daily-rate-chart {
  transform: scale(1.06);
}

.daily-rate-chart {
  --rate: 0%;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0 var(--rate), #e2e8f0 var(--rate) 100%);
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.daily-rate-chart:hover {
  transform: scale(1.06);
}

.daily-rate-card[data-empty="1"] .daily-rate-chart {
  background: conic-gradient(#e2e8f0 0 100%);
}

.daily-rate-chart::after {
  content: "";
  position: absolute;
  inset: 12px;
  background: #ffffff;
  border-radius: 50%;
}

.daily-rate-value {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.daily-rate-text h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.daily-rate-text p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
}

.daily-rate-text .link-hint {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.steps {
  padding-left: 20px;
  margin: 0;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease,
    transform 0.2s ease;
  box-shadow: none;
}

.btn.primary {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #1d4ed8;
  box-shadow: none;
}

.btn.ghost {
  background: #ffffff;
  border-color: var(--border);
  color: var(--ink);
}

.btn.danger {
  background: #fff5f5;
  border-color: #fecaca;
  color: #b91c1c;
}

.btn:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.btn:active {
  box-shadow: none;
  transform: translateY(0);
}

.btn.primary:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
  box-shadow: none;
}

.btn.ghost:hover {
  background: #eef2f7;
}

.btn.danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 10px;
  align-items: end;
}

.filter-actions {
  display: inline-flex;
  gap: 10px;
  align-self: end;
  justify-self: start;
}

.filter-actions .btn {
  padding: 8px 14px;
}

.filter-actions .btn.primary {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #1d4ed8;
}

.filter-actions .btn.primary:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-actions .btn.ghost {
  background: #f8fafc;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.multi-select-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.field-label {
  font-size: 14px;
  color: var(--muted);
}

.practice-filter .multi-select-field {
  grid-column: 1 / -1;
}

.multi-select {
  position: relative;
}

.multi-select summary {
  list-style: none;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.multi-select summary:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateY(-1px);
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 12px;
}

.multi-select[open] summary {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.multi-select-panel {
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.multi-select-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  background: #ffffff;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.multi-select-option input {
  accent-color: var(--accent);
}

.multi-select-option:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.multi-select-all-option {
  font-weight: 700;
  border-color: #c7d2fe;
  background: #f8fbff;
}

.multi-confirm {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #ffffff;
}

.mode-option {
  padding: 10px 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.mode-option.active {
  background: #eef2ff;
  color: #1d4ed8;
}

.mode-divider {
  width: 1px;
  height: 60%;
  background: var(--border);
  display: block;
}

.mode-option:hover {
  color: var(--ink);
  text-decoration: none;
}

.practice-topbar {
  position: sticky;
  top: 12px;
  z-index: 25;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.practice-topbar-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.practice-topbar-center {
  display: flex;
  justify-content: center;
  width: 100%;
}

.practice-topbar .mode-switch {
  width: min(360px, 100%);
}

.practice-topbar-title {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #1d4ed8;
  font-weight: 600;
  text-align: center;
  width: min(320px, 100%);
}

.practice-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 2vw, 10px);
  width: 100%;
}

.practice-topbar-actions .btn {
  white-space: nowrap;
}

.practice-topbar-actions .practice-menu {
  margin-left: auto;
}

.practice-topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.practice-topbar-meta span {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.practice-menu {
  position: relative;
}

.practice-menu summary {
  list-style: none;
}

.practice-menu summary::-webkit-details-marker {
  display: none;
}

.practice-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 170px;
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 60;
}

.practice-menu-panel a {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.practice-menu-panel a:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

body.practice-active {
  font-size: clamp(12px, 2.6vw, 13px);
}

body.practice-active .page {
  gap: clamp(10px, 3vw, 14px);
  padding-top: clamp(8px, 2vw, 12px);
}

body.practice-active .card {
  padding: clamp(10px, 2.8vw, 16px);
}

body.practice-active .question-head {
  margin-bottom: clamp(6px, 2vw, 8px);
}

body.practice-active .badge {
  font-size: clamp(10px, 2.4vw, 11px);
  padding: clamp(2px, 0.6vw, 3px) clamp(6px, 1.8vw, 8px);
}

body.practice-active .question-text {
  font-size: clamp(12.5px, 3.1vw, 15px);
  line-height: 1.5;
  margin-bottom: clamp(6px, 2vw, 8px);
}

body.practice-active .options {
  margin-bottom: clamp(8px, 2.2vw, 10px);
}

body.practice-active .options li {
  margin-bottom: clamp(3px, 1.2vw, 4px);
}

body.practice-active .choice-grid {
  gap: clamp(6px, 2vw, 8px);
}

body.practice-active .choice-item {
  padding: clamp(6px, 1.8vw, 8px) clamp(8px, 2.6vw, 10px);
  padding-right: clamp(18px, 6vw, 26px);
  font-size: clamp(11px, 2.8vw, 12.5px);
  border-radius: clamp(9px, 2.6vw, 12px);
}

body.practice-active .choice-letter {
  min-width: clamp(14px, 3vw, 16px);
}

body.practice-active .choice-text {
  line-height: 1.4;
}

body.practice-active .answer-panel {
  padding: clamp(6px, 2vw, 8px) clamp(8px, 2.8vw, 10px);
  margin-bottom: clamp(8px, 2.2vw, 10px);
}

body.practice-active .practice-feedback {
  margin-top: clamp(4px, 1.2vw, 6px);
}

body.practice-active .question-actions {
  gap: clamp(4px, 1.6vw, 6px);
}

body.practice-active .btn {
  padding: clamp(4px, 1.4vw, 6px) clamp(8px, 2.6vw, 10px);
  border-radius: clamp(7px, 2vw, 8px);
  font-size: clamp(11px, 2.6vw, 12.5px);
}

body.practice-active .practice-topbar {
  top: clamp(6px, 1.6vw, 10px);
  padding: clamp(6px, 2vw, 8px) clamp(8px, 3vw, 12px);
  gap: clamp(6px, 2vw, 8px);
  border-radius: clamp(12px, 3vw, 14px);
}

body.practice-active .practice-topbar-main {
  gap: clamp(6px, 2vw, 8px);
}

body.practice-active .practice-topbar-title {
  padding: clamp(5px, 2vw, 6px) clamp(10px, 3vw, 12px);
  font-size: clamp(12px, 2.8vw, 13px);
}

body.practice-active .mode-option {
  padding: clamp(6px, 2vw, 8px) clamp(8px, 2.6vw, 10px);
  font-size: clamp(11px, 2.6vw, 12.5px);
}

body.practice-active .practice-topbar-actions .btn {
  padding: clamp(4px, 1.4vw, 6px) clamp(8px, 2.6vw, 10px);
  font-size: clamp(11px, 2.6vw, 12.5px);
}

body.practice-active .practice-topbar-meta {
  font-size: clamp(9px, 2.2vw, 10.5px);
  gap: clamp(4px, 1.6vw, 6px);
}

body.practice-active .practice-topbar-meta span {
  padding: clamp(1px, 0.6vw, 2px) clamp(4px, 1.8vw, 6px);
}

body.practice-active .site-header {
  display: none;
}

.text-answer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.text-answer .btn {
  align-self: flex-start;
}

input,
select,
textarea {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #c7d2fe;
  box-shadow: var(--ring);
}

textarea {
  resize: vertical;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-hint {
  font-size: 13px;
  color: var(--muted);
}

.form-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.form .is-disabled {
  opacity: 0.6;
}

.form .is-disabled input {
  background: #f8fafc;
  cursor: not-allowed;
}

.count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.option-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.option-add {
  display: flex;
  align-items: flex-end;
}

.option-add .btn {
  padding: 8px 12px;
}

.notice {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.notice.success {
  border-color: #c7d2fe;
  background: #f5f7ff;
  color: #1d4ed8;
}

.notice.error {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
}

.notice.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.question-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 12px;
  text-transform: none;
}

.badge.ghost {
  background: #f1f5f9;
  color: #64748b;
  text-transform: none;
}

.badge.success {
  background: #ecfdf5;
  color: #047857;
}

.badge.warn {
  background: #fffbeb;
  color: #b45309;
}

.badge.danger {
  background: #fff1f2;
  color: #be123c;
}

.question-text {
  font-size: clamp(16px, 2.6vw, 18px);
  line-height: 1.7;
  margin-bottom: 14px;
}

.options {
  padding-left: 18px;
  margin: 0 0 16px;
}

.options li {
  margin-bottom: 6px;
  color: var(--muted);
}

.answer-panel {
  background: #f8fafc;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

.answer-panel.is-visible {
  max-height: 400px;
  opacity: 1;
}

.answer-line {
  margin-bottom: 8px;
}

.question-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.practice-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.practice-feedback {
  margin-top: 12px;
  font-weight: 600;
}

.practice-feedback.correct {
  color: #166534;
}

.practice-feedback.wrong {
  color: #b91c1c;
}

.practice-feedback.pending {
  color: var(--muted);
}

.exam-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.exam-question {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.exam-question:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.answer-input textarea {
  width: 100%;
}

.exam-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.exam-info-item {
  padding: 6px 12px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.exam-timer {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  padding: 10px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}

.exam-timer-label {
  font-size: 12px;
  color: var(--muted);
}

.exam-timer-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.exam-result-modal {
  border: 1px solid #c7d2fe;
  background: #f8f9ff;
}

.exam-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.exam-result-chart {
  margin: 14px 0;
}

.exam-chart-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
}

.exam-chart-correct {
  background: #93c5fd;
}

.exam-chart-wrong {
  background: #fecaca;
}

.exam-chart-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.type-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.type-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.type-stat:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.type-stat summary {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.type-stat summary::-webkit-details-marker {
  display: none;
}

.type-bar {
  margin: 10px 0;
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.type-bar-fill {
  height: 100%;
  background: #c7d2fe;
}

.type-detail {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.choice-grid.choice-column {
  flex-direction: column;
  align-items: stretch;
}

.choice-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 36px 12px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
}

.choice-item.choice-full {
  width: 100%;
  align-items: flex-start;
}

.choice-letter {
  font-weight: 600;
  min-width: 20px;
  color: var(--muted);
}

.choice-text {
  flex: 1;
  line-height: 1.5;
}

.choice-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.choice-item:focus-within {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.choice-item:has(input:checked),
.choice-item.is-checked {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #1e3a8a;
}

.choice-item::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
  transform: translateY(-50%);
  opacity: 0;
}

.choice-item:has(input:checked)::after,
.choice-item.is-checked::after {
  background: var(--accent);
  opacity: 1;
}

.choice-item:has(input:checked) .choice-letter,
.choice-item.is-checked .choice-letter {
  color: #1d4ed8;
}

.choice-item.is-correct {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.choice-item.is-wrong {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.choice-item.is-missed {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

.choice-item.is-correct.is-checked,
.choice-item.is-correct:has(input:checked) {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.choice-item.is-wrong.is-checked,
.choice-item.is-wrong:has(input:checked) {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.choice-item.is-missed.is-checked,
.choice-item.is-missed:has(input:checked) {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

.choice-item.is-correct:has(input:checked) .choice-letter,
.choice-item.is-correct.is-checked .choice-letter,
.choice-item.is-correct .choice-letter {
  color: #15803d;
}

.choice-item.is-wrong:has(input:checked) .choice-letter,
.choice-item.is-wrong.is-checked .choice-letter,
.choice-item.is-wrong .choice-letter {
  color: #b91c1c;
}

.choice-item.is-missed:has(input:checked) .choice-letter,
.choice-item.is-missed.is-checked .choice-letter,
.choice-item.is-missed .choice-letter {
  color: #1d4ed8;
}

.choice-item.is-correct:has(input:checked)::after,
.choice-item.is-correct.is-checked::after {
  background: #22c55e;
  opacity: 1;
}

.choice-item.is-wrong:has(input:checked)::after,
.choice-item.is-wrong.is-checked::after {
  background: #ef4444;
  opacity: 1;
}

.choice-item.is-missed::after,
.choice-item.is-missed:has(input:checked)::after,
.choice-item.is-missed.is-checked::after {
  background: #3b82f6;
  opacity: 1;
}

.result-summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.result-item {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.result-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.result-item.result-wrong {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.result-item.result-correct {
  border-left: 4px solid var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.result-line {
  margin-bottom: 8px;
}

.wrong-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.wrong-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.wrong-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.inline-form {
  margin-top: 12px;
}

.manage-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.manage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manage-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.manage-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.manage-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.manage-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.manage-check input {
  margin-top: 4px;
}

.manage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.option-list {
  padding-left: 18px;
  margin: 8px 0 12px;
  color: var(--muted);
}

.manage-answer {
  margin-bottom: 8px;
}

.pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}

.pagination a,
.pagination span {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: #ffffff;
  font-size: 13px;
}

.pagination a {
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
}

.pagination a:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: var(--ink);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

.pagination .current {
  background: #eef2ff;
  color: #1d4ed8;
  border-color: #c7d2fe;
}

.code {
  background: #1f1b2e;
  color: #f8f0e6;
  padding: 16px;
  border-radius: 14px;
  overflow-x: auto;
  font-size: 13px;
}

.site-footer {
  padding: 24px 6vw 32px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--accent-2);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 40;
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.back-to-top:focus-visible {
  outline: 2px solid #c7d2fe;
  outline-offset: 2px;
}

.game-time-input {
  display: flex;
  gap: 8px;
}

.game-time-input input {
  width: 100%;
}

.game-topbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: center;
}

.game-total-timer,
.game-question-timer {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
}

.game-timer-label {
  font-size: 12px;
  color: var(--muted);
}

.game-timer-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1px;
}

.game-total-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.game-total-fill {
  height: 100%;
  width: 100%;
  background: #60a5fa;
  transition: width 0.2s ease;
}

.game-question-timer.is-urgent .game-timer-value {
  color: #dc2626;
  animation: game-pulse 0.6s infinite;
}

.game-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

.game-competitor {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow);
}

.game-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #1f2937;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

.game-avatar.ai {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #ea580c;
}

.game-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.game-score-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.game-score-label {
  font-size: 12px;
  color: var(--muted);
}

.game-stats {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.game-progress {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.game-progress-fill {
  height: 100%;
  width: 0%;
  background: #93c5fd;
  transition: width 0.2s ease;
}

.game-versus {
  font-weight: 700;
  color: var(--muted);
}

.game-lead {
  margin-top: 10px;
  font-weight: 600;
  color: #2563eb;
}

.game-streak {
  font-weight: 700;
  color: #16a34a;
  min-height: 20px;
}

.game-streak.is-active {
  animation: game-bounce 0.6s ease;
}

.game-audio-hint {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: #f8fafc;
}

.game-audio-hint.is-hidden {
  display: none;
}

.game-question-card .multi-confirm {
  margin-top: 12px;
}

.game-question-card .question-actions {
  align-items: center;
}

.game-question-card [data-game-next] {
  display: none;
}

.game-question-card [data-game-next].is-visible {
  display: inline-flex;
}

.game-result {
  display: none;
}

.game-result.is-visible {
  display: block;
}

.game-chart {
  width: 100%;
  height: 200px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  padding: 12px;
}

.game-chart-svg {
  width: 100%;
  height: 100%;
}

.game-chart-line {
  fill: none;
  stroke-width: 2;
}

.game-chart-line.player {
  stroke: #2563eb;
}

.game-chart-line.ai {
  stroke: #f97316;
}

.game-inline-meta {
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
}

@keyframes game-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes game-bounce {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: center;
    gap: 12px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand-text p {
    display: none;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    width: 100%;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-nav a {
    text-align: center;
    padding: 10px 8px;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .card {
    padding: 16px;
  }

  .question-text {
    font-size: 16px;
  }

  .choice-item {
    padding: 10px 12px;
  }

  .daily-rate-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .daily-rate-chart {
    width: 84px;
    height: 84px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  body.practice-active .practice-topbar-meta {
    display: none;
  }

  .section-title-row {
    flex-direction: column;
  }

  .preview-stats {
    justify-content: flex-start;
  }

}

@media (max-height: 700px) {
  body.practice-active .practice-topbar-meta {
    display: none;
  }
}

@media (max-width: 520px) {
  .filter {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-actions .btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  .count-grid,
  .option-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .site-nav a {
    flex: 1 1 100%;
  }
}
@media (max-width: 720px) {
  .manage-item {
    grid-template-columns: 1fr;
  }

  .manage-check {
    margin-bottom: 6px;
  }

  .manage-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .question-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .exam-timer {
    top: 8px;
    right: 8px;
    padding: 8px 10px;
  }

  .game-scoreboard {
    grid-template-columns: 1fr;
  }

  .game-versus {
    text-align: center;
  }

  .practice-topbar {
    top: 8px;
    padding: 10px 12px;
  }

  .practice-topbar-center {
    justify-content: stretch;
  }

  .practice-topbar .mode-switch,
  .practice-topbar-title {
    width: 100%;
  }

  .practice-menu-panel {
    right: 0;
    left: auto;
  }

}

@media (prefers-reduced-motion: reduce) {
  .site-nav a,
  .hero-card,
  .tag,
  .card,
  .daily-rate-card,
  .daily-rate-chart,
  .btn,
  .multi-select summary,
  .multi-select-option,
  .choice-item,
  .exam-question,
  .type-stat,
  .result-item,
  .wrong-item,
  .manage-item,
  .pagination a,
  .back-to-top {
    transition: none;
    transform: none;
  }

  .game-question-timer.is-urgent .game-timer-value,
  .game-streak.is-active {
    animation: none;
  }
}

/* 全站响应式布局增强：电脑宽屏、平板双列、手机单列与横向导航 */

/* Stable responsive layout: keep natural page scrolling, avoid nested card scrollbars. */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

.site-header,
.page {
  width: min(1320px, calc(100% - 32px));
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  padding-left: 0;
  padding-right: 0;
}

.page {
  padding-left: 0;
  padding-right: 0;
}

.card,
.hero-card,
.manage-item,
.exam-question,
.wrong-item {
  overflow-wrap: anywhere;
}

input,
select,
textarea {
  max-width: 100%;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  padding: 0;
  flex: 0 0 auto;
}

body.is-ajax-loading .page {
  opacity: 0.78;
  transition: opacity 0.12s ease;
}

.manage-select-all {
  flex-direction: row;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.compact-filter {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.import-preview-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.import-preview-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
}

.import-status-duplicate {
  border-color: #fecdd3;
  background: #fff7f7;
}

.import-status-similar {
  border-color: #fde68a;
  background: #fffdf5;
}

.import-preview-head,
.import-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.import-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.import-question-text {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.compact-options {
  margin: 8px 0 10px;
  padding-left: 22px;
}

.compact-notice {
  margin: 8px 0;
}

.import-edit-grid {
  margin-top: 10px;
}

.sticky-form-actions {
  position: static;
  padding: 10px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.type-edit-form {
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}

@media (max-width: 720px) {
  .section-title-row {
    flex-direction: column;
  }

  .preview-stats {
    justify-content: flex-start;
  }
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.choice-grid.choice-column {
  grid-template-columns: 1fr;
}

.choice-item {
  width: 100%;
  min-width: 0;
}

.exam-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.exam-info-item {
  border-radius: 14px;
  text-align: center;
}

body.page-exam .exam-config {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 12px;
  align-items: end;
}

body.page-exam .exam-config > input[type="hidden"] {
  display: none;
}

body.page-exam .exam-config .form-hint,
body.page-exam .exam-config .count-grid,
body.page-exam .exam-config > button {
  grid-column: 1 / -1;
}

body.page-exam .exam-config .count-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
}

@media (max-width: 960px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .site-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .game-scoreboard {
    grid-template-columns: 1fr;
  }

  .game-versus {
    text-align: center;
  }
}

@media (max-width: 720px) {
  .site-header,
  .page {
    width: calc(100% - 20px);
  }

  .site-header {
    padding-top: 12px;
    padding-bottom: 8px;
    gap: 10px;
  }

  .brand-text h1 {
    font-size: 20px;
  }

  .brand-text p {
    font-size: 12px;
  }

  .site-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -10px;
    padding: 0 10px 6px;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 12px;
  }

  .card,
  .hero-card {
    padding: 16px;
    border-radius: 14px;
  }

  .filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .filter-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .filter-actions .btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  body.page-practice .filter .multi-select-field,
  body.page-wrong_practice .filter .multi-select-field,
  body.page-game_rush .filter .multi-select-field {
    grid-column: 1 / -1;
  }

  body.page-exam .exam-config {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.page-exam .exam-config .count-grid {
    grid-template-columns: 1fr;
  }

  .exam-timer {
    top: 8px;
    right: 8px;
    padding: 8px 10px;
  }
}

@media (max-width: 560px) {
  .site-header,
  .page {
    width: calc(100% - 16px);
  }

  .hero-actions,
  .question-actions,
  .manage-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .btn,
  .question-actions .btn,
  .question-actions a.btn,
  .manage-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .filter,
  .count-grid,
  .option-grid,
  body.page-exam .exam-config {
    grid-template-columns: 1fr;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .question-text {
    font-size: 16px;
    line-height: 1.65;
  }

  .daily-rate-card {
    flex-direction: column;
  }

  .pagination {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pagination a,
  .pagination span {
    text-align: center;
  }
}


/* Natural-flow quick actions: no forced full-screen page and no nested list scrollbars. */
.answer-panel.is-visible {
  max-height: none;
  overflow: visible;
}

body.practice-active {
  font-size: inherit;
}

body.practice-active .card {
  padding: clamp(14px, 2.8vw, 22px);
}

body.practice-active .question-text {
  font-size: clamp(15px, 2.8vw, 18px);
  line-height: 1.68;
}

body.practice-active .choice-item {
  font-size: clamp(13px, 2.7vw, 15px);
  line-height: 1.5;
}

.practice-topbar-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.practice-quick-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.practice-quick-actions .btn {
  white-space: nowrap;
}

.practice-topbar-actions .practice-menu {
  margin-left: auto;
}

.practice-question {
  scroll-margin-top: 120px;
}

.manage-list,
.manage-form,
.card {
  max-height: none;
}

.manage-list,
.manage-form,
.card,
.exam-form {
  overflow: visible;
}

body.exam-active .page {
  padding-bottom: 128px;
}

.exam-action-dock {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 55;
  width: min(760px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.exam-dock-status {
  min-width: 150px;
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
}

.exam-dock-count {
  color: var(--muted);
  font-size: 13px;
}

.exam-dock-count strong {
  color: var(--accent-2);
  font-size: 18px;
}

.exam-dock-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.exam-dock-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #93c5fd, #2563eb);
  transition: width 0.18s ease;
}

.exam-dock-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
}

.exam-question {
  scroll-margin-top: 16px;
}

.exam-question.is-answered {
  border-color: #bfdbfe;
  background: rgba(239, 246, 255, 0.62);
}

.game-board {
  position: sticky;
  top: 12px;
  z-index: 24;
}

body.page-game_rush .page {
  padding-bottom: 96px;
}

body.page-game_rush .game-question-card .question-actions {
  position: sticky;
  bottom: 12px;
  z-index: 28;
  padding: 10px;
  margin: 12px -10px -10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

@media (max-width: 720px) {
  .practice-topbar-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
  }

  .practice-quick-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    width: 100%;
  }

  .practice-quick-actions .btn,
  .practice-topbar-actions > .btn {
    justify-content: center;
  }

  .practice-topbar-actions .practice-menu {
    margin-left: 0;
    justify-self: end;
  }

  body.exam-active .page {
    padding-bottom: 150px;
  }

  .exam-action-dock {
    width: calc(100% - 20px);
    bottom: max(10px, env(safe-area-inset-bottom));
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
  }

  .exam-dock-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .exam-dock-actions .btn {
    justify-content: center;
  }

  .game-board {
    top: 8px;
  }
}

@media (max-width: 420px) {
  .practice-topbar-actions {
    grid-template-columns: 1fr;
  }

  .practice-topbar-actions .practice-menu {
    justify-self: stretch;
  }

  .practice-menu summary {
    justify-content: center;
  }

  .exam-dock-actions {
    grid-template-columns: 1fr;
  }
}

/* Advanced responsive learning cockpit polish */
:root {
  --ink: #172033;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-2: #2563eb;
  --accent-3: #e0e7ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --surface: #eef4ff;
  --surface-strong: rgba(255, 255, 255, 0.82);
  --border: rgba(148, 163, 184, 0.28);
  --shadow: 0 18px 45px rgba(30, 41, 59, 0.08);
  --shadow-hover: 0 26px 68px rgba(37, 99, 235, 0.16);
  --radius: 22px;
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(99, 102, 241, 0.18), transparent 32rem),
    radial-gradient(circle at 90% 8%, rgba(14, 165, 233, 0.16), transparent 30rem),
    linear-gradient(135deg, #f8fbff 0%, #eef4ff 48%, #f8fafc 100%);
  background-attachment: fixed;
}

.bg-orb {
  display: block;
  position: fixed;
  z-index: 0;
  width: 34vw;
  height: 34vw;
  min-width: 260px;
  min-height: 260px;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(20px);
  opacity: 0.5;
  animation: orbFloat 12s ease-in-out infinite alternate;
}

.orb-1 {
  left: -12vw;
  top: 8vh;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.34), transparent 68%);
}

.orb-2 {
  right: -12vw;
  bottom: 2vh;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.26), transparent 68%);
  animation-delay: -4s;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  margin: 12px auto 0;
  width: min(1320px, calc(100% - 32px));
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
}

.brand-mark {
  border: 1px solid rgba(99, 102, 241, 0.16);
  background: linear-gradient(135deg, #fff, #eef2ff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 10px 24px rgba(99, 102, 241, .14);
}

.site-nav {
  gap: 8px;
}

.site-nav a,
.btn,
.tag,
.badge,
.multi-select summary,
.chip-button {
  -webkit-tap-highlight-color: transparent;
}

.site-nav a {
  background: rgba(255, 255, 255, 0.66);
  border-color: rgba(148, 163, 184, 0.24);
  color: #475569;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.95), rgba(224, 242, 254, 0.92));
  color: #1d4ed8;
  text-decoration: none;
}

.page {
  max-width: 1320px;
  padding-top: 26px;
}

.card,
.hero-card,
.metric-card,
.bento-card,
.knowledge-card {
  position: relative;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.24);
  backdrop-filter: blur(18px) saturate(1.24);
  overflow: hidden;
}

.card::before,
.metric-card::before,
.bento-card::before,
.knowledge-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.66), transparent 42%);
  opacity: 0.72;
}

.card > *,
.metric-card > *,
.bento-card > *,
.knowledge-card > * {
  position: relative;
  z-index: 1;
}

.card:hover,
.metric-card:hover,
.bento-card:hover,
.knowledge-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: var(--shadow-hover);
}

.btn {
  border-radius: 999px;
  min-height: 38px;
  justify-content: center;
}

.btn.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #6366f1, #2563eb 56%, #0ea5e9);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.btn.ghost {
  background: rgba(255,255,255,.72);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-bottom: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 999px;
  background: rgba(238, 242, 255, 0.78);
  color: #4338ca;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.learning-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 20px;
  align-items: stretch;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.86), rgba(238,242,255,.70)),
    radial-gradient(circle at 18% 20%, rgba(99,102,241,.16), transparent 38%),
    radial-gradient(circle at 100% 0%, rgba(14,165,233,.16), transparent 32%);
  box-shadow: 0 26px 80px rgba(30, 41, 59, 0.1);
  overflow: hidden;
}

.learning-hero-copy h2 {
  margin: 0 0 12px;
  max-width: 880px;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.learning-hero-copy p {
  max-width: 780px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.8;
}

.dashboard-hero-panel,
.knowledge-orbit-card,
.learning-metric-ring {
  display: grid;
  place-items: center;
}

.dashboard-hero-panel {
  gap: 16px;
}

.learning-metric-ring {
  --value: 0;
  width: min(260px, 58vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,.94) 0 55%, transparent 56%),
    conic-gradient(#6366f1 calc(var(--value) * 1%), rgba(226,232,240,.82) 0);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 22px 52px rgba(99,102,241,.18);
}

.ring-value {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 900;
  letter-spacing: -0.06em;
  color: #1e1b4b;
}

.ring-label {
  margin-top: -42px;
  color: var(--muted);
  font-weight: 700;
}

.hero-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.hero-mini-stats span {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.62);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.hero-mini-stats strong {
  color: var(--ink);
  font-size: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.compact-dashboard {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  display: grid;
  min-height: 138px;
  padding: 20px;
  border-radius: 22px;
  color: inherit;
  text-decoration: none;
}

.metric-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
}

.metric-card strong {
  margin: 8px 0 4px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  color: #1d4ed8;
  letter-spacing: -0.04em;
}

.metric-label {
  color: #475569;
  font-weight: 800;
}

.metric-hint {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
}

.glow-card {
  background: linear-gradient(135deg, rgba(238,242,255,.96), rgba(224,242,254,.84));
}

.bento-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 16px;
}

.bento-card {
  min-height: 190px;
  padding: 24px;
  border-radius: 26px;
  color: inherit;
  text-decoration: none;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.bento-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
}

.bento-card h3,
.knowledge-card h3 {
  margin: 0 0 10px;
  font-size: clamp(20px, 2vw, 26px);
}

.bento-card p {
  color: var(--muted);
  line-height: 1.75;
}

.primary-bento {
  grid-row: span 2;
  background: linear-gradient(135deg, rgba(99,102,241,.96), rgba(37,99,235,.9));
  color: #fff;
}

.primary-bento .eyebrow {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.24);
  color: #fff;
}

.primary-bento p,
.primary-bento .bento-link {
  color: rgba(255,255,255,.84);
}

.bento-link {
  display: inline-flex;
  margin-top: 8px;
  color: #2563eb;
  font-weight: 800;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .86fr);
  gap: 16px;
  align-items: start;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title-row h3,
.section-title-row h4 {
  margin: 0 0 4px;
}

.insight-title-copy {
  width: 100%;
  min-width: 0;
}

.insight-heading-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.insight-heading-line h3 {
  min-width: 0;
  margin: 0;
}

.insight-inline-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.bank-progress-toggle {
  display: none;
}

@media (max-width: 900px) {
  body.page-index:not(.exam-active):not(.page-exam) .bank-progress-toggle {
    display: inline-flex;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bank-insight-card.is-bank-progress-collapsed .bank-progress-body {
    display: none;
  }
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(226,232,240,.92);
}

.progress-fill {
  height: 100%;
  min-width: 2%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  transition: width .28s ease;
}

.progress-fill.good { background: linear-gradient(90deg, #34d399, #059669); }
.progress-fill.mid { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.progress-fill.weak { background: linear-gradient(90deg, #fb7185, #ef4444); }

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: #475569;
  font-weight: 700;
}

.weak-tag-list,
.bank-progress-list,
.review-queue-list {
  display: grid;
  gap: 10px;
}

.weak-tag,
.bank-progress-item,
.queue-item {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 16px;
  background: rgba(255,255,255,.56);
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.weak-tag:hover,
.bank-progress-item:hover,
.queue-item:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.22);
  background: rgba(255,255,255,.82);
}

.weak-tag,
.queue-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.weak-tag strong,
.queue-score {
  color: #1d4ed8;
}

.queue-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-score {
  position: relative;
  min-width: 62px;
  padding: 5px 9px;
  border-radius: 999px;
  background: conic-gradient(#6366f1 var(--score), #e2e8f0 0);
  text-align: center;
  font-weight: 800;
  isolation: isolate;
}

.queue-score::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  border-radius: inherit;
  background: rgba(255,255,255,.92);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-button {
  padding: 7px 11px;
  border: 1px solid rgba(99,102,241,.18);
  border-radius: 999px;
  background: rgba(238,242,255,.72);
  color: #4338ca;
  font-weight: 800;
  cursor: pointer;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr));
  gap: 16px;
}

.knowledge-card {
  display: grid;
  gap: 12px;
}

.knowledge-orbit-card {
  justify-self: end;
  width: min(300px, 72vw);
  aspect-ratio: 1.05;
  border-radius: 32px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.95), rgba(255,255,255,.62) 42%, transparent 43%),
    linear-gradient(135deg, rgba(99,102,241,.88), rgba(14,165,233,.7));
  color: #fff;
  box-shadow: 0 22px 60px rgba(37, 99, 235, .22);
}

.knowledge-orbit-card strong {
  font-size: clamp(46px, 8vw, 78px);
  line-height: 1;
}

.knowledge-orbit-card span,
.knowledge-orbit-card small {
  color: rgba(255,255,255,.86);
  font-weight: 800;
}

.inline-editor summary {
  cursor: pointer;
  color: #2563eb;
  font-weight: 800;
}

.inline-editor[open] {
  padding-top: 8px;
}

.inline-filter select {
  min-width: 160px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.analysis-panel {
  padding: 16px;
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 18px;
  background: rgba(255,255,255,.56);
}

.analysis-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.analysis-row .progress-track {
  grid-column: 1 / -1;
}

.ai-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(238,242,255,.82), rgba(255,255,255,.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.76);
}

.ai-panel[hidden] {
  display: none;
}

.ai-panel-title {
  margin-bottom: 8px;
  color: #4338ca;
  font-weight: 900;
}

.ai-panel-body {
  white-space: pre-wrap;
  color: #334155;
  line-height: 1.78;
}

.ai-panel.is-loading {
  color: #6366f1;
  animation: pulsePanel 1s ease-in-out infinite alternate;
}

.empty-state {
  text-align: center;
}

.mini-empty {
  padding: 18px;
  border: 1px dashed rgba(148,163,184,.4);
  border-radius: 18px;
  background: rgba(248,250,252,.58);
}

.badge.warn {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

body.is-ajax-loading .page {
  opacity: .66;
  transform: translateY(2px);
  transition: opacity .16s ease, transform .16s ease;
}

@keyframes orbFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3vw, -2vh, 0) scale(1.08); }
}

@keyframes pulsePanel {
  from { box-shadow: inset 0 1px 0 rgba(255,255,255,.76), 0 0 0 rgba(99,102,241,0); }
  to { box-shadow: inset 0 1px 0 rgba(255,255,255,.76), 0 0 28px rgba(99,102,241,.16); }
}

@media (prefers-reduced-motion: no-preference) {
  .learning-hero,
  .metric-card,
  .bento-card,
  .knowledge-card,
  .card {
    animation: softEnter .36s ease both;
  }

  @keyframes softEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 1100px) {
  .dashboard-grid,
  .compact-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-bento {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .learning-hero,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-panel,
  .knowledge-orbit-card {
    justify-self: stretch;
  }

  .learning-metric-ring {
    justify-self: center;
  }

  .dashboard-grid,
  .compact-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    width: calc(100% - 18px);
    border-radius: 20px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(238,242,255,.95), rgba(255,255,255,.84));
  }

  .site-nav {
    display: none;
    padding-top: 8px;
  }

  .site-nav.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    margin: 0;
    padding: 8px 0 0;
  }

  .site-nav.is-open a {
    text-align: center;
  }

  .learning-hero {
    border-radius: 24px;
  }

  .hero-mini-stats,
  .dashboard-grid,
  .compact-dashboard,
  .bento-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 112px;
  }

  .section-title-row {
    display: grid;
  }

  .inline-filter select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .page {
    gap: 16px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .learning-hero {
    padding: 20px;
  }

  .learning-hero-copy h2 {
    font-size: clamp(27px, 10vw, 38px);
  }

  .metric-card,
  .bento-card,
  .knowledge-card,
  .card {
    border-radius: 20px;
  }

  .weak-tag,
  .queue-item {
    grid-template-columns: 1fr;
  }

  .question-actions.ai-inline-actions {
    grid-template-columns: 1fr;
  }
}

.card, .hero-card, .metric-card, .bento-card, .knowledge-card { overflow: visible; isolation: isolate; }


/* Review center fusion and all-page adaptive polish */
.review-fusion-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.fusion-tile {
  display: grid;
  gap: 6px;
  min-height: 126px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(238,242,255,.66));
  color: inherit;
  text-decoration: none;
  box-shadow: 0 18px 45px rgba(30, 41, 59, .08);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.fusion-tile:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: rgba(99,102,241,.28);
  box-shadow: 0 24px 64px rgba(37, 99, 235, .16);
}

.fusion-tile.active {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #2563eb 60%, #0ea5e9);
}

.fusion-tile span {
  width: max-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  color: inherit;
  font-size: 12px;
  font-weight: 900;
}

.fusion-tile strong {
  font-size: 20px;
}

.fusion-tile small {
  color: inherit;
  opacity: .78;
  line-height: 1.5;
}

.wrong-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 12px;
}

.wrong-review-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.wrong-review-item:hover {
  text-decoration: none;
  transform: translateY(-2px);
  background: rgba(255,255,255,.86);
  border-color: rgba(99,102,241,.24);
}

.wrong-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.compact-actions {
  justify-content: flex-end;
}

.wrong-item-actions {
  align-items: center;
  margin-top: 12px;
}

.wrong-item-actions .inline-form {
  margin: 0;
}

/* Make legacy pages feel like the same premium app without rewriting each template. */
body:not(.page-index):not(.page-review):not(.page-knowledge) .page > .card:first-child {
  padding: clamp(22px, 4vw, 34px);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(238,242,255,.68)),
    radial-gradient(circle at 0% 0%, rgba(99,102,241,.12), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(14,165,233,.12), transparent 30%);
  box-shadow: 0 26px 76px rgba(30, 41, 59, .1);
}

body:not(.page-index):not(.page-review):not(.page-knowledge) .page > .card:first-child h2 {
  margin-bottom: 8px;
  font-size: clamp(26px, 4.4vw, 42px);
  letter-spacing: -.04em;
}

.filter,
.form,
.exam-config,
.manage-form {
  gap: 14px;
}

.filter label,
.form label,
.exam-config label,
.manage-form label {
  border-radius: 18px;
}

input,
select,
textarea {
  border-radius: 14px !important;
}

.manage-item,
.wrong-item,
.result-item,
.type-stat,
.exam-question {
  border-radius: 20px;
  border-color: rgba(148,163,184,.24);
  background: rgba(255,255,255,.62);
  box-shadow: 0 12px 32px rgba(30,41,59,.05);
}

@media (min-width: 1360px) {
  .page,
  .site-header {
    max-width: min(1480px, calc(100% - 48px));
  }

  .dashboard-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .compact-dashboard {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 900px) and (max-width: 1359px) {
  .page,
  .site-header {
    width: min(100% - 28px, 1180px);
  }

  .compact-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .review-fusion-strip {
    grid-template-columns: 1fr;
  }

  .wrong-review-item {
    grid-template-columns: 1fr;
  }

  .compact-actions {
    justify-content: stretch;
  }

  .compact-actions .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .learning-metric-ring {
    width: min(230px, 72vw);
  }

  .ring-label {
    margin-top: -34px;
  }

  .fusion-tile {
    min-height: 104px;
  }

  .wrong-item-actions,
  .wrong-item-actions .inline-form {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
}

/* Device-aware premium polish: desktop / tablet / phone share one adaptive layout. */
.site-nav a.is-active,
.site-nav a[aria-current="page"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #6366f1, #2563eb 58%, #0ea5e9);
  box-shadow: 0 14px 30px rgba(37, 99, 235, .2);
}

.site-nav a.is-active:hover,
.site-nav a[aria-current="page"]:hover {
  color: #fff;
  transform: translateY(-1px);
}

.filter,
.form,
.exam-config,
.type-edit-form,
.import-edit-grid {
  padding: 2px;
}

.filter label,
.form label,
.exam-config label,
.type-edit-form label,
.import-edit-grid label,
.multi-select-field {
  padding: 12px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 18px;
  background: rgba(255,255,255,.54);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.68);
}

.filter-actions,
.hero-actions,
.question-actions {
  align-items: center;
}

.wrongs-dashboard {
  margin-top: -4px;
}

.wrong-review-card,
.wrongs-hero {
  overflow: hidden;
}

.wrong-item .question-text,
.manage-item .question-text,
.exam-question .question-text,
.practice-question .question-text {
  letter-spacing: .01em;
}

body.page-banks .manage-item,
body.page-upload .import-preview-item,
body.page-manage .manage-item,
body.page-wrongs .wrong-item,
body.page-exam_history .result-item,
body.page-game_history .result-item {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

body.page-banks .manage-item:hover,
body.page-upload .import-preview-item:hover,
body.page-manage .manage-item:hover,
body.page-wrongs .wrong-item:hover,
body.page-exam_history .result-item:hover,
body.page-game_history .result-item:hover {
  transform: translateY(-2px);
}

@media (min-width: 1181px) {
  body:not(.practice-active) .page {
    width: min(1480px, calc(100% - 56px));
    max-width: 1480px;
    gap: 22px;
  }

  body.page-banks .grid,
  body.page-game .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.page-upload .split-layout,
  body.page-manage .split-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .8fr);
  }
}

@media (min-width: 721px) and (max-width: 1180px) {
  body:not(.practice-active) .page,
  .site-header {
    width: min(100% - 24px, 980px);
  }

  .site-header {
    align-items: stretch;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
  }

  .site-nav a {
    text-align: center;
    min-height: 40px;
  }

  .learning-hero {
    grid-template-columns: 1fr;
  }

  .learning-metric-ring {
    justify-self: start;
  }

  .review-fusion-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter,
  body.page-exam .exam-config {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body {
    background-attachment: scroll;
  }

  body:not(.practice-active) .page {
    width: calc(100% - 16px);
    padding-bottom: max(36px, env(safe-area-inset-bottom));
  }

  .site-header {
    top: 6px;
    padding: 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .mobile-nav-toggle {
    min-height: 38px;
    border-radius: 999px;
  }

  .site-nav.is-open {
    gap: 8px;
  }

  .site-nav.is-open a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .learning-hero-copy h2 {
    letter-spacing: -0.04em;
  }

  .learning-metric-ring {
    margin-inline: auto;
  }

  .review-fusion-strip {
    gap: 10px;
  }

  .fusion-tile {
    min-height: 96px;
    padding: 15px;
    border-radius: 20px;
  }

  .dashboard-grid,
  .compact-dashboard {
    gap: 10px;
  }

  .filter label,
  .form label,
  .exam-config label,
  .type-edit-form label,
  .import-edit-grid label,
  .multi-select-field {
    padding: 10px;
  }

  .wrong-review-grid,
  .wrong-review-item,
  .wrong-item-actions,
  .question-actions {
    grid-template-columns: 1fr;
  }

  .wrong-review-item .badge {
    justify-self: start;
  }
}

@media (max-width: 420px) {
  .brand-text h1 {
    max-width: 12em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-nav.is-open {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .filter-actions,
  .question-actions,
  .compact-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .hero-actions .btn,
  .filter-actions .btn,
  .question-actions .btn,
  .compact-actions .btn {
    width: 100%;
  }
}

/* 题型管理：默认收起，展开后再编辑，避免页面过长。 */
.type-manage-list {
  gap: 10px;
}

.type-manage-item {
  display: block;
  padding: 0;
  overflow: hidden;
}

.type-manage-summary {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.type-manage-summary::-webkit-details-marker {
  display: none;
}

.type-summary-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
  color: #172033;
}

.type-summary-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.type-summary-action {
  padding: 5px 10px;
  border-radius: 999px;
  color: #1d4ed8;
  background: rgba(238,242,255,.86);
  border: 1px solid rgba(99,102,241,.16);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.type-manage-item[open] .type-summary-action {
  font-size: 0;
}

.type-manage-item[open] .type-summary-action::after {
  content: "收起编辑";
  font-size: 12px;
}

.type-manage-body {
  padding: 0 14px 14px;
  border-top: 1px solid rgba(148,163,184,.16);
}

.type-edit-form {
  margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 10px;
}

.type-edit-form label {
  padding: 10px;
}

.type-edit-form .filter-actions {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .type-manage-summary {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .type-summary-badges {
    justify-content: flex-start;
  }

  .type-summary-action {
    width: max-content;
  }
}

/* 移动端和平板端紧凑自适应：隐藏滚动条但保留页面滚动。 */
html,
body {
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

* {
  scrollbar-width: none;
}

@media (min-width: 721px) and (max-width: 1180px) {
  body:not(.exam-active) .site-header {
    width: min(100% - 20px, 980px);
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 20px;
    gap: 8px;
  }

  body:not(.exam-active) .brand-mark {
    width: 36px;
    height: 36px;
  }

  body:not(.exam-active) .brand-text h1 {
    font-size: clamp(20px, 3vw, 23px);
  }

  body:not(.exam-active) .site-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  body:not(.exam-active) .site-nav a {
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 12px;
    font-size: 13px;
  }

  body:not(.practice-active):not(.exam-active):not(.page-exam) .page {
    width: min(100% - 20px, 980px);
    padding-top: 14px;
    padding-bottom: 24px;
    gap: 12px;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero {
    grid-template-columns: minmax(0, 1fr) minmax(132px, 170px);
    align-items: center;
    gap: 14px;
    min-height: 0;
    padding: 20px;
    border-radius: 24px;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero-copy h2 {
    max-width: 100%;
    margin-bottom: 8px;
    font-size: clamp(28px, 4.2vw, 36px);
    line-height: 1.12;
    letter-spacing: -0.045em;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero-copy p {
    margin-bottom: 12px;
    font-size: 13.5px;
    line-height: 1.55;
  }

  body:not(.exam-active):not(.page-exam) .eyebrow {
    margin-bottom: 8px;
    padding: 4px 9px;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: none;
  }

  body:not(.exam-active):not(.page-exam) .hero-actions {
    gap: 8px;
  }

  body:not(.exam-active):not(.page-exam) .btn {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
  }

  body:not(.exam-active):not(.page-exam) .learning-metric-ring {
    width: min(170px, 22vw);
    justify-self: end;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.76), 0 14px 32px rgba(99,102,241,.14);
  }

  body:not(.exam-active):not(.page-exam) .ring-value {
    font-size: clamp(28px, 4vw, 36px);
  }

  body:not(.exam-active):not(.page-exam) .ring-label {
    margin-top: -28px;
    font-size: 12px;
  }

  body:not(.exam-active):not(.page-exam) .dashboard-grid,
  body:not(.exam-active):not(.page-exam) .compact-dashboard {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  body:not(.exam-active):not(.page-exam) .metric-card {
    min-height: 92px;
    padding: 12px;
    border-radius: 18px;
  }

  body:not(.exam-active):not(.page-exam) .metric-card strong {
    margin: 6px 0 3px;
    font-size: clamp(24px, 3.2vw, 30px);
  }

  body:not(.exam-active):not(.page-exam) .metric-label {
    font-size: 12px;
  }

  body:not(.exam-active):not(.page-exam) .metric-hint {
    font-size: 10.5px;
  }

  body:not(.exam-active):not(.page-exam) .review-fusion-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile {
    min-height: 82px;
    padding: 12px;
    border-radius: 18px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile strong {
    font-size: 16px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile small {
    font-size: 11px;
    line-height: 1.35;
  }

  body:not(.exam-active):not(.page-exam) .split-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
  }

  body:not(.exam-active):not(.page-exam) .card {
    padding: 16px;
    border-radius: 20px;
  }
}

@media (max-width: 720px) {
  body.page-exam:not(.exam-active) {
    font-size: 12.3px;
  }

  body.page-exam:not(.exam-active) .page {
    width: calc(100% - 10px);
    padding: 8px 0 max(18px, env(safe-area-inset-bottom));
    gap: 8px;
  }

  body.page-exam:not(.exam-active) .card,
  body.page-exam:not(.exam-active) .page > .card:first-child {
    padding: 12px;
    border-radius: 16px;
  }

  body.page-exam:not(.exam-active) .page > .card:first-child {
    padding: 14px;
    min-height: 0;
  }

  body.page-exam:not(.exam-active) .page > .card:first-child h2 {
    margin-bottom: 6px;
    font-size: clamp(22px, 6.2vw, 26px);
    line-height: 1.12;
  }

  body.page-exam:not(.exam-active) .page > .card:first-child p {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.42;
  }

  body.page-exam:not(.exam-active) .exam-config,
  body.page-exam:not(.exam-active) .form,
  body.page-exam:not(.exam-active) .count-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.page-exam:not(.exam-active) .exam-config label,
  body.page-exam:not(.exam-active) .form label,
  body.page-exam:not(.exam-active) .count-grid label {
    gap: 4px;
    padding: 8px;
    border-radius: 13px;
    font-size: 11px;
    line-height: 1.32;
  }

  body.page-exam:not(.exam-active) input,
  body.page-exam:not(.exam-active) select {
    min-height: 31px;
    padding: 6px 8px;
    border-radius: 11px !important;
    font-size: 11px;
  }

  body.page-exam:not(.exam-active) .form-hint,
  body.page-exam:not(.exam-active) .form-meta,
  body.page-exam:not(.exam-active) .field-label {
    font-size: 10.5px;
    line-height: 1.28;
  }

  body.page-exam:not(.exam-active) .exam-config > .form-hint,
  body.page-exam:not(.exam-active) .exam-config > .count-grid,
  body.page-exam:not(.exam-active) .exam-config > button {
    grid-column: 1 / -1;
  }

  body.page-exam:not(.exam-active) .btn {
    min-height: 31px;
    padding: 5px 8px;
    font-size: 11px;
  }

  body.page-exam:not(.exam-active) .manage-list,
  body.page-exam:not(.exam-active) .result-list {
    gap: 7px;
  }

  body.page-exam:not(.exam-active) .result-item,
  body.page-exam:not(.exam-active) .manage-item {
    padding: 8px 9px;
    border-radius: 13px;
    gap: 6px;
  }
}

@media (max-width: 720px) {
  body:not(.exam-active) .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: calc(100% - 12px);
    margin-top: 6px;
    padding: 8px;
    border-radius: 18px;
    gap: 8px;
  }

  body:not(.exam-active) .brand {
    min-width: 0;
    gap: 8px;
  }

  body:not(.exam-active) .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  body:not(.exam-active) .brand-text h1 {
    max-width: 13em;
    font-size: clamp(17px, 5.2vw, 20px);
    line-height: 1.12;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.exam-active) .mobile-nav-toggle {
    min-height: 32px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
  }

  body:not(.exam-active) .site-nav {
    grid-column: 1 / -1;
    padding-top: 4px;
  }

  body:not(.exam-active) .site-nav.is-open {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body:not(.exam-active) .site-nav.is-open a {
    min-height: 32px;
    padding: 5px 8px;
    border-radius: 11px;
    font-size: 12px;
  }

  body:not(.practice-active):not(.exam-active):not(.page-exam) .page {
    width: calc(100% - 12px);
    padding-top: 10px;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 20px;
    gap: 10px;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
    border-radius: 20px;
  }

  body:not(.exam-active):not(.page-exam) .eyebrow {
    margin-bottom: 6px;
    padding: 4px 8px;
    font-size: 10px;
    letter-spacing: .03em;
    text-transform: none;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero-copy h2 {
    margin-bottom: 7px;
    font-size: clamp(22px, 7vw, 28px);
    line-height: 1.12;
    letter-spacing: -0.045em;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero-copy p {
    margin-bottom: 9px;
    font-size: 12.5px;
    line-height: 1.5;
  }

  body:not(.exam-active):not(.page-exam) .hero-actions,
  body:not(.exam-active):not(.page-exam) .compact-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  body:not(.exam-active):not(.page-exam) .hero-actions .btn,
  body:not(.exam-active):not(.page-exam) .compact-actions .btn {
    width: 100%;
    min-height: 32px;
    padding: 5px 6px;
    font-size: 12px;
    white-space: nowrap;
  }

  body:not(.exam-active):not(.page-exam) .learning-metric-ring {
    width: 112px;
    margin: 2px auto 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.75), 0 10px 24px rgba(99,102,241,.14);
  }

  body:not(.exam-active):not(.page-exam) .ring-value {
    font-size: 25px;
  }

  body:not(.exam-active):not(.page-exam) .ring-label {
    margin-top: -18px;
    font-size: 10.5px;
  }

  body:not(.exam-active):not(.page-exam) .dashboard-grid,
  body:not(.exam-active):not(.page-exam) .compact-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body:not(.exam-active):not(.page-exam) .metric-card {
    min-height: 76px;
    padding: 10px;
    border-radius: 16px;
  }

  body:not(.exam-active):not(.page-exam) .metric-card strong {
    margin: 4px 0 2px;
    font-size: 24px;
  }

  body:not(.exam-active):not(.page-exam) .metric-label {
    font-size: 12px;
  }

  body:not(.exam-active):not(.page-exam) .metric-hint {
    font-size: 10px;
  }

  body:not(.exam-active):not(.page-exam) .review-fusion-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile {
    min-height: 62px;
    padding: 9px;
    border-radius: 16px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile span {
    padding: 2px 6px;
    font-size: 10px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile strong {
    font-size: 13px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile small {
    display: none;
  }

  body:not(.exam-active):not(.page-exam) .split-layout {
    gap: 10px;
  }

  body:not(.exam-active):not(.page-exam) .card,
  body:not(.exam-active):not(.page-exam) .bento-card,
  body:not(.exam-active):not(.page-exam) .knowledge-card {
    padding: 14px;
    border-radius: 18px;
  }

  body:not(.exam-active):not(.page-exam) .section-title-row {
    gap: 8px;
    margin-bottom: 10px;
  }

  body:not(.exam-active):not(.page-exam) .section-title-row h3,
  body:not(.exam-active):not(.page-exam) .section-title-row h4 {
    font-size: 17px;
  }

  body:not(.exam-active):not(.page-exam) .form-hint,
  body:not(.exam-active):not(.page-exam) .meta,
  body:not(.exam-active):not(.page-exam) .muted {
    font-size: 12px;
    line-height: 1.45;
  }
}

@media (max-width: 420px) {
  body:not(.exam-active):not(.page-exam) .hero-actions,
  body:not(.exam-active):not(.page-exam) .compact-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body:not(.exam-active):not(.page-exam) .brand-text h1 {
    max-width: 11.5em;
  }
}

/* 2026-07 终端自适应压缩版：电脑保持高级大屏，平板/手机更紧凑；隐藏滚动条但保留页面自然滑动。 */
html,
body {
  overflow-x: clip;
  scrollbar-gutter: auto;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.page::-webkit-scrollbar,
.site-nav::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

body:not(.exam-active):not(.page-exam) .learning-hero-copy p,
body:not(.exam-active):not(.page-exam) .bento-card p,
body:not(.exam-active):not(.page-exam) .form-hint {
  text-wrap: pretty;
}

@media (min-width: 721px) and (max-width: 1180px) {
  body:not(.exam-active):not(.page-exam) {
    font-size: 13px;
  }

  body:not(.exam-active) .site-header {
    width: min(100% - 18px, 980px);
    margin-top: 7px;
    padding: 9px 11px;
    border-radius: 19px;
    gap: 7px;
  }

  body:not(.exam-active) .brand {
    gap: 9px;
  }

  body:not(.exam-active) .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  body:not(.exam-active) .brand-text h1 {
    font-size: clamp(19px, 2.7vw, 22px);
    line-height: 1.08;
  }

  body:not(.exam-active) .site-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  body:not(.exam-active) .site-nav a {
    min-height: 30px;
    padding: 5px 7px;
    border-radius: 11px;
    font-size: 12.5px;
    line-height: 1.15;
  }

  body:not(.exam-active):not(.page-exam) .page {
    width: min(100% - 18px, 980px);
    padding-top: 10px;
    padding-bottom: 20px;
    gap: 10px;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero {
    grid-template-columns: minmax(0, 1fr) minmax(116px, 142px);
    align-items: center;
    gap: 12px;
    min-height: 0;
    padding: 16px;
    border-radius: 22px;
  }

  body:not(.exam-active):not(.page-exam) .dashboard-hero-panel {
    gap: 8px;
    align-self: center;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero-copy h2 {
    max-width: 100%;
    margin-bottom: 6px;
    font-size: clamp(24px, 3.6vw, 31px);
    line-height: 1.08;
    letter-spacing: -0.045em;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero-copy p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 9px;
    font-size: 12.5px;
    line-height: 1.45;
  }

  body:not(.exam-active):not(.page-exam) .eyebrow {
    margin-bottom: 6px;
    padding: 3px 8px;
    font-size: 10px;
    letter-spacing: .03em;
    text-transform: none;
  }

  body:not(.exam-active):not(.page-exam) .hero-actions,
  body:not(.exam-active):not(.page-exam) .question-actions,
  body:not(.exam-active):not(.page-exam) .filter-actions {
    gap: 6px;
  }

  body:not(.exam-active):not(.page-exam) .btn,
  body:not(.exam-active):not(.page-exam) .chip-button {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.15;
  }

  body:not(.exam-active):not(.page-exam) .learning-metric-ring {
    width: min(142px, 18vw);
    justify-self: end;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.76), 0 12px 28px rgba(99,102,241,.13);
  }

  body:not(.exam-active):not(.page-exam) .ring-value {
    font-size: clamp(24px, 3.4vw, 30px);
  }

  body:not(.exam-active):not(.page-exam) .ring-label {
    margin-top: -24px;
    font-size: 11px;
  }

  body:not(.exam-active):not(.page-exam) .hero-mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body:not(.exam-active):not(.page-exam) .hero-mini-stats span {
    min-height: 42px;
    padding: 7px 5px;
    border-radius: 12px;
    font-size: 10.5px;
    line-height: 1.2;
  }

  body:not(.exam-active):not(.page-exam) .hero-mini-stats strong {
    font-size: 16px;
  }

  body:not(.exam-active):not(.page-exam) .dashboard-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
  }

  body:not(.exam-active):not(.page-exam) .compact-dashboard {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
  }

  body:not(.exam-active):not(.page-exam) .metric-card {
    min-height: 72px;
    padding: 9px;
    border-radius: 16px;
  }

  body:not(.exam-active):not(.page-exam) .metric-card strong {
    margin: 4px 0 2px;
    font-size: clamp(20px, 2.7vw, 25px);
  }

  body:not(.exam-active):not(.page-exam) .metric-label {
    font-size: 11px;
    line-height: 1.2;
  }

  body:not(.exam-active):not(.page-exam) .metric-hint {
    font-size: 9.8px;
    line-height: 1.2;
  }

  body:not(.exam-active):not(.page-exam) .review-fusion-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile {
    min-height: 70px;
    padding: 10px;
    border-radius: 16px;
    gap: 4px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile span {
    padding: 2px 7px;
    font-size: 10px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile strong {
    font-size: 14px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile small {
    font-size: 10px;
    line-height: 1.28;
  }

  body:not(.exam-active):not(.page-exam) .split-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }

  body:not(.exam-active):not(.page-exam) .card,
  body:not(.exam-active):not(.page-exam) .bento-card,
  body:not(.exam-active):not(.page-exam) .knowledge-card {
    padding: 14px;
    border-radius: 18px;
  }

  body:not(.exam-active):not(.page-exam) .bento-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  body:not(.exam-active):not(.page-exam) .bento-card {
    min-height: 128px;
  }

  body:not(.exam-active):not(.page-exam) .filter,
  body:not(.exam-active):not(.page-exam) .form,
  body:not(.exam-active):not(.page-exam) .manage-form,
  body:not(.exam-active):not(.page-exam) .type-edit-form,
  body:not(.exam-active):not(.page-exam) .import-edit-grid {
    gap: 8px;
  }

  body:not(.exam-active):not(.page-exam) .filter label,
  body:not(.exam-active):not(.page-exam) .form label,
  body:not(.exam-active):not(.page-exam) .manage-form label,
  body:not(.exam-active):not(.page-exam) .type-edit-form label,
  body:not(.exam-active):not(.page-exam) .import-edit-grid label,
  body:not(.exam-active):not(.page-exam) .multi-select-field {
    padding: 9px;
    border-radius: 14px;
  }

  body:not(.exam-active):not(.page-exam) input,
  body:not(.exam-active):not(.page-exam) select,
  body:not(.exam-active):not(.page-exam) textarea,
  body:not(.exam-active):not(.page-exam) .multi-select summary {
    min-height: 32px;
    padding: 7px 9px;
    font-size: 12px;
  }
}

@media (max-width: 720px) {
  body:not(.exam-active):not(.page-exam) {
    font-size: 12.3px;
  }

  body:not(.exam-active) .site-header {
    width: calc(100% - 10px);
    min-height: 44px;
    margin-top: 5px;
    padding: 7px;
    border-radius: 16px;
    gap: 6px;
  }

  body:not(.exam-active) .brand {
    gap: 7px;
  }

  body:not(.exam-active) .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  body:not(.exam-active) .brand-text h1 {
    max-width: 13em;
    font-size: clamp(16px, 4.9vw, 18px);
    line-height: 1.08;
  }

  body:not(.exam-active) .mobile-nav-toggle {
    min-height: 29px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
  }

  body:not(.exam-active) .site-nav {
    grid-column: 1 / -1;
    padding-top: 3px;
  }

  body:not(.exam-active) .site-nav.is-open {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  body:not(.exam-active) .site-nav.is-open a {
    min-height: 28px;
    padding: 4px 6px;
    border-radius: 10px;
    font-size: 11px;
  }

  body:not(.exam-active):not(.page-exam) .page {
    width: calc(100% - 10px);
    padding: 8px 0 max(18px, env(safe-area-inset-bottom));
    gap: 8px;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 12px;
    border-radius: 18px;
  }

  body:not(.exam-active):not(.page-exam) .eyebrow {
    margin-bottom: 5px;
    padding: 3px 7px;
    font-size: 9px;
    letter-spacing: .02em;
    text-transform: none;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero-copy h2 {
    margin-bottom: 6px;
    font-size: clamp(20px, 6vw, 24px);
    line-height: 1.08;
    letter-spacing: -0.045em;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero-copy p {
    display: none;
  }

  body:not(.exam-active):not(.page-exam) .hero-actions,
  body:not(.exam-active):not(.page-exam) .compact-actions,
  body:not(.exam-active):not(.page-exam) .question-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
  }

  body:not(.exam-active):not(.page-exam) .hero-actions .btn,
  body:not(.exam-active):not(.page-exam) .compact-actions .btn,
  body:not(.exam-active):not(.page-exam) .question-actions .btn,
  body:not(.exam-active):not(.page-exam) .question-actions a.btn {
    width: 100%;
    min-height: 29px;
    padding: 4px 5px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.12;
    white-space: nowrap;
  }

  body:not(.exam-active):not(.page-exam) .learning-metric-ring {
    width: 88px;
    margin: 1px auto 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.75), 0 8px 18px rgba(99,102,241,.12);
  }

  body:not(.exam-active):not(.page-exam) .ring-value {
    font-size: 20px;
    letter-spacing: -0.04em;
  }

  body:not(.exam-active):not(.page-exam) .ring-label {
    margin-top: -14px;
    font-size: 9px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .dashboard-hero-panel {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    gap: 8px;
    width: 100%;
  }

  body.page-index:not(.exam-active):not(.page-exam) .dashboard-hero-panel .learning-metric-ring {
    width: 82px;
    margin: 0;
  }

  body:not(.exam-active):not(.page-exam) .hero-mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body:not(.exam-active):not(.page-exam) .hero-mini-stats span {
    min-height: 46px;
    padding: 6px 4px;
    border-radius: 12px;
    font-size: 9.5px;
    line-height: 1.15;
  }

  body:not(.exam-active):not(.page-exam) .hero-mini-stats strong {
    font-size: 15px;
  }

  body.page-review:not(.exam-active):not(.page-exam) .compact-dashboard {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  body.page-wrongs:not(.exam-active):not(.page-exam) .compact-dashboard {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body:not(.exam-active):not(.page-exam) .dashboard-grid,
  body:not(.exam-active):not(.page-exam) .compact-dashboard {
    gap: 6px;
  }

  body:not(.exam-active):not(.page-exam) .metric-card {
    min-height: 62px;
    padding: 7px;
    border-radius: 14px;
  }

  body:not(.exam-active):not(.page-exam) .metric-card strong {
    margin: 3px 0 1px;
    font-size: 20px;
  }

  body:not(.exam-active):not(.page-exam) .metric-label {
    font-size: 10px;
    line-height: 1.15;
  }

  body:not(.exam-active):not(.page-exam) .metric-hint {
    font-size: 9px;
    line-height: 1.15;
  }

  body.page-review:not(.exam-active):not(.page-exam) .compact-dashboard .metric-card,
  body.page-wrongs:not(.exam-active):not(.page-exam) .compact-dashboard .metric-card {
    min-height: 56px;
    padding: 6px 4px;
    text-align: center;
  }

  body.page-review:not(.exam-active):not(.page-exam) .compact-dashboard .metric-hint,
  body.page-wrongs:not(.exam-active):not(.page-exam) .compact-dashboard .metric-hint {
    display: none;
  }

  body.page-review:not(.exam-active):not(.page-exam) .compact-dashboard .metric-card strong,
  body.page-wrongs:not(.exam-active):not(.page-exam) .compact-dashboard .metric-card strong {
    font-size: 18px;
  }

  body.page-review:not(.exam-active):not(.page-exam) .compact-dashboard .metric-label,
  body.page-wrongs:not(.exam-active):not(.page-exam) .compact-dashboard .metric-label {
    font-size: 9px;
  }

  body:not(.exam-active):not(.page-exam) .review-fusion-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile {
    min-height: 50px;
    padding: 7px;
    border-radius: 14px;
    gap: 3px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile span {
    padding: 1px 6px;
    font-size: 9px;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile strong {
    font-size: 11.5px;
    line-height: 1.15;
  }

  body:not(.exam-active):not(.page-exam) .fusion-tile small {
    display: none;
  }

  body:not(.exam-active):not(.page-exam) .split-layout,
  body:not(.exam-active):not(.page-exam) .knowledge-tools {
    gap: 8px;
  }

  body:not(.exam-active):not(.page-exam) .card,
  body:not(.exam-active):not(.page-exam) .hero-card,
  body:not(.exam-active):not(.page-exam) .bento-card,
  body:not(.exam-active):not(.page-exam) .knowledge-card,
  body:not(.exam-active):not(.page-exam) .page > .card:first-child {
    padding: 12px;
    border-radius: 16px;
  }

  body:not(.page-index):not(.page-review):not(.page-knowledge):not(.exam-active):not(.page-exam) .page > .card:first-child {
    padding: 14px;
    border-radius: 18px;
  }

  body:not(.page-index):not(.page-review):not(.page-knowledge):not(.exam-active):not(.page-exam) .page > .card:first-child h2 {
    margin-bottom: 5px;
    font-size: clamp(22px, 6.2vw, 26px);
    line-height: 1.12;
  }

  body:not(.page-index):not(.page-review):not(.page-knowledge):not(.exam-active):not(.page-exam) .page > .card:first-child p {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.42;
  }

  body:not(.exam-active):not(.page-exam) .section-title-row {
    gap: 7px;
    margin-bottom: 8px;
  }

  body:not(.exam-active):not(.page-exam) .section-title-row h3,
  body:not(.exam-active):not(.page-exam) .section-title-row h4 {
    font-size: 15.5px;
    line-height: 1.16;
  }

  body:not(.exam-active):not(.page-exam) .form-hint,
  body:not(.exam-active):not(.page-exam) .meta,
  body:not(.exam-active):not(.page-exam) .muted,
  body:not(.exam-active):not(.page-exam) .badge,
  body:not(.exam-active):not(.page-exam) label,
  body:not(.exam-active):not(.page-exam) .field-label {
    font-size: 11px;
    line-height: 1.32;
  }

  body:not(.exam-active):not(.page-exam) .filter,
  body:not(.exam-active):not(.page-exam) .form,
  body:not(.exam-active):not(.page-exam) .manage-form,
  body:not(.exam-active):not(.page-exam) .type-edit-form,
  body:not(.exam-active):not(.page-exam) .import-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 7px;
  }

  body:not(.exam-active):not(.page-exam) .filter label,
  body:not(.exam-active):not(.page-exam) .form label,
  body:not(.exam-active):not(.page-exam) .manage-form label,
  body:not(.exam-active):not(.page-exam) .type-edit-form label,
  body:not(.exam-active):not(.page-exam) .import-edit-grid label,
  body:not(.exam-active):not(.page-exam) .multi-select-field {
    gap: 4px;
    padding: 8px;
    border-radius: 13px;
  }

  body:not(.exam-active):not(.page-exam) input,
  body:not(.exam-active):not(.page-exam) select,
  body:not(.exam-active):not(.page-exam) textarea,
  body:not(.exam-active):not(.page-exam) .multi-select summary {
    min-height: 31px;
    padding: 6px 8px;
    border-radius: 11px !important;
    font-size: 11px;
  }

  body:not(.exam-active):not(.page-exam) textarea {
    min-height: 78px;
  }

  body.page-review:not(.exam-active):not(.page-exam) .settings-card textarea {
    min-height: 92px;
  }

  body:not(.exam-active):not(.page-exam) .filter-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  body:not(.exam-active):not(.page-exam) .filter-actions .btn,
  body:not(.exam-active):not(.page-exam) .form-actions .btn,
  body:not(.exam-active):not(.page-exam) .manage-actions .btn {
    width: 100%;
    min-height: 31px;
    padding: 5px 8px;
    font-size: 11px;
  }

  body:not(.exam-active):not(.page-exam) .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body:not(.exam-active):not(.page-exam) .primary-bento {
    grid-column: 1 / -1;
    min-height: 110px;
  }

  body:not(.exam-active):not(.page-exam) .bento-card {
    min-height: 92px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .primary-bento {
    grid-column: 1 / -1;
    min-height: 66px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bento-card {
    min-height: 58px;
    padding: 9px 10px;
    border-radius: 15px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bento-card h3 {
    margin-bottom: 3px;
    font-size: 14px;
    line-height: 1.18;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bento-card p {
    display: none;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bento-link {
    margin-top: 2px;
    font-size: 11.5px;
    line-height: 1.1;
  }

  body.page-index:not(.exam-active):not(.page-exam) .primary-bento .eyebrow {
    margin-bottom: 4px;
    padding: 2px 7px;
    font-size: 9.5px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .dashboard-insights {
    gap: 8px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .insight-card {
    padding: 10px;
    border-radius: 16px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .insight-title-row {
    margin-bottom: 8px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .insight-heading-line {
    flex-wrap: nowrap;
    gap: 8px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .insight-heading-line h3 {
    flex: 1 1 auto;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.page-index:not(.exam-active):not(.page-exam) .insight-inline-btn {
    min-height: 26px;
    padding: 4px 10px;
    font-size: 11px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bank-progress-toggle {
    display: inline-flex;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bank-insight-card .insight-heading-line {
    gap: 6px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bank-insight-card .insight-inline-btn {
    padding-inline: 8px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bank-insight-card.is-bank-progress-collapsed .bank-progress-body {
    display: none;
  }

  body.page-index:not(.exam-active):not(.page-exam) .insight-title-copy .form-hint {
    margin: 3px 0 0;
    font-size: 10.5px;
    line-height: 1.25;
  }

  body.page-index:not(.exam-active):not(.page-exam) .weak-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .weak-tag {
    display: inline-flex;
    flex: 0 1 auto;
    grid-template-columns: none;
    width: auto;
    max-width: 100%;
    min-height: 26px;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.1;
  }

  body.page-index:not(.exam-active):not(.page-exam) .weak-tag span {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.page-index:not(.exam-active):not(.page-exam) .weak-tag strong {
    font-size: 11px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bank-progress-list {
    gap: 7px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bank-progress-item {
    padding: 8px;
    border-radius: 12px;
    gap: 5px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .bank-progress-item small {
    font-size: 10px;
    line-height: 1.25;
  }

  body.page-index:not(.exam-active):not(.page-exam) .progress-label {
    margin-bottom: 4px;
    font-size: 11.5px;
    line-height: 1.2;
  }

  body.page-index:not(.exam-active):not(.page-exam) .progress-track {
    height: 6px;
  }

  body.page-index:not(.exam-active):not(.page-exam) .page {
    padding-bottom: 6px;
    gap: 7px;
  }

  body.page-index:not(.exam-active):not(.page-exam) + .site-footer,
  body.page-index:not(.exam-active):not(.page-exam) .site-footer {
    padding-top: 8px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    font-size: 12px;
    line-height: 1.2;
  }

  body:not(.exam-active):not(.page-exam) .bento-card h3,
  body:not(.exam-active):not(.page-exam) .knowledge-card h3 {
    margin-bottom: 5px;
    font-size: 15.5px;
  }

  body:not(.exam-active):not(.page-exam) .bento-card p {
    display: none;
  }

  body:not(.exam-active):not(.page-exam) .queue-item,
  body:not(.exam-active):not(.page-exam) .weak-tag,
  body:not(.exam-active):not(.page-exam) .bank-progress-item,
  body:not(.exam-active):not(.page-exam) .wrong-review-item,
  body:not(.exam-active):not(.page-exam) .manage-item,
  body:not(.exam-active):not(.page-exam) .result-item {
    padding: 8px 9px;
    border-radius: 13px;
    gap: 6px;
  }

  body:not(.exam-active):not(.page-exam) .queue-score {
    min-width: 46px;
    padding: 3px 7px;
    font-size: 11px;
  }

  body:not(.exam-active):not(.page-exam) .preset-row {
    gap: 5px;
  }

  body:not(.exam-active):not(.page-exam) .chip-button {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 10.5px;
  }

  body:not(.exam-active):not(.page-exam) .type-manage-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 9px 10px;
    gap: 7px;
  }

  body:not(.exam-active):not(.page-exam) .type-summary-badges {
    display: none;
  }

  body:not(.exam-active):not(.page-exam) .type-manage-body {
    padding: 0 10px 10px;
  }
}

@media (max-width: 430px) {
  body:not(.exam-active):not(.page-exam) .brand-text h1 {
    max-width: 12em;
  }

  body:not(.exam-active):not(.page-exam) .hero-actions,
  body:not(.exam-active):not(.page-exam) .compact-actions,
  body:not(.exam-active):not(.page-exam) .question-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body:not(.exam-active):not(.page-exam) .filter,
  body:not(.exam-active):not(.page-exam) .form,
  body:not(.exam-active):not(.page-exam) .manage-form,
  body:not(.exam-active):not(.page-exam) .type-edit-form,
  body:not(.exam-active):not(.page-exam) .import-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.page-upload:not(.exam-active):not(.page-exam) .page > .card:first-child .filter,
  body.page-banks:not(.exam-active):not(.page-exam) .page > .card:first-child .filter {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  body:not(.exam-active):not(.page-exam) .brand-text h1 {
    max-width: 10.5em;
    font-size: 15px;
  }

  body:not(.exam-active):not(.page-exam) .hero-actions .btn,
  body:not(.exam-active):not(.page-exam) .compact-actions .btn,
  body:not(.exam-active):not(.page-exam) .question-actions .btn,
  body:not(.exam-active):not(.page-exam) .question-actions a.btn {
    font-size: 10px;
    letter-spacing: -0.02em;
  }

  body.page-review:not(.exam-active):not(.page-exam) .compact-dashboard,
  body.page-wrongs:not(.exam-active):not(.page-exam) .compact-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mobile-collapse-toggle {
  display: none;
}

@media (min-width: 901px) {
  .mobile-collapse-body {
    display: block !important;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  body:not(.exam-active) .mobile-collapse-ready {
    padding: 9px !important;
    border-radius: 18px !important;
  }

  body:not(.exam-active) .mobile-collapse-toggle {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(238,242,255,.7));
    color: #172033;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
  }

  body:not(.exam-active) .mobile-collapse-toggle span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.exam-active) .mobile-collapse-toggle em {
    flex: 0 0 auto;
    min-width: 44px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(99,102,241,.1);
    color: #4338ca;
    font-style: normal;
    font-size: 11px;
    text-align: center;
  }

  body:not(.exam-active) .mobile-collapse-toggle::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid #6366f1;
    border-bottom: 2px solid #6366f1;
    transform: rotate(45deg);
    transition: transform .18s ease;
  }

  body:not(.exam-active) .mobile-collapse-ready:not(.is-mobile-collapsed) > .mobile-collapse-toggle::before {
    transform: rotate(-135deg) translate(-1px, -1px);
  }

  body:not(.exam-active) .mobile-collapse-body {
    padding-top: 9px;
  }

  body:not(.exam-active) .is-mobile-collapsed > .mobile-collapse-body {
    display: none !important;
  }
}

@media (max-width: 720px) {
  body:not(.exam-active) .mobile-collapse-ready {
    padding: 7px !important;
    border-radius: 15px !important;
  }

  body:not(.exam-active) .mobile-collapse-toggle {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,.88), rgba(238,242,255,.68));
    color: #172033;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
  }

  body:not(.exam-active) .mobile-collapse-toggle span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.exam-active) .mobile-collapse-toggle em {
    flex: 0 0 auto;
    min-width: 42px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(99,102,241,.1);
    color: #4338ca;
    font-style: normal;
    font-size: 10px;
    text-align: center;
  }

  body:not(.exam-active) .mobile-collapse-toggle::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 2px solid #6366f1;
    border-bottom: 2px solid #6366f1;
    transform: rotate(45deg);
    transition: transform .18s ease;
  }

  body:not(.exam-active) .mobile-collapse-ready:not(.is-mobile-collapsed) > .mobile-collapse-toggle::before {
    transform: rotate(-135deg) translate(-1px, -1px);
  }

  body:not(.exam-active) .mobile-collapse-body {
    padding-top: 8px;
  }

  body:not(.exam-active) .is-mobile-collapsed > .mobile-collapse-body {
    display: none;
  }

  body:not(.exam-active) .is-mobile-collapsed {
    min-height: 0 !important;
  }

  body:not(.exam-active) .mobile-collapse-body > h2:first-child,
  body:not(.exam-active) .mobile-collapse-body > h3:first-child,
  body:not(.exam-active) .mobile-collapse-body > h4:first-child {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 16px;
    line-height: 1.18;
  }

  body:not(.exam-active) .mobile-collapse-body > p {
    margin: 5px 0;
    font-size: 11px;
    line-height: 1.36;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero {
    padding: 10px;
  }

  body:not(.exam-active):not(.page-exam) .learning-hero-copy h2 {
    font-size: clamp(19px, 5.6vw, 22px);
  }

  body:not(.exam-active):not(.page-exam) .learning-metric-ring {
    width: 76px;
  }

  body:not(.exam-active):not(.page-exam) .ring-value {
    font-size: 18px;
  }

  body:not(.exam-active):not(.page-exam) .ring-label {
    margin-top: -12px;
    font-size: 8.5px;
  }

  body.page-review:not(.exam-active):not(.page-exam) .learning-hero,
  body.page-wrongs:not(.exam-active):not(.page-exam) .learning-hero,
  body.page-index:not(.exam-active):not(.page-exam) .learning-hero {
    grid-template-columns: minmax(0, 1fr) 76px;
    align-items: center;
  }

  body.page-review:not(.exam-active):not(.page-exam) .learning-hero .learning-metric-ring,
  body.page-wrongs:not(.exam-active):not(.page-exam) .learning-hero .learning-metric-ring,
  body.page-index:not(.exam-active):not(.page-exam) .dashboard-hero-panel .learning-metric-ring {
    width: 72px;
    margin: 0;
  }

  body.page-index:not(.exam-active):not(.page-exam) .dashboard-hero-panel {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 6px;
  }

  body:not(.exam-active):not(.page-exam) .hero-mini-stats span {
    min-height: 38px;
    padding: 5px 3px;
  }

  body:not(.exam-active):not(.page-exam) .hero-mini-stats strong {
    font-size: 13px;
  }

  body.page-knowledge:not(.exam-active):not(.page-exam) .knowledge-orbit-card {
    width: 96px;
    min-height: 82px;
    aspect-ratio: auto;
    justify-self: center;
    border-radius: 18px;
  }

  body.page-knowledge:not(.exam-active):not(.page-exam) .knowledge-orbit-card strong {
    font-size: 28px;
  }

  body.page-knowledge:not(.exam-active):not(.page-exam) .knowledge-orbit-card small {
    display: none;
  }
}

/* 考试进行中：手机/平板只保留答题所需信息，顶部信息固定，题目区域加宽压缩。 */
.exam-info-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  width: 100%;
}

.exam-info-line span {
  white-space: nowrap;
}

body.exam-active .exam-info {
  position: sticky;
  top: 8px;
  z-index: 64;
  justify-content: center;
}

body.exam-active .site-footer {
  display: none !important;
}

body.exam-active .exam-abandon {
  position: fixed;
  top: 16px;
  right: 124px;
  z-index: 91;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 6px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.18);
  backdrop-filter: blur(12px) saturate(1.18);
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

body.exam-active .exam-abandon:hover {
  border-color: rgba(248, 113, 113, 0.42);
  color: #dc2626;
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.12);
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  body.exam-active {
    font-size: 13px;
  }

  body.exam-active .site-header {
    display: none !important;
  }

  body.exam-active .page {
    width: 100%;
    max-width: none;
    padding: 42px 5px 58px;
    gap: 8px;
  }

  body.exam-active .page > .card:first-child:not(.exam-info) {
    display: none;
  }

  body.exam-active .exam-info {
    position: fixed;
    top: 6px;
    left: 5px;
    right: 5px;
    width: auto;
    margin: 0;
    min-height: 35px;
    padding: 7px 124px 7px 9px;
    border-radius: 15px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 10px 28px rgba(15,23,42,.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
  }

  body.exam-active .exam-info-line {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4px 9px;
    color: #475569;
    font-size: 11px;
    line-height: 1.2;
  }

  body.exam-active .exam-info-line span {
    padding: 0;
  }

  body.exam-active .exam-info-line span:first-child:nth-last-child(4) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.exam-active .exam-timer {
    top: 10px;
    right: 10px;
    z-index: 90;
    min-width: 58px;
    padding: 4px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #eef2ff, #ffffff);
    box-shadow: 0 8px 20px rgba(37,99,235,.13);
  }

  body.exam-active .exam-abandon {
    top: 10px;
    right: 74px;
    min-height: 25px;
    padding: 4px 9px;
    font-size: 11px;
    box-shadow: 0 8px 20px rgba(15,23,42,.08);
  }

  body.exam-active .exam-timer-label {
    display: none;
  }

  body.exam-active .exam-timer-value {
    font-size: 13px;
    line-height: 1.15;
    letter-spacing: -.02em;
  }

  body.exam-active .exam-timer-value::before {
    content: "剩 ";
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
  }

  body.exam-active .page > .card:not(.exam-info) {
    width: 100%;
    padding: 8px;
    border-radius: 17px;
  }

  body.exam-active .exam-form {
    gap: 10px;
    padding-bottom: 0;
  }

  body.exam-active .exam-question {
    padding: 10px;
    border-radius: 15px;
  }

  body.exam-active .question-meta {
    margin-bottom: 7px;
  }

  body.exam-active .badge {
    padding: 3px 8px;
    font-size: 10.5px;
  }

  body.exam-active .question-text {
    margin-bottom: 9px;
    font-size: 15px;
    line-height: 1.52;
    letter-spacing: 0;
  }

  body.exam-active .choice-grid {
    gap: 6px;
  }

  body.exam-active .choice-item {
    min-height: 0;
    align-items: flex-start;
    padding: 7px 26px 7px 10px;
    border-radius: 12px;
    gap: 0;
    font-size: 13px;
    line-height: 1.38;
  }

  body.exam-active .choice-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.38;
  }

  body.exam-active .choice-letter {
    display: inline;
    min-width: 0;
    margin-right: 4px;
    font-weight: 900;
  }

  body.exam-active .answer-input textarea {
    min-height: 92px;
  }

  body.exam-active .exam-question:last-of-type {
    scroll-margin-bottom: 96px;
  }

  body.exam-active .exam-action-dock {
    display: grid;
    grid-template-columns: minmax(68px, 86px) minmax(0, 1fr);
    align-items: center;
    width: calc(100% - 12px);
    bottom: max(6px, env(safe-area-inset-bottom));
    gap: 7px;
    padding: 8px;
    border-radius: 15px;
  }

  body.exam-active .exam-dock-status {
    gap: 5px;
    min-width: 0;
    width: 100%;
  }

  body.exam-active .exam-dock-count {
    font-size: 12px;
  }

  body.exam-active .exam-dock-count strong {
    font-size: 15px;
  }

  body.exam-active .exam-dock-progress {
    height: 7px;
  }

  body.exam-active .exam-dock-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    width: 100%;
  }

  body.exam-active .exam-dock-actions .btn {
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 12px;
  }

  body.exam-active .back-to-top {
    display: none !important;
  }
}

@media (max-width: 420px) {
  body.exam-active .page {
    padding-left: 4px;
    padding-right: 4px;
    padding-bottom: 48px;
  }

  body.exam-active .exam-info {
    padding-right: 116px;
  }

  body.exam-active .exam-info-line {
    gap: 3px 7px;
    font-size: 10.5px;
  }

  body.exam-active .page > .card:not(.exam-info) {
    padding: 7px;
  }

  body.exam-active .exam-question {
    padding: 9px;
  }

  body.exam-active .question-text {
    font-size: 14.5px;
    line-height: 1.5;
  }

  body.exam-active .choice-item {
    padding: 6px 24px 6px 9px;
    font-size: 12.8px;
  }

  body.exam-active .exam-abandon {
    right: 72px;
    padding-inline: 8px;
  }

  body.exam-active .exam-form {
    padding-bottom: 0;
  }

  body.exam-active .exam-dock-actions {
    gap: 6px;
  }

  body.exam-active .exam-dock-actions .btn {
    min-height: 32px;
    padding: 5px 6px;
    font-size: 11.5px;
  }
}

/* 手机端刷题页：选项与考试页保持同款紧凑卡片，顶部只保留必要操作。 */
@media (max-width: 900px) {
  body.practice-active .choice-grid,
  body.review-active .choice-grid {
    gap: 6px;
  }

  body.practice-active .choice-item,
  body.review-active .choice-item {
    min-height: 0;
    align-items: flex-start;
    gap: 0;
    padding: 7px 26px 7px 10px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.38;
  }

  body.practice-active .choice-text,
  body.review-active .choice-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.38;
  }

  body.practice-active .choice-letter,
  body.review-active .choice-letter {
    display: inline;
    min-width: 0;
    margin-right: 4px;
    font-weight: 900;
  }

  body.practice-active .practice-topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.practice-active .practice-topbar-actions > .btn {
    width: 100%;
    justify-content: center;
  }

  body.page-review.review-active .review-queue-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.page-review.review-active .queue-card .form-hint {
    margin: 4px 0 8px;
    font-size: 11px;
    line-height: 1.28;
  }

  body.page-review.review-active .queue-card select {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 12px;
  }

  body.page-review.review-active .queue-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px 8px;
    min-height: 44px;
    padding: 8px 9px 7px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(239,246,255,.7));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  }

  body.page-review.review-active .queue-title {
    display: -webkit-box;
    overflow: hidden;
    min-width: 0;
    color: #1e293b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.28;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  body.page-review.review-active .queue-score {
    min-width: 38px;
    padding: 2px 7px;
    border: 1px solid rgba(37, 99, 235, .12);
    border-radius: 999px;
    background: rgba(238, 242, 255, .9);
    color: #2563eb;
    font-size: 11px;
    line-height: 1.15;
  }

  body.page-review.review-active .queue-score::before {
    display: none;
  }

  body.page-review.review-active .queue-item::after {
    content: "";
    grid-column: 1 / -1;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6 var(--score), rgba(191, 219, 254, .62) 0);
  }
}

@media (max-width: 720px) {
  body.page-practice.practice-active {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  body.page-practice.practice-active .site-header {
    flex: 0 0 auto;
  }

  body.page-practice.practice-active .page {
    flex: 1 0 auto;
    padding-bottom: 6px;
  }

  body.page-practice.practice-active .practice-question {
    margin-top: auto;
    margin-bottom: auto;
  }

  body.page-practice.practice-active .site-footer {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 6px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    font-size: 12px;
    line-height: 1.2;
  }
}

@media (max-width: 420px) {
  body.practice-active .choice-item,
  body.review-active .choice-item {
    padding: 6px 24px 6px 9px;
    font-size: 12.8px;
  }

  body.page-review.review-active .review-queue-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  body.page-review.review-active .queue-card.mobile-collapse-ready {
    padding: 7px !important;
  }

  body.page-review.review-active .queue-item {
    min-height: 38px;
    padding: 6px 8px;
    border-radius: 12px;
  }

  body.page-review.review-active .queue-title {
    font-size: 11.5px;
  }

  body.page-review.review-active .queue-score {
    min-width: 34px;
    padding: 2px 6px;
    font-size: 10.5px;
  }
}

/* 考试设置页：手机/平板压缩布局，设置区常显，历史区默认收起。 */
@media (max-width: 900px) {
  body.page-exam:not(.exam-active) .page {
    gap: 7px;
  }

  body.page-exam:not(.exam-active) .page > .card:first-child {
    display: grid;
    min-height: 0;
    place-items: center;
    padding: 7px 10px;
    border-radius: 14px;
  }

  body.page-exam:not(.exam-active) .page > .card:first-child h2 {
    margin: 0;
    font-size: clamp(17px, 4.6vw, 22px);
    line-height: 1.15;
    text-align: center;
  }

  body.page-exam:not(.exam-active) .page > .card:first-child p {
    display: none;
  }

  body.page-exam:not(.exam-active) .exam-config {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 0;
  }

  body.page-exam:not(.exam-active) .exam-config label,
  body.page-exam:not(.exam-active) .count-grid label {
    gap: 3px;
    padding: 6px 7px;
    border-radius: 12px;
    font-size: 10.5px;
    line-height: 1.18;
  }

  body.page-exam:not(.exam-active) .exam-config input,
  body.page-exam:not(.exam-active) .exam-config select {
    min-height: 28px;
    padding: 5px 8px;
    border-radius: 10px !important;
    font-size: 11px;
  }

  body.page-exam:not(.exam-active) .exam-config > .form-hint {
    margin: 0;
    padding: 0 2px;
    font-size: 10.5px;
    line-height: 1.25;
  }

  body.page-exam:not(.exam-active) .form-meta,
  body.page-exam:not(.exam-active) .field-label {
    font-size: 10px;
    line-height: 1.15;
  }

  body.page-exam:not(.exam-active) .count-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body.page-exam:not(.exam-active) .count-grid label {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  body.page-exam:not(.exam-active) .exam-config > button {
    min-height: 34px;
    margin-top: 1px;
    border-radius: 999px;
    font-size: 12px;
  }

  body.page-exam:not(.exam-active) .page > .card.mobile-collapse-ready {
    padding: 7px !important;
  }

  body.page-exam:not(.exam-active) .page > .card.mobile-collapse-ready .mobile-collapse-body {
    padding-top: 7px;
  }

  body.page-exam:not(.exam-active) .mobile-collapse-body > h3:first-child {
    display: none;
  }

  body.page-exam:not(.exam-active) .result-item {
    display: grid;
    gap: 6px;
    margin-bottom: 7px;
    padding: 8px;
    border-radius: 13px;
  }

  body.page-exam:not(.exam-active) .result-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 0;
  }

  body.page-exam:not(.exam-active) .result-summary .stat {
    display: grid;
    gap: 1px;
    padding: 6px 5px;
    border-radius: 12px;
    background: rgba(255,255,255,.62);
  }

  body.page-exam:not(.exam-active) .result-summary .stat-number {
    font-size: 18px;
    line-height: 1.05;
  }

  body.page-exam:not(.exam-active) .result-summary .stat-label,
  body.page-exam:not(.exam-active) .result-item .meta {
    font-size: 10.5px;
    line-height: 1.26;
  }

  body.page-exam:not(.exam-active) .result-item .question-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  body.page-exam:not(.exam-active) .result-item .btn {
    min-height: 27px;
    padding: 4px 8px;
    font-size: 10.5px;
  }
}

@media (max-width: 420px) {
  body.page-exam:not(.exam-active) .page {
    width: calc(100% - 8px);
    padding-top: 6px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  body.page-exam:not(.exam-active) .page > .card:first-child {
    padding: 6px 9px;
  }

  body.page-exam:not(.exam-active) .exam-config,
  body.page-exam:not(.exam-active) .count-grid {
    gap: 5px;
  }

  body.page-exam:not(.exam-active) .exam-config label,
  body.page-exam:not(.exam-active) .count-grid label {
    padding: 5px 6px;
  }
}

/* 最终移动端覆盖：考试设置标题只保留文字高度，题型数量区改为更紧凑的小卡片。 */
@media (max-width: 900px) {
  body.page-exam:not(.exam-active) .page > .card:first-child {
    min-height: 0 !important;
    padding: 4px 10px !important;
    border-radius: 16px !important;
  }

  body.page-exam:not(.exam-active) .page > .card:first-child h2 {
    margin: 0 !important;
    font-size: clamp(17px, 4.8vw, 20px) !important;
    line-height: 1.15 !important;
    letter-spacing: .02em;
  }

  body.page-exam:not(.exam-active) .page > .card:first-child p {
    display: none !important;
  }

  body.page-exam:not(.exam-active) .exam-config {
    gap: 5px !important;
  }

  body.page-exam:not(.exam-active) .exam-config > label {
    min-height: 0;
    padding: 5px 7px !important;
  }

  body.page-exam:not(.exam-active) .exam-config input,
  body.page-exam:not(.exam-active) .exam-config select {
    min-height: 26px !important;
    padding: 4px 8px !important;
  }

  body.page-exam:not(.exam-active) .count-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px !important;
  }

  body.page-exam:not(.exam-active) .type-count-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    min-width: 0;
    padding: 6px;
    border: 1px solid rgba(203,213,225,.78);
    border-radius: 12px;
    background: rgba(255,255,255,.7);
  }

  body.page-exam:not(.exam-active) .type-count-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    color: #334155;
    font-size: 10.5px;
    line-height: 1.1;
  }

  body.page-exam:not(.exam-active) .type-count-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.page-exam:not(.exam-active) .type-count-card .mini-field {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.page-exam:not(.exam-active) .type-count-card .mini-field span {
    color: #64748b;
    font-size: 10px;
    line-height: 1.05;
  }

  body.page-exam:not(.exam-active) .type-count-card .mini-field input {
    width: 100%;
  }
}

@media (max-width: 420px) {
  body.page-exam:not(.exam-active) .page > .card:first-child {
    padding: 3px 8px !important;
    border-radius: 15px !important;
  }
}

/* 速刷页：移动端固定总倒计时、题目右上角本题倒计时、题下方 VS 记分和统一选项。 */
body.page-game_rush.game-result-only .page > .card:first-child,
body.page-game_rush.game-result-only [data-game-rush],
body.page-game_rush.game-result-only [data-game-question-card],
body.page-game_rush.game-result-only > .game-total-timer {
  display: none !important;
}

body.page-game_rush.game-result-only .game-result.is-visible {
  display: block !important;
}

.game-question-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.question-head-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.page-game_rush.game-active .game-question-card .game-scoreboard {
  margin-top: 14px;
}

body.page-game_rush.game-active .game-question-card .question-actions {
  justify-content: center;
}

@media (max-width: 900px) {
  body.page-game_rush.game-active .page {
    width: calc(100% - 10px);
    gap: 7px;
    padding-top: 6px;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }

  body.page-game_rush.game-active .page > .card:first-child {
    display: none !important;
  }

  body.page-game_rush.game-active .game-board {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    height: 0;
    min-height: 0;
    overflow: visible;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    animation: none !important;
    transform: none !important;
  }

  body.page-game_rush.game-active .game-topbar {
    display: block;
  }

  body.page-game_rush.game-active .game-total-timer {
    position: fixed;
    top: 55px;
    right: 8px;
    z-index: 35;
    width: auto;
    min-width: 74px;
    padding: 5px 8px;
    border-radius: 999px;
    gap: 2px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 10px 24px rgba(15,23,42,.12);
  }

  body.page-game_rush.game-active .game-total-timer .game-timer-label,
  body.page-game_rush.game-active .game-total-bar {
    display: none;
  }

  body.page-game_rush.game-active .game-total-timer .game-timer-value {
    font-size: 13px;
    line-height: 1.15;
    letter-spacing: 0;
  }

  body.page-game_rush.game-active .game-total-timer .game-timer-value::before {
    content: "总 ";
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
  }

  body.page-game_rush.game-active .game-question-card {
    padding: 9px !important;
    border-radius: 17px;
  }

  body.page-game_rush.game-active .game-question-head {
    align-items: center;
    margin-bottom: 8px;
  }

  body.page-game_rush.game-active .question-head-badges {
    gap: 5px;
  }

  body.page-game_rush.game-active .badge {
    padding: 3px 8px;
    font-size: 10.5px;
  }

  body.page-game_rush.game-active .game-question-timer {
    flex: 0 0 auto;
    min-width: 54px;
    padding: 4px 8px;
    border-radius: 999px;
    gap: 0;
    text-align: center;
    box-shadow: none;
  }

  body.page-game_rush.game-active .game-question-timer .game-timer-label {
    display: none;
  }

  body.page-game_rush.game-active .game-question-timer .game-timer-value {
    font-size: 15px;
    line-height: 1.12;
  }

  body.page-game_rush.game-active .game-question-timer .game-timer-value::before {
    content: "本题 ";
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
  }

  body.page-game_rush.game-active .question-text {
    margin-bottom: 9px;
    font-size: 14.5px;
    line-height: 1.5;
  }

  body.page-game_rush.game-active .choice-grid {
    gap: 6px;
  }

  body.page-game_rush.game-active .choice-item {
    min-height: 0;
    align-items: flex-start;
    gap: 0;
    padding: 6px 24px 6px 9px;
    border-radius: 12px;
    font-size: 12.8px;
    line-height: 1.38;
  }

  body.page-game_rush.game-active .choice-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.38;
  }

  body.page-game_rush.game-active .choice-letter {
    display: inline;
    min-width: 0;
    margin-right: 4px;
    font-weight: 900;
  }

  body.page-game_rush.game-active .game-scoreboard {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
    align-items: stretch;
    margin-top: 10px;
  }

  body.page-game_rush.game-active .game-competitor {
    min-width: 0;
    padding: 7px;
    border-radius: 13px;
    gap: 4px;
  }

  body.page-game_rush.game-active .game-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  body.page-game_rush.game-active .game-score {
    gap: 5px;
  }

  body.page-game_rush.game-active .game-score-value {
    font-size: 18px;
    line-height: 1;
  }

  body.page-game_rush.game-active .game-score-label,
  body.page-game_rush.game-active .game-stats {
    font-size: 10px;
    line-height: 1.1;
  }

  body.page-game_rush.game-active .game-stats {
    justify-content: space-between;
    gap: 4px;
  }

  body.page-game_rush.game-active .game-progress {
    height: 5px;
  }

  body.page-game_rush.game-active .game-versus {
    align-self: center;
    padding: 3px 5px;
    border-radius: 999px;
    background: rgba(238,242,255,.9);
    color: #4f46e5;
    font-size: 10px;
    font-weight: 900;
  }

  body.page-game_rush.game-active .game-lead,
  body.page-game_rush.game-active .game-streak {
    min-height: 0;
    margin-top: 5px;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
  }

  body.page-game_rush.game-active .game-audio-hint {
    display: none;
  }

  body.page-game_rush.game-active .game-question-card .question-actions {
    display: flex !important;
    grid-template-columns: none !important;
    position: static !important;
    bottom: auto !important;
    z-index: auto !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center;
    align-items: center;
    gap: 7px;
    width: 100%;
    margin-top: 8px;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  body.page-game_rush.game-active .game-question-card .question-actions .btn {
    width: auto !important;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11.5px;
  }

  body.page-game_rush.game-result-only .page {
    display: flex;
    min-height: calc(100dvh - 106px);
    justify-content: center;
  }

  body.page-game_rush.game-result-only .game-result {
    width: 100%;
    margin: auto 0;
    padding: 14px !important;
    border-radius: 18px;
  }

  body.page-game_rush.game-result-only .game-result h3 {
    text-align: center;
  }

  body.page-game_rush.game-result-only .game-result .result-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
}

/* 速刷结果页：数值不拆行，正确率完整显示；设置页清理残留悬浮倒计时。 */
body.page-game_rush:not(.game-active) > [data-game-floating-timer],
body:not(.page-game_rush) > [data-game-floating-timer] {
  display: none !important;
}

body.page-game_rush .game-result {
  overflow-wrap: normal;
}

body.page-game_rush .game-result .result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

body.page-game_rush .game-result .stat {
  display: grid;
  min-width: 0;
  align-items: center;
  justify-items: center;
  gap: 4px;
  padding: 8px 5px;
  border: 1px solid rgba(203, 213, 225, .62);
  border-radius: 14px;
  background: rgba(255, 255, 255, .58);
}

body.page-game_rush .game-result .stat-number {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #4f46e5;
  font-size: clamp(20px, 6.6vw, 30px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

body.page-game_rush .game-result .stat-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

body.page-game_rush .game-result .meta {
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
  word-break: normal;
  overflow-wrap: normal;
}

body.page-game_rush .game-result .question-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

body.page-game_rush .game-result .question-actions .btn {
  min-width: 104px;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
}

@media (max-width: 720px) {
  body.page-game_rush.game-active {
    display: flex;
    min-height: 100dvh;
    flex-direction: column;
  }

  body.page-game_rush.game-active .site-header {
    flex: 0 0 auto;
  }

  body.page-game_rush.game-active .page {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
  }

  body.page-game_rush.game-active .game-question-card:not(.game-result) {
    margin-top: auto;
    margin-bottom: auto;
  }

  body.page-game_rush.game-active .site-footer {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 6px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    font-size: 12px;
    line-height: 1.2;
  }
}

/* 题库管理页：手机端题目卡片压缩、选择态高亮、操作按钮置顶。 */
@media (max-width: 720px) {
  body.page-manage .manage-form {
    gap: 9px;
  }

  body.page-manage .manage-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  body.page-manage .manage-toolbar .manage-actions {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
  }

  body.page-manage .manage-toolbar input[type="password"] {
    grid-column: 1 / -1;
    min-height: 30px;
    margin-bottom: 6px;
  }

  body.page-manage .manage-select-all,
  body.page-manage .manage-toolbar .manage-actions .btn {
    display: inline-flex !important;
    flex-direction: row !important;
    width: 100%;
    min-height: 31px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 8px !important;
    border: 1px solid rgba(191, 219, 254, .9);
    border-radius: 999px !important;
    background: rgba(238, 242, 255, .62);
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.1;
  }

  body.page-manage .manage-select-all input {
    width: 13px;
    height: 13px;
    min-height: 13px !important;
    margin: 0;
    accent-color: #22c55e;
  }

  body.page-manage .manage-select-all.is-selected {
    border-color: rgba(74, 222, 128, .75);
    background: rgba(220, 252, 231, .82);
    color: #15803d;
  }

  body.page-manage .manage-toolbar .manage-actions .btn.danger {
    border-color: rgba(252, 165, 165, .92);
    background: rgba(255, 241, 242, .72);
    color: #dc2626;
  }

  body.page-manage .manage-list {
    gap: 10px;
  }

  body.page-manage .manage-item {
    position: relative;
    display: block;
    min-height: 0;
    padding: 44px 10px 10px !important;
    border-radius: 15px !important;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
  }

  body.page-manage .manage-item:has([data-select-item]:checked),
  body.page-manage .manage-item.is-selected {
    border-color: rgba(34, 197, 94, .58);
    background: linear-gradient(135deg, rgba(240, 253, 244, .92), rgba(236, 253, 245, .76));
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .18), 0 12px 26px rgba(22, 163, 74, .08);
  }

  body.page-manage .manage-check {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: inline-flex !important;
    flex-direction: row !important;
    width: auto;
    min-height: 26px;
    margin: 0 !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 9px !important;
    border: 1px solid rgba(191, 219, 254, .88);
    border-radius: 999px !important;
    background: rgba(238, 242, 255, .72);
    color: #2563eb;
    font-size: 10.5px;
    font-weight: 900;
    line-height: 1;
  }

  body.page-manage .manage-check input {
    width: 12px;
    height: 12px;
    min-height: 12px !important;
    margin: 0;
    accent-color: #22c55e;
  }

  body.page-manage .manage-check:has(input:checked),
  body.page-manage .manage-item.is-selected .manage-check {
    border-color: rgba(34, 197, 94, .72);
    background: rgba(220, 252, 231, .92);
    color: #15803d;
  }

  body.page-manage .manage-check:has(input:checked) span,
  body.page-manage .manage-item.is-selected .manage-check span {
    font-size: 0;
  }

  body.page-manage .manage-check:has(input:checked) span::after,
  body.page-manage .manage-item.is-selected .manage-check span::after {
    content: "已选";
    font-size: 10.5px;
  }

  body.page-manage .manage-body {
    min-width: 0;
  }

  body.page-manage .manage-item > .manage-body > .manage-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    width: auto;
    align-items: center;
  }

  body.page-manage .manage-item > .manage-body > .manage-actions .btn {
    width: auto !important;
    min-width: 46px;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    line-height: 1;
  }

  body.page-manage .manage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0 0 8px;
    padding-right: 0;
  }

  body.page-manage .manage-meta .badge {
    max-width: 100%;
    min-height: 22px;
    overflow: hidden;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 10.2px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.page-manage .manage-meta .bank-badge {
    max-width: min(48vw, 170px);
  }

  body.page-manage .manage-meta .tag-badge {
    max-width: min(45vw, 154px);
    color: #64748b;
  }

  body.page-manage .manage-meta .source-badge,
  body.page-manage .manage-meta .id-badge,
  body.page-manage .manage-meta .type-badge {
    max-width: 96px;
  }

  body.page-manage .manage-item .question-text {
    margin-top: 3px;
    font-size: 14px;
    line-height: 1.48;
  }

  body.page-manage .manage-item .option-list {
    margin: 7px 0 10px;
    padding-left: 16px;
    font-size: 12px;
    line-height: 1.45;
  }

  body.page-manage .manage-answer {
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.35;
  }
}

/* ҳ⿨ѡصѡťֻǳɫѡ̬ */
body.page-manage .manage-item {
  cursor: pointer;
}

body.page-manage .manage-item:has([data-select-item]:checked),
body.page-manage .manage-item.is-selected {
  border-color: rgba(34, 197, 94, .58) !important;
  background: linear-gradient(135deg, rgba(240, 253, 244, .94), rgba(236, 253, 245, .78)) !important;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .18), 0 12px 26px rgba(22, 163, 74, .08) !important;
}

body.page-manage .manage-check {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
  background: transparent !important;
}

body.page-manage .manage-check input {
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
}

body.page-manage .floating-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9999;
  width: min(82vw, 320px);
  margin: 0 !important;
  padding: 13px 18px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  text-align: center;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .72);
  animation: toast-pop .24s ease both;
}

body.page-manage .floating-toast.is-toast-leaving {
  opacity: 0;
  transform: translate(-50%, -54%) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}

body.page-manage .manage-inline-notice.is-notice-leaving {
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}

@keyframes toast-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 720px) {
  body.page-manage .manage-item {
    padding-top: 38px !important;
  }

  body.page-manage .manage-inline-notice {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.25;
  }
}

/* ɾɹʾʹűδִУҲ̶Ļ롣 */
body.page-manage [data-auto-toast] {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 9999 !important;
  width: min(82vw, 320px) !important;
  margin: 0 !important;
  padding: 13px 18px !important;
  transform: translate(-50%, -50%) !important;
  border-radius: 999px !important;
  text-align: center !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .72) !important;
}

body.page-manage [data-auto-toast].is-toast-leaving {
  opacity: 0;
  transform: translate(-50%, -54%) scale(.98) !important;
  transition: opacity .18s ease, transform .18s ease;
}
