:root {
  --sidebar-width: 232px;
  --bg: #f3efe7;
  --surface: #fbf8f1;
  --panel: #ffffff;
  --ink: #17152e;
  --muted: #6f6872;
  --soft: #f5efe4;
  --line: #ded4c5;
  --line-strong: #bcae9d;
  --primary: #211d43;
  --primary-dark: #17152e;
  --gold: #bd8b34;
  --gold-dark: #8c6424;
  --wine: #a4475d;
  --wine-dark: #783246;
  --sapphire: #365d80;
  --plum: #5a4b85;
  --bronze: #a9693f;
  --safe: #356d80;
  --stable: #5a4b85;
  --reach: #bd8b34;
  --risk: #a4475d;
  --gold-soft: #fbf1d8;
  --wine-soft: #f9e9ee;
  --sapphire-soft: #eaf1f7;
  --plum-soft: #eeebf7;
  --bronze-soft: #f8eade;
  --neutral-soft: #faf6ee;
  --shadow: 0 20px 52px rgba(28, 23, 40, 0.12);
  --shadow-soft: 0 10px 28px rgba(28, 23, 40, 0.08);
  --ring: 0 0 0 3px rgba(189, 139, 52, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0%, rgba(189, 139, 52, 0.18), transparent 30rem),
    linear-gradient(180deg, #2a264c 0, #17152e 52%, #111026 100%),
    var(--primary-dark);
  letter-spacing: 0;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(189, 139, 52, 0.18);
}

button,
input,
select {
  font: inherit;
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(-160%);
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--primary-dark);
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background:
    linear-gradient(180deg, #fffdf8 0, #f4ead8 100%),
    var(--surface);
  pointer-events: none;
  z-index: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  grid-column: 1;
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  min-height: 100vh;
  min-height: 100dvh;
  padding: 22px 16px;
  background:
    linear-gradient(180deg, #fffdf8 0, #f4ead8 100%),
    var(--surface);
  color: var(--primary-dark);
  border-right: 1px solid #d8c8aa;
  box-shadow: 12px 0 34px rgba(31, 26, 43, 0.12);
  z-index: 2;
}

.brand {
  display: block;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(33, 29, 67, 0.14);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 92px;
  object-fit: contain;
}

.brand > div {
  display: none;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: stretch;
}

.nav a {
  color: var(--primary);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.nav-toggle {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 1px solid #d8c292;
  border-radius: 8px;
  background: rgba(255, 247, 228, 0.78);
  color: var(--primary-dark);
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.nav-toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
}

.nav-toggle:hover {
  background: #fff7e4;
  border-color: #caa45d;
}

.nav a::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gold);
}

.nav a:hover,
.nav a.active {
  background: #fff7e4;
  color: var(--primary-dark);
  border-color: #d8c292;
  box-shadow: 0 10px 22px rgba(189, 139, 52, 0.16);
}

.nav-primary {
  font-weight: 800;
}

.nav-group.active-group .nav-primary:not(.active) {
  background: rgba(255, 247, 228, 0.72);
  border-color: rgba(216, 194, 146, 0.72);
  color: var(--primary-dark);
}

.subnav {
  display: grid;
  gap: 6px;
  padding-left: 13px;
  margin-left: 8px;
  border-left: 1px solid rgba(189, 139, 52, 0.3);
}

.nav-group[data-collapsed="true"] .subnav {
  display: none;
}

.nav-group[data-collapsed="true"] .nav-toggle::before {
  transform: rotate(-45deg);
}

.subnav a {
  padding: 8px 10px 8px 12px;
  font-size: 14px;
  color: rgba(33, 29, 67, 0.82);
  background: rgba(255, 250, 240, 0.62);
}

.subnav a::before {
  width: 3px;
  opacity: 0.66;
}

.subnav a:hover,
.subnav a.active {
  background: #fffaf0;
  border-color: #e4d4af;
  box-shadow: 0 6px 14px rgba(189, 139, 52, 0.1);
}

.workspace {
  grid-column: 2;
  min-width: 0;
  padding: 30px clamp(20px, 3vw, 42px) 36px;
  position: relative;
  z-index: 1;
  color: #ffffff;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
  padding: 2px 2px 8px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.25;
  color: #ffffff;
  position: relative;
  text-wrap: balance;
}

.topbar h1::after {
  content: "";
  display: block;
  width: 128px;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--gold);
}

.topbar-copy {
  max-width: 720px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  line-height: 1.8;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status-pill,
.rank-chip {
  padding: 9px 13px;
  border: 1px solid #d5c3a0;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--primary);
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  font-variant-numeric: tabular-nums;
}

#dataStatus {
  display: none !important;
}

.subject-chip {
  color: var(--primary);
  background: var(--gold-soft);
  border-color: #d5c3a0;
}

.panel .eyebrow,
.account-panel .eyebrow {
  color: var(--wine);
}

body.auth-locked .app-shell {
  display: none;
}

.auth-gate {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 42px 22px;
  background: #f3efe7;
  overflow: hidden;
  isolation: isolate;
}

.auth-gate[hidden] {
  display: none !important;
}

.auth-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 460px);
  width: min(980px, 100%);
  min-height: 560px;
  border: 1px solid rgba(216, 200, 170, 0.9);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 26px 80px rgba(23, 21, 46, 0.22);
  overflow: hidden;
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 24px;
  padding: 34px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(248, 241, 228, 0.96)),
    #fffdf8;
  color: var(--ink);
}

.auth-intro h1 {
  max-width: 360px;
  margin: 10px 0 0;
  font-size: 32px;
  line-height: 1.2;
}

.auth-title {
  letter-spacing: 0;
}

.auth-title span {
  display: block;
  color: #a80000;
}

.auth-intro .eyebrow {
  color: var(--wine);
}

.auth-logo {
  display: block;
  width: min(340px, 100%);
  height: auto;
  max-height: 132px;
  margin-bottom: 28px;
  object-fit: contain;
}

.auth-slogan {
  max-width: 410px;
  margin: 18px 0 0;
  color: #5f5868;
  font-size: 14px;
  line-height: 1.9;
}

.auth-data-proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.auth-data-proof div {
  position: relative;
  min-height: 116px;
  padding: 14px 15px;
  border: 1px solid #e1d2ba;
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 0 12px 30px rgba(39, 32, 52, 0.08);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
  animation: authCardFloat 4.8s ease-in-out infinite;
}

.auth-data-proof div:nth-child(2) {
  animation-delay: 0.35s;
}

.auth-data-proof div:nth-child(3) {
  animation-delay: 0.7s;
}

.auth-data-proof div:nth-child(4) {
  animation-delay: 1.05s;
}

.auth-data-proof div:hover {
  transform: translateY(-4px);
  border-color: rgba(220, 38, 38, 0.36);
  box-shadow: 0 18px 42px rgba(220, 38, 38, 0.12);
}

