/* 永星学习世界：前台样式
 * 设计基准：藏青 + 亮蓝；触控目标不小于 44px；不使用外部字体与图标。
 * 断点：>=1200 / 992–1199 / 769–991 / <=768。
 */

:root {
  --navy-950: #060d1c;
  --navy-900: #0b1730;
  --navy-800: #12264a;
  --navy-700: #1b3768;
  --blue-700: #1a56c4;
  --blue-600: #2266dd;
  --blue-500: #3b82f6;
  --blue-400: #69a5ff;
  --blue-100: #e4efff;
  --ink: #12203a;
  --ink-soft: #33445f;
  --muted: #61718a;
  --line: #dbe3ef;
  --line-strong: #c3cfe2;
  --surface: #f4f7fc;
  --surface-soft: #eef3fa;
  --card: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.94);
  --shadow-sm: 0 1px 2px rgba(15, 33, 66, 0.06);
  --shadow: 0 12px 32px rgba(15, 33, 66, 0.1);
  --shadow-lg: 0 24px 60px rgba(6, 13, 28, 0.28);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --danger: #cf3434;
  --danger-soft: #fdecec;
  --success: #17845a;
  --success-soft: #e6f7ef;
  --warning: #a56a10;
  --warning-soft: #fff5df;
  --header-height: 64px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

html[data-theme="eye"] {
  --ink: #2b2a22;
  --ink-soft: #403d31;
  --muted: #6d6957;
  --line: #e2dccb;
  --line-strong: #cdc5ad;
  --surface: #f4efe2;
  --surface-soft: #ece5d3;
  --card: #fbf8ef;
  --header-bg: rgba(251, 248, 239, 0.95);
  --blue-600: #4a6f8f;
  --blue-500: #5b83a3;
  --blue-100: #e4eadf;
  --shadow: 0 12px 32px rgba(74, 66, 42, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--blue-700);
  text-decoration: none;
}

a:hover {
  color: var(--blue-600);
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.container-xl {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1 0 auto;
  padding-top: 32px;
  padding-bottom: 56px;
}

/* ---------- 通用控件 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.icon-btn:focus-visible,
.nav-link:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue-400);
  outline-offset: 2px;
}

.btn-primary {
  --bs-btn-bg: var(--blue-600);
  --bs-btn-border-color: var(--blue-600);
  --bs-btn-hover-bg: var(--blue-700);
  --bs-btn-hover-border-color: var(--blue-700);
  --bs-btn-active-bg: var(--blue-700);
  --bs-btn-active-border-color: var(--blue-700);
  --bs-btn-disabled-bg: #9bb4d8;
  --bs-btn-disabled-border-color: #9bb4d8;
  color: #fff;
}

.btn-secondary {
  --bs-btn-bg: var(--card);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-color: var(--ink);
  --bs-btn-hover-bg: var(--surface-soft);
  --bs-btn-hover-border-color: var(--blue-500);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: var(--surface-soft);
  --bs-btn-active-border-color: var(--blue-500);
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger);
  border: 1px solid var(--danger);
  color: #fff;
}

.btn-sm {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 14px;
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.62;
  pointer-events: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.icon-btn:hover {
  border-color: var(--blue-400);
  color: var(--blue-700);
}

.form-label,
label {
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--ink-soft);
}

.form-control,
.form-select {
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background-color: var(--card);
  color: var(--ink);
  font-size: 15px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

.form-success {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
  font-size: 14px;
}

.form-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 顶部导航 ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.brand-star,
.footer-star {
  width: 26px;
  height: 26px;
  flex: none;
  fill: var(--blue-500);
  filter: drop-shadow(0 2px 6px rgba(59, 130, 246, 0.45));
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
}

.nav-link:hover {
  background: var(--surface-soft);
  color: var(--blue-700);
  text-decoration: none;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 12.5px;
  white-space: nowrap;
}

.stat-label {
  color: var(--muted);
}

.stat-chip strong {
  font-size: 13px;
  color: var(--ink);
}

.stat-chip-bank {
  max-width: 260px;
  overflow: hidden;
}

.stat-chip-bank strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-sub {
  color: var(--muted);
  font-size: 12px;
}

.dot {
  color: var(--line-strong);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.header-mobile-info {
  display: none;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
  text-align: right;
}

.header-mobile-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 190px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
}

.user-menu-toggle:hover {
  border-color: var(--blue-400);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  min-width: 230px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.user-menu-panel a,
.user-menu-panel button {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: var(--surface-soft);
  color: var(--blue-700);
  text-decoration: none;
}

.user-menu-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.user-menu-head .muted {
  font-size: 12px;
}

.menu-logout {
  color: var(--danger) !important;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-soft);
}

.mobile-drawer {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  z-index: 1035;
  width: min(320px, 86vw);
  padding: 20px 16px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-nav a,
.drawer-nav button {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

.drawer-nav a:hover,
.drawer-nav button:hover {
  background: var(--surface-soft);
  color: var(--blue-700);
  text-decoration: none;
}

.drawer-nav a.is-active {
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 700;
}

.drawer-backdrop {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  z-index: 1030;
  background: rgba(6, 13, 28, 0.42);
}

/* ---------- 页脚 ---------- */

.app-footer {
  flex: none;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 13px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink-soft);
}

