/* ==========================================================================
   Design Tokens — Light Tech Refresh (Global Foundation)
   ========================================================================== */
:root {
  color-scheme: light;
  /* Brand tokens */
  --ui-brand: var(--brand-color, #18674d);
  --ui-brand-on: var(--brand-on, #ffffff);
  --ui-brand-text: var(--brand-text, var(--brand-color, #18674d));
  --ui-brand-tint: color-mix(in srgb, var(--ui-brand) 5%, #ffffff);
  --ui-brand-soft: color-mix(in srgb, var(--ui-brand) 11%, #ffffff);
  --ui-brand-soft-2: color-mix(in srgb, var(--ui-brand) 17%, #ffffff);
  --ui-brand-border: color-mix(in srgb, var(--ui-brand) 26%, #dce4ea);
  --ui-brand-ring: color-mix(in srgb, var(--ui-brand) 22%, transparent);

  /* Surface & ink */
  --ui-bg: #f3f6f8;
  --ui-surface: #ffffff;
  --ui-surface-2: #f8fafc;
  --ui-surface-glass: rgb(255 255 255 / 86%);
  --ui-ink: #0f172a;
  --ui-ink-2: #334155;
  --ui-muted: #5b6b7c;
  --ui-line: #e2e8f0;
  --ui-line-strong: #cbd5e1;

  /* Semantic status */
  --ui-pos: #059669;
  --ui-pos-soft: #ecfdf5;
  --ui-pos-border: #a7f3d0;
  --ui-neg: #dc2626;
  --ui-neg-soft: #fef2f2;
  --ui-neg-border: #fecaca;
  --ui-warn: #d97706;
  --ui-warn-soft: #fffbeb;
  --ui-info: #2563eb;
  --ui-info-soft: #eff6ff;

  /* Radii */
  --ui-r-sm: 8px;
  --ui-r-md: 12px;
  --ui-r-lg: 16px;
  --ui-r-pill: 999px;

  /* Shadows */
  --ui-shadow-xs: 0 1px 2px rgb(15 23 42 / 4%);
  --ui-shadow-sm: 0 2px 10px rgb(15 23 42 / 5%), 0 1px 2px rgb(15 23 42 / 3%);
  --ui-shadow-md: 0 12px 32px rgb(15 23 42 / 10%), 0 2px 6px rgb(15 23 42 / 4%);
  --ui-shadow-sheet: 0 -10px 32px rgb(15 23 42 / 14%);

  /* Spacing */
  --ui-sp-1: 4px;
  --ui-sp-2: 8px;
  --ui-sp-3: 12px;
  --ui-sp-4: 16px;
  --ui-sp-5: 20px;

  /* Typography */
  --ui-font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC",
    "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --ui-fs-aux: 12px;
  --ui-fs-body: 13px;
  --ui-fs-md: 14px;
  --ui-fs-lg: 16px;

  /* Motion */
  --ui-dur-fast: 140ms;
  --ui-dur-base: 220ms;
  --ui-dur-slow: 250ms;
  --ui-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Force light mode & override legacy dark-mode tokens */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light;
    --bg: var(--ui-bg);
    --paper: var(--ui-surface);
    --ink: var(--ui-ink);
    --muted: var(--ui-muted);
    --line: var(--ui-line);
    --accent: var(--ui-brand);
    --accent-ink: var(--ui-brand-on);
    --accent-soft: var(--ui-brand-soft);
    --rush: #9a3412;
    --rush-bg: #ffedd5;
    --steady: #14532d;
    --steady-bg: #dcfce7;
    --safe: #1e3a8a;
    --safe-bg: #dbeafe;
    --fight: #854d0e;
    --fight-bg: #fef3c7;
    --hard: #3f3f46;
    --hard-bg: #e4e4e7;
    --danger: #dc2626;
    --shadow: var(--ui-shadow-md);
  }
  body.sheet-mode:not(.live-mode),
  body.sheet-mode:not(.live-mode) .top,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page),
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-scroll,
  body.sheet-mode:not(.live-mode) .xl:not(.basket-table) th,
  body.sheet-mode:not(.live-mode) .xl:not(.basket-table) td,
  body.sheet-mode:not(.live-mode) .xl-pop {
    background: var(--ui-surface);
    color: var(--ui-ink);
  }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes ui-fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ui-sheet-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ui-check-pop {
  0% {
    opacity: 0;
    transform: scale(0.45) rotate(-14deg);
  }
  65% {
    opacity: 1;
    transform: scale(1.16) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

/* ==========================================================================
   Page Shell & Top Bar (Scoped to match sheet mode, excluding live & basket)
   ========================================================================== */
body.sheet-mode:not(.live-mode) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  font-family: var(--ui-font);
  color: var(--ui-ink);
  background:
    radial-gradient(900px 280px at 18% -80px, color-mix(in srgb, var(--ui-brand) 9%, transparent), transparent 64%),
    radial-gradient(760px 260px at 88% -60px, color-mix(in srgb, var(--ui-brand) 6%, transparent), transparent 60%),
    var(--ui-bg);
}

body.sheet-mode:not(.live-mode) .top {
  position: relative;
  z-index: 8;
  flex: 0 0 auto;
  padding: 10px 20px;
  background: var(--ui-surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ui-line);
}

body.sheet-mode:not(.live-mode) #main {
  flex: 1;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 20px 16px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ui-surface);
  color: var(--ui-ink);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-r-lg);
  box-shadow: var(--ui-shadow-sm);
}

/* ==========================================================================
   Student Bar & Toolbar
   ========================================================================== */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student {
  flex-shrink: 0;
  padding: 10px 16px;
  gap: 8px 16px;
  background: linear-gradient(180deg, var(--ui-surface) 0%, var(--ui-surface-2) 100%);
  border-bottom: 1px solid var(--ui-line);
  color: var(--ui-ink);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student-info > strong {
  color: var(--ui-brand-text);
  font-size: var(--ui-fs-md);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student-info > span,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-subjects {
  font-size: var(--ui-fs-aux);
  color: var(--ui-ink-2);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-subjects b {
  font-size: var(--ui-fs-aux);
  border-radius: 6px;
  padding: 1px 6px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-add-query {
  min-height: 34px;
  font-size: var(--ui-fs-aux);
  border-radius: var(--ui-r-sm);
  background: var(--ui-brand);
  border-color: var(--ui-brand);
  color: var(--ui-brand-on);
  transition: transform var(--ui-dur-fast) var(--ui-ease), filter var(--ui-dur-fast) ease;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar {
  flex-shrink: 0;
  padding: 10px 16px;
  gap: 8px;
  background: var(--ui-surface);
  border-top: 0;
  border-bottom: 1px solid var(--ui-line);
}

/* Segmented Mode Switch */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mode-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
  border-radius: 10px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ui-muted);
  font: inherit;
  font-size: var(--ui-fs-body);
  font-weight: 600;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ui-dur-fast) var(--ui-ease), color var(--ui-dur-fast) var(--ui-ease), box-shadow var(--ui-dur-fast) var(--ui-ease), transform var(--ui-dur-fast) var(--ui-ease);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mode-btn:hover:not(.on) {
  color: var(--ui-ink);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mode-btn.on {
  background: var(--ui-surface);
  color: var(--ui-brand-text);
  box-shadow: var(--ui-shadow-xs);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mode-btn:active,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-expand:active,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-add-query:active {
  transform: scale(0.97);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-expand {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  background: var(--ui-surface);
  color: var(--ui-ink-2);
  font-size: var(--ui-fs-body);
  font-weight: 550;
  cursor: pointer;
  transition: border-color var(--ui-dur-fast) ease, background var(--ui-dur-fast) ease, color var(--ui-dur-fast) ease, transform var(--ui-dur-fast) var(--ui-ease);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-expand:hover {
  border-color: var(--ui-brand-border);
  background: var(--ui-brand-tint);
  color: var(--ui-brand-text);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-expand[aria-pressed="true"] {
  background: var(--ui-brand-soft);
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .ai-btn {
  background: var(--ui-brand);
  border-color: var(--ui-brand);
  color: var(--ui-brand-on);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .ai-btn:hover {
  background: color-mix(in srgb, var(--ui-brand) 90%, #000);
  color: var(--ui-brand-on);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-search {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  font-size: var(--ui-fs-body);
  color: var(--ui-ink);
  background: var(--ui-surface-2);
  transition: border-color var(--ui-dur-fast) ease, background var(--ui-dur-fast) ease, box-shadow var(--ui-dur-fast) ease;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-search:focus {
  background: var(--ui-surface);
  border-color: var(--ui-brand);
  box-shadow: 0 0 0 3px var(--ui-brand-ring);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-meta {
  font-size: var(--ui-fs-aux);
  color: var(--ui-muted);
  font-variant-numeric: tabular-nums;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-link {
  font-size: var(--ui-fs-aux);
  color: var(--ui-brand-text);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-active-filters {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--ui-surface-2);
  border-top: 0;
  border-bottom: 1px solid var(--ui-line);
  color: var(--ui-ink-2);
  font-size: var(--ui-fs-aux);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-active-filters > span {
  border-color: var(--ui-brand-border);
  background: var(--ui-surface);
  border-radius: var(--ui-r-sm);
}

/* ==========================================================================
   Scroll Container & Desktop Table
   ========================================================================== */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-scroll {
  flex: 1;
  min-height: 0;
  height: auto;
  overflow: auto;
  contain: layout style;
  container-type: normal;
  background-color: var(--ui-surface-2);
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ui-brand) 7%, transparent) 1px, transparent 0);
  background-size: 22px 22px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: var(--ui-fs-body);
  line-height: 1.45;
  color: var(--ui-ink);
  background: var(--ui-surface);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) {
  min-width: 1120px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-full:not(.basket-table) {
  min-width: var(--xl-table-min, 1680px);
}

/* Frosted Glass Sticky Header */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) thead th {
  background: var(--ui-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ui-ink-2);
  border-right: 1px solid var(--ui-line);
  border-bottom: 1px solid var(--ui-line);
  box-shadow: none;
}

/* Group Row — Thin Colored Pill Tags */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th {
  height: 34px;
  padding: 5px 8px;
  background: rgb(248 250 252 / 90%);
  border-bottom: 1px solid var(--ui-line);
  border-right: 1px solid var(--ui-line-strong);
  font-size: var(--ui-fs-aux);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: var(--ui-r-pill);
  font-size: var(--ui-fs-aux);
  font-weight: 650;
  line-height: 1.5;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-text);
  border: 1px solid var(--ui-brand-border);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="学考入围"] .xl-group-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="录取测算"] .xl-group-pill {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="校测安排"] .xl-group-pill {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="参考操作"] .xl-group-pill {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="补充信息"] .xl-group-pill {
  background: #ecfeff;
  color: #0e7490;
  border-color: #a5f3fc;
}

/* Column Header Row */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-column-row th,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-column-row th.hd-orange,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-column-row th.hd-red,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-column-row th:is(.c-innRate, .c-admit) {
  background: rgb(248 250 252 / 90%) !important;
  color: var(--ui-ink-2);
  border-bottom: 1px solid var(--ui-line-strong);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) th.c-mine {
  background: color-mix(in srgb, var(--ui-brand) 8%, #f8fafc) !important;
  color: var(--ui-brand-text);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-head-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  padding: 6px 4px;
  font-size: var(--ui-fs-aux);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .hd-text,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) th.hd-admit .hd-text {
  font-size: var(--ui-fs-aux);
  font-weight: 650;
  color: inherit;
  padding: 0;
  white-space: nowrap;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .hd-sub {
  font-size: var(--ui-fs-aux);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .hd-filter {
  width: 20px;
  height: 22px;
  border-radius: 6px;
  color: var(--ui-muted);
  transition: background var(--ui-dur-fast) ease, color var(--ui-dur-fast) ease;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .hd-filter:hover {
  background: var(--ui-brand-soft);
  color: var(--ui-brand-text);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) th.filtered .hd-filter {
  background: var(--ui-brand-soft);
  color: var(--ui-brand-text);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .sort-btns button {
  width: 20px;
  height: 15px;
  border: 1px solid var(--ui-line);
  border-radius: 4px;
  background: var(--ui-surface);
  color: var(--ui-muted);
  font-size: 9px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .sort-btns button.on {
  background: var(--ui-brand);
  border-color: var(--ui-brand);
  color: var(--ui-brand-on);
}

/* Group dividers in Full view & Compact view */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-full:not(.basket-table) .xl-group-row th:is([data-group="院校招生"], [data-group="学考入围"], [data-group="录取测算"], [data-group="校测安排"]),
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-full:not(.basket-table) .xl-column-row th:is(.c-plan, .c-innRate, .c-totalpoint, .c-date),
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-full:not(.basket-table) tbody td:is(.c-plan, .c-innRate, .c-totalpoint, .c-date) {
  border-right: 1px solid var(--ui-line-strong);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) .xl-column-row th:is(.c-plan, .c-innRate, .c-band, .c-date),
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody td:is(.c-plan, .c-innRate, .c-band, .c-date) {
  border-right: 1px solid var(--ui-line-strong);
}

/* ==========================================================================
   Table Body Rows, Cells & School Grouping
   ========================================================================== */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row],
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td {
  height: auto;
  min-height: 48px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td {
  padding: 9px 8px;
  border-right: 1px solid var(--ui-line);
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink);
  font-size: var(--ui-fs-body);
  transition: background var(--ui-dur-fast) ease;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-mine {
  background: var(--ui-brand-tint);
  color: var(--ui-brand-text);
  font-weight: 700;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-innRate, .c-admit) {
  background: var(--ui-surface);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row]:hover td {
  background: color-mix(in srgb, var(--ui-brand) 4%, #ffffff);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row]:hover td.c-mine {
  background: color-mix(in srgb, var(--ui-brand) 10%, #ffffff);
}

/* School Group Visual Framing */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:first-child {
  border-left: 0;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--ui-brand) 22%, transparent);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.school-start td {
  border-top: 1.5px solid color-mix(in srgb, var(--ui-brand) 24%, var(--ui-line));
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.school-start td:first-child {
  box-shadow: inset 3px 0 0 var(--ui-brand);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.school-end:not(.is-expanded) td,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.xl-detail.school-end td {
  border-bottom: 1.5px solid color-mix(in srgb, var(--ui-brand) 24%, var(--ui-line));
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:last-child {
  border-right: 0;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-cell-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 0;
  overflow: visible;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-cell-value {
  width: 100%;
  max-height: none;
  overflow: visible;
}

/* Single-line School & Major in Compact Desktop */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) td.c-school .xl-cell-content,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) td.c-major .xl-cell-content {
  justify-content: flex-start;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) td.c-school .major-link,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) td.c-major .major-link {
  text-align: left;
  min-width: 0;
  max-width: 100%;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .school-n {
  display: block;
  font-size: var(--ui-fs-body);
  font-weight: 650;
  color: var(--ui-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) td.c-school:hover .school-n {
  color: var(--ui-brand-text);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .school-tag {
  display: inline-block;
  margin-top: 3px;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
  color: var(--ui-muted);
  font-size: var(--ui-fs-aux);
  line-height: 1.35;
  white-space: nowrap;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) td.c-major .major-n {
  display: block;
  font-size: var(--ui-fs-body);
  font-weight: 650;
  color: var(--ui-brand-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) td.c-major .major-leibie {
  display: block;
  margin-top: 2px;
  font-size: var(--ui-fs-aux);
  font-weight: 500;
  color: var(--ui-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tabular Numbers & Semantic Colors */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .num,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .cell-green,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .cell-gap-neg,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .c-plan {
  font-variant-numeric: tabular-nums;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .cell-green,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .cell-yes {
  color: var(--ui-pos);
  font-weight: 700;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .cell-gap-neg {
  color: var(--ui-neg);
  font-weight: 700;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .c-plan,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .c-kind,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .c-city,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .shortlist-tag {
  font-size: var(--ui-fs-aux);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .c-formula {
  font-size: var(--ui-fs-aux);
  line-height: 1.4;
}

/* Action Column Buttons (Desktop) */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-act-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .pick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--ui-brand-border);
  border-radius: var(--ui-r-sm);
  background: var(--ui-surface);
  color: var(--ui-brand-text);
  font-size: var(--ui-fs-aux);
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ui-dur-fast) ease, border-color var(--ui-dur-fast) ease, color var(--ui-dur-fast) ease, transform var(--ui-dur-fast) var(--ui-ease);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .pick-btn:hover {
  background: var(--ui-brand-tint);
  border-color: var(--ui-brand);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .pick-btn:active,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-btn:active {
  transform: scale(0.95);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .pick-btn.pick-btn.pick-btn.on,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .pick-btn.pick-btn.pick-btn.on:hover {
  background: var(--ui-brand);
  border-color: var(--ui-brand);
  color: var(--ui-brand-on);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-mode-btn.xl-mode-btn.xl-mode-btn.on,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mode-switch .xl-mode-btn.xl-mode-btn.xl-mode-btn.on {
  background: var(--ui-brand-soft);
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
  font-weight: 600;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .pick-btn.on::before {
  content: "✓";
  display: inline-block;
  font-weight: 800;
  line-height: 1;
  animation: ui-check-pop var(--ui-dur-base) var(--ui-ease) both;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-r-sm);
  background: var(--ui-surface-2);
  color: var(--ui-ink-2);
  font: inherit;
  font-size: var(--ui-fs-aux);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ui-dur-fast) ease, border-color var(--ui-dur-fast) ease, color var(--ui-dur-fast) ease, transform var(--ui-dur-fast) var(--ui-ease);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-btn:hover {
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
  background: var(--ui-brand-tint);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-btn.on {
  background: var(--ui-brand-soft);
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-m {
  display: none;
}

/* ==========================================================================
   Expandable Detail Row (Desktop & Mobile)
   ========================================================================== */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tr.xl-detail td.xl-detail-cell {
  padding: 0;
  background: var(--ui-surface-2);
  border-bottom: 1px solid var(--ui-line-strong);
  border-right: 0;
  text-align: left;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tr.xl-detail td.xl-detail-cell:first-child {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--ui-brand) 40%, transparent);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-box {
  padding: 12px 16px 14px;
  animation: ui-fade-up var(--ui-dur-base) var(--ui-ease) both;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 14px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 7px 10px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-r-sm);
  text-align: left;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-item.is-wide {
  grid-column: span 2;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-mobile-only {
  display: none;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-label {
  font-size: var(--ui-fs-aux);
  font-weight: 600;
  color: var(--ui-muted);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-val {
  font-size: var(--ui-fs-body);
  color: var(--ui-ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-empty {
  color: var(--ui-muted);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-explain {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: var(--ui-r-sm);
  background: var(--ui-brand-tint);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-ink-2);
  font-size: var(--ui-fs-aux);
  line-height: 1.5;
  text-align: left;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tfoot td {
  background: var(--ui-surface-2);
  padding: 14px;
  border-right: 0;
}

/* ==========================================================================
   Filter Popup (.xl-pop)
   ========================================================================== */
body.sheet-mode:not(.live-mode) .xl-pop {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-r-md);
  box-shadow: var(--ui-shadow-md);
  color: var(--ui-ink);
}

body.sheet-mode:not(.live-mode) .xl-pop-title {
  padding: 10px 12px 6px;
  font-size: var(--ui-fs-body);
  color: var(--ui-ink);
}

body.sheet-mode:not(.live-mode) .xl-pop-q {
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-r-sm);
  font-size: var(--ui-fs-body);
}

body.sheet-mode:not(.live-mode) .xl-pop-q:focus {
  outline: none;
  border-color: var(--ui-brand);
  box-shadow: 0 0 0 3px var(--ui-brand-ring);
}

body.sheet-mode:not(.live-mode) .xl-check {
  font-size: var(--ui-fs-body);
}

body.sheet-mode:not(.live-mode) .xl-check input {
  accent-color: var(--ui-brand);
}

body.sheet-mode:not(.live-mode) .xl-pop-actions button {
  min-height: 34px;
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-r-sm);
  font-size: var(--ui-fs-aux);
  color: var(--ui-ink-2);
}

/* ==========================================================================
   Mobile Tools Wrapper (Hidden on Desktop)
   ========================================================================== */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-tools {
  display: none;
}

/* ==========================================================================
   Mobile Card View & Bottom Sheet (<= 720px)
   ========================================================================== */
@media (max-width: 720px) {
  body.sheet-mode:not(.live-mode) {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow-x: clip;
    overflow-y: visible;
  }

  body.sheet-mode:not(.live-mode):has(#xl-mobile-tools.is-open) {
    overflow: hidden;
  }

  body.sheet-mode:not(.live-mode) .top {
    position: static;
    padding: 10px 12px;
  }

  body.sheet-mode:not(.live-mode) #main {
    display: block;
    flex: none;
    height: auto;
    overflow: visible;
    padding: 8px 10px 24px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) {
    display: block;
    height: auto;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-r-md);
    margin-bottom: 8px;
    padding: 10px 12px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-r-md);
    margin-bottom: 8px;
    padding: 10px;
    gap: 8px;
  }

  /* Mobile always uses compact cards: hide mode switch & hidden-cols button */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mode-switch,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar [data-act="hidden"] {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-search {
    order: -1;
    flex: 1 0 100%;
    min-height: 42px;
    font-size: 16px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-expand {
    min-height: 38px;
    font-size: var(--ui-fs-body);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-meta {
    flex: 1 0 100%;
    font-size: var(--ui-fs-aux);
    white-space: normal;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-active-filters {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-r-md);
    margin-bottom: 8px;
    padding: 8px 10px;
  }

  /* Sticky Mobile Filter/Sort Trigger Bar */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-tools {
    display: block;
    position: sticky;
    top: 0;
    z-index: 9;
    margin-bottom: 10px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--ui-r-md);
    background: var(--ui-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--ui-line);
    box-shadow: var(--ui-shadow-xs);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-sheet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--ui-brand-border);
    border-radius: var(--ui-r-pill);
    background: var(--ui-brand-soft);
    color: var(--ui-brand-text);
    font: inherit;
    font-size: var(--ui-fs-body);
    font-weight: 650;
    cursor: pointer;
    transition: transform var(--ui-dur-fast) var(--ui-ease), background var(--ui-dur-fast) ease;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-sheet-btn:active {
    transform: scale(0.97);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-sheet-btn svg {
    width: 16px;
    height: 16px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-bar-meta {
    font-size: var(--ui-fs-aux);
    color: var(--ui-muted);
    font-variant-numeric: tabular-nums;
  }

  /* Bottom Sheet Panel */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-backdrop,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-panel {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-tools.is-open .xl-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgb(15 23 42 / 42%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-tools.is-open .xl-sheet-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 16;
    max-height: 78dvh;
    background: var(--ui-surface);
    border-radius: 20px 20px 0 0;
    box-shadow: var(--ui-shadow-sheet);
    padding-bottom: env(safe-area-inset-bottom);
    animation: ui-sheet-up var(--ui-dur-base) var(--ui-ease) both;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--ui-line);
    flex-shrink: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-head strong {
    font-size: var(--ui-fs-lg);
    color: var(--ui-ink);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-close {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--ui-brand);
    border-radius: var(--ui-r-pill);
    background: var(--ui-brand);
    color: var(--ui-brand-on);
    font: inherit;
    font-size: var(--ui-fs-body);
    font-weight: 600;
    cursor: pointer;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px 18px;
    overscroll-behavior: contain;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-body .xl-field-tools {
    display: block;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-body .xl-field-tools > summary {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-body .xl-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-body .xl-field-tool {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    padding: 4px 6px;
    background: var(--ui-surface-2);
    border: 1px solid var(--ui-line);
    border-radius: 10px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-body .xl-field-tool button {
    min-width: 0;
    flex: 1 1 auto;
    min-height: 40px;
    padding: 0 6px;
    border: 0;
    background: transparent;
    color: var(--ui-ink);
    font-size: var(--ui-fs-body);
    text-align: left;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-body .xl-field-tool .hd-filter {
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    min-height: 40px;
    padding: 0 10px;
    writing-mode: horizontal-tb;
    border-radius: var(--ui-r-pill);
    border: 1px solid var(--ui-brand-border);
    background: var(--ui-brand-soft);
    color: var(--ui-brand-text);
    font-size: var(--ui-fs-aux);
    font-weight: 600;
    white-space: nowrap;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-body .xl-field-tool .hd-filter::after {
    display: none;
    content: none;
  }

  /* Mobile .xl-pop as Full-width Bottom Sheet */
  body.sheet-mode:not(.live-mode) .xl-pop {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 82dvh;
    border: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: var(--ui-shadow-sheet);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 25;
    animation: ui-sheet-up var(--ui-dur-base) var(--ui-ease) both;
  }

  body.sheet-mode:not(.live-mode) .xl-pop-q {
    min-height: 42px;
    font-size: 16px;
  }

  body.sheet-mode:not(.live-mode) .xl-pop-list {
    max-height: 45dvh;
  }

  body.sheet-mode:not(.live-mode) .xl-check {
    min-height: 42px;
    padding: 8px 14px;
    font-size: var(--ui-fs-md);
  }

  body.sheet-mode:not(.live-mode) .xl-pop-actions {
    padding: 10px 12px;
  }

  body.sheet-mode:not(.live-mode) .xl-pop-actions button {
    min-height: 40px;
    flex: 1 1 auto;
    font-size: var(--ui-fs-body);
  }

  /* ========================================================================
     Card Transformation of <table class="xl">
     ======================================================================== */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-scroll {
    flex: none;
    width: 100%;
    height: auto;
    overflow: visible;
    background: transparent;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table),
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) {
    display: block;
    width: 100%;
    min-width: 0;
    background: transparent;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) colgroup,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) thead {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px 6px;
    width: 100%;
    padding: 14px;
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-r-lg);
    box-shadow: var(--ui-shadow-sm);
    box-sizing: border-box;
    animation: ui-fade-up var(--ui-dur-slow) var(--ui-ease) both;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row].is-expanded {
    border-radius: var(--ui-r-lg) var(--ui-r-lg) 0 0;
    border-bottom-color: var(--ui-line);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td {
    display: block;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    text-align: left;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.is-empty:not(.c-mine):not(.c-innGap):not(.c-min),
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-needZt {
    display: none;
  }

  /* Card Row 1: School + Tags */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-school {
    order: 1;
    flex: 0 0 100%;
    min-width: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-school .major-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 6px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .school-n {
    font-size: var(--ui-fs-lg);
    font-weight: 700;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .school-tag {
    margin: 0;
  }

  /* Card Row 2: Major + Category */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-major {
    order: 2;
    flex: 0 0 100%;
    min-width: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-major .major-link {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-major .major-n {
    font-size: var(--ui-fs-md);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-major .major-leibie {
    margin: 0;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--ui-brand-tint);
    color: var(--ui-brand-text);
    white-space: normal;
    overflow: visible;
  }

  /* Card Middle: 3 Key Metric Blocks (折算分 / 入围分差 / 录取分) */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-mine, .c-innGap, .c-min) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 calc((100% - 12px) / 3);
    width: calc((100% - 12px) / 3);
    box-sizing: border-box;
    min-width: 0;
    padding: 8px 4px;
    border-radius: 10px;
    border: 1px solid var(--ui-line);
    background: var(--ui-surface-2);
    text-align: center;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-mine {
    order: 3;
    background: var(--ui-brand-tint);
    border-color: var(--ui-brand-border);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innGap {
    order: 4;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innGap.cell-green {
    background: var(--ui-pos-soft);
    border-color: var(--ui-pos-border);
    color: var(--ui-pos);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innGap.cell-gap-neg {
    background: var(--ui-neg-soft);
    border-color: var(--ui-neg-border);
    color: var(--ui-neg);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-min {
    order: 5;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-mine, .c-innGap, .c-min)::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 550;
    color: var(--ui-muted);
    line-height: 1.2;
    white-space: nowrap;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-mine, .c-innGap, .c-min) .xl-cell-content {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-mine, .c-innGap, .c-min) .xl-cell-value {
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-min .xl-cell-value {
    letter-spacing: -0.02em;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-min .score-year-line {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-min .score-year-line:not(:first-child) {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-mine, .c-innGap, .c-min) .xl-cell-value:empty::before {
    content: "—";
    display: inline-block;
    color: var(--ui-muted);
    font-weight: 500;
  }

  /* Card Pills Row: 是否入围、级别、入围率、需得分率、测试形式、校测时间、招生计划 */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-inn, .c-band, .c-innRate, .c-admit, .c-test, .c-date, .c-plan) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 1 auto;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: var(--ui-r-sm);
    background: var(--ui-surface-2);
    border: 1px solid var(--ui-line);
    font-size: var(--ui-fs-aux);
    line-height: 1.35;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-inn { order: 6; }
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-band { order: 7; }
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innRate { order: 8; }
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-admit { order: 9; }
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-test { order: 10; }
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-date { order: 11; }
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-plan { order: 12; }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-inn, .c-band, .c-innRate, .c-admit, .c-test, .c-date, .c-plan)::before {
    content: attr(data-label);
    color: var(--ui-muted);
    font-size: var(--ui-fs-aux);
    flex-shrink: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-inn, .c-band, .c-innRate, .c-admit, .c-test, .c-date, .c-plan) .xl-cell-content,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-inn, .c-band, .c-innRate, .c-admit, .c-test, .c-date, .c-plan) .xl-cell-value {
    width: auto;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-plan br {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) {
    font-size: 0;
    line-height: 0;
    gap: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) > .plan-current,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) > .plan-up,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) > .plan-down,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) > span:last-child {
    display: inline-flex;
    align-items: center;
    font-size: var(--ui-fs-aux);
    line-height: 1.35;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) > .plan-current ~ :is(.plan-up, .plan-down, span:last-child)::before {
    content: "·";
    margin: 0 4px;
    color: var(--ui-muted);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innRate .major-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    width: auto;
    color: var(--ui-brand-text);
    font-weight: 600;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innRate .shortlist-tag {
    display: inline;
  }

  /* Card Bottom Actions: 展开详情 & 添加 / 已添加 (>= 40px) */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-act {
    order: 20;
    flex: 0 0 100%;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--ui-line);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .xl-act-wrap {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .xl-more-btn {
    order: -1;
    flex: 1 1 0;
    min-height: 42px;
    border-radius: 10px;
    font-size: var(--ui-fs-body);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .pick-btn {
    order: 1;
    flex: 1 1 0;
    min-height: 42px;
    border-radius: 10px;
    font-size: var(--ui-fs-body);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-d {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-m {
    display: inline;
  }

  /* Mobile Detail Row Attached Below Card */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.xl-detail {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: -8px;
    padding: 0;
    background: var(--ui-surface-2);
    border: 1px solid var(--ui-line);
    border-top: 0;
    border-radius: 0 0 var(--ui-r-lg) var(--ui-r-lg);
    box-shadow: var(--ui-shadow-sm);
    overflow: hidden;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.xl-detail td.xl-detail-cell,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.xl-detail.school-end td.xl-detail-cell {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-box {
    margin: 0;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-label {
    display: block;
    width: 100%;
    font-size: 12px;
    line-height: 1.35;
    color: var(--ui-muted);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-val {
    display: block;
    width: 100%;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ui-ink);
    word-break: break-word;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-item.is-wide {
    grid-column: 1 / -1;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-mobile-only {
    display: flex;
  }

  /* Mobile Empty State & Lazy Load More Footer */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr:has(> td.xl-empty),
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tfoot,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tfoot tr,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tfoot td {
    display: block;
    width: 100%;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tfoot {
    margin-top: 12px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tfoot td {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tfoot .xl-expand {
    width: 100%;
    min-height: 44px;
  }
}

/* ==========================================================================
   Desktop Compact View Row Density Optimization
   ========================================================================== */
@media (min-width: 721px) {
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row],
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td {
    min-height: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td {
    padding: 8px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) {
    font-size: 0;
    line-height: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) br {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) > .plan-current,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) > .plan-up,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) > .plan-down,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td.c-plan .xl-cell-value:has(.plan-current) > span:last-child {
    display: block;
    font-size: var(--ui-fs-aux);
    line-height: 1.35;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td.c-min .xl-cell-value {
    line-height: 1.35;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td.c-min .xl-cell-value br {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td.c-min .score-year-line {
    display: block;
    line-height: 1.35;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) tbody tr[data-match-row] td.c-min .score-year-line:nth-child(n+3) {
    display: none;
  }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) *,
  body.sheet-mode:not(.live-mode) .xl-pop {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}


/* ===== Round 3: Auth + Shell ===== */
:root {
  --ui-brand-deep: color-mix(in srgb, var(--ui-brand) 88%, #000000);
  --ui-brand-light: color-mix(in srgb, var(--ui-brand) 80%, #ffffff);
  --ui-brand-glow: color-mix(in srgb, var(--ui-brand) 36%, transparent);
  --ui-btn-grad: linear-gradient(
    95deg,
    var(--ui-brand-deep) 0%,
    var(--ui-brand) 54%,
    var(--ui-brand-light) 100%
  );
  --ui-glass-border: rgb(255 255 255 / 86%);
}

@keyframes uiAuthDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(2%, -1.5%, 0) scale(1.03);
  }
  100% {
    transform: translate3d(-1.5%, 2%, 0) scale(1.01);
  }
}

@keyframes uiCardRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes uiDialogIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   1. Auth Page (#auth)
   -------------------------------------------------------------------------- */
body.auth-on section#auth.auth {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 28px 24px;
  font-family: var(--ui-font);
  color: var(--ui-ink);
  background:
    radial-gradient(circle 2.5px at 14% 20%, rgb(255 255 255 / 80%), transparent 100%),
    radial-gradient(circle 3px at 29% 13%, rgb(255 255 255 / 72%), transparent 100%),
    radial-gradient(circle 2px at 78% 17%, rgb(255 255 255 / 68%), transparent 100%),
    radial-gradient(circle 2.5px at 87% 80%, rgb(255 255 255 / 62%), transparent 100%),
    radial-gradient(circle 2px at 20% 85%, rgb(255 255 255 / 68%), transparent 100%),
    radial-gradient(62% 55% at 10% 6%, color-mix(in srgb, var(--ui-brand) 16%, #e7f5f0), transparent 72%),
    radial-gradient(56% 50% at 92% 90%, color-mix(in srgb, var(--ui-brand) 13%, #e8f5f1), transparent 74%),
    linear-gradient(
      142deg,
      color-mix(in srgb, var(--ui-brand) 9%, #edf7f4) 0%,
      #f5faf9 48%,
      color-mix(in srgb, var(--ui-brand) 7%, #edf6f3) 100%
    );
}

/* Top-left dot matrix */
section#auth.auth::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(
    circle,
    color-mix(in srgb, var(--ui-brand) 26%, #94a3b8) 1.25px,
    transparent 1.4px
  );
  background-size: 18px 18px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse 46% 42% at 6% 8%, #000 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 46% 42% at 6% 8%, #000 0%, transparent 100%);
}

/* Curved luminous ribbons + soft drifting glow orbs */
section#auth.auth::after {
  content: "";
  position: fixed;
  inset: -6%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(125% 60% at 16% -12%, transparent 62%, rgb(255 255 255 / 58%) 63.4%, transparent 65.2%),
    radial-gradient(115% 52% at 84% 112%, transparent 63%, rgb(255 255 255 / 48%) 64.4%, transparent 66.2%),
    radial-gradient(42% 38% at 18% 20%, color-mix(in srgb, var(--ui-brand) 14%, transparent), transparent 72%),
    radial-gradient(38% 34% at 84% 82%, color-mix(in srgb, var(--ui-brand) 12%, transparent), transparent 72%);
  animation: uiAuthDrift 24s ease-in-out infinite alternate;
}

#auth .auth-card {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: 1.26fr 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  background: rgb(255 255 255 / 78%);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--ui-glass-border);
  box-shadow:
    0 24px 64px rgb(15 23 42 / 9%),
    0 4px 16px color-mix(in srgb, var(--ui-brand) 8%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 92%);
  animation: uiCardRise 380ms var(--ui-ease) both;
}

#auth .auth-discover {
  min-width: 0;
  padding: 36px 38px 34px;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--ui-brand) 4%, rgb(247 251 249 / 76%)) 0%,
    rgb(248 251 252 / 64%) 100%
  );
  border-right: 1px solid color-mix(in srgb, var(--ui-brand) 10%, var(--ui-line));
}

#auth .auth-brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 13px;
  row-gap: 3px;
  align-items: center;
  justify-items: start;
  text-align: left;
}

#auth .auth-brand .mark {
  grid-row: 1 / 3;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--ui-brand-on);
  background: linear-gradient(
    145deg,
    var(--ui-brand-light) 0%,
    var(--ui-brand) 52%,
    var(--ui-brand-deep) 100%
  );
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 38%),
    0 6px 16px -4px var(--ui-brand-glow);
}

#auth .auth-brand h1 {
  margin: 0;
  align-self: end;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ui-ink);
}

#auth .auth-brand p {
  margin: 0;
  align-self: start;
  font-size: 12px;
  color: var(--ui-muted);
}

/* System Cards */
#auth .auth-systems {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0 22px;
}

#auth .auth-systems .system-card {
  position: relative;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 15px 34px 15px 16px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--ui-brand) 22%, #dce4ea);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--ui-brand) 6%, #ffffff) 0%,
    rgb(255 255 255 / 92%) 100%
  );
  box-shadow:
    0 4px 14px color-mix(in srgb, var(--ui-brand) 7%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 92%);
  cursor: pointer;
  transition:
    transform var(--ui-dur-fast) var(--ui-ease),
    border-color var(--ui-dur-fast) var(--ui-ease),
    background var(--ui-dur-fast) var(--ui-ease),
    box-shadow var(--ui-dur-fast) var(--ui-ease);
}

#auth .auth-systems .system-card::after {
  content: "›";
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
  color: #8a97a3;
  transition:
    transform var(--ui-dur-fast) var(--ui-ease),
    color var(--ui-dur-fast) var(--ui-ease);
}

#auth .auth-systems .system-card .auth-ico {
  width: 34px;
  height: 34px;
  padding: 7px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-text);
  transition: background-color var(--ui-dur-fast) var(--ui-ease);
}

#auth .auth-systems .system-card .system-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ui-ink);
}

#auth .auth-systems .system-card .system-description {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ui-muted);
}

#auth .auth-systems .system-card:hover {
  transform: translateY(-2px);
  border-color: var(--ui-brand);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--ui-brand) 14%, transparent);
}

#auth .auth-systems .system-card:hover .auth-ico {
  background: var(--ui-brand-soft-2);
}

#auth .auth-systems .system-card:hover::after {
  color: var(--ui-brand-text);
  transform: translate(2px, -50%);
}

#auth .auth-systems .system-card[aria-pressed="true"] {
  background: linear-gradient(145deg, var(--ui-brand-soft) 0%, var(--ui-brand-tint) 100%);
  border-color: var(--ui-brand);
  box-shadow:
    0 0 0 2px var(--ui-brand-ring),
    0 8px 20px color-mix(in srgb, var(--ui-brand) 16%, transparent);
}

#auth .auth-systems .system-card[aria-pressed="true"]::before {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--ui-brand);
  color: var(--ui-brand-on);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

#auth .auth-systems .system-card[aria-pressed="true"]::after {
  top: 58%;
  color: var(--ui-brand-text);
}

/* Section Label with left brand accent bar */
#auth .auth-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ui-ink);
}

#auth .auth-section-label::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 999px;
  background: var(--ui-brand);
}

/* 9 App Entrances */
#auth .auth-apps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#auth .auth-apps button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 82px;
  padding: 12px 6px 10px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ui-line) 85%, #ffffff);
  background: rgb(255 255 255 / 90%);
  box-shadow:
    0 2px 8px rgb(15 23 42 / 4%),
    inset 0 1px 0 #ffffff;
  color: var(--ui-ink);
  cursor: pointer;
  animation: uiCardRise 340ms var(--ui-ease) both;
  transition:
    transform var(--ui-dur-fast) var(--ui-ease),
    border-color var(--ui-dur-fast) var(--ui-ease),
    background-color var(--ui-dur-fast) var(--ui-ease),
    box-shadow var(--ui-dur-fast) var(--ui-ease);
}

#auth .auth-apps button:nth-child(1) { animation-delay: 0ms; }
#auth .auth-apps button:nth-child(2) { animation-delay: 30ms; }
#auth .auth-apps button:nth-child(3) { animation-delay: 60ms; }
#auth .auth-apps button:nth-child(4) { animation-delay: 90ms; }
#auth .auth-apps button:nth-child(5) { animation-delay: 120ms; }
#auth .auth-apps button:nth-child(6) { animation-delay: 150ms; }
#auth .auth-apps button:nth-child(7) { animation-delay: 180ms; }
#auth .auth-apps button:nth-child(8) { animation-delay: 210ms; }
#auth .auth-apps button:nth-child(9) { animation-delay: 240ms; }

#auth .auth-apps button:hover {
  transform: translateY(-2px);
  border-color: var(--ui-brand-border);
  background: #ffffff;
  box-shadow: 0 8px 18px rgb(15 23 42 / 7%);
}

#auth .auth-apps button:active {
  transform: scale(0.98);
}

#auth .auth-apps .auth-ico {
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

#auth .auth-apps b {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: var(--ui-ink);
}

#auth .auth-ico.ico-h5 {
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #e2f7ef;
  color: #0f8a5f;
}
#auth .auth-ico.ico-tqz  { background: #e6f6ec; color: #15803d; }
#auth .auth-ico.ico-zsb  { background: #e6f0ff; color: #2563eb; }
#auth .auth-ico.ico-jobs { background: #fde8ec; color: #db2777; }
#auth .auth-ico.ico-live { background: #e4f6ea; color: #16a34a; }
#auth .auth-ico.ico-iv   { background: #f1ebfe; color: #7c3aed; }
#auth .auth-ico.ico-bank { background: #e7f1ff; color: #2563eb; }
#auth .auth-ico.ico-ace  { background: #fef3dc; color: #d97706; }
#auth .auth-ico.ico-hist { background: #e8f1fe; color: #2563eb; }

/* Right Column: Login & Recovery */
#auth .auth-access {
  min-width: 0;
  padding: 40px 38px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgb(255 255 255 / 86%);
  border-left: 0;
}

#auth .auth-welcome {
  margin-bottom: 22px;
}

#auth .auth-welcome .section-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-brand-text);
}

#auth .auth-welcome h2 {
  margin: 6px 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ui-ink);
}

#auth .auth-welcome p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ui-muted);
}

/* Segmented Tabs (Desktop: white floating slider) */
#auth .auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border-radius: 11px;
  background: #f1f5f4;
  border: 1px solid color-mix(in srgb, var(--ui-line) 75%, transparent);
}

#auth .auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--ui-dur-fast) var(--ui-ease),
    color var(--ui-dur-fast) var(--ui-ease),
    box-shadow var(--ui-dur-fast) var(--ui-ease);
}

#auth .auth-tabs button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--ui-brand-text);
  font-weight: 700;
  box-shadow: 0 2px 8px rgb(15 23 42 / 8%);
}

/* Form & Inputs */
#auth .auth-form {
  gap: 15px;
}

#auth .auth-form label {
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-ink);
}

#auth .auth-form input:not([type="checkbox"]) {
  min-height: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #dce4ea;
  background-color: var(--ui-surface-2);
  color: var(--ui-ink);
  font-size: 14px;
  transition:
    border-color var(--ui-dur-fast) var(--ui-ease),
    box-shadow var(--ui-dur-fast) var(--ui-ease),
    background-color var(--ui-dur-fast) var(--ui-ease);
}

#auth .auth-form input:not([type="checkbox"])::placeholder {
  color: #8a97a3;
}

#auth .auth-form input:not([type="checkbox"]):focus {
  outline: none;
  border-color: var(--ui-brand);
  box-shadow: 0 0 0 3px var(--ui-brand-ring);
  background-color: #ffffff;
}

/* Inline SVG data URI icons (#8a97a3 neutral gray) */
#auth #login-phone,
#auth #reset-phone {
  padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a97a3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M5 20c1.4-3.5 3.8-5.2 7-5.2s5.6 1.7 7 5.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 17px 17px;
}

#auth .auth-form input[type="password"] {
  padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a97a3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3Ccircle cx='12' cy='15.5' r='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 17px 17px;
}

#auth .auth-form .btn.btn-primary {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ui-brand-on);
  border: 1px solid var(--ui-brand-deep);
  background: var(--ui-btn-grad);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 26%),
    0 8px 20px -4px color-mix(in srgb, var(--ui-brand) 42%, transparent);
}

#auth .auth-form .btn.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 32%),
    0 10px 24px -4px color-mix(in srgb, var(--ui-brand) 50%, transparent);
}

#auth .auth-form .btn.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

#auth .auth-switch {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ui-muted);
  text-align: center;
}

#auth .auth-switch button {
  min-height: 32px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-brand-text);
  cursor: pointer;
}

#auth .auth-hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ui-muted);
}

#auth .auth-err:not([hidden]) {
  margin: 10px 0 0;
  padding: 8px 14px;
  border-radius: var(--ui-r-pill);
  background: var(--ui-neg-soft);
  border: 1px solid var(--ui-neg-border);
  color: var(--ui-neg);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

#auth .auth-invite:not([hidden]),
#auth .auth-recovery-status:not([hidden]) {
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-brand-text);
  border-radius: 10px;
}

#auth .auth-recovery-contact,
#auth .privacy-link {
  color: var(--ui-brand-text);
}

#auth .auth-footnote {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--ui-line);
  font-size: 12px;
  color: var(--ui-muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   2. Mobile Auth Layout (<= 720px)
   Order: Brand -> Login Card -> Two System Cards -> Other Features
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  body.auth-on section#auth.auth {
    align-items: start;
    padding: calc(16px + env(safe-area-inset-top)) 14px calc(92px + env(safe-area-inset-bottom));
  }

  #auth .auth-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 480px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
  }

  #auth .auth-discover {
    display: contents;
  }

  #auth .auth-brand {
    order: 1;
    padding: 2px 2px 4px;
    column-gap: 12px;
  }

  #auth .auth-brand .mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 19px;
  }

  #auth .auth-brand h1 {
    font-size: 18px;
  }

  #auth .auth-access {
    order: 2;
    padding: 22px 18px 18px;
    border-radius: 20px;
    background: rgb(255 255 255 / 92%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ui-glass-border);
    box-shadow:
      0 14px 36px rgb(15 23 42 / 8%),
      inset 0 1px 0 rgb(255 255 255 / 95%);
  }

  body.auth-on #auth .auth-access {
    padding-bottom: 18px;
  }

  #auth .auth-welcome {
    margin-bottom: 14px;
  }

  #auth .auth-welcome .section-eyebrow {
    display: none;
  }

  #auth .auth-welcome h2 {
    margin: 0 0 4px;
    font-size: 20px;
  }

  #auth .auth-welcome p {
    font-size: 12px;
    line-height: 1.5;
  }

  /* Mobile Segmented Tabs: solid brand fill + white text */
  #auth .auth-tabs {
    margin-bottom: 14px;
    padding: 3px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--ui-brand) 6%, #f1f5f9);
  }

  #auth .auth-tabs button {
    min-height: 38px;
  }

  #auth .auth-tabs button[aria-pressed="true"] {
    background: var(--ui-brand);
    color: var(--ui-brand-on);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--ui-brand) 30%, transparent);
  }

  #auth .auth-form {
    gap: 12px;
  }

  /* 16px prevents iOS Safari auto-zoom on focus */
  #auth .auth-form input:not([type="checkbox"]) {
    font-size: 16px;
  }

  #auth .auth-footnote {
    margin-top: 14px;
    padding-top: 12px;
  }

  /* Mobile System Cards: side-by-side horizontal layout, description hidden */
  #auth .auth-systems {
    order: 3;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 2px 0 0;
  }

  #auth .auth-systems .system-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 64px;
    padding: 12px 30px 12px 10px;
    border-radius: 14px;
  }

  #auth .auth-systems .system-card .auth-ico {
    width: 34px;
    height: 34px;
    margin-bottom: 0;
    padding: 7px;
  }

  #auth .auth-systems .system-card .system-name {
    font-size: 13px;
    line-height: 1.3;
  }

  #auth .auth-systems .system-card .system-description {
    display: none;
  }

  #auth .auth-systems .system-card::after {
    right: 9px;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--ui-brand-soft);
    color: var(--ui-brand-text);
    font-size: 13px;
  }

  #auth .auth-systems .system-card[aria-pressed="true"]::before {
    top: 50%;
    right: 9px;
    transform: translateY(-50%);
  }

  #auth .auth-systems .system-card[aria-pressed="true"]::after {
    opacity: 0;
  }

  #auth .auth-section-label {
    order: 4;
    margin: 4px 2px -4px;
  }

  #auth .auth-apps {
    order: 5;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  #auth .auth-apps button {
    min-height: 74px;
    padding: 10px 4px 8px;
    gap: 6px;
  }

  #auth .auth-apps .auth-ico {
    width: 32px;
    height: 32px;
    padding: 6px;
  }

  #auth .auth-apps b {
    font-size: 12px;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 375px) {
  body.auth-on section#auth.auth {
    padding-left: 10px;
    padding-right: 10px;
  }

  #auth .auth-systems {
    gap: 8px;
  }

  #auth .auth-systems .system-card {
    padding: 10px 26px 10px 8px;
    gap: 6px;
  }

  #auth .auth-apps {
    gap: 6px;
  }
}

