:root {
  --navy-950: #071a2e;
  --navy-900: #0b2239;
  --navy-800: #12314f;
  --navy-700: #1b4468;
  --navy-600: #2a5c86;
  --navy-100: #e7eef6;
  --navy-50: #f3f7fb;
  --gold: #b08a3e;
  --gold-soft: #c8a96a;
  --ink: #0e1b2a;
  --muted: #5b6b7d;
  --muted-soft: #7d8b9b;
  --line: #e2e8f0;
  --line-strong: #d3dce7;
  --surface: #ffffff;
  --canvas: #f3f5f8;
  --positive: #0b6b4f;
  --positive-bg: #e9f6f0;
  --negative: #b42318;
  --negative-bg: #fdecea;
  --warning: #8a5a00;
  --warning-bg: #fff6e5;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(15, 35, 58, 0.04), 0 10px 30px -20px rgba(15, 35, 58, 0.2);
  --shadow-float: 0 24px 70px -20px rgba(7, 26, 46, 0.35);
  --font-sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-num: "Segoe UI", "SF Pro Display", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, dt, ul, ol { margin: 0; }
button { font-family: inherit; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--navy-600); outline-offset: 2px; }

/* ------------------------------- 应用外壳 ------------------------------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: linear-gradient(180deg, #071a2b 0%, #061522 100%);
  border-right: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 130, 32, 0.6) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(245, 130, 32, 0.6); border-radius: 999px; }
.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
  flex: 0 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 196px; max-width: 100%; height: auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--navy-900); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; letter-spacing: -0.04em;
  box-shadow: 0 4px 12px -4px rgba(11, 34, 57, 0.45);
  flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand-text span { font-size: 9.5px; color: var(--muted-soft); letter-spacing: 0.1em; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px 10px; flex: 1 1 auto; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(245, 130, 32, 0.5) transparent; }
.nav::-webkit-scrollbar { width: 3px; }
.nav::-webkit-scrollbar-thumb { background: rgba(245, 130, 32, 0.5); border-radius: 999px; }
.nav-section {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5); padding: 12px 10px 4px;
}
.nav-section::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #f58220; flex: 0 0 auto; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid transparent; background: transparent;
  color: rgba(255, 255, 255, 0.8); font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em;
  padding: 6px 10px; border-radius: 7px; cursor: pointer; text-align: left;
  min-height: 35px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active {
  background: #f58220; border-color: #f58220; color: #071a2b; font-weight: 800;
  box-shadow: 0 7px 18px -10px rgba(245, 130, 32, 0.8);
}
.nav-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.nav-icon { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; opacity: 0.82; }
.nav-icon svg { width: 16px; height: 16px; display: block; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-index { font-size: 10px; opacity: 0.42; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
.nav-item.active .nav-index { opacity: 0.68; }
.sidebar-foot {
  margin: 6px 12px 10px; padding: 9px; border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px; background: rgba(255, 255, 255, 0.055);
  display: flex; align-items: flex-start; gap: 8px;
  flex: 0 0 auto;
}
.sidebar-foot-icon {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(245, 130, 32, 0.14); color: #f58220;
  font-size: 11px; font-weight: 800;
}
.sidebar-foot-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.86); text-transform: uppercase; margin-bottom: 3px; }
.sidebar-foot p + p { font-size: 10.5px; line-height: 1.55; color: rgba(255, 255, 255, 0.5); }
.sidebar-scrim { display: none; }

.content { margin-left: 238px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 64px; padding: 0 24px;
  display: flex; align-items: center; gap: 14px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.menu-btn { display: none; }
.topbar-title { font-size: 13px; font-weight: 600; color: var(--muted); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 10px;
  border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--navy-50); border: 1px solid var(--navy-100); color: var(--navy-800);
  font-variant-numeric: tabular-nums;
}
.chip-gold { background: #fffaf0; border-color: #f0dfbd; color: var(--warning); }
.user-menu { position: relative; }
.user-button {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  background: #fff; border-radius: 999px; padding: 3px 10px 3px 3px; cursor: pointer;
}
.avatar {
  width: 27px; height: 27px; border-radius: 50%; background: var(--navy-100);
  color: var(--navy-800); font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.user-name { font-size: 11.5px; font-weight: 600; color: var(--ink); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: #fff;
  border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-float);
  padding: 6px; z-index: 50;
}
.user-dropdown button, .user-dropdown a {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 10px; border-radius: 7px; font-size: 12px; color: var(--ink); cursor: pointer;
}
.user-dropdown button:hover, .user-dropdown a:hover { background: var(--navy-50); text-decoration: none; }
.user-dropdown .danger { color: var(--negative); }
.dropdown-meta { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dropdown-meta strong { display: block; font-size: 12px; }
.dropdown-meta span { display: block; font-size: 10.5px; color: var(--muted-soft); margin-top: 2px; }

.view { flex: 1; padding: 26px 26px 50px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ------------------------------- 页面结构 ------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { font-size: 9.5px; font-weight: 700; letter-spacing: 0.18em; color: var(--gold); text-transform: uppercase; }
.page-title { margin-top: 5px; font-size: 26px; font-weight: 650; letter-spacing: -0.03em; color: var(--navy-950); }
.page-sub { margin-top: 6px; max-width: 720px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 15px; font-weight: 650; color: var(--ink); }
.section-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

/* --------------------------------- 卡片 --------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-head .section-title { font-size: 15px; }
.card-body { padding: 16px 20px 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi-card {
  background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px;
  box-shadow: var(--shadow-card); min-width: 0;
}
.kpi-card.dark { background: linear-gradient(155deg, #12314f 0%, #0b2239 65%, #071a2e 100%); border-color: transparent; color: #fff; }
.kpi-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; color: var(--muted-soft); }
.kpi-card.dark .kpi-label { color: rgba(255, 255, 255, 0.66); }
.kpi-value {
  margin-top: 7px; font-family: var(--font-num); font-size: 22px; font-weight: 650;
  letter-spacing: -0.02em; color: var(--navy-950); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-card.dark .kpi-value { color: #fff; }
.kpi-meta { margin-top: 4px; font-size: 10.5px; color: var(--muted-soft); }
.kpi-card.dark .kpi-meta { color: rgba(255, 255, 255, 0.58); }
.kpi-value.is-negative { color: var(--negative); }
.kpi-card.dark .kpi-value.is-negative { color: #ffc7bd; }
.kpi-value.is-positive { color: var(--positive); }
.kpi-card.dark .kpi-value.is-positive { color: #fff; }

.split-bar { display: flex; height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; }
.split-bar-company { background: var(--navy-800); }
.split-bar-agent { background: var(--gold-soft); }

/* --------------------------------- 表格 --------------------------------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.orders-table { min-width: 1100px; }
.orders-table td:first-child { white-space: nowrap; }
.orders-table td:nth-child(3) { white-space: nowrap; }
.orders-table .actions { gap: 4px; }
.orders-table .btn-sm { padding: 5px 7px; }
.data-table th {
  text-align: left; font-size: 10px; font-weight: 600; letter-spacing: 0.05em;
  color: var(--muted-soft); padding: 9px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: #fbfcfe;
}
.data-table td { padding: 10px; border-bottom: 1px solid #eef2f7; font-size: 12px; color: var(--ink); vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfe; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num, .num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .muted, .muted { color: var(--muted-soft); }
.data-table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.data-table .actions .btn { height: 29px; padding: 0 8px; font-size: 11px; }
.data-table .is-negative { color: var(--negative); }
.data-table .is-positive { color: var(--positive); }
.empty { text-align: center; padding: 30px 12px; color: var(--muted-soft); font-size: 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px;
  border-radius: 999px; font-size: 10px; font-weight: 600; background: #eef2f7; color: #56677a;
  white-space: nowrap;
}
.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--positive-bg); color: var(--positive); }
.badge-red { background: var(--negative-bg); color: var(--negative); }
.badge-amber { background: var(--warning-bg); color: var(--warning); }
.badge-navy { background: var(--navy-50); color: var(--navy-800); }

/* --------------------------------- 按钮 --------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent;
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.06s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-outline { background: #fff; border-color: var(--line-strong); color: var(--navy-800); }
.btn-outline:hover { background: var(--navy-50); border-color: #bfcddd; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2f7; color: var(--navy-800); }
.btn-danger { background: #fff; border-color: #f0cbc7; color: var(--negative); }
.btn-danger:hover { background: var(--negative-bg); }
.btn-sm { height: 31px; padding: 0 9px; font-size: 11px; border-radius: 7px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--navy-50); color: var(--navy-800); }

/* --------------------------------- 表单 --------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 600; color: #26374a; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff;
  color: var(--ink); font-family: var(--font-sans); font-size: 13px; padding: 0 10px; min-height: 40px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { padding: 9px 10px; min-height: 80px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(42, 92, 134, 0.13);
}
.field input[aria-invalid="true"] { border-color: #e2a49e; background: #fffafa; }
.field .hint { font-size: 10.5px; line-height: 1.5; color: var(--muted-soft); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-grid > .field + .field { margin-top: 0; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.form-error { margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: var(--negative-bg); color: var(--negative); font-size: 11.5px; line-height: 1.5; }
.notice { padding: 10px 12px; border-radius: 9px; background: var(--warning-bg); color: var(--warning); font-size: 11.5px; line-height: 1.6; border: 1px solid #f2e2be; }
.notice-blue { background: var(--navy-50); color: var(--navy-800); border-color: var(--navy-100); }
.filter-bar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar .field { min-width: 150px; }
.filter-bar .btn { height: 40px; }
.partner-filter {
  height: 38px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff;
  font-family: inherit; font-size: 12px; color: var(--ink); padding: 0 10px; min-width: 190px;
}
.card-body-tight { padding-top: 12px; }
.field + .field { margin-top: 12px; }
.confirm-text { margin: 0; font-size: 13px; line-height: 1.75; color: #3c4c60; }
.print-sheet { display: none; }
.badge-gray { background: #eef2f7; color: #56677a; }
.pt-12 { padding-top: 12px; }
.mt-18 { margin-top: 18px; }
.readonly-box {
  min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc;
  padding: 9px 10px; font-size: 12px; color: var(--muted);
}
.calc-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.8fr); gap: 16px; align-items: start; }
.calc-result { position: sticky; top: 84px; }
.budget-block { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.budget-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 12px; color: var(--muted); }
.budget-line b { font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.budget-line.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; color: var(--ink); font-weight: 600; }
.budget-line.total b { font-size: 15px; color: var(--navy-900); }
.budget-line.profit { margin-top: 5px; padding: 10px; background: var(--navy-50); border-radius: 8px; color: var(--navy-900); font-weight: 650; }
.budget-line.profit b { font-size: 19px; color: var(--navy-900); }
.budget-line.profit.negative, .budget-line.profit.negative b { color: var(--negative); }
.result-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.result-split > div { background: #f8fafc; border: 1px solid #e8edf4; border-radius: 9px; padding: 10px 12px; }
.result-split span { display: block; font-size: 10px; color: var(--muted-soft); }
.result-split strong { display: block; margin-top: 4px; font-family: var(--font-num); font-size: 16px; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.result-note { margin-top: 10px; font-size: 10.5px; line-height: 1.6; color: var(--muted-soft); }
.teacher-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.teacher-grid > .card + .card { margin-top: 0; }
.teacher-card { margin: 0; }
.teacher-card .card-head { padding: 16px 18px 0; }
.teacher-card .card-body { padding: 12px 18px 16px; }
.teacher-card .section-title { font-size: 16px; }
.teacher-table { min-width: 0; table-layout: fixed; }
.teacher-table th { font-size: 10.5px; padding: 8px 8px; }
.teacher-table td { font-size: 12.5px; padding: 9px 8px; }
.teacher-table th:nth-child(1) { width: 30%; }
.teacher-table th:nth-child(2) { width: 14%; }
.teacher-table th:nth-child(3) { width: 25%; }
.teacher-table th:nth-child(4) { width: 13%; }
.teacher-table th:nth-child(5) { width: 18%; }
.teacher-table:not(.is-admin) th:nth-child(1) { width: 32%; }
.teacher-table:not(.is-admin) th:nth-child(2) { width: 16%; }
.teacher-table:not(.is-admin) th:nth-child(3) { width: 30%; }
.teacher-table:not(.is-admin) th:nth-child(4) { width: 22%; }
.teacher-table .num { font-size: 13px; font-weight: 600; }
.teacher-table .actions { flex-wrap: nowrap; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.split-panel { margin-bottom: 16px; }
.split-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.rate-big { font-family: var(--font-num); font-size: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rate-big strong { font-size: 30px; color: var(--navy-900); font-weight: 650; }
.setting-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eef2f7; font-size: 12px; color: var(--muted); }
.setting-line strong { color: var(--ink); font-weight: 600; }
.hint-block { margin-top: 10px; }
.print-doc { color: var(--ink); }
.print-doc h1 { font-size: 21px; margin-bottom: 4px; }
.print-sub { margin-bottom: 16px; font-size: 10.5px; color: var(--muted-soft); }
.print-h2 { margin-top: 18px; font-size: 13px; }
.print-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.print-table th, .print-table td { border-bottom: 1px solid #dfe5ec; padding: 7px 6px; font-size: 11px; text-align: left; }
.print-table th { background: #f4f7fa; font-size: 10px; color: var(--muted); }
.print-table td:last-child, .print-table th:last-child { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.print-table tr.total td { font-weight: 700; background: #f4f7fa; border-top: 1px solid #c9d3df; }
.print-note { margin-top: 14px; font-size: 9.5px; line-height: 1.7; color: var(--muted-soft); }
.money-input { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; min-height: 40px; padding: 0 10px; }
.money-input:focus-within { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(42, 92, 134, 0.13); }
.money-input input { border: 0; outline: none; flex: 1; min-width: 0; font-family: var(--font-num); font-size: 13.5px; font-weight: 600; color: var(--navy-950); height: 36px; background: transparent; }
.money-input .prefix, .money-input .suffix { font-size: 11px; color: var(--muted-soft); }
.money-input .prefix { margin-right: 5px; }
.money-input .suffix { margin-left: 5px; }
.check-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }

/* --------------------------------- 弹窗 --------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 70; background: rgba(7, 26, 46, 0.46);
  display: flex; align-items: flex-start; justify-content: center; padding: 34px 18px;
  overflow-y: auto;
}
.modal {
  position: relative; width: 100%; max-width: 620px; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-float); margin: auto;
}
.modal.modal-wide { max-width: 880px; }
.modal.modal-sm { max-width: 440px; }
.modal-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line); padding-right: 56px; }
.modal-head h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.modal-head p { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.modal-body { padding: 18px 22px 20px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal-close {
  position: absolute; top: 13px; right: 13px; width: 30px; height: 30px; border: 0;
  background: transparent; border-radius: 7px; font-size: 19px; line-height: 1; color: var(--muted-soft); cursor: pointer;
}
.modal-close:hover { background: #f1f5f9; color: var(--ink); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 20px; padding: 12px 14px; background: #f8fafc; border: 1px solid #e8edf4; border-radius: 10px; }
.detail-grid > div { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; padding: 2px 0; }
.detail-grid dt { color: var(--muted-soft); }
.detail-grid dd { color: var(--ink); font-weight: 600; text-align: right; }
.detail-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.order-profit-card, .order-cost-card { margin-top: 16px; padding: 14px; border: 1px solid #dfe8f3; border-radius: 12px; background: #f7fafc; }
.order-profit-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-profit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.order-profit-item { padding: 10px; border: 1px solid #e6edf5; border-radius: 9px; background: #fff; }
.order-profit-value { margin-top: 4px; font-size: 16px; font-weight: 700; color: var(--ink); }

.course-rule-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.course-calc-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.course-calc-layout > .card { display: flex; flex-direction: column; }
.course-calc-layout > .card > .card-body { display: flex; flex-direction: column; flex: 1; }
.course-calc-layout > .card + .card { margin-top: 0; }
.course-calc-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.course-calc-note { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.course-calc-layout .form-actions { margin-top: auto; padding-top: 16px; }
.course-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.course-result-item { padding: 12px; border: 1px solid #e6edf5; border-radius: 10px; background: #f8fafc; }
.course-result-item span { display: block; color: var(--muted); font-size: 11px; }
.course-result-item strong { display: block; margin-top: 4px; font-size: 20px; color: var(--ink); }
.course-result-item.accent { background: #0b2239; border-color: #0b2239; }
.course-result-item.accent span { color: #b9c9d8; }
.course-result-item.accent strong { color: #fff; }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.filter-tab { border: 1px solid #dce5ef; background: #fff; color: var(--muted); padding: 6px 11px; border-radius: 999px; font-size: 12px; cursor: pointer; }
.filter-tab.active { background: #0b2239; border-color: #0b2239; color: #fff; }
.course-table { min-width: 1080px; }
.progress { width: 100%; height: 8px; accent-color: #2f7d5b; }
.progress-cell { display: flex; align-items: center; gap: 7px; min-width: 130px; }
.progress-cell span { white-space: nowrap; font-size: 11px; color: var(--muted); }
.course-status { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.course-status.green { background: #e8f5ee; color: #1f6d4b; }
.course-status.yellow { background: #fff6d9; color: #936b00; }
.course-status.orange { background: #fff0e2; color: #a85b13; }
.course-status.red { background: #fdecec; color: #b23b3b; }
.course-status.gray { background: #eef2f7; color: #607080; }
.course-detail-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.course-detail-head > div { padding: 10px; border: 1px solid #e6edf5; border-radius: 9px; background: #f8fafc; }
.course-detail-head span { display: block; color: var(--muted); font-size: 11px; }
.course-detail-head strong { display: block; margin: 4px 0; font-size: 15px; color: var(--ink); }
.course-detail-head small { color: var(--muted); font-size: 10px; }
.selection-summary { margin: 0 0 14px; padding: 13px 15px; border: 1px solid #cfe0d8; background: #f1f8f4; border-radius: 12px; }
.selection-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.selection-summary-head strong { font-size: 13px; color: var(--ink); }
.selection-metrics { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.selection-metrics > div { padding: 8px 9px; border-radius: 8px; background: #fff; border: 1px solid #e1eee7; }
.selection-metrics span { display: block; font-size: 10px; color: var(--muted); }
.selection-metrics strong { display: block; margin-top: 3px; font-size: 13px; color: var(--ink); }
.selection-loading { color: var(--muted); font-size: 12px; }
.select-col { width: 30px; text-align: center; }
.select-col input { width: 14px; height: 14px; accent-color: #2f7d5b; }

/* --------------------------------- Toast -------------------------------- */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 36px)); }
.toast {
  padding: 10px 13px; border-radius: 9px; background: var(--navy-900); color: #fff;
  font-size: 12px; line-height: 1.5; box-shadow: 0 14px 34px -14px rgba(7, 26, 46, 0.6);
  animation: toast-in 0.16s ease-out;
}
.toast.error { background: #8f1d14; }
.toast.success { background: #0b5d45; }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --------------------------------- 登录 --------------------------------- */
.login-body { background: #fff; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(440px, 0.95fr); }
.login-aside {
  background: linear-gradient(155deg, #12314f 0%, #0b2239 58%, #071a2e 100%);
  color: #fff; padding: 42px 48px; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.login-aside::after {
  content: ""; position: absolute; right: -120px; top: -100px; width: 380px; height: 380px;
  border: 1px solid rgba(200, 169, 106, 0.25); border-radius: 50%;
}
.brand-light { color: #fff; }
.brand-light .brand-mark { background: #fff; color: var(--navy-900); }
.brand-light .brand-text strong { color: #fff; }
.brand-light .brand-text span { color: rgba(255, 255, 255, 0.5); }
.login-brand .brand-logo { width: 240px; }
.login-aside-copy { margin-top: auto; margin-bottom: auto; padding: 40px 0 30px; position: relative; z-index: 1; }
.eyebrow-light { font-size: 9.5px; font-weight: 700; letter-spacing: 0.2em; color: var(--gold-soft); text-transform: uppercase; }
.login-aside h1 { margin-top: 16px; font-size: clamp(30px, 3vw, 42px); line-height: 1.22; letter-spacing: -0.035em; font-weight: 650; }
.login-aside-copy > p:last-child { margin-top: 16px; max-width: 430px; font-size: 12.5px; line-height: 1.8; color: rgba(255, 255, 255, 0.65); }
.login-points { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 9px; margin-top: 22px; }
.login-points li { position: relative; padding-left: 15px; font-size: 11.5px; color: rgba(255, 255, 255, 0.62); }
.login-points li::before { content: ""; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-soft); }
.login-aside-foot { font-size: 10px; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.35); }
.login-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 28px; background: #fff; }
.login-form-wrap { width: 100%; max-width: 380px; }
.login-form-wrap h2 { margin-top: 8px; font-size: 28px; letter-spacing: -0.03em; font-weight: 650; color: var(--navy-950); }
.login-sub { margin: 8px 0 24px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.login-form-wrap .field + .field { margin-top: 14px; }
.login-form-wrap .btn { margin-top: 20px; height: 44px; }
.login-help { margin-top: 16px; font-size: 10.5px; color: var(--muted-soft); text-align: center; line-height: 1.6; }
.login-copyright { margin-top: 36px; font-size: 10px; color: var(--muted-soft); }

/* ------------------------------- 响应式 -------------------------------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-3 { grid-column: span 2; }
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
  .calc-result { position: static; }
  .teacher-grid { grid-template-columns: minmax(0, 1fr); }
  .split-layout { grid-template-columns: minmax(0, 1fr); }
  .course-calc-layout { grid-template-columns: minmax(0, 1fr); }
  .course-detail-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .teacher-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 950px) {
  .sidebar-foot { display: none; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-float); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(7, 26, 46, 0.4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  .content { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .view { padding: 20px 16px 40px; }
  .login-shell { grid-template-columns: minmax(0, 1fr); }
  .login-aside { display: none; }
  .login-panel { min-height: 100vh; }
}
@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 19px; }
  .page-title { font-size: 22px; }
  .page-head { align-items: flex-start; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2, .form-grid .span-3 { grid-column: auto; }
  .card-head, .card-body, .card-foot { padding-left: 14px; padding-right: 14px; }
  .topbar-title { display: none; }
  .topbar-right .chip-gold { display: none; }
  .modal-overlay { padding: 14px 8px; }
  .modal { border-radius: 13px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .order-profit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-result-grid { grid-template-columns: minmax(0, 1fr); }
  .course-detail-head { grid-template-columns: minmax(0, 1fr); }
  .selection-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-actions .btn { width: 100%; }
  .filter-bar .field { flex: 1 1 140px; }
  .login-panel { padding: 30px 20px; }
}
@media (max-width: 460px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 18px; }
  .topbar { height: 58px; }
  .user-name { display: none; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .sidebar, .topbar, .sidebar-scrim, .page-actions, .filter-bar, .no-print, .toast-stack { display: none !important; }
  .content { margin: 0; }
  .view { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .data-table { min-width: 0; }
  .data-table th, .data-table td { padding: 5px 4px; font-size: 10px; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .kpi-card { box-shadow: none; }
  body.print-mode > *:not(.print-sheet) { display: none !important; }
  body.print-mode .print-sheet { display: block !important; }
}