.footer-star {
  width: 18px;
  height: 18px;
}

/* ---------- 页面通用 ---------- */

.page-section {
  width: 100%;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-title {
  margin-bottom: 6px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.page-hint {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 14px;
}

.page-summary {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.loading-line {
  margin: 18px 0;
  color: var(--muted);
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
}

.empty-star {
  width: 40px;
  height: 40px;
  fill: var(--line-strong);
}

.empty-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.empty-desc {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 登录 / 改密 ---------- */

.auth-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 12%, rgba(47, 108, 246, 0.28), transparent 42%),
    radial-gradient(circle at 85% 88%, rgba(28, 72, 168, 0.35), transparent 46%),
    linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 45%, #0a1e42 100%);
}

.auth-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -10%, rgba(105, 165, 255, 0.2), transparent 55%);
}

.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.9;
  background-image:
    radial-gradient(1.6px 1.6px at 18% 28%, #ffffff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 72% 16%, #dbe8ff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 42% 78%, #ffffff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 88% 62%, #cfe0ff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 8% 82%, #e8f0ff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 58% 42%, #ffffff 50%, transparent 51%);
  background-size: 320px 320px, 260px 260px, 420px 420px, 360px 360px,
    300px 300px, 480px 480px;
  animation: star-twinkle 7s ease-in-out infinite alternate;
}

@keyframes star-twinkle {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 0.95;
  }
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.auth-card {
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
}

.auth-title {
  margin-bottom: 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  font-size: 16px;
}

.btn.is-loading {
  opacity: 0.8;
  cursor: progress;
}

/* ---------- 题库选择 ---------- */

.banks-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.search-field {
  flex: 1 1 260px;
  min-width: 0;
}

.filter-field,
.sort-field {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-width: 150px;
}

.filter-field label,
.sort-field label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.bank-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.bank-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.bank-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue-400);
  box-shadow: var(--shadow);
}

.bank-card.is-current {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18), var(--shadow-sm);
}

.bank-card.is-locked {
  opacity: 0.6;
  background: var(--surface-soft);
}