.auth-data-proof strong,
.auth-data-proof span {
  display: block;
}

.auth-data-proof strong {
  color: #dc2626;
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.auth-data-proof span {
  margin-top: 8px;
  color: #5f5868;
  font-size: 12px;
  line-height: 1.55;
}

.auth-status {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.auth-status span {
  width: fit-content;
  padding: 8px 10px;
  border: 1px solid #d8c292;
  border-radius: 8px;
  background: #fff7e4;
  color: var(--primary);
  font-size: 13px;
}

.auth-heat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.auth-heat-strip span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.98), rgba(255, 247, 237, 0.94));
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(220, 38, 38, 0.08);
}

.auth-heat-strip span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.42);
  animation: authHeatPulse 1.7s ease-out infinite;
}

.auth-card {
  align-self: center;
  width: 100%;
  position: relative;
  padding: 34px 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(23, 21, 46, 0.9);
  box-shadow:
    0 28px 70px rgba(23, 21, 46, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #ffffff;
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  overflow: hidden;
  isolation: auto;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 80% 18%, rgba(82, 39, 255, 0.24), transparent 18rem),
    linear-gradient(145deg, rgba(15, 23, 42, 0.32), rgba(23, 37, 84, 0.44));
  pointer-events: none;
}

.auth-video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.05) brightness(0.78);
  pointer-events: none;
}

.auth-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 26% 36%, rgba(219, 234, 254, 0.34), transparent 24rem),
    linear-gradient(90deg, rgba(4, 12, 33, 0.58), rgba(10, 26, 65, 0.28) 48%, rgba(4, 12, 33, 0.62)),
    linear-gradient(180deg, rgba(248, 250, 252, 0.16), rgba(15, 23, 42, 0.28));
  pointer-events: none;
}

.auth-brand,
.auth-tabs,
.auth-form,
.auth-message {
  position: relative;
  z-index: 2;
}

.auth-message:empty {
  display: none;
}

.auth-form input,
.auth-tabs,
.auth-message {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-brand h2 {
  margin: 4px 0 0;
  font-size: 23px;
  line-height: 1.25;
  color: #ffffff;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid rgba(247, 231, 191, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-tabs button,
.auth-form button,
.account-panel button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.auth-tabs button {
  padding: 10px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 700;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.auth-tabs button.active {
  background: #fffdf8;
  color: var(--primary-dark);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.auth-card .eyebrow {
  color: #f2d9a4;
}

.auth-form label {
  color: #ffffff;
}

.auth-form label span {
  color: rgba(255, 255, 255, 0.84);
}

.auth-form input {
  border-color: rgba(247, 231, 191, 0.3);
  background: #fffdf8;
}

.auth-form button.secondary-action {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(247, 231, 191, 0.28);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form[hidden] {
  display: none;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--primary);
  font-weight: 700;
}

.auth-form label span {
  font-size: 13px;
}

.auth-form input {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #d4c8bb;
  border-radius: 8px;
  background: #fffdfa;
  color: var(--ink);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.auth-form input:focus-visible {
  border-color: var(--gold);
  background: #ffffff;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
  align-items: end;
}

.auth-form button {
  min-height: 46px;
  padding: 11px 14px;
  background: var(--wine);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(164, 71, 93, 0.2);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.auth-form button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--wine-dark);
  box-shadow: 0 18px 36px rgba(164, 71, 93, 0.24);
}

.auth-form button.secondary-action {
  background: #fffdf8;
  color: var(--wine);
  border: 1px solid #e5cbd2;
  box-shadow: none;
}

.auth-form button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.auth-message {
  min-height: 24px;
  margin: 18px 0 0;
  padding: 12px;
  border: 1px solid #e4d7c6;
  border-radius: 8px;
  background: #fbf6ee;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-message[data-type="success"] {
  border-color: rgba(53, 109, 128, 0.28);
  background: #edf5f6;
  color: var(--safe);
}

.auth-message[data-type="error"] {
  border-color: rgba(164, 71, 93, 0.26);
  background: #faedf1;
  color: var(--wine-dark);
}

.auth-card .auth-form label {
  color: #ffffff;
}

.auth-card .auth-form label span {
  color: rgba(255, 255, 255, 0.84);
}

.auth-card .auth-form input {
  border-color: rgba(247, 231, 191, 0.3);
  background: #fffdf8;
  color: var(--ink);
}

.auth-card .auth-form input:focus-visible {
  border-color: #f2d9a4;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(247, 231, 191, 0.18);
}

.auth-card .auth-form button.secondary-action {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(247, 231, 191, 0.28);
}

.auth-card .auth-message {
  border-color: rgba(247, 231, 191, 0.26);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
}

.auth-card .auth-message[data-type="success"] {
  border-color: rgba(247, 231, 191, 0.36);
  background: rgba(247, 231, 191, 0.1);
  color: #f7e7bf;
}

.auth-card .auth-message[data-type="error"] {
  border-color: rgba(255, 174, 193, 0.32);
  background: rgba(164, 71, 93, 0.18);
  color: #ffd9e2;
}

.account-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
  padding: 8px;
  border: 1px solid #d5c3a0;
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 0 8px 20px rgba(31, 26, 43, 0.08);
}

.account-panel[hidden] {
  display: none !important;
}

.account-panel span,
.account-panel strong {
  grid-column: 1 / -1;
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
}

.account-panel strong {
  font-size: 13px;
  line-height: 1.2;
}

.account-panel span {
  font-size: 12px;
  line-height: 1.2;
}

.account-panel a,
.account-panel button {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #d8c292;
  border-radius: 7px;
  background: #fff7e4;
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
}

.account-panel a:hover,
.account-panel button:hover {
  background: #f7e7bf;
}

.account-panel a[hidden] {
  display: none !important;
}

.admin-submissions-panel {
  grid-column: 1 / -1;
}

.admin-submissions-panel::before {
  background: var(--wine);
}

.compact-action {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #d8c8aa;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--wine);
  font-weight: 800;
  cursor: pointer;
}

.section {
  margin-bottom: 24px;
  scroll-margin-top: 24px;
}

.section[hidden] {
  display: none !important;
}

.panel {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--primary);
}

.summary-panel::before {
  background: var(--sapphire);
}

.dashboard-grid > .panel:nth-child(2)::before {
  background: var(--gold);
}

.input-panel::before {
  background: var(--wine);
}

#schools.panel::before {
  background: var(--bronze);
}

.data-grid > .panel:nth-child(1)::before {
  background: var(--primary);
}

.data-grid > .panel:nth-child(2)::before {
  background: var(--primary);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fffdfa;
}

.summary-panel .panel-title {
  background: var(--sapphire-soft);
}

.dashboard-grid > .panel:nth-child(2) .panel-title {
  background: var(--gold-soft);
}

.input-panel .panel-title {
  background: var(--wine-soft);
}

#schools.panel .panel-title {
  background: var(--bronze-soft);
}

