/* ==========================================================================
   知练 · 校内刷题系统  —  design system & components
   ========================================================================== */

:root {
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --bg: #f4f5fb;
  --bg-soft: #eceefa;
  --surface: #ffffff;
  --surface-2: #f7f8fd;
  --surface-3: #eef0f9;
  --border: #e7e9f2;
  --border-strong: #d8dbe8;
  --text: #171c2b;
  --text-2: #464d60;
  --muted: #858b9d;

  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --primary-soft: #eef0ff;
  --primary-ring: rgba(79, 70, 229, 0.22);
  --accent: #0d9488;
  --accent-soft: #e5fbf7;
  --success: #16a34a;
  --success-soft: #e9f9ef;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --warning: #d97706;
  --warning-soft: #fff5e5;

  --shadow-sm: 0 1px 2px rgba(23, 28, 43, 0.06);
  --shadow: 0 18px 40px -24px rgba(23, 28, 43, 0.35), 0 2px 8px rgba(23, 28, 43, 0.04);
  --shadow-lg: 0 32px 70px -32px rgba(23, 28, 43, 0.45);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --sidebar-w: 248px;
}

[data-theme="dark"] {
  --bg: #0e1119;
  --bg-soft: #121624;
  --surface: #171b26;
  --surface-2: #1d2230;
  --surface-3: #242a3a;
  --border: #262c3b;
  --border-strong: #333a4d;
  --text: #e9ebf3;
  --text-2: #b4bac9;
  --muted: #7f8698;

  --primary: #818cf8;
  --primary-strong: #a5b4fc;
  --primary-soft: #242a45;
  --primary-ring: rgba(129, 140, 248, 0.3);
  --accent: #2dd4bf;
  --accent-soft: #11312f;
  --success: #4ade80;
  --success-soft: #122b1d;
  --danger: #f87171;
  --danger-soft: #351818;
  --warning: #fbbf24;
  --warning-soft: #33270e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 32px 70px -30px rgba(0, 0, 0, 0.9);
  --topbar-bg: rgba(15, 18, 27, 0.82);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(99, 102, 241, 0.1), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(20, 184, 166, 0.08), transparent 55%),
    var(--bg);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--primary-ring); }

h1, h2, h3, h4, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.spacer { flex: 1; }

/* ------------------------------------------------------------------ boot */

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
}
.boot-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 24px;
  background: linear-gradient(135deg, #6366f1, #14b8a6);
  box-shadow: var(--shadow);
  animation: pulse 1.4s ease-in-out infinite;
}
.boot-text { color: var(--muted); font-size: 13px; }
@keyframes pulse { 50% { transform: translateY(-4px); opacity: 0.85; } }