.bank-card.is-locked:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.bank-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.bank-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.bank-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-recommended {
  background: linear-gradient(135deg, #ffe9b3, #ffd166);
  color: #6a4700;
}

.badge-current {
  background: var(--blue-100);
  color: var(--blue-700);
}

.badge-status {
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.badge-completed {
  background: var(--success-soft);
  color: var(--success);
}

.badge-completed_new {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-in_progress {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-abandoned {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-type {
  background: var(--blue-100);
  color: var(--blue-700);
}

.badge-difficulty-1 {
  background: var(--success-soft);
  color: var(--success);
}

.badge-difficulty-2 {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-difficulty-3 {
  background: var(--danger-soft);
  color: var(--danger);
}

.bank-description {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 14px;
  word-break: break-word;
}

.bank-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0 0 16px;
  font-size: 13px;
}

.bank-meta div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bank-meta dt {
  color: var(--muted);
  font-weight: 400;
}

.bank-meta dd {
  margin: 0;
  font-weight: 700;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}

.bank-coverage-track {
  height: 6px;
  margin: -6px 0 16px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.bank-coverage-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-700));
}

.bank-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.bank-card-actions .btn {
  flex: 1 1 auto;
}

.bank-lock-hint {
  margin: 0 0 12px;
  color: var(--warning);
  font-size: 12.5px;
}

.bank-select-trigger {
  width: 100%;
}

.bank-card.is-locked .bank-select-trigger {
  pointer-events: none;
}

.pagination-wrap {
  margin-top: 24px;
}

.pagination-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination-list button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink-soft);
  font-weight: 600;
}

.pagination-list button[aria-current="page"] {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: #fff;
}

.pagination-list button:disabled {
  opacity: 0.45;
}

/* ---------- 弹窗 ---------- */

.modal-content {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
}

.modal-header,
.modal-footer {
  border-color: var(--line);
}

.modal-bank-desc {
  color: var(--muted);
  font-size: 14px;
}

.modal-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.modal-facts div {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.modal-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.modal-facts dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.lock-rule {
  padding: 10px 12px;
  border-left: 4px solid var(--blue-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 13px;
}

.sample-title {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.sample-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sample-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.sample-type {
  display: inline-block;
  margin-bottom: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 700;
}

.sample-stem {
  margin: 0 0 8px;
  font-weight: 600;
  word-break: break-word;
}

.sample-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.sample-options li {
  word-break: break-word;
}

.sample-empty {
  color: var(--muted);
  font-size: 13px;
}

.abandon-step {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.abandon-warning {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 14px;
}

.abandon-name-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- 首页 ---------- */

.home-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.home-hero {
  position: relative;
  padding: 30px 32px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 12%, rgba(105, 165, 255, 0.35), transparent 45%),
    linear-gradient(145deg, var(--navy-950), var(--navy-800));
  color: #fff;
  box-shadow: var(--shadow);
}

.home-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.home-eyebrow {
  margin-bottom: 6px;
  color: rgba(219, 232, 255, 0.75);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home-bank-name {
  margin-bottom: 8px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.home-bank-meta {
  margin: 0;
  color: rgba(219, 232, 255, 0.78);
  font-size: 14px;
}

.admin-exempt {
  display: inline-block;
  margin: 14px 0 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.18);
  color: #ffe3a3;
  font-size: 12.5px;
  font-weight: 700;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.stat-card-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.stat-card-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  word-break: break-word;
}

.stat-card-foot {
  color: var(--muted);
  font-size: 12.5px;
}

.progress-track {
  height: 8px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-700));
  transition: width 0.4s ease;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.hero-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-height: 104px;
  padding: 22px 26px;
  border-radius: var(--radius);
  text-align: left;
  box-shadow: 0 14px 30px rgba(34, 102, 221, 0.22);
}

.hero-btn-title {
  font-size: 21px;
  font-weight: 800;
}

.hero-btn-sub {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
}

.home-more {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.home-more-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-secondary-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: -10px;
}

.home-secondary-link {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-secondary-link:hover {
  color: var(--blue-700);
}

.home-special-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.home-special-fields > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lock-hint {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 错误页 ---------- */

.status-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 64px 24px;
  text-align: center;
}

.status-orb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--navy-900), var(--navy-700));
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow);
}

.status-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}