.data-grid > .panel:nth-child(1) .panel-title {
  background: var(--neutral-soft);
}

.data-grid > .panel:nth-child(2) .panel-title {
  background: var(--neutral-soft);
}

.panel-title h2 {
  margin: 4px 0 0;
  font-size: 19px;
  color: var(--primary-dark);
  text-wrap: balance;
}

.panel-disclaimer {
  align-self: flex-end;
  margin: 0 6px 2px auto;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
  text-align: right;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.data-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.source-overview {
  padding: 18px 18px 12px;
}

.source-overview-head {
  padding: 14px;
  border: 1px solid #ddd1c2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.source-overview-head strong,
.source-overview-head span {
  display: block;
}

.source-overview-head strong {
  color: var(--primary-dark);
  font-size: 16px;
}

.source-overview-head span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.source-year-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.source-year-card {
  min-height: 116px;
  padding: 12px;
  border: 1px solid #ddd1c2;
  border-left: 4px solid var(--sapphire);
  border-radius: 8px;
  background: var(--neutral-soft);
}

.source-year-card strong,
.source-year-card span,
.source-year-card p {
  display: block;
}

.source-year-card strong {
  color: var(--primary-dark);
  font-size: 15px;
}

.source-year-card span {
  margin-top: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.source-year-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.metric {
  min-height: 118px;
  padding: 15px;
  border: 1px solid #ddd1c2;
  border-radius: 8px;
  background: var(--sapphire-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--primary);
}

.metric:nth-child(2)::before {
  background: var(--sapphire);
}

.metric:nth-child(2) {
  background: var(--sapphire-soft);
}

.metric:nth-child(3)::before {
  background: var(--sapphire);
}

.metric:nth-child(3) {
  background: var(--sapphire-soft);
}

.metric:nth-child(4)::before {
  background: var(--sapphire);
}

.metric:nth-child(4) {
  background: var(--sapphire-soft);
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.15;
  color: var(--primary-dark);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.source-panel {
  padding: 0 18px 18px;
}

.source-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0 10px;
  border-top: 1px solid var(--line);
}

.source-panel-title strong,
.source-panel-title span {
  display: block;
}

.source-panel-title strong {
  color: var(--primary-dark);
  font-size: 15px;
}

.source-panel-title span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.empty-state,
.school-info-grid > div {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--neutral-soft);
}

.empty-state strong,
.school-info-grid strong {
  color: var(--primary-dark);
  font-size: 16px;
}

.empty-state span,
.school-info-grid span {
  color: var(--muted);
  line-height: 1.8;
}

.school-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.school-directory {
  display: grid;
  gap: 14px;
}

.school-quick-panel,
.featured-school-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(25, 20, 51, 0.08);
  overflow: hidden;
}

.school-quick-head,
.featured-school-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
}

.school-quick-head strong,
.featured-school-title h3 {
  color: var(--primary-dark);
  font-size: 22px;
  line-height: 1.2;
}

.school-quick-head span,
.featured-school-title > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.school-quick-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px 22px;
}

.school-quick-card {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 94px;
  border: 1px solid #d8c292;
  border-radius: 8px;
  background: #f7f1e5;
  color: var(--primary-dark);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.school-quick-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.school-quick-card strong {
  font-size: 18px;
}

.school-quick-card:hover,
.school-quick-card.active {
  border-color: #b44c68;
  box-shadow: 0 12px 28px rgba(180, 76, 104, 0.16);
  transform: translateY(-1px);
}

.featured-school-panel {
  display: grid;
  gap: 0;
}

.featured-district-block {
  display: grid;
  gap: 14px;
  padding: 18px 20px 22px;
  border-bottom: 1px solid var(--line);
}

.featured-district-block:last-child {
  border-bottom: 0;
}

.featured-district-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.featured-district-head strong {
  color: var(--primary-dark);
  font-size: 18px;
}

.featured-district-head button {
  min-height: 34px;
  border: 1px solid #d8c292;
  border-radius: 999px;
  background: #fffaf0;
  color: #8e3752;
  cursor: pointer;
  font-weight: 800;
  padding: 6px 14px;
}

.featured-school-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.featured-school-card {
  position: relative;
  min-width: 0;
  border: 1px solid #e0d2bd;
  border-radius: 8px;
  background: #fffdf8;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(25, 20, 51, 0.08);
}

.featured-school-image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #f4ecdf, #e8edf5);
  overflow: hidden;
}

.featured-school-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.featured-school-card.image-error .featured-school-image::after {
  content: "图片待替换";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.featured-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.featured-badges span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(25, 20, 51, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.featured-badges span:last-child {
  background: #c8952d;
}

.featured-school-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.featured-school-body h4 {
  color: var(--primary-dark);
  font-size: 17px;
  line-height: 1.45;
}

.featured-school-body p {
  min-height: 42px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.featured-school-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #eadfce;
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.featured-school-meta a {
  color: #8e3752;
  text-decoration: none;
  white-space: nowrap;
}

.directory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.directory-summary > div {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid #dcc89c;
  border-radius: 8px;
  background: #fffaf0;
}

.directory-summary strong {
  color: var(--primary-dark);
  font-size: 28px;
  line-height: 1;
}

.directory-summary span {
  color: var(--muted);
  font-size: 13px;
}

.directory-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
}

.directory-tools input,
.directory-tools select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8cfc1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 700;
  padding: 9px 12px;
}

.directory-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.directory-table {
  min-width: 960px;
}

.directory-table td strong,
.directory-table td span {
  display: block;
}

.alias-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.directory-status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid #d8c292;
  border-radius: 999px;
  background: #fff7e4;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.directory-note {
  color: var(--muted);
  font-size: 13px;
}

.inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  margin-top: 16px;
  padding: 8px 14px;
  border: 1px solid #d8c292;
  border-radius: 8px;
  background: #fff7e4;
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.inline-action:hover {
  background: #f7e7bf;
}

.source-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #ddd1c2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.source-main {
  min-width: 0;
}