/* --------------------------------------------------------------------------
   3. Workspace Shell: Top Bar, Tabbar, User Slot (non-live, non-popup)
   -------------------------------------------------------------------------- */
body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 24px;
  background: rgb(255 255 255 / 84%);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid color-mix(in srgb, var(--ui-brand) 12%, var(--ui-line));
  box-shadow: 0 2px 12px rgb(15 23 42 / 4%);
  color: var(--ui-ink);
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top .top-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 44px;
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top .brand .mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--ui-brand-on);
  background: linear-gradient(
    145deg,
    var(--ui-brand-light) 0%,
    var(--ui-brand) 52%,
    var(--ui-brand-deep) 100%
  );
  box-shadow:
    inset 0 1px 1px rgb(255 255 255 / 35%),
    0 4px 12px -3px var(--ui-brand-glow);
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ui-ink);
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top .brand :is(.sub, p, small) {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.25;
  color: var(--ui-muted);
}

/* Tabbar */
body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top nav.tabbar:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 2px 6px;
  overflow-x: auto;
  background: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top nav.tabbar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top nav.tabbar button {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 13px;
  border: 0;
  border-radius: var(--ui-r-pill);
  background: transparent;
  color: var(--ui-ink-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--ui-dur-fast) var(--ui-ease),
    color var(--ui-dur-fast) var(--ui-ease);
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top nav.tabbar button:hover:not([aria-current="page"]) {
  background: rgb(15 23 42 / 5%);
  color: var(--ui-ink);
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top nav.tabbar button[aria-current="page"] {
  background: var(--ui-brand-soft);
  color: var(--ui-brand-text);
  font-weight: 700;
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top nav.tabbar button[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--ui-brand);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ui-brand) 65%, transparent);
}