.status-desc {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* ---------- Toast / 顶部错误条 ---------- */

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue-500);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 14px;
  pointer-events: auto;
  animation: toast-in 0.18s ease-out;
  word-break: break-word;
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-success {
  border-left-color: var(--success);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.global-error-banner {
  position: fixed;
  left: 50%;
  top: 76px;
  z-index: 1080;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid #f3b4b4;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* ---------- 题目列表 ---------- */

.question-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.question-filters .filter-field {
  min-width: 140px;
}

.question-filters .search-field {
  display: flex;
  flex-direction: column;
  flex: 1 1 220px;
  gap: 4px;
  min-width: 0;
}

.question-filters .search-field label,
.question-filters .filter-field label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.question-filters .btn {
  min-height: 44px;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink-soft);
  font-size: 14px;
}

.check-field .form-check-input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.question-launchers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
}

.question-launchers .btn {
  min-height: 44px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.question-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.question-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.question-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-answered {
  background: var(--success-soft);
  color: var(--success);
}

.badge-unanswered {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-type.type-multiple {
  background: #fff3e0;
  color: #c25a00;
}

.badge-type.type-judge {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-wrong-count {
  background: var(--danger-soft);
  color: var(--danger);
}

.favorite-btn {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.favorite-btn:hover {
  border-color: var(--blue-500);
  color: var(--blue-700);
}

.favorite-btn.is-on {
  border-color: #e46a7a;
  background: #fff0f2;
  color: #c2334a;
}

.question-stem {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.55;
  word-break: break-word;
}

.question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 12px;
}

.pagination-info {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- 答题页与护眼主题三档 ---------- */

html[data-practice-theme="soft"] {
  --practice-bg: #eef3e4;
  --practice-paper: #f9fbf1;
  --practice-ink: #2d3a26;
  --practice-muted: #5e6b53;
  --practice-line: #d3ddc2;
  --practice-option-bg: #fdfcf5;
  --practice-note-bg: #f4edc9;
  --practice-note-ink: #4a4022;
  --practice-note-line: #c7a83a;
}

html[data-practice-theme="deep"] {
  --practice-bg: #1d261f;
  --practice-paper: #26322a;
  --practice-ink: #e7efe1;
  --practice-muted: #b6c4ae;
  --practice-line: #3c4a40;
  --practice-option-bg: #2c3a31;
  --practice-note-bg: #3a3521;
  --practice-note-ink: #f2e8c4;
  --practice-note-line: #c9a43a;
}

body.practice-body {
  color: var(--practice-ink, var(--ink));
  background: var(--practice-bg, var(--surface));
}

.practice-page {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.practice-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.badge-mode {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px;
  background: var(--blue-100);
  color: var(--blue-700);
}

.practice-statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 8px;
}

.save-badge {
  min-height: 30px;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12.5px;
  font-weight: 700;
  transition: opacity 0.35s ease;
}

.save-badge:disabled {
  opacity: 1;
}

.save-badge.save-saving {
  background: var(--surface-soft);
  color: var(--muted);
}

.save-badge.save-retrying {
  background: var(--warning-soft);
  color: var(--warning);
}

.save-badge.save-failed {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  cursor: pointer;
}

.save-badge.is-fading {
  opacity: 0;
}

.practice-counter {
  color: var(--practice-muted, var(--muted));
  font-size: 13.5px;
  font-weight: 700;
}

.practice-stats {
  color: var(--practice-muted, var(--muted));
  font-size: 13px;
}

.practice-progress {
  height: 10px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.practice-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1fa2ff, #12d8fa);
  transition: width 0.35s ease;
}

.practice-paper {
  padding: 28px;
  border: 1px solid var(--practice-line, var(--line));
  border-radius: var(--radius-lg);
  background: var(--practice-paper, var(--card));
  color: var(--practice-ink, var(--ink));
  box-shadow: var(--shadow-sm);
}

.practice-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.practice-stem {
  margin: 0 0 20px;
  color: inherit;
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 700;
  line-height: 1.55;
  word-break: break-word;
}

.practice-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 13px 16px;
  border: 1.5px solid var(--practice-line, var(--line));
  border-radius: 14px;
  background: var(--practice-option-bg, var(--card));
  color: inherit;
  font-size: 15px;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option-card:hover,
.option-card:focus-visible {
  border-color: var(--blue-500);
  background: var(--blue-100);
}

.option-card.is-selected {
  border-color: var(--blue-600);
  background: var(--blue-100);
}

.option-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-soft);
  font-weight: 800;
}

.option-card.is-selected .option-key {
  background: var(--blue-600);
  color: #fff;
}

.option-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.option-mark {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.option-card.is-correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.option-card.is-correct .option-mark {
  color: var(--success);
}

.option-card.is-wrong-choice {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.option-card.is-wrong-choice .option-mark {
  color: var(--danger);
}

.option-card[disabled] {
  cursor: default;
  opacity: 1;
}

.option-card:disabled:hover {
  border-color: var(--practice-line, var(--line));
  background: var(--practice-option-bg, var(--card));
}

.option-card.is-correct:disabled:hover {
  border-color: var(--success);
  background: var(--success-soft);
}

.option-card.is-wrong-choice:disabled:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.practice-feedback {
  margin-top: 18px;
}

.feedback-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-left: 5px solid transparent;
  border-radius: 12px;
  font-size: 14.5px;
}

.feedback-result.is-correct {
  border-left-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.feedback-result.is-wrong,
.feedback-result.is-error {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.feedback-result.is-error .btn {
  margin-left: auto;
}

.feedback-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
  line-height: 1;
}

.feedback-answer,
.feedback-detail {
  color: inherit;
  font-weight: 600;
}

.feedback-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 4px solid var(--practice-note-line, #f0ad4e);
  border-radius: 10px;
  background: var(--practice-note-bg, #fff8e1);
  color: var(--practice-note-ink, #4a3b12);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.feedback-origin {
  margin-top: 8px;
  color: var(--practice-muted, var(--muted));
  font-size: 12.5px;
  word-break: break-word;
}

.practice-favorite-row {
  margin-top: 14px;
}

.practice-favorite-row .btn {
  min-height: 44px;
}

.all-covered-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--success);
  border-radius: 12px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 700;
}

.practice-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.practice-submit {
  min-width: 180px;
  min-height: 48px;
  font-size: 16px;
}

html[data-practice-theme="deep"] .feedback-result.is-correct,
html[data-practice-theme="deep"] .all-covered-banner {
  background: #1f3a2c;
  color: #9fe3bd;
}

html[data-practice-theme="deep"] .option-card.is-correct {
  background: #1f3a2c;
}

html[data-practice-theme="deep"] .option-card.is-correct:disabled:hover {
  background: #1f3a2c;
}

html[data-practice-theme="deep"] .option-card.is-wrong-choice {
  background: #43262a;
}

html[data-practice-theme="deep"] .option-card.is-wrong-choice:disabled:hover {
  background: #43262a;
}

/* ---------- 结果页 ---------- */

.result-eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.badge-warning-historical {
  margin-top: 8px;
  background: var(--warning-soft);
  color: var(--warning);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.result-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.result-card-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.result-card-value {
  font-size: 26px;
  font-weight: 800;
}

.result-ring-card {
  align-items: center;
  text-align: center;
}

.result-ring {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(
    var(--blue-500) calc(var(--rate) * 1%),
    var(--surface-soft) 0
  );
}

.result-ring-value {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--card);
  font-size: 20px;
  font-weight: 800;
}

.result-coverage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.result-coverage-label {
  color: var(--muted);
  font-size: 13px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.result-actions .btn {
  min-height: 44px;
}

#result-error {
  margin: 8px 0;
  color: var(--danger);
  font-weight: 600;
}

.result-items {
  margin-top: 10px;
}

.result-item {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.result-item-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
}

.result-item-stem {
  min-width: 0;
  word-break: break-word;
}

.result-item-body {
  padding: 0 16px 16px;
}

.result-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.result-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}

.result-option.is-correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.result-option.is-wrong-choice {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.result-option-text {
  flex: 1 1 200px;
  word-break: break-word;
}

.badge-correct {
  background: var(--success-soft);
  color: var(--success);
}

.badge-wrong {
  background: var(--danger-soft);
  color: var(--danger);
}

.result-answer-line,
.result-note,
.result-origin {
  margin: 0 0 8px;
  font-size: 14px;
}

.result-note {
  padding: 10px 12px;
  border-left: 4px solid #f0ad4e;
  border-radius: 8px;
  background: #fff8e1;
  color: #4a3b12;
  white-space: pre-wrap;
}

.result-origin {
  color: var(--muted);
  font-size: 12.5px;
}

.result-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* ---------- 错题本 ---------- */

.wrong-hint {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--warning);
  border-radius: 10px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 14px;
}

.wrong-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.wrong-toolbar label {
  color: var(--muted);
  font-size: 13px;
}

.wrong-toolbar .form-select {
  width: auto;
  min-width: 110px;
  min-height: 44px;
}

.wrong-toolbar .btn {
  min-height: 44px;
}

.wrong-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.wrong-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.wrong-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.wrong-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wrong-time {
  color: var(--muted);
  font-size: 12.5px;
}

.wrong-stem {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.55;
  word-break: break-word;
}

.wrong-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wrong-actions .btn {
  min-height: 44px;
}

/* ---------- 收藏页 ---------- */

.favorites-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.favorites-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.favorite-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.favorite-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.favorite-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.favorite-bank {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.favorite-stem-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
  word-break: break-word;
  cursor: pointer;
}

.favorite-stem-button:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

.favorite-stem-button:focus-visible {
  outline: 3px solid var(--blue-400);
  outline-offset: 2px;
}

.favorite-card-actions {
  display: flex;
  justify-content: flex-end;
}

.favorite-preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.favorite-preview-stem {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
  word-break: break-word;
}

/* ---------- 个人中心 ---------- */

.profile-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.profile-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.panel-title {
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 800;
}

.profile-task {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.profile-task-bank {
  font-size: 16px;
}

.profile-task-progress {
  color: var(--blue-700);
  font-weight: 700;
}

.profile-task-actions,
.profile-shortcut-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-no-bank {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.profile-no-bank-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.link-btn {
  align-self: flex-start;
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:disabled {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
}

.profile-completed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.profile-completed-item,
.progress-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  font-size: 13.5px;
}

.progress-list,
.session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}

.progress-status {
  color: var(--blue-700);
  font-size: 12.5px;
  font-weight: 700;
}

.progress-detail {
  color: var(--muted);
  font-size: 12.5px;
}

.session-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.session-card.is-in-progress {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 1px var(--blue-500) inset;
}

.session-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.session-bank {
  font-size: 15.5px;
  word-break: break-word;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--muted);
  font-size: 13px;
}

.session-actions {
  display: flex;
  justify-content: flex-end;
}

.session-stopped {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.badge-session-in_progress {
  background: var(--blue-100);
  color: var(--blue-700);
}

.badge-session-completed {
  background: var(--success-soft);
  color: var(--success);
}

.badge-session-abandoned {
  background: var(--warning-soft);
  color: var(--warning);
}

/* ---------- 响应式：>=1200 ---------- */

@media (min-width: 1200px) {
  .bank-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- 响应式：992–1199 ---------- */

@media (min-width: 992px) and (max-width: 1199px) {
  .bank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-chip-activity {
    display: none;
  }

  .stat-chip-bank {
    max-width: 200px;
  }
}

/* ---------- 响应式：769–991 ---------- */

@media (min-width: 769px) and (max-width: 991px) {
  .bank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- 响应式：<992（平板竖屏与手机） ---------- */

@media (max-width: 991px) {
  .desktop-nav,
  .header-stats,
  .user-menu,
  .theme-btn {
    display: none !important;
  }

  .hamburger {
    display: inline-flex;
  }

  .header-mobile-info {
    display: block;
  }

  .header-inner {
    gap: 12px;
  }

  .brand-name {
    font-size: 16px;
  }
}

/* ---------- 响应式：<=768 ---------- */

@media (max-width: 768px) {
  .container-xl {
    padding-left: 16px;
    padding-right: 16px;
  }

  .app-main {
    padding-top: 20px;
    padding-bottom: 40px;
  }

  .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .page-summary {
    white-space: normal;
  }

  .banks-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-field,
  .filter-field,
  .sort-field {
    flex: 1 1 auto;
    width: 100%;
  }

  .bank-grid {
    grid-template-columns: 1fr;
  }

  .bank-meta {
    grid-template-columns: 1fr;
  }

  .bank-card-actions .btn {
    flex: 1 1 100%;
  }

  .home-hero {
    padding: 24px 20px;
  }

  .home-stats {
    grid-template-columns: 1fr;
  }

  .home-actions {
    grid-template-columns: 1fr;
  }

  .hero-btn {
    min-height: 88px;
    padding: 18px 20px;
  }

  .home-special-fields {
    grid-template-columns: 1fr;
  }

  .home-more-panel {
    width: 100%;
  }

  .home-more-panel .btn {
    flex: 1 1 100%;
  }

  .favorites-list,
  .profile-stats {
    grid-template-columns: 1fr;
  }

  .session-meta {
    flex-direction: column;
    gap: 2px;
  }

  .session-actions .btn {
    flex: 1 1 auto;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .auth-card {
    padding: 28px 20px;
  }

  .auth-page {
    padding: 20px 12px;
    align-items: center;
  }

  .modal-dialog {
    margin: 0.75rem;
  }

  .modal-dialog.modal-lg {
    max-width: calc(100vw - 1.5rem);
  }

  .modal-facts {
    grid-template-columns: 1fr;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }

  .status-page {
    padding: 40px 16px;
  }

  .status-orb {
    width: 88px;
    height: 88px;
    font-size: 24px;
  }
}

/* ---------- 响应式：题目/答题/结果/错题（<=768） ---------- */

@media (max-width: 768px) {
  .question-filters {
    align-items: stretch;
  }

  .question-filters .filter-field,
  .question-filters .search-field {
    flex: 1 1 100%;
    width: 100%;
  }

  .question-launchers .btn {
    flex: 1 1 100%;
  }

  .question-card-head {
    flex-wrap: wrap;
  }

  .practice-page {
    padding-bottom: 96px;
  }

  .practice-toolbar .btn {
    flex: 1 1 auto;
  }

  .practice-paper {
    padding: 20px 16px;
  }

  .practice-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--practice-line, var(--line));
    background: var(--practice-bg, var(--surface));
  }

  .practice-submit {
    width: 100%;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-ring-card {
    grid-column: 1 / -1;
  }

  .result-actions .btn {
    flex: 1 1 100%;
  }

  .wrong-toolbar .btn {
    flex: 1 1 auto;
  }

  .wrong-actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   后台管理（固定原版主题；独立骨架与表格/卡片）
   ============================================================ */

.admin-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-soft);
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.admin-header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-height);
}

.admin-brand-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
}

.admin-nav {
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.admin-nav-link.is-active {
  background: var(--blue-100);
  color: var(--blue-700);
}

.admin-header-actions {
  margin-left: auto;
}

.admin-main {
  flex: 1 0 auto;
  padding-top: 28px;
  padding-bottom: 56px;
}

.admin-footer {
  margin-top: auto;
}

.admin-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-page-title {
  margin: 0 0 4px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.admin-stat-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-stat-value {
  margin: 0;
  color: var(--ink);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.15;
}

.admin-stat-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.admin-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-panel-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
}

.admin-panel-head .admin-panel-title {
  margin-bottom: 0;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.admin-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.admin-metric-label {
  color: var(--muted);
  font-size: 13px;
}

.admin-metric-value {
  font-size: 24px;
  font-weight: 800;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 20px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  vertical-align: middle;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.admin-table th {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-soft);
}

.admin-table tbody tr:hover {
  background: var(--surface-soft);
}

.admin-clickable-row {
  cursor: pointer;
}

.admin-cell-strong {
  color: var(--ink);
  font-weight: 700;
}

.admin-cell-stem {
  min-width: 240px;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row-disabled {
  color: var(--muted);
  opacity: 0.82;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-actions .btn {
  min-height: 44px;
  padding: 8px 14px;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-active {
  background: var(--success-soft);
  color: var(--success);
}

.badge-disabled {
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-empty {
  margin: 12px 0 0;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-align: center;
}

.admin-filters {
  display: grid;
  grid-template-columns:
    minmax(200px, 1.4fr) repeat(4, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.admin-filters label {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.admin-filter-actions {
  display: flex;
  gap: 8px;
}

.admin-filter-actions .btn {
  min-height: 44px;
}

.admin-card-list {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.admin-card-id {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-card-stem {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.admin-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-card-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}

.admin-card-meta-label {
  color: var(--muted);
}

.admin-card-meta-value {
  text-align: right;
  overflow-wrap: anywhere;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.admin-fieldset legend {
  padding: 0 6px;
  margin-bottom: 8px;
}

.admin-option-list,
.admin-answer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-option-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-option-key {
  flex: none;
  width: 24px;
  color: var(--muted);
  font-weight: 800;
}

.admin-option-row .form-control {
  flex: 1;
}

.admin-answer-list {
  flex-direction: row;
  flex-wrap: wrap;
}

.admin-answer-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  font-size: 14px;
  cursor: pointer;
}

.admin-answer-item input {
  width: 18px;
  height: 18px;
}

.admin-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-frozen-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 600;
}

.admin-tags-panel {
  margin-top: 8px;
}

.admin-inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-inline-form .search-field {
  flex: 1;
}

.admin-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.admin-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.admin-rank-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--blue-600);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.admin-rank-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-rank-value {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.admin-form .form-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
}

.admin-form .form-check-input {
  width: 18px;
  height: 18px;
}

/* ---------- 后台响应式 ---------- */

@media (max-width: 1199px) {
  .admin-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .admin-header-inner {
    gap: 12px;
  }

  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-main {
    padding-top: 20px;
    padding-bottom: 40px;
  }

  .admin-page-heading > .btn,
  .admin-page-heading > a.btn {
    width: 100%;
  }

  .admin-stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-filter-actions .btn {
    flex: 1;
  }

  /* 列表表格转卡片；概览表使用 data-label 堆叠为键值卡片。 */
  .admin-list-table {
    display: none;
  }

  .admin-card-list {
    display: flex;
  }

  .admin-responsive-table thead {
    display: none;
  }

  .admin-responsive-table,
  .admin-responsive-table tbody,
  .admin-responsive-table tr,
  .admin-responsive-table td {
    display: block;
    width: 100%;
  }

  .admin-responsive-table tr {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
  }

  .admin-responsive-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
  }

  .admin-responsive-table td:last-child {
    border-bottom: 0;
  }

  .admin-responsive-table td::before {
    content: attr(data-label);
    flex: none;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
  }

  .admin-actions {
    width: 100%;
  }

  .admin-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .admin-form {
    padding: 16px;
  }

  .admin-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-option-row {
    flex-wrap: wrap;
  }

  .admin-option-row .form-control {
    flex: 1 1 calc(100% - 40px);
    min-width: 0;
  }

  .admin-answer-list {
    flex-direction: column;
  }

  .admin-answer-item {
    width: 100%;
  }

  .admin-inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-inline-form .btn {
    width: 100%;
  }

  .admin-rank-item {
    flex-wrap: wrap;
  }

  .admin-rank-value {
    width: 100%;
    text-align: left;
    padding-left: 38px;
  }
}