.source-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.source-year,
.source-status {
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.source-year {
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.source-status {
  background: var(--neutral-soft);
  color: var(--muted);
}

.source-status.ready {
  background: var(--sapphire-soft);
  color: var(--sapphire);
}

.source-status.review {
  background: var(--wine-soft);
  color: var(--wine-dark);
}

.source-card p {
  margin: 7px 0 4px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.source-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.source-card a {
  white-space: nowrap;
  color: var(--wine);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.source-card a:hover {
  color: var(--wine-dark);
  text-decoration: underline;
}

.todo-list,
.import-slots,
.review-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.todo-list div,
.import-slots div,
.review-list div {
  padding: 13px 14px;
  border: 1px solid #ddd1c2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.todo-list div::before,
.import-slots div::before,
.review-list div::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gold);
}

.todo-list div:nth-child(1) {
  background: var(--gold-soft);
}

.todo-list div:nth-child(2) {
  background: var(--gold-soft);
}

.todo-list div:nth-child(3) {
  background: var(--gold-soft);
}

.todo-list div:nth-child(2)::before,
.import-slots div:nth-child(2)::before,
.review-list div:nth-child(2)::before {
  background: var(--gold);
}

.todo-list div:nth-child(3)::before,
.import-slots div:nth-child(3)::before,
.review-list div:nth-child(3)::before {
  background: var(--gold);
}

.import-slots div:nth-child(1),
.review-list div:nth-child(1) {
  background: var(--neutral-soft);
}

.import-slots div:nth-child(2),
.review-list div:nth-child(2) {
  background: var(--neutral-soft);
}

.import-slots div:nth-child(3),
.review-list div:nth-child(3) {
  background: var(--neutral-soft);
}

.todo-list strong,
.todo-list span,
.import-slots strong,
.import-slots span,
.review-list strong,
.review-list span {
  display: block;
}

.todo-list span,
.import-slots span,
.review-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.input-panel {
  display: grid;
  gap: 0;
  padding-bottom: 0;
  border-color: #dbc7d0;
  position: relative;
}

.input-panel label {
  display: grid;
  gap: 5px;
  padding: 0 12px;
}

.input-panel label span {
  color: #465568;
  font-size: 13px;
  font-weight: 600;
}

.calc-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 12px;
  padding: 14px;
}

.calc-form-grid .field-group {
  margin: 0;
}

.subject-group {
  grid-column: 1 / -1;
}

.subject-group .wide-field {
  grid-column: 1 / -1;
}

.input-panel input,
.input-panel select,
.search {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #b9c8d7;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.input-panel input:focus-visible,
.input-panel select:focus-visible,
.search:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--ring);
}

.switch-row {
  display: grid;
  gap: 8px;
  padding: 0 18px;
}

.switch-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: var(--primary);
  font-weight: 600;
}

.switch-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  padding: 0;
  accent-color: var(--wine);
  box-shadow: none;
}

.inline-switches {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
  margin-top: 4px;
}

.field-group {
  display: grid;
  gap: 8px;
  margin: 2px 18px;
  padding: 12px;
  border: 1px solid #d7cabb;
  border-radius: 8px;
  background: var(--neutral-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.primary-group {
  background: #fff8f6;
  border-color: #e2c1ca;
}

.rank-group {
  background: #fffaf0;
  border-color: #dfc996;
}

.subject-group {
  background: #f8f2fb;
  border-color: #d2c8e6;
}

.field-group strong {
  font-size: 14px;
  color: var(--primary-dark);
  padding-left: 9px;
  border-left: 4px solid var(--primary);
}

.primary-group strong {
  border-left-color: var(--wine);
}

.rank-group strong {
  border-left-color: var(--gold);
}

.subject-group strong {
  border-left-color: var(--plum);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.mini-grid label {
  padding: 0;
  min-width: 0;
}

.mini-grid label span {
  min-height: 22px;
  line-height: 1.35;
}

.field-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.mini-grid select {
  min-height: 38px;
}

.subject-group .mini-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px 14px;
}

.form-actions button {
  flex: 0 0 160px;
  margin: 0;
}

.form-actions .form-note {
  padding: 0;
}

.input-panel button {
  min-height: 44px;
  margin: 2px 18px 0;
  border: 0;
  border-radius: 8px;
  background: var(--wine);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(143, 61, 86, 0.24);
  transition:
    background 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.input-panel button:hover {
  background: var(--wine-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(110, 44, 65, 0.28);
}

.input-panel .secondary-action {
  background: #ffffff;
  color: var(--wine-dark);
  border: 1px solid #d9b6c0;
  box-shadow: none;
}

.input-panel .secondary-action:hover:not(:disabled) {
  background: var(--wine-soft);
  color: var(--wine-dark);
  box-shadow: var(--shadow-soft);
}

.input-panel .secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.form-note {
  margin: 0;
  padding: 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.calculator-guide::before {
  background: var(--gold);
}

.calculator-guide {
  order: -1;
}

.calculator-guide .panel-title {
  background: var(--gold-soft);
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.guide-steps div {
  padding: 14px;
  border: 1px solid #dfc996;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow-soft);
}

.guide-steps strong,
.guide-steps span {
  display: block;
}

.guide-steps strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.guide-steps span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.result-dialog {
  width: min(1420px, calc(100vw - 42px));
  max-height: calc(100vh - 42px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}

.result-dialog::backdrop {
  background: rgba(23, 21, 46, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-frame {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 42px);
  padding: 18px;
  overflow: auto;
  background:
    linear-gradient(180deg, #fffdf8 0, #f4efe7 100%),
    var(--bg);
  box-shadow: 0 28px 80px rgba(18, 14, 32, 0.3);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 4px 2px 2px;
}

.dialog-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
  color: var(--primary-dark);
}

.dialog-close {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #d9b6c0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--wine-dark);
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.dialog-close:hover {
  background: var(--wine-soft);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.result-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-color: #d6c2a3;
  background:
    linear-gradient(135deg, rgba(251, 241, 216, 0.92), rgba(255, 255, 255, 0.96)),
    var(--gold-soft);
}

.result-summary h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.summary-chips {
  display: grid;
  justify-items: end;
  gap: 8px;
}

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

.unified-panel,
.quota-panel {
  min-width: 0;
}

.unified-panel::before {
  background: var(--sapphire);
}

.pathway-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--sapphire-soft);
}

.pathway-head h2 {
  margin: 4px 0 0;
  font-size: 19px;
  color: var(--primary-dark);
}

.quota-panel {
  border-color: #d7cabb;
}

.quota-panel::before {
  background: var(--wine);
}

.quota-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--wine-soft);
}

.quota-head h2 {
  margin: 4px 0 0;
  font-size: 19px;
  color: var(--primary-dark);
}

.quota-badge {
  padding: 6px 10px;
  border: 1px solid #e0b8c4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--wine-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.quota-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px;
}

.quota-summary div {
  padding: 11px;
  border: 1px solid #ddd1c2;
  border-radius: 8px;
  background: #ffffff;
}

.quota-summary strong,
.quota-summary span {
  display: block;
}

.quota-summary strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.quota-summary span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.quota-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 18px 18px;
}

.quota-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 12px;
  padding: 13px 13px 13px 16px;
  border: 1px solid #d7cabb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.quota-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--wine);
}

.quota-card.safe::before {
  background: var(--safe);
}

.quota-card.stable::before {
  background: var(--stable);
}

.quota-card.reach::before {
  background: var(--reach);
}

.quota-card.risk::before {
  background: var(--risk);
}

.quota-card h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.quota-card p {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.quota-card .quota-stage {
  margin: 9px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--primary);
  font-weight: 700;
  line-height: 1.55;
}

.quota-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quota-tags span {
  padding: 4px 7px;
  border: 1px solid #d4c7b8;
  border-radius: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  background: var(--neutral-soft);
}

.quota-score {
  display: grid;
  align-content: center;
  justify-items: center;
  border-left: 1px solid var(--line);
}

.quota-score strong {
  color: var(--wine);
  font-size: 23px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.quota-score span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quota-empty {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid #ddd1c2;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
}

.band-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px;
}

.band-tab {
  padding: 13px 14px;
  border: 1px solid #d6cabb;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.band-tab:nth-child(1) {
  background: #ffffff;
  border-color: var(--line);
}

.band-tab:nth-child(2) {
  background: #ffffff;
  border-color: var(--line);
}

.band-tab:nth-child(3) {
  background: #ffffff;
  border-color: var(--line);
}

.band-tab:nth-child(4) {
  background: #ffffff;
  border-color: var(--line);
}

.band-tab:hover {
  transform: translateY(-1px);
  border-color: #bda574;
  box-shadow: 0 12px 24px rgba(40, 34, 31, 0.12);
}

.band-tab.active {
  border-color: var(--gold);
  box-shadow:
    inset 0 0 0 1px var(--gold),
    0 12px 24px rgba(185, 138, 59, 0.16);
  background: #ffffff;
}

.band-tab strong,
.band-tab span {
  display: block;
}

.band-tab span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.result-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 18px 18px;
}

.school-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 14px;
  padding: 14px 14px 14px 16px;
  border: 1px solid #d7cabb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.school-card.safe-card {
  background: #ffffff;
  border-color: #c6d0df;
}

.school-card.stable-card {
  background: #ffffff;
  border-color: #d2c8e2;
}

.school-card.reach-card {
  background: #ffffff;
  border-color: #e2ca96;
}

.school-card.risk-card {
  background: #ffffff;
  border-color: #e0b8c4;
}

.school-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--primary);
}