/* Numeric badge inside tab (e.g. 我的志愿 18) */
body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top nav.tabbar button :is(
  .badge,
  .tab-badge,
  .tab-count,
  .count,
  .nav-badge,
  .tab-num,
  .pill,
  [data-badge],
  [data-count],
  small,
  sup
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--ui-r-pill);
  background: var(--ui-brand);
  color: var(--ui-brand-on);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* User Slot */
body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) #user-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) #user-slot :is(button, .btn, a.btn, .user-out) {
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--ui-r-sm);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink-2);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition:
    border-color var(--ui-dur-fast) var(--ui-ease),
    background-color var(--ui-dur-fast) var(--ui-ease),
    color var(--ui-dur-fast) var(--ui-ease);
}

body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) #user-slot :is(button, .btn, a.btn, .user-out):hover {
  border-color: var(--ui-brand-border);
  background: var(--ui-brand-tint);
  color: var(--ui-brand-text);
}

@media (max-width: 900px) {
  body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top {
    padding: 8px 14px;
  }

  body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top .top-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top .brand h1 {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top nav.tabbar:not(:empty) {
    grid-area: 2 / 1 / 3 / -1;
    justify-content: flex-start;
    margin: 0 -8px;
    padding: 4px 14px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  }
}

/* --------------------------------------------------------------------------
   4. Global Buttons, Inputs, Dialogs, Toast, Technical Support Trigger
   -------------------------------------------------------------------------- */
body:not(.live-mode):not(.live-popup) .btn {
  border-radius: 10px;
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 600;
  transition:
    transform var(--ui-dur-fast) var(--ui-ease),
    background-color var(--ui-dur-fast) var(--ui-ease),
    border-color var(--ui-dur-fast) var(--ui-ease),
    box-shadow var(--ui-dur-fast) var(--ui-ease),
    filter var(--ui-dur-fast) var(--ui-ease);
}

body:not(.live-mode):not(.live-popup) .btn:hover:not(:disabled) {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-2);
}