/* ------------------------------------------------------------------ shell */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 50;
  transition: transform 0.22s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 10px 20px;
  color: var(--text);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  background: linear-gradient(135deg, #6366f1, #14b8a6);
  box-shadow: 0 8px 18px -8px rgba(79, 70, 229, 0.7);
}
.brand-name { font-weight: 750; font-size: 17px; letter-spacing: 0.3px; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.8px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  color: var(--text-2);
  font-weight: 520;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: 0.75; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 650;
}
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
  font-weight: 650;
}

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.avatar.green { background: linear-gradient(135deg, #0d9488, #22c55e); }
.avatar.amber { background: linear-gradient(135deg, #d97706, #f59e0b); }
.user-chip-name { display: block; font-weight: 620; font-size: 13.5px; line-height: 1.25; }
.user-chip-role { display: block; font-size: 11.5px; color: var(--muted); }
.user-chip .icon { margin-left: auto; color: var(--muted); width: 16px; height: 16px; flex: none; }
.user-chip .grow { min-width: 0; }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(18px, 3vw, 36px);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 15px; font-weight: 650; letter-spacing: 0.2px; }
.topbar-sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: 0.15s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.icon-btn.plain { border-color: transparent; background: transparent; }
.icon-btn.plain:hover { background: var(--surface-2); }

.menu-btn { display: none; }

.view {
  padding: 26px clamp(18px, 3vw, 40px) 72px;
  max-width: 1240px;
  margin: 0 auto;
  animation: fadeUp 0.26s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

body.focus-mode .sidebar { display: none; }
body.focus-mode .main { margin-left: 0; }
body.focus-mode .topbar { display: none; }
body.focus-mode .view { max-width: 880px; padding-top: 22px; }

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 15, 24, 0.5);
  z-index: 45;
}

/* ------------------------------------------------------------------ page head */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head h1 { font-size: 24px; font-weight: 760; letter-spacing: -0.3px; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb svg { width: 12px; height: 12px; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  transition: 0.16s ease;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(79, 70, 229, 0.85);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-strong), #4f46e5); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: var(--primary-ring); }
.btn-ghost { border-color: var(--border); background: var(--surface); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-soft); color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-link { background: none; border: 0; color: var(--primary); padding: 0; height: auto; font-weight: 600; }
.btn-link:hover { text-decoration: underline; transform: none; }
.btn-sm { height: 31px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 680; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 12px; }
.card-pad { padding: 20px; }

.section-gap { margin-top: 22px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  position: relative;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary-soft);
  opacity: 0.55;
}
.kpi-head { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; }
.kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-icon.green { background: var(--success-soft); color: var(--success); }
.kpi-icon.amber { background: var(--warning-soft); color: var(--warning); }
.kpi-icon.red { background: var(--danger-soft); color: var(--danger); }
.kpi-value { font-size: 27px; font-weight: 760; letter-spacing: -0.6px; margin-top: 9px; line-height: 1.1; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-foot { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ------------------------------------------------------------------ badges & tags */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--surface-3); color: var(--muted); }
.badge-teal { background: var(--accent-soft); color: var(--accent); }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
}
.difficulty { color: var(--warning); letter-spacing: 1px; font-size: 12px; white-space: nowrap; }
.difficulty .off { color: var(--border-strong); }

/* ------------------------------------------------------------------ forms */

.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12.5px; font-weight: 620; color: var(--text-2); }
.label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.65; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.error-text { font-size: 12px; color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: 0.15s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice b { font-size: 13px; font-weight: 650; }
.choice span { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.choice:hover { border-color: var(--primary); }
.choice.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px var(--primary-ring);
}

.search-box { position: relative; min-width: 220px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search-box .input { padding-left: 34px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.table .stem-cell { max-width: 440px; }
.table .stem-cell .stem-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.table .sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; }

/* ------------------------------------------------------------------ bank cards */

.bank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bank-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: 0.18s ease;
  overflow: hidden;
}
.bank-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.bank-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--bank-color, #6366f1), transparent 85%);
  opacity: 0.85;
}
.bank-top { display: flex; align-items: flex-start; gap: 12px; }
.bank-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--bank-soft, var(--primary-soft));
  color: var(--bank-color, var(--primary));
  font-weight: 750;
  font-size: 17px;
  flex: none;
}
.bank-icon svg { width: 20px; height: 20px; }
.bank-name { font-size: 15.5px; font-weight: 700; letter-spacing: -0.1px; }
.bank-meta { color: var(--muted); font-size: 12px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.bank-meta span { display: inline-flex; align-items: center; gap: 4px; }
.bank-desc {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 41px;
}
.bank-progress { display: flex; flex-direction: column; gap: 6px; }
.bank-progress-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6366f1, #14b8a6); transition: width 0.5s ease; }
.progress.thin { height: 4px; }
.bank-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.bank-stat { display: flex; flex-direction: column; gap: 1px; }
.bank-stat b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bank-stat span { font-size: 10.5px; color: var(--muted); letter-spacing: 0.3px; }
.bank-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 2px; }
.bank-actions .btn { flex: none; }
.bank-actions .more { margin-left: auto; }

/* ------------------------------------------------------------------ empty state */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 52px 20px;
  color: var(--muted);
}
.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  margin-bottom: 4px;
}
.empty-icon svg { width: 24px; height: 24px; }
.empty-title { color: var(--text); font-weight: 650; font-size: 14.5px; }
.empty-desc { font-size: 12.5px; max-width: 380px; line-height: 1.6; }
.empty .btn { margin-top: 8px; }

/* ------------------------------------------------------------------ dashboard */