.school-card.safe-card::before {
  background: var(--safe);
}

.school-card.stable-card::before {
  background: var(--stable);
}

.school-card.reach-card::before {
  background: var(--reach);
}

.school-card.risk-card::before {
  background: var(--risk);
}

.school-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  color: var(--primary-dark);
  overflow-wrap: anywhere;
}

.school-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.tag {
  padding: 5px 8px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--primary);
  border: 1px solid #d4c7b8;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.reason {
  margin: 0;
  color: #625b66;
  line-height: 1.7;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.school-address {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid #e1d6c8;
  border-radius: 8px;
  background: var(--neutral-soft);
  color: var(--primary);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.chance {
  display: grid;
  align-content: center;
  justify-items: center;
  border-left: 1px solid #d7cabb;
  background: rgba(255, 255, 255, 0.74);
  border-radius: 0 8px 8px 0;
}

.chance strong {
  font-size: 25px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.chance span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  font-weight: 600;
}

.chance.safe strong {
  color: var(--safe);
}

.chance.stable strong {
  color: var(--stable);
}

.chance.reach strong {
  color: var(--reach);
}

.chance.risk strong {
  color: var(--risk);
}

.table-wrap {
  overflow: auto;
  max-height: 560px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #e0d6ca;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.55;
}

th {
  position: sticky;
  top: 0;
  background: var(--gold-soft);
  color: var(--primary);
  z-index: 1;
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background: #fbf8f2;
}

tbody tr:hover {
  background: var(--gold-soft);
}

.search {
  max-width: 280px;
}

.empty-card {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 1380px) {
  .pathway-grid {
    grid-template-columns: 1fr;
  }

  .band-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .featured-school-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .auth-gate {
    background: #f3efe7;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-intro {
    padding: 26px;
  }

  .auth-intro h1 {
    margin-bottom: 0;
    font-size: 30px;
  }

  .auth-status {
    display: flex;
    flex-wrap: wrap;
    margin-top: 24px;
  }

  .auth-data-proof {
    margin-top: 18px;
  }

  .calculator-layout,
  .dashboard-grid,
  .data-grid {
    grid-template-columns: 1fr;
  }

  .calc-form-grid {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: relative;
    top: auto;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-group,
  .rank-group {
    grid-column: 1 / -1;
  }

  .subject-group {
    grid-column: 1 / -1;
  }

  .subject-group .mini-grid,
  .mini-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .result-list {
    grid-template-columns: 1fr;
  }

  .result-dialog {
    width: min(980px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
  }

  .dialog-frame {
    max-height: calc(100vh - 28px);
  }

  .source-list {
    grid-template-columns: 1fr;
  }

  .school-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .featured-school-title,
  .school-quick-head {
    align-items: start;
    flex-direction: column;
  }

  .featured-school-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .school-info-grid {
    grid-template-columns: 1fr;
  }

  .directory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .directory-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell::before {
    display: none;
  }

  .sidebar {
    grid-column: 1;
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    min-height: 0;
  }

  .workspace {
    grid-column: 1;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

  .result-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
  }

  .dialog-frame {
    max-height: calc(100vh - 18px);
    padding: 12px;
  }

  .dialog-head {
    display: grid;
  }

  .topbar,
  .result-summary,
  .panel-title,
  .school-card {
    display: grid;
    gap: 12px;
  }

  .topbar,
  .result-summary,
  .school-card {
    grid-template-columns: 1fr;
  }

  .status-pill,
  .rank-chip {
    white-space: normal;
  }

  .quota-head,
  .quota-card {
    grid-template-columns: 1fr;
  }

  .quota-head {
    display: grid;
  }

  .quota-summary,
  .quota-list {
    grid-template-columns: 1fr;
  }

  .band-tabs {
    padding: 14px;
  }

  .result-list {
    padding: 0 14px 14px;
  }

  .quota-score {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }

  .summary-chips {
    justify-items: stretch;
  }

  .metrics,
  .band-tabs,
  .guide-steps,
  .directory-summary,
  .school-quick-grid,
  .featured-school-grid {
    grid-template-columns: 1fr;
  }

  .school-quick-head,
  .featured-school-title,
  .featured-district-block {
    padding-inline: 14px;
  }

  .featured-district-head {
    align-items: start;
    flex-direction: column;
  }

  .source-year-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-group {
    grid-column: 1 / -1;
  }

  .subnav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-form-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .primary-group,
  .rank-group,
  .subject-group {
    grid-column: 1 / -1;
  }

  .mini-grid,
  .subject-group .mini-grid,
  .inline-switches {
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
    padding: 0 14px 14px;
  }

  .form-actions button {
    width: 100%;
    min-width: 0;
  }

  .chance {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    border-radius: 0 0 8px 8px;
  }
}

/* UI Pro Max CLI redesign layer: education data dashboard */
:root {
  --sidebar-width: 248px;
  --bg: #f8fafc;
  --surface: #ffffff;
  --panel: rgba(255, 255, 255, 0.96);
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #eef4ff;
  --line: #dbeafe;
  --line-strong: #93c5fd;
  --primary: #1e40af;
  --primary-dark: #172554;
  --gold: #d97706;
  --gold-dark: #92400e;
  --wine: #b45309;
  --wine-dark: #78350f;
  --sapphire: #2563eb;
  --plum: #4f46e5;
  --bronze: #d97706;
  --safe: #0369a1;
  --stable: #1e40af;
  --reach: #d97706;
  --risk: #b91c1c;
  --gold-soft: #fff7ed;
  --wine-soft: #ffedd5;
  --sapphire-soft: #eff6ff;
  --plum-soft: #eef2ff;
  --bronze-soft: #fff7ed;
  --neutral-soft: #f8fafc;
  --shadow: 0 22px 60px rgba(15, 23, 42, 0.11);
  --shadow-soft: 0 12px 30px rgba(30, 64, 175, 0.1);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

body {
  background:
    radial-gradient(circle at 16% 0%, rgba(37, 99, 235, 0.16), transparent 30rem),
    radial-gradient(circle at 92% 10%, rgba(217, 119, 6, 0.12), transparent 28rem),
    linear-gradient(180deg, #f8fafc 0%, #eef4ff 48%, #f8fafc 100%);
  color: var(--ink);
}

.app-shell::before,
.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.92)),
    var(--surface);
}

.sidebar {
  border-right: 1px solid rgba(147, 197, 253, 0.52);
  box-shadow: 16px 0 48px rgba(15, 23, 42, 0.08);
}

.brand {
  display: grid;
  gap: 10px;
  padding: 2px 2px 22px;
}

.brand::before {
  content: "导航";
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(30, 64, 175, 0.28);
}

.brand-logo,
.auth-logo {
  display: none !important;
}

.brand > div {
  display: grid;
  gap: 4px;
}

.brand strong {
  color: var(--primary-dark);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav {
  gap: 8px;
}

.nav a,
.nav-toggle,
.account-panel a,
.account-panel button {
  min-height: 44px;
  border-radius: 12px;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.nav a::before {
  width: 3px;
  border-radius: 999px;
  background: var(--gold);
  opacity: 0.9;
}

.nav a:hover,
.nav a.active,
.subnav a:hover,
.subnav a.active,
.nav-group.active-group .nav-primary:not(.active) {
  background: #eff6ff;
  color: var(--primary-dark);
  border-color: #bfdbfe;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.nav a.active {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  border-color: rgba(30, 64, 175, 0.75);
  color: #ffffff;
}

.nav-toggle {
  background: #ffffff;
  border-color: #bfdbfe;
  color: var(--primary);
}

.workspace {
  color: var(--ink);
  padding: 28px clamp(20px, 3vw, 44px) 42px;
}

.topbar {
  align-items: flex-start;
  position: relative;
  min-height: clamp(300px, 36vw, 460px);
  padding: clamp(26px, 4vw, 54px);
  border: 1px solid rgba(147, 197, 253, 0.28);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.84), rgba(30, 64, 175, 0.48) 48%, rgba(15, 23, 42, 0.16)),
    linear-gradient(0deg, rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0.22)),
    url("./assets/generated/education-hero-wide.png") center right / cover no-repeat,
    var(--primary-dark);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  isolation: isolate;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.4));
  z-index: -1;
}