body:not(.live-mode):not(.live-popup) .btn:active:not(:disabled) {
  transform: scale(0.98);
}

body:not(.live-mode):not(.live-popup) .btn.btn-primary {
  background: var(--ui-btn-grad);
  border-color: var(--ui-brand-deep);
  color: var(--ui-brand-on);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 26%),
    0 6px 16px -4px color-mix(in srgb, var(--ui-brand) 40%, transparent);
}

body:not(.live-mode):not(.live-popup) .btn.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  background: var(--ui-btn-grad);
  border-color: var(--ui-brand-deep);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 32%),
    0 10px 22px -4px color-mix(in srgb, var(--ui-brand) 48%, transparent);
}

body:not(.live-mode):not(.live-popup) dialog :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
body:not(.live-mode):not(.live-popup) main :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):not(.xl *) {
  border-radius: 10px;
  border: 1px solid var(--ui-line);
  transition:
    border-color var(--ui-dur-fast) var(--ui-ease),
    box-shadow var(--ui-dur-fast) var(--ui-ease);
}

body:not(.live-mode):not(.live-popup) dialog :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus,
body:not(.live-mode):not(.live-popup) main :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):not(.xl *):focus {
  outline: none;
  border-color: var(--ui-brand);
  box-shadow: 0 0 0 3px var(--ui-brand-ring);
}