.hello {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(120deg, #4f46e5 0%, #6366f1 55%, #0d9488 130%);
  color: #fff;
  box-shadow: 0 24px 50px -30px rgba(79, 70, 229, 0.8);
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}
.hello::after {
  content: "";
  position: absolute;
  right: 40px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}
.hello::before {
  content: "";
  position: absolute;
  right: -30px;
  top: -80px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}
.hello h1 { font-size: 23px; font-weight: 760; letter-spacing: -0.3px; }
.hello p { color: rgba(255, 255, 255, 0.78); font-size: 13px; margin-top: 6px; max-width: 560px; }
.hello .btn { background: #fff; color: #4338ca; box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.5); }
.hello .btn:hover { background: #f4f4ff; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-track { width: 100%; max-width: 34px; height: 100px; display: flex; align-items: flex-end; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.bar-fill { width: 100%; min-height: 3px; border-radius: 7px; background: linear-gradient(180deg, #818cf8, #4f46e5); transition: height 0.5s; }
.bar-fill.zero { background: var(--border); }
.bar-label { font-size: 10.5px; color: var(--muted); }
.bar-count { font-size: 10.5px; color: var(--text-2); font-weight: 650; height: 14px; }

.mini-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.mini-row:last-child { border-bottom: 0; }
.mini-row .grow { min-width: 0; }
.mini-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.score-pill {
  min-width: 44px;
  height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  color: var(--text-2);
}
.score-pill.good { background: var(--success-soft); color: var(--success); }
.score-pill.mid { background: var(--warning-soft); color: var(--warning); }
.score-pill.bad { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------------ tabs */

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.tab {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------------ practice */

.practice-shell { display: flex; flex-direction: column; gap: 18px; }
.practice-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.practice-title { font-weight: 700; font-size: 14.5px; }
.practice-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.practice-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--text-2);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.practice-timer svg { width: 14px; height: 14px; color: var(--muted); }

.practice-progress { display: flex; align-items: center; gap: 12px; }
.practice-progress .progress { flex: 1; height: 7px; }
.practice-progress span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(20px, 4vw, 34px);
}
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.q-stem {
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 650;
  line-height: 1.7;
  letter-spacing: -0.1px;
  white-space: pre-wrap;
  word-break: break-word;
}
.q-stem .q-no { color: var(--muted); font-weight: 600; margin-right: 6px; }
.q-hint { margin-top: 10px; font-size: 12px; color: var(--muted); }

.options { display: flex; flex-direction: column; gap: 9px; margin-top: 22px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  text-align: left;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  transition: 0.14s ease;
}
.option:hover:not(.locked) { border-color: var(--primary); background: var(--primary-soft); }
.option-key {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin-top: -1px;
}
.option.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-ring); }
.option.selected .option-key { background: var(--primary); border-color: var(--primary); color: #fff; }
.option.correct { border-color: var(--success); background: var(--success-soft); }
.option.correct .option-key { background: var(--success); border-color: var(--success); color: #fff; }
.option.wrong { border-color: var(--danger); background: var(--danger-soft); }
.option.wrong .option-key { background: var(--danger); border-color: var(--danger); color: #fff; }
.option.locked { cursor: default; }
.option .mark { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; }
.option .mark svg { width: 15px; height: 15px; }

.judge-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.judge-options .option { justify-content: center; text-align: center; font-weight: 650; font-size: 15px; padding: 16px; }
.judge-options .option-key { display: none; }

.fill-wrap { margin-top: 22px; }
.fill-wrap .input { height: 48px; font-size: 15px; }

.feedback {
  margin-top: 20px;
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  animation: fadeUp 0.2s ease both;
}
.feedback.ok { border-color: var(--success); background: var(--success-soft); }
.feedback.bad { border-color: var(--danger); background: var(--danger-soft); }
.feedback-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.feedback.ok .feedback-head { color: var(--success); }
.feedback.bad .feedback-head { color: var(--danger); }
.feedback-head svg { width: 18px; height: 18px; }
.feedback-row { margin-top: 8px; font-size: 13px; color: var(--text-2); }
.feedback-row b { color: var(--text); }
.feedback-analysis {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-strong);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  white-space: pre-wrap;
}

.practice-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 2px;
}
.practice-foot .spacer { flex: 1; }
.practice-foot .btn { min-width: 96px; }

.palette { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.palette-item {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.palette-item.current { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 2px var(--primary-ring); }
.palette-item.answered { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.palette-item.answered.current { border-color: var(--primary); }

.practice-aside {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.practice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 18px; align-items: start; }

/* ------------------------------------------------------------------ result */

.result-hero {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 44px);
  padding: clamp(22px, 4vw, 34px);
  background:
    radial-gradient(500px 200px at 100% 0%, rgba(20, 184, 166, 0.08), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.score-ring {
  --val: 0;
  --ring-color: var(--primary);
  width: 150px;
  height: 150px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--val) * 1%), var(--surface-3) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.score-ring-inner { position: relative; text-align: center; line-height: 1.15; }
.score-ring-value { font-size: 36px; font-weight: 780; letter-spacing: -1px; }
.score-ring-value small { font-size: 14px; font-weight: 600; color: var(--muted); }
.score-ring-label { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.result-headline h2 { font-size: 22px; font-weight: 760; letter-spacing: -0.3px; }
.result-headline p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.result-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; }
.result-stat b { display: block; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.result-stat span { font-size: 11.5px; color: var(--muted); }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

.review-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
}
.review-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.review-item summary::-webkit-details-marker { display: none; }
.review-item summary .r-no { color: var(--muted); font-size: 12px; font-weight: 650; padding-top: 2px; min-width: 22px; }
.review-item summary .r-stem { font-size: 13.5px; line-height: 1.6; font-weight: 550; flex: 1; }
.review-item summary .badge { flex: none; }
.review-item summary > svg { width: 16px; height: 16px; flex: none; color: var(--muted); margin-top: 3px; }
.review-body { padding: 0 16px 16px 48px; border-top: 1px dashed var(--border); margin-top: 2px; padding-top: 12px; font-size: 13px; }
.review-body .answer-line { margin-bottom: 6px; color: var(--text-2); }
.review-body .answer-line b { color: var(--text); }
.review-body .analysis { color: var(--text-2); line-height: 1.7; white-space: pre-wrap; }
.review-options { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 10px; }
.review-option { padding: 4px 8px; border-radius: 6px; color: var(--text-2); font-size: 12.5px; }
.review-option.correct { background: var(--success-soft); color: var(--success); }
.review-option.wrong { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------------ wrongbook */

.wrong-item { display: flex; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.wrong-item:last-child { border-bottom: 0; }
.wrong-index { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.wrong-main { flex: 1; min-width: 0; }
.wrong-stem { font-size: 14px; line-height: 1.65; font-weight: 550; white-space: pre-wrap; }
.wrong-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.wrong-answer { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.wrong-answer b { color: var(--success); }
.wrong-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }

/* ------------------------------------------------------------------ chart / analytics */

.dist { display: flex; flex-direction: column; gap: 10px; }
.dist-row { display: grid; grid-template-columns: 58px 1fr 36px; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.dist-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.dist-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #818cf8, #4f46e5); }
.dist-fill.good { background: linear-gradient(90deg, #34d399, #059669); }
.dist-fill.bad { background: linear-gradient(90deg, #f87171, #dc2626); }

.accuracy-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.accuracy-bar .progress { width: 74px; height: 5px; }
.accuracy-bar span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; width: 36px; }

/* ------------------------------------------------------------------ modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 13, 22, 0.52);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fadeIn 0.15s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
  overflow: hidden;
}
.modal.wide { max-width: 720px; }
.modal.xwide { max-width: 900px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 14px; }
.modal-title { font-size: 16.5px; font-weight: 720; }
.modal-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal-close { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 4px 22px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

/* ------------------------------------------------------------------ toast */

.toast-root { position: fixed; right: 20px; top: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 220px;
  max-width: 340px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text);
  animation: toastIn 0.2s ease both;
  pointer-events: auto;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--primary); }
.toast.hide { animation: toastOut 0.2s ease both; }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ------------------------------------------------------------------ login */

.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(700px 500px at 15% 10%, rgba(255, 255, 255, 0.16), transparent 55%),
    linear-gradient(140deg, #312e81 0%, #4f46e5 48%, #0f766e 120%);
}
.login-art::before, .login-art::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}
.login-art::before { width: 480px; height: 480px; right: -180px; top: -160px; }
.login-art::after { width: 320px; height: 320px; right: -40px; bottom: -170px; }
.login-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-brand .brand-mark { background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px); box-shadow: none; border: 1px solid rgba(255, 255, 255, 0.24); }
.login-brand-name { font-weight: 760; font-size: 19px; letter-spacing: 0.4px; }
.login-brand-sub { font-size: 11px; color: rgba(255, 255, 255, 0.65); letter-spacing: 1.4px; }
.login-copy { margin-top: auto; margin-bottom: 34px; position: relative; z-index: 1; max-width: 460px; }
.login-copy h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.25; letter-spacing: -1px; font-weight: 780; }
.login-copy h1 em { font-style: normal; color: #99f6e4; }
.login-copy p { margin-top: 16px; color: rgba(255, 255, 255, 0.74); font-size: 14px; line-height: 1.8; max-width: 400px; }
.login-features { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; position: relative; z-index: 1; }
.login-feature { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, 0.86); }
.login-feature .dot { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.2); }
.login-feature svg { width: 12px; height: 12px; }
.login-preview {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  max-width: 380px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.6);
}
.login-preview-head { display: flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: 1px; color: rgba(255, 255, 255, 0.6); }
.login-preview-q { margin-top: 8px; font-size: 13.5px; font-weight: 600; line-height: 1.6; }
.login-preview-options { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.login-preview-options span { font-size: 11.5px; padding: 4px 9px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.24); color: rgba(255, 255, 255, 0.78); }
.login-preview-options span.ok { background: rgba(45, 212, 191, 0.22); border-color: rgba(153, 246, 228, 0.7); color: #ccfbf1; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 30px; }
.login-card { width: 100%; max-width: 390px; }
.login-card h2 { font-size: 24px; font-weight: 760; letter-spacing: -0.4px; }
.login-card > p { color: var(--muted); font-size: 13px; margin-top: 6px; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .field { gap: 7px; }
.login-form .input { height: 44px; border-radius: 11px; }
.login-error { display: none; padding: 9px 12px; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-size: 12.5px; }
.login-error.show { display: block; }
.login-submit { height: 46px; border-radius: 12px; margin-top: 2px; }
.login-note { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 18px; line-height: 1.7; }
.setup-hint { padding: 10px 12px; margin-bottom: 18px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12px; line-height: 1.7; }

/* ------------------------------------------------------------------ misc */

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.6;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--primary); }
.alert.warning { background: var(--warning-soft); border-color: transparent; color: var(--text-2); }
.alert.warning svg { color: var(--warning); }

.divider { height: 1px; background: var(--border); margin: 4px 0; }

.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 14px 2px 0; }
.pagination .btn { min-width: 32px; height: 30px; padding: 0 8px; font-size: 12px; }
.pagination .page-info { font-size: 12px; color: var(--muted); margin-right: auto; }

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  padding: 26px 18px;
  text-align: center;
  background: var(--surface-2);
  transition: 0.16s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--muted); }
.dropzone-title { font-weight: 600; font-size: 13.5px; margin-top: 8px; }
.dropzone-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.file-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.file-pill svg { width: 15px; height: 15px; color: var(--primary); }

.import-preview { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.import-preview table { font-size: 12px; }
.import-preview td, .import-preview th { padding: 7px 10px; }

.code-input {
  font-family: var(--mono);
  font-size: 12.5px;
  min-height: 180px;
  line-height: 1.6;
  background: var(--surface-2);
}

.settings-list { display: flex; flex-direction: column; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: 0; }
.settings-row .label { font-size: 13.5px; color: var(--text); }
.settings-row .hint { margin-top: 2px; }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .bank-grid { grid-template-columns: 1fr; }
  .practice-layout { grid-template-columns: 1fr; }
  .practice-aside { position: static; }
  .practice-aside .card { display: none; }
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .drawer-overlay.show { display: block; }
  .topbar { padding: 0 16px; }
  .view { padding: 18px 16px 60px; }
  body.focus-mode .view { padding: 14px 12px 40px; }
  .page-head h1 { font-size: 21px; }
  .practice-shell { gap: 14px; }
  .practice-head { padding: 10px 12px; }
  .question-card { padding: 20px 16px; border-radius: 16px; }
  .options { margin-top: 16px; }
  .option { padding: 11px 12px; font-size: 13.5px; }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 23px; }
  .bank-card { padding: 16px; }
  .bank-actions { flex-wrap: wrap; }
  .bank-actions .btn { flex: 1; }
  .result-hero { padding: 20px; gap: 20px; }
  .score-ring { width: 120px; height: 120px; }
  .score-ring-value { font-size: 28px; }
  .result-stats { gap: 20px; }
  .review-body { padding-left: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { max-height: 92vh; }
  .modal-head { padding: 16px 16px 10px; }
  .modal-body { padding: 4px 16px 16px; }
  .modal-foot { padding: 12px 16px; }
  .toolbar { gap: 8px; }
  .toolbar .search-box { width: 100%; }
  .practice-foot .btn { flex: 1; }
  .practice-foot .spacer { display: none; }
  .judge-options { grid-template-columns: 1fr; }
  .toast-root { left: 16px; right: 16px; top: 12px; }
  .toast { max-width: none; width: 100%; }
  .page-head { align-items: flex-start; }
}

@media print {
  .sidebar, .topbar, .page-actions, .btn { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
}