.topbar > div:first-child {
  max-width: 760px;
  position: relative;
  z-index: 1;
  padding-top: clamp(6px, 2vw, 24px);
}

.topbar h1 {
  color: #ffffff;
  font-size: clamp(32px, 4.4vw, 58px);
  letter-spacing: 0;
}

.topbar h1::after {
  width: 148px;
  height: 5px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.topbar-copy {
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
}

.hero-data-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  max-width: 700px;
}

.hero-data-strip span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.34);
  color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
}

.hero-data-strip strong {
  color: #fbbf24;
  font-size: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  color: #d97706;
  letter-spacing: 0.04em;
}

.topbar .eyebrow {
  color: #fbbf24;
}

.section {
  animation: pageReveal 0.34s ease both;
}

.panel,
.school-quick-panel,
.featured-school-panel,
.directory-table-wrap,
.empty-state,
.school-info-grid > div,
.source-year-card,
.source-card,
.metric-card {
  border: 1px solid rgba(147, 197, 253, 0.42);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.panel::before,
.summary-panel::before,
.dashboard-grid > .panel:nth-child(2)::before,
.input-panel::before,
#schools.panel::before,
.data-grid > .panel:nth-child(1)::before,
.data-grid > .panel:nth-child(2)::before {
  height: 4px;
  background: linear-gradient(90deg, #1e40af, #d97706);
}

.panel-title,
.school-quick-head,
.featured-school-title {
  border-bottom-color: rgba(147, 197, 253, 0.42);
  background: linear-gradient(180deg, #eff6ff, #ffffff);
}

.panel-title h2,
.school-quick-head strong,
.featured-school-title h3,
.directory-summary strong,
.featured-district-head strong {
  color: var(--primary-dark);
}

.calc-form-grid,
.field-group,
.directory-summary > div,
.source-year-card,
.featured-school-card {
  border-color: rgba(147, 197, 253, 0.42);
  background: #ffffff;
}

.field-group {
  border-radius: 16px;
}

.field-group::before {
  background: var(--primary);
  border-radius: 999px;
}

.subject-group::before {
  background: var(--plum);
}

.rank-group::before {
  background: var(--gold);
}

input,
select,
.directory-tools input,
.directory-tools select {
  border-color: #bfdbfe;
  border-radius: 12px;
  background: #ffffff;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

input:focus,
select:focus,
.directory-tools input:focus,
.directory-tools select:focus {
  border-color: #2563eb;
  box-shadow: var(--ring);
}

.form-actions button,
.auth-form button,
.modal-actions button,
.account-panel a,
.account-panel button,
.featured-district-head button {
  border-radius: 12px;
}

.form-actions button,
.auth-form button,
.modal-actions button.primary,
.account-panel a,
.account-panel button {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(30, 64, 175, 0.22);
}

.form-actions button:hover,
.auth-form button:hover:not(:disabled),
.modal-actions button:hover,
.account-panel a:hover,
.account-panel button:hover,
.school-quick-card:hover,
.featured-school-card:hover {
  transform: translateY(-2px);
}

.school-quick-card {
  border-color: #bfdbfe;
  border-radius: 18px;
  background: #eff6ff;
}

.school-quick-card.active,
.school-quick-card:hover {
  border-color: #2563eb;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.16);
}

.featured-school-card {
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.featured-school-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.16);
}

.featured-badges span {
  background: rgba(30, 64, 175, 0.92);
}

.featured-badges span:last-child {
  background: #d97706;
}

.data-table th,
th {
  background: #eff6ff;
  color: var(--primary-dark);
}

tbody tr:hover {
  background: #f8fbff;
}

.auth-gate {
  background:
    radial-gradient(circle at 16% 0%, rgba(37, 99, 235, 0.18), transparent 32rem),
    linear-gradient(180deg, #f8fafc, #eaf2ff);
}

.auth-shell {
  border-radius: 28px;
  border-color: rgba(147, 197, 253, 0.45);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 34px 96px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.auth-intro {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.88)),
    #ffffff;
}

.auth-title {
  color: var(--primary-dark);
  font-size: clamp(34px, 4vw, 50px);
}

.auth-card {
  background:
    linear-gradient(145deg, rgba(23, 37, 84, 0.92), rgba(30, 64, 175, 0.82)),
    var(--primary-dark);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 30px 76px rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(18px);
}

.auth-card .eyebrow,
.auth-card h2,
.auth-card .auth-form label span {
  color: #ffffff;
}

.auth-tabs {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.auth-tabs button.active {
  background: #ffffff;
  color: var(--primary-dark);
}

.auth-card .auth-message {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
}

.account-panel {
  border-radius: 18px;
  border-color: rgba(147, 197, 253, 0.58);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
}

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

@keyframes authCardFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes authHeatPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.44);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1080px) {
  .topbar {
    display: grid;
    min-height: 340px;
    border-radius: 22px;
  }

  .school-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

  .topbar {
    min-height: 300px;
    padding: 20px;
    border-radius: 18px;
  }

  .hero-data-strip {
    gap: 8px;
    margin-top: 18px;
  }

  .hero-data-strip span {
    width: 100%;
    justify-content: space-between;
    border-radius: 12px;
  }

  .brand::before {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 16px;
  }

  .brand strong {
    font-size: 20px;
  }
}

/* Sidebar interaction rebuild: compact navigation, no persistent account block */
body.sidebar-collapsed {
  --sidebar-width: 88px;
}

.app-shell {
  transition: grid-template-columns 0.22s ease;
}

.app-shell::before,
.sidebar {
  transition:
    width 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
}

.sidebar {
  overflow: hidden;
  padding: 20px 14px;
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(245, 238, 224, 0.94)),
    var(--surface);
  border-right: 1px solid rgba(217, 119, 6, 0.22);
  box-shadow: 18px 0 50px rgba(15, 23, 42, 0.12);
}

.brand {
  width: 100%;
  min-height: 56px;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid rgba(217, 119, 6, 0.18);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.brand::before {
  content: none !important;
  display: none !important;
}

.brand > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brand strong {
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1.2;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.brand:hover strong {
  color: var(--primary);
}

.nav {
  gap: 9px;
}

.nav-group-head {
  grid-template-columns: 1fr !important;
}

.nav-toggle {
  display: none !important;
}

.nav a {
  min-height: 46px;
  display: flex;
  align-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.96), rgba(255, 255, 255, 0.8));
  border-color: rgba(217, 119, 6, 0.22);
  color: #172554;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.nav a::before {
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  opacity: 0.86;
}

.nav a:hover,
.nav a.active,
.nav-group.active-group .nav-primary:not(.active) {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.98), rgba(239, 246, 255, 0.96));
  border-color: rgba(217, 119, 6, 0.44);
  color: var(--primary-dark);
  box-shadow: 0 14px 30px rgba(217, 119, 6, 0.12);
  transform: translateY(-1px);
}