body:not(.live-mode):not(.live-popup) dialog {
  border: 1px solid var(--ui-glass-border);
  border-radius: var(--ui-r-lg);
  background: var(--ui-surface);
  color: var(--ui-ink);
  box-shadow:
    0 24px 60px rgb(15 23 42 / 20%),
    0 4px 14px rgb(15 23 42 / 8%);
}

body:not(.live-mode):not(.live-popup) dialog[open] {
  animation: uiDialogIn var(--ui-dur-base) var(--ui-ease) both;
}

body:not(.live-mode):not(.live-popup) dialog::backdrop {
  background: rgb(15 23 42 / 42%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

body:not(.live-mode):not(.live-popup) #toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 18px;
  border-radius: var(--ui-r-pill);
  background: rgb(15 23 42 / 86%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgb(255 255 255 / 12%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgb(15 23 42 / 22%);
}

body:not(.live-mode):not(.live-popup) #technical-support-trigger.technical-support-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--ui-r-pill);
  border: 1px solid var(--ui-glass-border);
  background: rgb(255 255 255 / 88%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ui-ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow:
    0 10px 26px rgb(15 23 42 / 10%),
    0 2px 6px rgb(15 23 42 / 4%);
  transition:
    transform var(--ui-dur-fast) var(--ui-ease),
    border-color var(--ui-dur-fast) var(--ui-ease),
    box-shadow var(--ui-dur-fast) var(--ui-ease);
}

body:not(.live-mode):not(.live-popup) #technical-support-trigger.technical-support-trigger:hover {
  transform: translateY(-2px);
  border-color: var(--ui-brand-border);
  box-shadow:
    0 14px 32px rgb(15 23 42 / 14%),
    0 4px 10px color-mix(in srgb, var(--ui-brand) 14%, transparent);
}

/* --------------------------------------------------------------------------
   5. Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  section#auth.auth::after,
  #auth .auth-card,
  #auth .auth-apps button,
  body:not(.live-mode):not(.live-popup) dialog[open] {
    animation: none;
  }

  #auth *,
  body:not(.live-mode):not(.live-popup) header.top *,
  body:not(.live-mode):not(.live-popup) .btn,
  body:not(.live-mode):not(.live-popup) #technical-support-trigger {
    transition: none;
  }
}

/* ===== Round 4 手补：客服按钮只在登录页显示且横排；tab 溢出时靠左不裁切 ===== */
body:not(.auth-on):not(.live-mode):not(.live-popup) #technical-support-trigger.technical-support-trigger.technical-support-trigger { display: none; }
body.auth-on:not(.live-mode):not(.live-popup) #technical-support-trigger.technical-support-trigger {
  width: auto; min-height: 0; white-space: nowrap;
}
body.auth-on:not(.live-mode):not(.live-popup) #technical-support-trigger.technical-support-trigger svg { width: 18px; height: 18px; }
body:not(.live-mode):not(.live-popup):not(.iv-mode):not(.auth-on) header.top nav.tabbar:not(:empty) { justify-content: safe center; }
/* 旧 CSS 的 --accent 写死 #18674d，统一指向品牌色，机构换色时跟着变 */
:root:root { --accent: var(--ui-brand); --accent-ink: var(--ui-brand-on); --accent-soft: var(--ui-brand-soft); }


/* ===== Round 5: Table replica ===== */

/* --------------------------------------------------------------------------
   1. Desktop Student Bar & Toolbar (Scoped)
   -------------------------------------------------------------------------- */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 9px 16px;
  background: linear-gradient(180deg, var(--ui-surface) 0%, var(--ui-surface-2) 100%);
  border-bottom: 1px solid var(--ui-line);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student-info {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student-info > strong {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: var(--ui-r-pill);
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-brand-text);
  font-size: var(--ui-fs-body);
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-subjects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 6px 10px;
  font-size: var(--ui-fs-body);
  color: var(--ui-ink-2);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-subjects > span:not(.match-grade-summary) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-subjects b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid var(--ui-line);
  color: var(--ui-ink);
  font-size: var(--ui-fs-aux);
  font-weight: 700;
  line-height: 1;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-grade-summary {
  display: inline-flex;
  align-items: center;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--ui-line-strong);
  color: #ea580c;
  font-size: var(--ui-fs-body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student button[data-act="to-grades"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--ui-line-strong);
  background: var(--ui-surface);
  color: var(--ui-ink-2);
  font-size: var(--ui-fs-body);
  font-weight: 600;
  white-space: nowrap;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student button[data-act="to-grades"]::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235b6b7a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.8 3.6a2 2 0 0 1 2.8 2.8L7.4 15.6l-3.8.9.9-3.8 9.3-9.1Z'/%3E%3Cpath d='M12 5.4l2.6 2.6'/%3E%3C/svg%3E");
}

/* Toolbar Controls */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 16px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-mode-switch {
  padding: 3px;
  border-radius: 10px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-mode-btn {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-mode-btn.xl-mode-btn.xl-mode-btn.on {
  background: var(--ui-brand-soft);
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
  box-shadow: none;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-search {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 440px;
  height: 38px;
  min-height: 38px;
  padding: 0 12px 0 34px;
  border-radius: 10px;
  border: 1px solid var(--ui-line-strong);
  background-color: var(--ui-surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.75' cy='8.75' r='5.25'/%3E%3Cpath d='M13 13l3.75 3.75'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
  background-size: 16px 16px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-search:focus {
  background-color: var(--ui-surface);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  white-space: nowrap;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar button[data-act="person"]::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.75' stroke-linejoin='round'%3E%3Cpath d='M3.5 4.5h13l-4.8 5.4v4.6l-3.4 1.3V9.9L3.5 4.5Z'/%3E%3C/svg%3E");
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.75' stroke-linejoin='round'%3E%3Cpath d='M3.5 4.5h13l-4.8 5.4v4.6l-3.4 1.3V9.9L3.5 4.5Z'/%3E%3C/svg%3E");
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar button[data-act="go-live"]::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3E%3Cpath d='M4.5 3.1a.75.75 0 0 1 1.13-.65l7.25 4.4a.75.75 0 0 1 0 1.3l-7.25 4.4a.75.75 0 0 1-1.13-.65V3.1Z'/%3E%3C/svg%3E");
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3E%3Cpath d='M4.5 3.1a.75.75 0 0 1 1.13-.65l7.25 4.4a.75.75 0 0 1 0 1.3l-7.25 4.4a.75.75 0 0 1-1.13-.65V3.1Z'/%3E%3C/svg%3E");
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-expand.ai-btn.ai-btn {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--ui-brand) 82%, #ffffff) 0%,
    var(--ui-brand) 52%,
    color-mix(in srgb, var(--ui-brand) 82%, #000000) 100%
  );
  border-color: color-mix(in srgb, var(--ui-brand) 88%, #000000);
  color: var(--ui-brand-on);
  font-weight: 650;
  box-shadow:
    0 4px 14px color-mix(in srgb, var(--ui-brand) 28%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 22%);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-expand.ai-btn.ai-btn:hover {
  filter: brightness(1.04);
  color: var(--ui-brand-on);
  box-shadow:
    0 6px 18px color-mix(in srgb, var(--ui-brand) 34%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 28%);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-expand.ai-btn::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23000'%3E%3Cpath d='M10 1.8l1.95 5.45L17.4 9.2l-5.45 1.95L10 16.6l-1.95-5.45L2.6 9.2l5.45-1.95L10 1.8Zm5.2 11.4.65 1.85 1.85.65-1.85.65-.65 1.85-.65-1.85-1.85-.65 1.85-.65.65-1.85Z'/%3E%3C/svg%3E");
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23000'%3E%3Cpath d='M10 1.8l1.95 5.45L17.4 9.2l-5.45 1.95L10 16.6l-1.95-5.45L2.6 9.2l5.45-1.95L10 1.8Zm5.2 11.4.65 1.85 1.85.65-1.85.65-.65 1.85-.65-1.85-1.85-.65 1.85-.65.65-1.85Z'/%3E%3C/svg%3E");
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-meta {
  margin-left: auto;
  color: var(--ui-muted);
  font-size: var(--ui-fs-aux);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   2. Table Header: Group Pills with Dots & Frosted Column Row
   -------------------------------------------------------------------------- */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th {
  height: 36px;
  padding: 5px 8px;
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ui-line);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-pill {
  gap: 6px;
  padding: 2px 11px;
  font-size: var(--ui-fs-aux);
  font-weight: 650;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: currentColor;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="院校招生"] .xl-group-pill {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="院校招生"] .xl-group-pill::before {
  background: #10b981;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="学考入围"] .xl-group-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="学考入围"] .xl-group-pill::before {
  background: #3b82f6;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="录取测算"] .xl-group-pill {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="录取测算"] .xl-group-pill::before {
  background: #8b5cf6;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="校测安排"] .xl-group-pill {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="校测安排"] .xl-group-pill::before {
  background: #f59e0b;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="参考操作"] .xl-group-pill {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-group-row th[data-group="参考操作"] .xl-group-pill::before {
  background: #64748b;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-column-row th,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-column-row th.hd-orange,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-column-row th.hd-red,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-column-row th:is(.c-innRate, .c-admit) {
  background: rgb(248 250 252 / 90%) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ui-ink-2);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-column-row th.c-mine {
  background: color-mix(in srgb, var(--ui-brand) 7%, #f8fafc) !important;
  color: var(--ui-brand-text);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-head-cell {
  min-height: 38px;
  padding: 4px;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .hd-filter,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .sort-btns button {
  color: #94a3b8;
}

/* --------------------------------------------------------------------------
   3. Desktop Table Rows, School Grouping, Semantic Colors & Detail Panel
   -------------------------------------------------------------------------- */
@media (min-width: 721px) {
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row],
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td {
    min-height: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--ui-line);
    vertical-align: middle;
  }

  /* Continuous 3px brand stripe per school group + stronger divider between schools */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:first-child,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.school-start td:first-child {
    box-shadow: inset 3px 0 0 var(--ui-brand);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.xl-detail td.xl-detail-cell:first-child {
    box-shadow: inset 3px 0 0 var(--ui-brand);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.school-start td {
    border-top: 1.5px solid var(--ui-line-strong);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.school-end:not(.is-expanded) td,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.xl-detail.school-end td {
    border-bottom: 1.5px solid var(--ui-line-strong);
  }

  /* Compact View: Single-line school + 1-line gray tags below; single-line major + category */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) td.c-school .major-link {
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.3;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) .school-n {
    margin-bottom: 2px;
    line-height: 1.35;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) .school-tag {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ui-muted);
    font-size: var(--ui-fs-aux);
    font-weight: 400;
    line-height: 1.3;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) .school-tag + .school-tag::before {
    content: " · ";
    color: var(--ui-line-strong);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) td.c-major .major-n {
    line-height: 1.35;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) td.c-major .major-leibie {
    margin-top: 2px;
    line-height: 1.3;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl.xl-compact:not(.basket-table) td.c-innRate .shortlist-tag {
    display: block;
    font-size: var(--ui-fs-aux);
    color: var(--ui-muted);
    font-weight: 400;
    line-height: 1.25;
  }

  /* Expanded row subtle tint */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row].is-expanded td {
    background: color-mix(in srgb, var(--ui-brand) 4%, #ffffff);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row].is-expanded td.c-mine {
    background: color-mix(in srgb, var(--ui-brand) 10%, #ffffff);
  }

  /* Action buttons on desktop */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .pick-btn {
    min-height: 30px;
    padding: 0 9px;
    border-radius: 8px;
    border: 1px solid var(--ui-brand-border);
    background: var(--ui-surface);
    color: var(--ui-brand-text);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-btn {
    min-height: 30px;
    padding: 0 9px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid var(--ui-line);
    color: var(--ui-ink-2);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-btn[aria-expanded="true"] {
    min-width: 34px;
    padding: 0 9px;
    background: var(--ui-brand-soft);
    border-color: var(--ui-brand-border);
    color: var(--ui-brand-text);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-btn[aria-expanded="true"] .xl-more-d {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-more-btn[aria-expanded="true"]::before {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l5-5 5 5'/%3E%3C/svg%3E");
    mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l5-5 5 5'/%3E%3C/svg%3E");
  }

  /* Desktop Expandable Detail Panel (12px inset, brand-soft panel, white grid cards) */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tr.xl-detail td.xl-detail-cell {
    padding: 8px 12px 12px;
    background: color-mix(in srgb, var(--ui-brand) 3%, #ffffff);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-box {
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--ui-brand-tint);
    border: 1px solid var(--ui-brand-border);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-item {
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--ui-surface);
    border: 1px solid color-mix(in srgb, var(--ui-brand) 10%, var(--ui-line));
    box-shadow: var(--ui-shadow-xs);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-label {
    font-size: 12px;
    color: var(--ui-muted);
    font-weight: 500;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-val {
    font-size: 13.5px;
    color: var(--ui-ink);
    font-weight: 550;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .xl-detail-explain {
    margin: 10px 0 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgb(255 255 255 / 80%);
    border: 1px solid var(--ui-brand-border);
    color: var(--ui-ink-2);
    font-size: 12px;
  }
}

/* Semantic Column & Badge Styling (Desktop + Shared) */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-mine,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-mine.cell-green {
  background: var(--ui-brand-tint);
  color: var(--ui-brand-text);
  font-weight: 700;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row]:hover td {
  background: color-mix(in srgb, var(--ui-brand) 5%, #ffffff);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row]:hover td.c-mine,
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row]:hover td.c-mine.cell-green {
  background: color-mix(in srgb, var(--ui-brand) 10%, #ffffff);
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innGap.cell-green {
  color: #059669;
  font-weight: 700;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innGap.cell-gap-neg {
  color: #dc2626;
  font-weight: 700;
}

/* Circular Band Badges */
body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .band {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .band.band-rush {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .band.band-steady {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .band.band-fight {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .band.band-safe {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) .band.band-hard {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* --------------------------------------------------------------------------
   4. Mobile Layout, Scrollable Action Pills, Cards & Bottom Sheet (<= 720px)
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  /* Compact 2-Row Student Bar: Row 1 = Name + Summary + Edit, Rows 2-3 = 5x2 Subjects */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student {
    order: 1;
    flex: 0 0 100%;
    margin-bottom: 0;
    padding: 10px 12px;
    gap: 6px 6px;
    border-radius: 14px;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-xs);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student-info {
    order: 1;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-subjects {
    display: contents;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-grade-summary {
    order: 2;
    flex: 1 1 auto;
    margin-left: 2px;
    padding-left: 0;
    border-left: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student button[data-act="to-grades"] {
    position: relative;
    order: 3;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student button[data-act="to-grades"]::after {
    content: "";
    position: absolute;
    inset: -4px -2px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-subjects > span:not(.match-grade-summary) {
    order: 10;
    flex: 0 0 calc((100% - 24px) / 5);
    justify-content: space-between;
    font-size: 12px;
    gap: 2px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-subjects b {
    min-width: 21px;
    height: 21px;
    font-size: 12px;
  }

  /* Toolbar + Mobile Tools: Search + Filter/Sort Row, Action Pills Row, Meta Caption */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-tools,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-bar {
    display: contents;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-meta {
    display: none;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-search {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    height: 42px;
    min-height: 42px;
    border-radius: 12px;
    background-color: var(--ui-surface);
    border: 1px solid var(--ui-line);
    box-shadow: var(--ui-shadow-xs);
    font-size: 16px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-sheet-btn {
    order: 3;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 13px;
    border-radius: 12px;
    border: 1.5px solid var(--ui-brand-border);
    background: var(--ui-surface);
    color: var(--ui-ink);
    font-size: 13px;
    font-weight: 650;
    box-shadow: var(--ui-shadow-xs);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-sheet-btn svg {
    color: var(--ui-brand-text);
  }

  /* Three Capsule Buttons Row (34px visual height, >= 40px touch area, no scrollbar) */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-expand {
    position: relative;
    order: 4;
    flex: 0 0 auto;
    height: 34px;
    min-height: 34px;
    padding: 0 11px;
    border-radius: var(--ui-r-pill);
    font-size: 12.5px;
    font-weight: 600;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-expand::after {
    content: "";
    position: absolute;
    inset: -3px 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-bar-meta {
    order: 5;
    flex: 0 0 100%;
    font-size: 12px;
    color: var(--ui-muted);
    padding: 0 2px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-active-filters {
    order: 6;
    flex: 0 0 100%;
    margin-bottom: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-scroll {
    order: 7;
    flex: 0 0 100%;
    width: 100%;
  }

  /* Mobile Cards */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody {
    gap: 12px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] {
    gap: 10px 8px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--ui-line);
    box-shadow: 0 4px 16px rgb(15 23 42 / 5%), 0 1px 3px rgb(15 23 42 / 3%);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row].is-expanded {
    border-radius: 16px 16px 0 0;
  }

  /* Card Line 1: School 17px bold + gray pill tags */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .school-n {
    font-size: 17px;
    font-weight: 700;
    color: var(--ui-ink);
    line-height: 1.35;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .school-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--ui-r-pill);
    background: #f1f5f9;
    border: 1px solid var(--ui-line);
    color: var(--ui-muted);
    font-size: 12px;
    line-height: 1.35;
  }

  /* Card Line 2: Major 15px brand bold + vertical bar + gray category */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-major .major-link {
    align-items: center;
    gap: 4px 8px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-major .major-n {
    font-size: 15px;
    font-weight: 700;
    color: var(--ui-brand-text);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-major .major-leibie {
    padding: 0 0 0 8px;
    border-left: 1px solid var(--ui-line-strong);
    border-radius: 0;
    background: transparent;
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 500;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-major .major-leibie:empty {
    display: none;
  }

  /* Card Middle: 3 Metric Blocks */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-mine, .c-innGap, .c-min) {
    flex: 0 0 calc((100% - 16px) / 3);
    width: calc((100% - 16px) / 3);
    padding: 10px 6px;
    border-radius: 12px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-mine,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-mine.cell-green {
    background: var(--ui-brand-tint);
    border-color: var(--ui-brand-border);
    color: var(--ui-brand-text);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innGap.cell-green {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innGap.cell-gap-neg {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-min {
    background: #f8fafc;
    border-color: var(--ui-line);
    color: var(--ui-ink);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-mine, .c-innGap, .c-min) .xl-cell-value {
    font-size: 22px;
    font-weight: 750;
    line-height: 1.2;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-min .xl-cell-value:has(.score-year-line) {
    font-size: clamp(15px, 4.1vw, 17px);
    letter-spacing: -0.02em;
  }

  /* Card Pills Row */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-inn, .c-band, .c-innRate, .c-admit, .c-test, .c-date, .c-plan) {
    padding: 4px 10px;
    border-radius: var(--ui-r-pill);
    background: #f1f5f9;
    border: 0;
    gap: 5px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td:is(.c-inn, .c-band, .c-innRate, .c-admit, .c-test, .c-date, .c-plan) .xl-cell-value {
    color: var(--ui-ink);
    font-size: 12px;
    font-weight: 700;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-inn.cell-yes .xl-cell-value,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-admit .xl-cell-value {
    color: var(--ui-ink);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-innRate .shortlist-tag {
    font-size: 12px;
    font-weight: 500;
    color: var(--ui-muted);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-band .band {
    width: auto;
    height: auto;
    padding: 1px 6px;
    border-radius: var(--ui-r-pill);
    font-size: 12px;
    line-height: 1.3;
  }

  /* Card Bottom Action Buttons (Half-width each, 44px height) */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-act {
    margin-top: 2px;
    padding-top: 10px;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .xl-more-btn {
    min-height: 44px;
    border-radius: 10px;
    background: var(--ui-surface);
    border: 1px solid var(--ui-line-strong);
    color: var(--ui-brand-text);
    font-size: 14px;
    font-weight: 600;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .pick-btn,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .pick-btn.on,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] .pick-btn:hover {
    min-height: 44px;
    border-radius: 10px;
    background: var(--ui-brand);
    border: 1px solid var(--ui-brand);
    color: var(--ui-brand-on);
    font-size: 14px;
    font-weight: 650;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr.xl-detail {
    margin-top: -12px;
    border-radius: 0 0 16px 16px;
  }

  /* Bottom Sheet Handle, Radius & Shadow Unification */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-tools.is-open .xl-sheet-panel,
  body.sheet-mode:not(.live-mode) .xl-pop {
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 36px rgb(15 23 42 / 14%), 0 -2px 8px rgb(15 23 42 / 6%);
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-tools.is-open .xl-sheet-panel::before,
  body.sheet-mode:not(.live-mode) .xl-pop::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    margin: 10px auto 2px;
    border-radius: var(--ui-r-pill);
    background: var(--ui-line-strong);
    flex-shrink: 0;
  }

  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-sheet-head {
    padding: 8px 16px 12px;
  }
}
/* ===== Round 5 手补：手机端表格外层 .live-stage 排到工具区之后 ===== */
@media (max-width: 720px) {
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) > .live-stage {
    order: 7;
    flex: 0 0 100%;
    min-width: 0;
  }
}
@media (max-width: 720px) {
  /* 旧规则把 xl-page 设成竖向居中，这里改回横向换行，让搜索框和筛选排序同一行 */
  body.sheet-mode:not(.live-mode) .xl-page.xl-page:not(.live-page) {
    flex-direction: row;
    align-items: center;
    align-content: flex-start;
  }
  /* 学考条：姓名、汇总、修改学考单独占第一行 */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-student::before {
    content: "";
    order: 5;
    flex: 0 0 100%;
    height: 0;
  }
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .match-grade-summary { order: 2; }
  /* 卡片里不需要院校分组竖线 */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-school:first-child:first-child {
    box-shadow: none;
  }
  /* 搜索框独占剩余宽度，和筛选排序同一行；三个功能胶囊换到下一行 */
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-toolbar .xl-search.xl-search {
    flex: 1 1 calc(100% - 140px);
  }
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl-mobile-sheet-btn.xl-mobile-sheet-btn {
    margin-right: 0;
  }
}
/* 数字列和校测时间不折行（1024 宽时折算分会断成两截） */
@media (min-width: 721px) {
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.num .xl-cell-content,
  body.sheet-mode:not(.live-mode) .xl-page:not(.live-page) .xl:not(.basket-table) tbody tr[data-match-row] td.c-date .xl-cell-content {
    white-space: nowrap;
  }
}

/* ===== Round 6: Management pages ===== */

body.management-mode,
body.stu-mode {
  font-family: var(--ui-font);
  color: var(--ui-ink);
  background:
    radial-gradient(900px 360px at 12% 0%, var(--ui-brand-soft), transparent 65%),
    radial-gradient(760px 320px at 88% 4%, color-mix(in srgb, var(--ui-brand) 7%, transparent), transparent 60%),
    var(--ui-bg);
  overflow-x: clip;
}

body.management-mode #main {
  width: min(1280px, 100%);
  padding: 28px 24px 48px;
  box-sizing: border-box;
}

body.stu-mode #main {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 24px clamp(12px, 2vw, 28px) 44px;
  box-sizing: border-box;
}

/* Shared cards & panels */
body.management-mode .panel,
body.stu-mode .panel {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-r-lg);
  box-shadow: var(--ui-shadow-sm);
}

/* ==========================================================================
   1. 机构管理 & 机构设置 (management-mode)
   ========================================================================== */

body.management-mode .org-workspace .org-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

body.management-mode .org-workspace .section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--ui-brand-text);
}

body.management-mode .org-workspace .section-eyebrow::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--ui-brand);
  flex-shrink: 0;
}

body.management-mode .org-workspace .org-heading h2 {
  margin: 0 0 6px;
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--ui-ink);
}

body.management-mode .org-workspace .org-heading .lead {
  margin: 0;
  font-size: 14px;
  color: var(--ui-muted);
}

body.management-mode .org-heading .org-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--ui-r-pill);
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-brand-text);
  font-size: 13px;
  font-weight: 600;
}

body.management-mode .org-heading .org-role::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  flex-shrink: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='6.5' r='3'/%3E%3Cpath d='M4.5 16.5c.7-2.6 2.9-4 5.5-4s4.8 1.4 5.5 4'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='6.5' r='3'/%3E%3Cpath d='M4.5 16.5c.7-2.6 2.9-4 5.5-4s4.8 1.4 5.5 4'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Overview cards */
body.management-mode .admin-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 22px;
}

body.management-mode .admin-overview article {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--ui-r-lg);
  background: var(--ui-surface-glass);
  border: 1px solid var(--ui-line);
  box-shadow: var(--ui-shadow-sm);
  backdrop-filter: blur(10px);
}

body.management-mode .admin-overview article::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 16px;
  width: 96px;
  height: 38px;
  pointer-events: none;
  background: var(--ui-brand);
  opacity: 0.24;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 112 44' fill='none'%3E%3Cpath d='M4 34 L24 25 L44 29 L64 17 L86 21 L106 8 L106 42 L4 42 Z' fill='%23000' fill-opacity='0.18'/%3E%3Cpolyline points='4,34 24,25 44,29 64,17 86,21 106,8' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='24' cy='25' r='2.5' fill='%23000'/%3E%3Ccircle cx='64' cy='17' r='2.5' fill='%23000'/%3E%3Ccircle cx='106' cy='8' r='2.8' fill='%23000'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 112 44' fill='none'%3E%3Cpath d='M4 34 L24 25 L44 29 L64 17 L86 21 L106 8 L106 42 L4 42 Z' fill='%23000' fill-opacity='0.18'/%3E%3Cpolyline points='4,34 24,25 44,29 64,17 86,21 106,8' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='24' cy='25' r='2.5' fill='%23000'/%3E%3Ccircle cx='64' cy='17' r='2.5' fill='%23000'/%3E%3Ccircle cx='106' cy='8' r='2.8' fill='%23000'/%3E%3C/svg%3E") no-repeat center / contain;
}

body.management-mode .admin-overview .metric-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-brand-text);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

body.management-mode .admin-overview .metric-icon svg {
  width: 26px;
  height: 26px;
}

body.management-mode .admin-overview article > div:last-child {
  position: relative;
  z-index: 1;
  min-width: 0;
}

body.management-mode .admin-overview article span {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--ui-muted);
}

body.management-mode .admin-overview article b {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 2px 0 4px;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--ui-ink);
}

body.management-mode .admin-overview article b small {
  margin-left: 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ui-muted);
}

body.management-mode .admin-overview article p {
  margin: 0;
  font-size: 12px;
  color: var(--ui-muted);
}

/* Panel headings with left 3px bar */
body.management-mode .org-workspace .panel {
  padding: 22px 24px;
  border-radius: var(--ui-r-lg);
}

body.management-mode .org-workspace .panel h3,
body.management-mode .org-workspace .panel .org-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ui-ink);
}

body.management-mode .org-workspace .panel h3::before,
body.management-mode .org-workspace .panel .org-section-title::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--ui-brand);
  flex-shrink: 0;
}

body.management-mode .org-workspace .panel .org-panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

body.management-mode .org-workspace .panel .org-panel-heading h3::before,
body.management-mode .org-workspace .panel .org-panel-heading .org-section-title::before {
  display: none;
}

body.management-mode .org-workspace .panel .org-panel-heading .panel-index {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-brand-text);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

body.management-mode .org-workspace .panel .org-panel-heading p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--ui-muted);
}

body.management-mode .org-workspace .org-section-head {
  margin-bottom: 14px;
}

body.management-mode .org-workspace .org-section-head .section-description {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ui-muted);
}

/* Fix 1: 机构注册审核列表横排一行 + 两个 p 用 · 连接 + 按钮自适应宽度 */
body.management-mode #admin-application-review .btn {
  width: auto;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

body.management-mode #admin-application-refresh {
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
  color: var(--ui-ink-2);
}

body.management-mode #admin-application-refresh:hover {
  background: var(--ui-brand-tint);
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
}

body.management-mode #admin-application-list {
  display: grid;
  gap: 0;
}

body.management-mode #admin-application-list .admin-org-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 4px;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  border-radius: 0;
}

body.management-mode #admin-application-list .admin-org-card:first-child {
  padding-top: 8px;
}

body.management-mode #admin-application-list .admin-org-card:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

body.management-mode #admin-application-list .admin-card-copy {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
}

body.management-mode #admin-application-list .admin-card-copy h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ui-ink);
}

body.management-mode #admin-application-list .admin-card-copy p {
  display: inline;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ui-muted);
}

body.management-mode #admin-application-list .admin-card-copy p + p::before {
  content: "·";
  margin: 0 6px;
  color: var(--ui-line-strong);
}

/* Search input inside 机构列表 */
body.management-mode .admin-search {
  position: relative;
  flex: 1 1 220px;
  max-width: 280px;
}

body.management-mode .admin-search > svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--ui-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

body.management-mode .admin-search .ai-gk {
  min-height: 40px;
  height: 40px;
  padding: 0 12px 0 36px;
  border-radius: 10px;
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
  font-size: 13px;
}

/* 机构列表: card DOM rendered as table-row style */
body.management-mode #admin-org-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--ui-line);
}

body.management-mode #admin-org-list .admin-org-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  border-radius: 0;
  transition: background var(--ui-dur-fast) var(--ui-ease);
}

body.management-mode #admin-org-list .admin-org-card:hover {
  background: var(--ui-brand-tint);
}

body.management-mode #admin-org-list .admin-org-card:last-child {
  border-bottom: 0;
}

body.management-mode #admin-org-list .admin-card-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-brand-text);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

body.management-mode #admin-org-list .admin-card-copy {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  overflow-wrap: break-word;
}

body.management-mode #admin-org-list .admin-card-copy h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--ui-ink);
}

body.management-mode #admin-org-list .admin-card-copy p {
  margin: 0;
  font-size: 12px;
  color: var(--ui-muted);
}

body.management-mode #admin-org-list .admin-card-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0;
}

body.management-mode #admin-org-list .admin-card-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: var(--ui-r-pill);
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
  color: var(--ui-ink-2);
  font-size: 12px;
  font-weight: 550;
}

body.management-mode .org-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: var(--ui-r-pill);
  font-size: 12px;
  font-weight: 600;
}

body.management-mode #admin-org-list .admin-card-meta > span.org-status.is-enabled,
body.management-mode .org-status.is-enabled {
  background: var(--ui-pos-soft);
  border: 1px solid var(--ui-pos-border);
  color: var(--ui-pos);
}

body.management-mode #admin-org-list .admin-card-meta > span.org-status.is-disabled,
body.management-mode .org-status.is-disabled {
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
  color: var(--ui-muted);
}

body.management-mode #admin-org-list .admin-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

body.management-mode #admin-org-list .admin-card-actions .btn {
  width: auto;
  min-height: 32px;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  color: var(--ui-ink-2);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

body.management-mode #admin-org-list .admin-card-actions .btn:hover {
  background: var(--ui-brand-soft);
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
}

body.management-mode #admin-org-list .admin-card-actions .admin-manage {
  border-color: var(--ui-brand-border);
  background: var(--ui-brand-tint);
  color: var(--ui-brand-text);
}

body.management-mode #admin-org-list .admin-org-card.is-selected .admin-manage {
  background: var(--ui-brand);
  border-color: var(--ui-brand);
  color: var(--ui-brand-on);
}

/* Right column & form controls */
body.management-mode .admin-create-panel {
  border-top: 3px solid var(--ui-brand);
}

body.management-mode .org-workspace .org-field {
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-ink-2);
}

body.management-mode .org-workspace .ai-gk,
body.management-mode .org-workspace select.ai-gk,
body.management-mode .org-workspace textarea {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-ink);
  font-size: 14px;
  padding: 9px 12px;
  transition:
    border-color var(--ui-dur-fast) var(--ui-ease),
    box-shadow var(--ui-dur-fast) var(--ui-ease),
    background var(--ui-dur-fast) var(--ui-ease);
}

body.management-mode .org-workspace .ai-gk:focus,
body.management-mode .org-workspace select.ai-gk:focus,
body.management-mode .org-workspace textarea:focus {
  background: var(--ui-surface);
  border-color: var(--ui-brand);
  box-shadow: 0 0 0 3px var(--ui-brand-ring);
  outline: none;
}

body.management-mode .org-workspace .btn-primary {
  min-height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ui-brand), color-mix(in srgb, var(--ui-brand) 82%, #000));
  border: 1px solid var(--ui-brand);
  color: var(--ui-brand-on);
  font-weight: 650;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ui-brand) 22%, transparent);
}

body.management-mode .org-workspace .btn-primary:hover {
  filter: brightness(1.04);
}

body.management-mode .admin-create-panel .btn-primary,
body.management-mode .admin-recovery-panel .btn-primary {
  width: 100%;
}

body.management-mode .org-workspace .btn:not(.btn-primary) {
  border-radius: 9px;
  border: 1px solid var(--ui-line);
  background: var(--ui-surface);
  color: var(--ui-ink-2);
}

body.management-mode .org-workspace .btn:not(.btn-primary):hover {
  background: var(--ui-brand-tint);
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
}

/* 机构设置 (org view) */
body.management-mode .org-subnav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: var(--ui-r-pill);
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  box-shadow: var(--ui-shadow-xs);
}

body.management-mode .org-subnav button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--ui-r-pill);
  background: transparent;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ui-dur-fast) var(--ui-ease);
}

body.management-mode .org-subnav button:hover {
  color: var(--ui-ink);
  background: var(--ui-surface-2);
}

body.management-mode .org-subnav button[aria-pressed="true"] {
  background: var(--ui-brand);
  color: var(--ui-brand-on);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--ui-brand) 24%, transparent);
}

body.management-mode .org-brand-preview {
  padding: 20px 24px;
  margin-bottom: 20px;
  border-radius: var(--ui-r-lg);
  background: var(--ui-surface-glass);
  border: 1px solid var(--ui-line);
  box-shadow: var(--ui-shadow-sm);
  backdrop-filter: blur(10px);
}

body.management-mode .preview-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-brand-text);
}

body.management-mode .brand-touchpoints span {
  padding: 4px 10px;
  border-radius: var(--ui-r-pill);
  background: var(--ui-brand-tint);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-brand-text);
  font-size: 12px;
  font-weight: 550;
}

body.management-mode .h5-limit-chip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--ui-r-pill);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-ink-2);
  font-size: 13px;
  font-weight: 550;
}

body.management-mode .h5-limit-chip.is-on {
  background: var(--ui-brand-soft);
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
  font-weight: 650;
}