.nav a.active {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(239, 246, 255, 0.92));
  color: var(--primary-dark);
  border-color: rgba(217, 119, 6, 0.46);
}

.subnav {
  margin: -2px 0 2px 12px;
  padding: 4px 0 4px 13px;
  border-left-color: rgba(30, 64, 175, 0.2);
}

.subnav a {
  min-height: 34px;
  padding: 7px 10px 7px 14px;
  border-radius: 10px;
  background: rgba(239, 246, 255, 0.56);
  border-color: rgba(147, 197, 253, 0.2);
  color: rgba(30, 64, 175, 0.86);
  font-size: 12px;
  font-weight: 750;
  box-shadow: none;
}

.subnav a::before {
  width: 2px;
  background: #93c5fd;
  opacity: 0.72;
}

.subnav a:hover,
.subnav a.active {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.26);
  color: #1d4ed8;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

body.sidebar-collapsed .sidebar {
  padding: 18px 10px;
}

body.sidebar-collapsed .brand {
  display: grid;
  place-items: center;
  min-height: 52px;
  padding-bottom: 16px;
  text-align: center;
}

body.sidebar-collapsed .brand strong {
  font-size: 0;
}

body.sidebar-collapsed .brand strong::after {
  content: "导航";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 40px;
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: 14px;
  background: rgba(255, 247, 237, 0.92);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 900;
}

body.sidebar-collapsed .brand span,
body.sidebar-collapsed .subnav {
  display: none !important;
}

body.sidebar-collapsed .nav {
  gap: 10px;
}

body.sidebar-collapsed .nav a {
  justify-content: center;
  min-height: 52px;
  padding: 8px 6px;
  text-align: center;
  font-size: 0;
}

body.sidebar-collapsed .nav a::before {
  width: 3px;
}

body.sidebar-collapsed .nav a::after {
  content: attr(data-short);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 900;
}

body.sidebar-collapsed .nav-group {
  gap: 0;
}

.sidebar .account-panel {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar .account-panel[hidden] {
  display: none !important;
}

.account-trigger {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(23, 37, 84, 0.94), rgba(30, 64, 175, 0.76)),
    #172554;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.account-trigger:hover {
  background:
    linear-gradient(135deg, rgba(23, 37, 84, 0.98), rgba(37, 99, 235, 0.78)),
    #172554;
  border-color: rgba(191, 219, 254, 0.34);
  transform: translateY(-1px);
}

.account-trigger span,
.account-trigger strong {
  color: inherit;
  line-height: 1.2;
  white-space: nowrap;
}

.account-trigger span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 850;
}

.account-trigger strong {
  font-size: 13px;
  font-weight: 900;
}

.account-actions {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-panel[data-expanded="true"] .account-actions {
  display: grid;
}

.account-actions a,
.account-actions button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 12px;
  background: rgba(23, 37, 84, 0.72);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: none;
}

.account-actions a:hover,
.account-actions button:hover {
  background: rgba(30, 64, 175, 0.78);
  border-color: rgba(191, 219, 254, 0.34);
  transform: translateY(-1px);
}

.account-actions a[hidden] {
  display: none !important;
}

body.sidebar-collapsed .sidebar .account-panel {
  margin-top: auto;
}

body.sidebar-collapsed .account-trigger {
  display: grid;
  place-items: center;
  min-height: 50px;
  padding: 8px 6px;
  text-align: center;
}

body.sidebar-collapsed .account-trigger span,
body.sidebar-collapsed .account-trigger strong,
body.sidebar-collapsed .account-actions {
  display: none !important;
}

body.sidebar-collapsed .account-trigger::after {
  content: "账号";
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.topbar .account-panel {
  position: absolute;
  top: clamp(16px, 2.5vw, 26px);
  right: clamp(16px, 2.5vw, 26px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.34);
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(14px);
}

.topbar .account-panel[hidden] {
  display: none !important;
}

.topbar .account-panel strong,
.topbar .account-panel span {
  grid-column: auto;
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
}

.topbar .account-panel span {
  color: rgba(255, 255, 255, 0.82);
}

.topbar .account-panel a,
.topbar .account-panel button {
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-dark);
  box-shadow: none;
}

.topbar .account-panel a:hover,
.topbar .account-panel button:hover {
  background: #fff7ed;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  body.sidebar-collapsed {
    --sidebar-width: 76px;
  }

  .topbar .account-panel {
    position: static;
    margin-top: 18px;
    align-self: flex-start;
    flex-wrap: wrap;
    border-radius: 16px;
  }
}

/* Auth video background fills the first-screen visual area behind the login panel. */
.auth-gate {
  background: #08152f;
}

.auth-gate > .auth-video-bg,
.auth-gate > .auth-video-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.auth-gate > .auth-video-bg {
  z-index: 0;
}

.auth-gate > .auth-video-overlay {
  z-index: 1;
}

.auth-gate > .auth-shell {
  position: relative;
  z-index: 2;
  border-color: rgba(219, 234, 254, 0.42);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 36px 110px rgba(2, 6, 23, 0.34);
  backdrop-filter: blur(18px) saturate(126%);
  -webkit-backdrop-filter: blur(18px) saturate(126%);
}

.auth-gate .auth-intro {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(239, 246, 255, 0.7)),
    rgba(255, 255, 255, 0.62);
  color: #0f1b3d;
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.auth-gate .auth-title,
.auth-gate .auth-slogan,
.auth-gate .auth-data-proof span {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}

.auth-gate .auth-data-proof div {
  background: rgba(255, 250, 240, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-gate .auth-card {
  border-color: rgba(219, 234, 254, 0.3);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.58), rgba(30, 64, 175, 0.48)),
    rgba(10, 18, 48, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 32px 90px rgba(2, 6, 23, 0.38);
  backdrop-filter: blur(24px) saturate(142%);
  -webkit-backdrop-filter: blur(24px) saturate(142%);
}

.auth-gate .auth-card::before {
  background:
    radial-gradient(circle at 84% 10%, rgba(59, 130, 246, 0.26), transparent 18rem),
    linear-gradient(145deg, rgba(15, 23, 42, 0.14), rgba(30, 64, 175, 0.26));
}

.auth-gate .auth-tabs,
.auth-gate .auth-card .auth-message {
  background: rgba(255, 255, 255, 0.14);
}

.auth-gate .auth-form input {
  border-color: rgba(219, 234, 254, 0.54);
  background: rgba(248, 250, 252, 0.94);
  color: #061334;
}

.auth-gate .auth-form button:not(.secondary-action) {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.34);
}

/* Split the first screen into left text content and a compact right login panel. */
.auth-gate > .auth-shell {
  grid-template-columns: minmax(390px, 0.9fr) minmax(320px, 370px);
  align-items: center;
  gap: clamp(40px, 8vw, 140px);
  width: min(1280px, calc(100% - 48px));
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-gate .auth-intro {
  max-width: 580px;
  padding: 0;
  justify-self: start;
  gap: 16px;
  background: transparent;
  color: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-gate .auth-intro .eyebrow {
  color: #fbbf24;
  text-shadow: 0 2px 18px rgba(2, 6, 23, 0.46);
}

.auth-gate .auth-title {
  max-width: 560px;
  color: #ffffff;
  font-size: clamp(44px, 5.4vw, 72px);
  line-height: 1.04;
  text-shadow: 0 12px 42px rgba(2, 6, 23, 0.52);
}

.auth-gate .auth-title span {
  color: #ffffff;
}

.auth-gate .auth-slogan {
  max-width: 540px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  line-height: 1.82;
  text-shadow: 0 6px 26px rgba(2, 6, 23, 0.48);
}

.auth-gate .auth-heat-strip span {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.36);
  color: #ffffff;
  box-shadow: 0 12px 34px rgba(2, 6, 23, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-gate .auth-heat-strip {
  margin-top: 8px;
}

.auth-gate .auth-data-proof {
  grid-template-columns: 1fr;
  gap: 9px;
  max-width: 520px;
  margin-top: 18px;
}

.auth-gate .auth-data-proof div {
  display: grid;
  grid-template-columns: minmax(96px, max-content) minmax(0, 1fr);
  align-items: baseline;
  gap: 18px;
  min-height: 0;
  padding: 0 0 9px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-gate .auth-data-proof div:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: none;
}

.auth-gate .auth-data-proof strong {
  color: #ef4444;
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1;
  text-shadow: 0 10px 30px rgba(127, 29, 29, 0.34);
}

.auth-gate .auth-data-proof span {
  margin-top: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.62;
  text-shadow: 0 5px 18px rgba(2, 6, 23, 0.46);
}

.auth-gate .auth-card {
  width: min(380px, 100%);
  justify-self: end;
  transform: translate(34px, 28px);
  padding: 28px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.58), rgba(30, 64, 175, 0.42)),
    rgba(10, 18, 48, 0.48);
}

.auth-gate .auth-brand {
  margin-bottom: 18px;
}

.auth-gate .auth-brand h2 {
  font-size: 21px;
}

.auth-gate .auth-tabs {
  margin-bottom: 16px;
}

.auth-gate .auth-form {
  gap: 12px;
}

.auth-gate .auth-form input,
.auth-gate .auth-form button {
  min-height: 44px;
}

@media (max-width: 1080px) {
  .auth-gate > .auth-shell {
    grid-template-columns: 1fr;
    width: min(720px, calc(100% - 32px));
    gap: 28px;
  }

  .auth-gate .auth-card {
    justify-self: stretch;
    width: 100%;
  }
}

@media (max-width: 620px) {
  .auth-gate {
    padding: 28px 16px;
  }

  .auth-gate .auth-title {
    font-size: 40px;
  }

  .auth-gate .auth-data-proof div {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