body.management-mode .org-feedback {
  background: var(--ui-brand-tint);
  border: 1px solid var(--ui-brand-border);
  border-radius: var(--ui-r-md);
  color: var(--ui-ink);
}

/* ==========================================================================
   2. 学生管理 (stu-mode)
   ========================================================================== */

body.stu-mode .stu-page {
  gap: 16px;
}

body.stu-mode .stu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

body.stu-mode .stu-head h1 {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 30px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--ui-ink);
}

body.stu-mode .stu-head .stu-add-trigger {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ui-brand), color-mix(in srgb, var(--ui-brand) 82%, #000));
  border: 1px solid var(--ui-brand);
  color: var(--ui-brand-on);
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ui-brand) 22%, transparent);
}

/* Collapsible Add Student Panel */
body.stu-mode details.stu-add {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-r-lg);
  box-shadow: var(--ui-shadow-sm);
  overflow: hidden;
}

body.stu-mode details.stu-add > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  min-height: 54px;
  font-size: 15px;
  font-weight: 650;
  color: var(--ui-ink);
  cursor: pointer;
}

body.stu-mode details.stu-add > summary::-webkit-details-marker {
  display: none;
}

body.stu-mode details.stu-add > summary::before {
  content: "+";
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ui-brand);
  color: var(--ui-brand-on);
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  transition: transform var(--ui-dur-fast) var(--ui-ease), background var(--ui-dur-fast) var(--ui-ease);
}

body.stu-mode details.stu-add[open] > summary::before {
  content: "−";
  background: var(--ui-brand-soft);
  color: var(--ui-brand-text);
}

body.stu-mode details.stu-add > summary span {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ui-muted);
}

body.stu-mode .stu-add .ai-gk,
body.stu-mode .stu-add textarea,
body.stu-mode .stu-add select {
  border-radius: 10px;
  border: 1px solid var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-ink);
  font-size: 14px;
}

body.stu-mode .stu-add .ai-gk:focus,
body.stu-mode .stu-add textarea:focus,
body.stu-mode .stu-add select:focus {
  background: var(--ui-surface);
  border-color: var(--ui-brand);
  box-shadow: 0 0 0 3px var(--ui-brand-ring);
  outline: none;
}

body.stu-mode .stu-add .stu-sub {
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-line);
  border-radius: 10px;
}

body.stu-mode .stu-add .stu-sub select.has-g {
  border-color: var(--ui-brand);
  color: var(--ui-brand-text);
  background: var(--ui-brand-tint);
}

/* Roster Board */
body.stu-mode .stu-board {
  padding: 0;
  overflow: visible;
}

body.stu-mode .stu-list-heading {
  padding: 18px 24px 12px;
}

body.stu-mode .stu-list-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ui-ink);
}

body.stu-mode .stu-list-heading h2::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--ui-brand);
  flex-shrink: 0;
}

body.stu-mode .stu-list-heading h2 span {
  margin-left: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-muted);
}

body.stu-mode .stu-list-heading p,
body.stu-mode #stu-roster-count {
  margin: 0;
  font-size: 12px;
  color: var(--ui-muted);
}

body.stu-mode .stu-roster-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 0 24px 16px;
}

body.stu-mode .stu-search {
  flex: 1 1 260px;
  max-width: 380px;
}

body.stu-mode .stu-search input {
  width: 100%;
  min-height: 40px;
  height: 40px;
  padding: 0 14px 0 36px;
  border-radius: 10px;
  border: 1px solid var(--ui-line);
  background-color: var(--ui-surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='9' r='5.5'/%3E%3Cpath d='M13.5 13.5L17 17'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px 16px;
  font-size: 13px;
  color: var(--ui-ink);
  transition:
    border-color var(--ui-dur-fast) var(--ui-ease),
    box-shadow var(--ui-dur-fast) var(--ui-ease),
    background-color var(--ui-dur-fast) var(--ui-ease);
}

body.stu-mode .stu-search input:focus {
  background-color: var(--ui-surface);
  border-color: var(--ui-brand);
  box-shadow: 0 0 0 3px var(--ui-brand-ring);
  outline: none;
}

body.stu-mode .stu-counselor-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 230px;
  min-width: 0;
  font-size: 13px;
  color: var(--ui-muted);
}

body.stu-mode .stu-counselor-filter select {
  min-height: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--ui-line);
  background: var(--ui-surface-2);
  font-size: 13px;
  color: var(--ui-ink);
}

body.stu-mode .stu-counselor-filter select:focus {
  background: var(--ui-surface);
  border-color: var(--ui-brand);
  box-shadow: 0 0 0 3px var(--ui-brand-ring);
  outline: none;
}

body.stu-mode .stu-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.stu-mode .stu-status-tabs button {
  min-height: 36px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--ui-r-pill);
  border: 1px solid var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-ink-2);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all var(--ui-dur-fast) var(--ui-ease);
}

body.stu-mode .stu-status-tabs button:hover {
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
}

body.stu-mode .stu-status-tabs button[aria-pressed="true"] {
  background: var(--ui-brand);
  border-color: var(--ui-brand);
  color: var(--ui-brand-on);
  font-weight: 650;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ui-brand) 24%, transparent);
}

/* Roster Table */
body.stu-mode .stu-board .stu-table-wrap {
  overflow: visible;
  border: 0;
  border-radius: 0 0 var(--ui-r-lg) var(--ui-r-lg);
}

body.stu-mode .stu-roster-table {
  width: 100%;
  table-layout: fixed;
  min-width: 0;
  font-size: 13px;
}

body.stu-mode .stu-roster-table thead th {
  height: 42px;
  padding: 10px 12px;
  background: var(--ui-surface-2);
  border-top: 1px solid var(--ui-line);
  border-bottom: 1px solid var(--ui-line);
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 600;
}

body.stu-mode .stu-roster-table th:nth-child(1) { width: 24%; }
body.stu-mode .stu-roster-table th:nth-child(2) { width: 32%; }
body.stu-mode .stu-roster-table th:nth-child(3) { width: auto; }
body.stu-mode .stu-roster-table th:nth-child(4) { width: 88px; }
body.stu-mode .stu-roster-table th:nth-child(5) { width: 256px; }

body.stu-mode .stu-roster-table tbody tr {
  transition: background var(--ui-dur-fast) var(--ui-ease);
}

body.stu-mode .stu-roster-table tbody td {
  padding: 14px 12px;
  min-height: 70px;
  border-bottom: 1px solid var(--ui-line);
  vertical-align: middle;
}

body.stu-mode .stu-roster-table tbody tr:last-child td {
  border-bottom: 0;
}

body.stu-mode .stu-roster-table tbody tr:hover td {
  background: var(--ui-brand-tint);
}

body.stu-mode .stu-roster-table tbody tr.stu-on td {
  background: var(--ui-brand-soft);
}

/* Student Name & inline metadata */
body.stu-mode #main .stu-roster-table td.stu-roster-name {
  text-align: left;
  padding-left: 24px;
}

body.stu-mode .stu-roster-name .stu-name-button {
  display: block;
  min-height: 24px;
  padding: 0;
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ui-ink);
  cursor: pointer;
}

body.stu-mode .stu-roster-name .stu-name-button:hover {
  color: var(--ui-brand-text);
}

body.stu-mode .stu-roster-name > span {
  display: inline;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ui-muted);
  font-variant-numeric: tabular-nums;
}

body.stu-mode .stu-roster-name > span + span::before {
  content: "·";
  margin: 0 5px;
  color: var(--ui-line-strong);
}

/* Grades column */
body.stu-mode .stu-roster-grades > b {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.03em;
  color: #ea580c;
}

body.stu-mode .stu-grade-preview {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

body.stu-mode .stu-grade-preview > span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--ui-muted);
  white-space: nowrap;
}

body.stu-mode .stu-grade-preview b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 1px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: #f1f5f9;
  color: #475569;
}

body.stu-mode .stu-grade-preview b[data-display-grade="A"] {
  background: var(--ui-brand-soft-2);
  color: var(--ui-brand-text);
}

body.stu-mode .stu-grade-preview b[data-display-grade="B"] {
  background: var(--ui-brand-soft);
  color: var(--ui-brand-text);
}

body.stu-mode .stu-grade-preview b[data-display-grade="C"] {
  background: #f1f5f9;
  color: #475569;
}

body.stu-mode .stu-grade-preview b[data-display-grade="D"],
body.stu-mode .stu-grade-preview b[data-display-grade="E"] {
  background: #fff7ed;
  color: #ea580c;
}

/* Notes column */
body.stu-mode .stu-roster-notes p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ui-muted);
}

/* Plan count column */
body.stu-mode .stu-roster-count button {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  min-height: 36px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-brand-text);
  font-size: 20px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

body.stu-mode .stu-roster-count button:hover {
  background: var(--ui-brand-soft);
}

body.stu-mode .stu-roster-count button span {
  display: inline;
  font-size: 12px;
  font-weight: 500;
  color: var(--ui-muted);
}

/* Fix 2: 操作列只露出「查询匹配」「志愿方案」与「⋯」更多菜单 */
body.stu-mode #main .stu-roster-actions .stu-acts {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: visible;
  padding: 0;
}

body.stu-mode .stu-roster-actions .stu-acts > .btn,
body.stu-mode .stu-roster-actions .stu-more-btn {
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--ui-r-pill);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--ui-dur-fast) var(--ui-ease);
}

body.stu-mode .stu-roster-actions button[data-act="stu-filter"].btn-primary {
  background: var(--ui-brand);
  border: 1px solid var(--ui-brand);
  color: var(--ui-brand-on);
}

body.stu-mode .stu-roster-actions button[data-act="stu-filter"].btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

body.stu-mode .stu-roster-actions button[data-act="stu-filter"].btn-primary:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

body.stu-mode .stu-roster-actions button[data-act="stu-plan"].btn {
  background: var(--ui-surface);
  border: 1px solid var(--ui-brand);
  color: var(--ui-brand-text);
}

body.stu-mode .stu-roster-actions button[data-act="stu-plan"].btn:hover {
  background: var(--ui-brand-tint);
}

body.stu-mode details.stu-more {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

body.stu-mode summary.stu-more-btn {
  list-style: none;
  min-width: 34px;
  width: 34px;
  padding: 0;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line-strong);
  color: var(--ui-ink-2);
  font-size: 15px;
  line-height: 1;
}

body.stu-mode summary.stu-more-btn::-webkit-details-marker {
  display: none;
}

body.stu-mode summary.stu-more-btn:hover,
body.stu-mode details.stu-more[open] > summary.stu-more-btn {
  background: var(--ui-brand-tint);
  border-color: var(--ui-brand-border);
  color: var(--ui-brand-text);
}

body.stu-mode .stu-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 164px;
  padding: 6px;
  border-radius: var(--ui-r-md);
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  box-shadow: var(--ui-shadow-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.stu-mode .stu-roster-table tbody tr:nth-child(n+3):nth-last-child(-n+2) .stu-more-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

body.stu-mode .stu-more-menu .stu-roster-management {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

body.stu-mode .stu-more-menu .btn {
  width: 100%;
  min-height: 36px;
  height: auto;
  padding: 7px 12px;
  border: 0;
  border-radius: var(--ui-r-sm);
  background: transparent;
  color: var(--ui-ink-2);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  cursor: pointer;
}

body.stu-mode .stu-more-menu .btn:hover {
  background: var(--ui-brand-tint);
  color: var(--ui-brand-text);
}

body.stu-mode .stu-more-menu .btn.basket-delete {
  position: relative;
  margin-top: 8px;
  color: var(--ui-neg);
}

body.stu-mode .stu-more-menu .btn.basket-delete::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: -5px;
  height: 1px;
  background: var(--ui-line);
}

body.stu-mode .stu-more-menu .btn.basket-delete:hover {
  background: var(--ui-neg-soft);
  color: var(--ui-neg);
}

/* ==========================================================================
   3. Responsive (1024, 720, 620, 390, 360)
   ========================================================================== */

@media (max-width: 1200px) {
  body.stu-mode .stu-roster-table th:nth-child(1) { width: 22%; }
  body.stu-mode .stu-roster-table th:nth-child(2) { width: 31%; }
  body.stu-mode .stu-roster-table th:nth-child(4) { width: 76px; }
  body.stu-mode .stu-roster-table th:nth-child(5) { width: 244px; }
}

@media (max-width: 1000px) {
  body.stu-mode .stu-roster-table {
    table-layout: auto;
  }
  body.stu-mode #main .stu-roster-table td.stu-roster-name {
    padding-left: 0;
  }
  body.stu-mode .stu-roster-table tbody td {
    min-height: 0;
    padding: 0;
    border-bottom: 0;
  }
  body.stu-mode .stu-roster-table tbody tr {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-r-md);
    box-shadow: var(--ui-shadow-xs);
  }
  body.stu-mode .stu-roster-table tbody tr.stu-on {
    border-color: var(--ui-brand);
  }
  body.stu-mode .stu-roster-table tbody tr:hover td {
    background: transparent;
  }
  body.stu-mode #main .stu-roster-actions .stu-acts {
    justify-content: flex-start;
  }
  body.stu-mode .stu-roster-table tbody tr:nth-child(n+3):nth-last-child(-n+2) .stu-more-menu {
    top: calc(100% + 6px);
    bottom: auto;
  }
}

@media (max-width: 720px) {
  body.stu-mode #main {
    padding: 14px 12px 28px;
  }
  body.stu-mode .stu-head .stu-add-trigger {
    min-height: 40px;
  }
  body.stu-mode details.stu-add > summary {
    padding: 14px 16px;
    min-height: 52px;
  }
  body.stu-mode .stu-add-meta {
    grid-template-columns: 1fr;
  }
  body.stu-mode .stu-list-heading,
  body.stu-mode .stu-roster-toolbar {
    padding-left: 14px;
    padding-right: 14px;
  }
  body.stu-mode .stu-search {
    flex: 1 1 100%;
    max-width: none;
  }
  body.stu-mode .stu-counselor-filter {
    flex: 1 1 100%;
    max-width: none;
  }
  body.stu-mode .stu-status-tabs {
    width: 100%;
  }
  body.stu-mode .stu-status-tabs button {
    min-height: 40px;
    height: auto;
    padding: 6px 12px;
  }
  body.stu-mode .stu-board .stu-table-wrap {
    padding: 0 12px 14px;
    overflow: visible;
  }
  body.stu-mode .stu-roster-table,
  body.stu-mode .stu-roster-table tbody {
    display: block;
    width: 100%;
  }
  body.stu-mode .stu-roster-table thead {
    display: none;
  }
  body.stu-mode .stu-roster-table tbody {
    display: grid;
    gap: 12px;
  }
  body.stu-mode .stu-roster-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 14px;
  }
  body.stu-mode .stu-roster-name {
    grid-column: 1;
    grid-row: 1;
  }
  body.stu-mode .stu-roster-name .stu-name-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    margin-bottom: 2px;
  }
  body.stu-mode .stu-roster-count {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }
  body.stu-mode .stu-roster-count button {
    min-height: 40px;
    padding: 4px 6px;
  }
  body.stu-mode .stu-roster-grades {
    grid-column: 1 / -1;
    text-align: left;
    margin-top: 2px;
  }
  body.stu-mode .stu-grade-preview {
    justify-content: flex-start;
    gap: 5px 8px;
  }
  body.stu-mode .stu-roster-notes {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  body.stu-mode .stu-roster-actions {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--ui-line);
  }
  body.stu-mode #main .stu-roster-actions .stu-acts {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  body.stu-mode .stu-roster-actions button[data-act="stu-filter"].btn-primary,
  body.stu-mode .stu-roster-actions button[data-act="stu-plan"].btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    height: 40px;
    padding: 0 10px;
    font-size: 13px;
  }
  body.stu-mode summary.stu-more-btn {
    min-width: 40px;
    width: 40px;
    min-height: 40px;
    height: 40px;
  }
  body.stu-mode .stu-more-menu {
    right: 0;
    left: auto;
    max-width: calc(100vw - 48px);
  }
  body.stu-mode .stu-more-menu .btn {
    min-height: 42px;
    font-size: 14px;
  }
}

@media (max-width: 620px) {
  body.management-mode #main {
    padding: 20px 14px 32px;
  }
  body.management-mode .org-workspace .panel {
    padding: 18px 16px;
  }
  body.management-mode .admin-overview {
    gap: 8px;
    margin: 0 0 18px;
  }
  body.management-mode .admin-overview article {
    display: block;
    padding: 12px 10px;
    border-radius: var(--ui-r-md);
  }
  body.management-mode .admin-overview article::after {
    display: none;
  }
  body.management-mode .admin-overview .metric-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    margin-bottom: 8px;
  }
  body.management-mode .admin-overview .metric-icon svg {
    width: 18px;
    height: 18px;
  }
  body.management-mode .admin-overview article span {
    font-size: 12px;
  }
  body.management-mode .admin-overview article b {
    font-size: 24px;
  }
  body.management-mode .admin-overview article b small {
    font-size: 12px;
  }
  body.management-mode #admin-application-list .admin-org-card {
    flex-wrap: wrap;
    gap: 10px;
  }
  body.management-mode #admin-application-list .admin-card-copy {
    flex: 1 1 180px;
  }
  body.management-mode #admin-application-review .btn {
    min-height: 40px;
  }
  body.management-mode #admin-org-list .admin-org-card {
    flex-wrap: wrap;
    padding: 14px 4px;
  }
  body.management-mode #admin-org-list .admin-card-actions {
    width: 100%;
  }
  body.management-mode #admin-org-list .admin-card-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
    height: 40px;
  }
  body.management-mode .org-subnav {
    display: flex;
    width: 100%;
    border-radius: var(--ui-r-md);
  }
  body.management-mode .org-subnav button {
    flex: 1 1 calc(50% - 4px);
    min-height: 40px;
  }
  body.management-mode .org-workspace .btn {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.management-mode #admin-org-list .admin-org-card,
  body.management-mode .org-workspace .ai-gk,
  body.management-mode .org-workspace select.ai-gk,
  body.management-mode .org-workspace textarea,
  body.management-mode .org-subnav button,
  body.stu-mode details.stu-add > summary::before,
  body.stu-mode .stu-search input,
  body.stu-mode .stu-status-tabs button,
  body.stu-mode .stu-roster-table tbody tr,
  body.stu-mode .stu-roster-actions .stu-acts > .btn,
  body.stu-mode .stu-roster-actions .stu-more-btn {
    transition: none;
  }
}

/* ===== Round 6 手补 ===== */
/* 机构列表搜索框：原规则 .ai-gk 的 padding 优先级更高，图标压住了文字 */
body.management-mode .admin-search.admin-search input.ai-gk { padding-left: 38px; }
/* 审核条目手机端：信息两行、按钮不挤 */
@media (max-width: 720px) {
  body.management-mode #admin-application-list .admin-card-copy p { display: block; }
  body.management-mode #admin-application-list .admin-card-copy p + p::before { content: none; }
}
/* 手机学生卡片：姓名独占一行，电话、高中、归属换到下一行 */
@media (max-width: 720px) {
  body.stu-mode .stu-roster-name .stu-name-button { display: flex; width: max-content; max-width: 100%; }
  body.stu-mode .stu-roster-name > span:first-of-type::before { content: none; }
  /* 「更多」菜单在手机上向上弹出，避免伸出卡片底部 */
  body.stu-mode .stu-roster-table tbody tr .stu-more-menu.stu-more-menu { top: auto; bottom: calc(100% + 6px); }
}

/* ===== 2026-12-04 导航栏：高职提招 / 三位一体 切换 ===== */
header.top nav.tabbar .sys-switch {
  display: inline-flex; flex: 0 0 auto; align-items: center; gap: 2px;
  padding: 3px; margin-right: 10px; border-radius: 999px;
  background: rgba(24, 103, 77, .08); border: 1px solid rgba(24, 103, 77, .16);
}
header.top nav.tabbar .sys-switch .sys-switch-btn {
  height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent;
  color: #3d5a50; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; box-shadow: none;
}
header.top nav.tabbar .sys-switch .sys-switch-btn::after { display: none; }
header.top nav.tabbar .sys-switch .sys-switch-btn[aria-pressed="true"] {
  background: #18674d; color: #fff; box-shadow: 0 2px 6px rgba(24, 103, 77, .25);
}
header.top nav.tabbar .sys-switch .sys-switch-btn[aria-pressed="false"]:hover { background: rgba(24, 103, 77, .12); color: #18674d; }
