/* ══════════════════════════════════════════════════
   续班看板 · 样式
   设计取向：教师每天看 1~2 次，信息优先于装饰。
   浅色主题，深海军蓝主色，数字一律等宽对齐。
   ══════════════════════════════════════════════════ */

:root {
  --bg:        #f3f5f9;
  --bg-deep:   #e9edf4;
  --card:      #ffffff;
  --ink:       #16233a;
  --ink-2:     #55647d;
  --ink-3:     #8a99b0;
  --ink-4:     #aab6c8;
  --line:      #e3e8f1;
  --line-2:    #eef1f7;
  --brand:     #1f4e79;
  --brand-2:   #2b6ca3;
  --brand-ink: #12314f;
  --accent:    #0f9b8e;
  --ok:        #1a7f4b;
  --ok-bg:     #e8f6ee;
  --warn:      #b3730a;
  --warn-bg:   #fdf3e0;
  --danger:    #bf3b2c;
  --danger-bg: #fceceb;
  --shadow-sm: 0 1px 2px rgba(18, 34, 58, .05);
  --shadow-md: 0 4px 16px -4px rgba(18, 34, 58, .10), 0 1px 3px rgba(18, 34, 58, .04);
  --shadow-lg: 0 24px 60px -12px rgba(18, 34, 58, .22);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ══════════════ 登录 ══════════════ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 46% 54%;
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: 40px 52px 34px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background:
    radial-gradient(1200px 600px at 10% 110%, rgba(15, 155, 142, .30), transparent 60%),
    radial-gradient(900px 500px at 100% -10%, rgba(43, 108, 163, .55), transparent 55%),
    linear-gradient(150deg, #0d2338 0%, #14395c 45%, #1c4d78 100%);
  color: #fff;
}

.brand-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 40%, transparent 100%);
  pointer-events: none;
}

.brand-top, .brand-main, .brand-foot { position: relative; z-index: 1; }

.brand-top { display: flex; align-items: center; gap: 12px; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: rgba(255,255,255,.55); letter-spacing: 1.5px; }

.brand-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 24px; }
.brand-main h1 {
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 14px;
  font-weight: 700;
  letter-spacing: -.5px;
}
.brand-desc {
  font-size: 14px;
  color: rgba(255,255,255,.68);
  max-width: 380px;
  margin: 0 0 34px;
  line-height: 1.75;
}

.brand-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.bm {
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 11px 16px;
  min-width: 104px;
  backdrop-filter: blur(6px);
}
.bm-k { font-size: 11px; color: rgba(255,255,255,.5); letter-spacing: .5px; }
.bm-v { font-size: 14px; font-weight: 600; margin-top: 3px; color: #fff; }

.brand-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,.45);
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: #35d39c;
  box-shadow: 0 0 0 3px rgba(53,211,156,.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: .35; }
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 396px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 38px 36px 30px;
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.2px;
}
.login-hint {
  margin: 0 0 26px;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.65;
}

.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fbfcfe;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.field input::placeholder { color: var(--ink-4); }
.field input:focus {
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(43,108,163,.11);
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 58px; }
.pw-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--ink-3);
  padding: 5px 9px;
  border-radius: 6px;
}
.pw-toggle:hover { color: var(--brand); background: var(--line-2); }

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f3d2ce;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.btn-primary {
  width: 100%;
  height: 46px;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, #2a5f8f, #1f4e79);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5px;
  box-shadow: 0 2px 8px rgba(31,78,121,.24), inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform .12s, box-shadow .16s, filter .16s;
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 4px 14px rgba(31,78,121,.3); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.demo-box {
  margin-top: 22px;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}
.demo-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 9px;
  letter-spacing: .3px;
}
.demo-tip { color: var(--ink-4); }
.demo-list { display: flex; flex-wrap: wrap; gap: 7px; }
.demo-item {
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fafbfd;
  color: var(--ink-2);
  transition: .15s;
}
.demo-item:hover { border-color: var(--brand-2); color: var(--brand); background: #f2f7fc; }
.demo-item b { font-weight: 600; }

.login-legal {
  margin-top: 20px;
  font-size: 11.5px;
  color: var(--ink-4);
  line-height: 1.6;
}

/* ══════════════ 顶栏 ══════════════ */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 62px;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }
.logo-mark.small { display: flex; }
.topbar-title { display: flex; align-items: baseline; gap: 8px; }
.t-name { font-size: 15.5px; font-weight: 700; letter-spacing: -.1px; }
.t-org { font-size: 12px; color: var(--ink-3); }

.cycle-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 8px;
  background: #eef4fa;
  border: 1px solid #dbe6f2;
  border-radius: 20px;
  font-size: 12px;
}
.chip-label { color: var(--ink-3); }
.chip-value { color: var(--brand); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.sync-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 13px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfd;
  cursor: default;
}
.sync-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(26,127,75,.12);
  flex: none;
}
.sync-dot.stale { background: var(--warn); box-shadow: 0 0 0 3px rgba(179,115,10,.14); }
.sync-dot.fail  { background: var(--danger); box-shadow: 0 0 0 3px rgba(191,59,44,.14); }
.sync-dot.running { background: var(--brand-2); animation: pulse 1.2s infinite; }

.sync-text { line-height: 1.25; }
.sync-line1 { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sync-line2 { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.btn-ghost {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink-2);
  padding: 7px 12px;
  font-size: 13px;
  transition: .15s;
}
.btn-ghost:hover { border-color: var(--ink-4); color: var(--ink); background: #fbfcfe; }
.icon-btn { padding: 7px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.user-menu { position: relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 9px 4px 4px;
  border-radius: 22px;
  border: 1px solid transparent;
  transition: .15s;
}
.user-btn:hover { background: var(--line-2); border-color: var(--line); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(140deg, #2b6ca3, #1f4e79);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--ink-3); }

.user-drop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 208px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 50;
  animation: dropIn .14s ease-out;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } }
.drop-head { padding: 13px 15px; border-bottom: 1px solid var(--line-2); }
.dh-name { font-size: 13.5px; font-weight: 600; }
.dh-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.drop-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 15px;
  font-size: 13px;
  color: var(--ink-2);
}
.drop-item:hover { background: var(--line-2); color: var(--ink); }
.drop-item.danger { color: var(--danger); border-top: 1px solid var(--line-2); }
.drop-item.danger:hover { background: var(--danger-bg); }

/* ══════════════ Tabs ══════════════ */
.tabs {
  position: sticky;
  top: 62px;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: 12px 15px 13px;
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.tab .tab-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 9px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
  vertical-align: 1px;
}

/* ══════════════ 主体 ══════════════ */
.main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 22px 40px;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 90px 0;
  color: var(--ink-3);
  font-size: 13.5px;
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-2);
}
.card-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .hint {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-3);
}
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.sec-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  margin: 26px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── KPI ── */
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px 15px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand-2);
  opacity: .9;
}
.kpi.ok::before { background: var(--ok); }
.kpi.warn::before { background: var(--warn); }
.kpi.danger::before { background: var(--danger); }
.kpi-label {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.kpi-value .unit { font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.kpi-foot {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
  flex-wrap: wrap;
}
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--ink-3); }

/* ── 主指标卡 ── */
.hero {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fafd 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.ring { position: relative; flex: none; }
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}
.ring-num { font-size: 26px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.ring-cap { font-size: 10.5px; color: var(--ink-3); letter-spacing: .5px; }

.hero-info { flex: 1; min-width: 0; }
.hero-title {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: .4px;
  margin-bottom: 6px;
}
.hero-main {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.5;
}
.hero-main em {
  font-style: normal;
  color: var(--brand);
  font-weight: 700;
}

.progress {
  height: 10px;
  background: #eef2f8;
  border-radius: 6px;
  position: relative;
  overflow: visible;
  margin-bottom: 9px;
}
.progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #2b6ca3, #1f4e79);
  transition: width .6s cubic-bezier(.22,.8,.3,1);
}
.progress-fill.good { background: linear-gradient(90deg, #1c9d63, #157347); }
.progress-fill.risk { background: linear-gradient(90deg, #d98b3a, #b3730a); }
.progress-mark {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--ink-3);
  border-radius: 2px;
}
.progress-mark::after {
  content: attr(data-label);
  position: absolute;
  top: -17px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--ink-3);
  white-space: nowrap;
}
.progress-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ── 表格 ── */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: .3px;
  padding: 10px 14px;
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.tb th.r, table.tb td.r { text-align: right; }
table.tb th.c, table.tb td.c { text-align: center; }
table.tb td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
table.tb tbody tr { transition: background .12s; }
table.tb tbody tr:hover { background: #f8fafd; }
table.tb tbody tr:last-child td { border-bottom: none; }
table.tb td.strong { color: var(--ink); font-weight: 600; }
table.tb td.num { font-variant-numeric: tabular-nums; }
table.tb tr.clickable { cursor: pointer; }

.rate-cell { display: flex; align-items: center; gap: 9px; justify-content: flex-end; }
.rate-bar {
  width: 64px; height: 5px;
  background: #edf1f7;
  border-radius: 3px;
  overflow: hidden;
  flex: none;
}
.rate-bar span { display: block; height: 100%; border-radius: 3px; background: var(--brand-2); }
.rate-bar span.good { background: var(--ok); }
.rate-bar span.risk { background: #d98b3a; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.badge.good { background: var(--ok-bg); color: var(--ok); }
.badge.watch { background: var(--warn-bg); color: var(--warn); }
.badge.risk { background: var(--danger-bg); color: var(--danger); }
.badge.neutral { background: #eef1f7; color: var(--ink-2); }
.badge.info { background: #eaf2fb; color: var(--brand-2); }

.tag-sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ── 空状态 ── */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-3);
  font-size: 13px;
}
.empty svg { display: block; margin: 0 auto 10px; opacity: .35; }

/* ── 图表 ── */
.chart-wrap { padding: 6px 4px 0; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-legend {
  display: flex;
  gap: 16px;
  padding: 0 18px 14px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-line { width: 14px; height: 2px; border-radius: 2px; }
.legend-line.dash { height: 0; border-top: 2px dashed var(--ink-4); }

/* ── 列表 ── */
.mini-list { display: flex; flex-direction: column; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}
.mini-row:last-child { border-bottom: none; }
.mini-row:hover { background: #f8fafd; }
.mini-rank {
  width: 20px; height: 20px;
  border-radius: 5px;
  background: #eef1f7;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.mini-rank.top { background: #1f4e79; color: #fff; }
.mini-name { flex: 1; min-width: 0; color: var(--ink); font-weight: 500; }
.mini-sub { font-size: 11px; color: var(--ink-3); }
.mini-val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.mini-track { width: 96px; height: 4px; background: #edf1f7; border-radius: 2px; overflow: hidden; }
.mini-track span { display: block; height: 100%; background: var(--brand-2); border-radius: 2px; }

/* ── 导出卡 ── */
.export-box { display: flex; flex-direction: column; gap: 12px; }
.export-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fbfcfe;
}
.export-info { min-width: 0; }
.export-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.export-desc { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--brand);
  color: #fff;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: .15s;
  flex: none;
}
.btn-dl:hover { background: var(--brand-2); }
.btn-dl.sec { background: #fff; color: var(--brand); border: 1px solid #cfdff0; }
.btn-dl.sec:hover { background: #f2f7fc; }

/* ── 抽屉 ── */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 30, 50, .34);
  backdrop-filter: blur(1.5px);
  z-index: 60;
  animation: fadeIn .16s;
}
@keyframes fadeIn { from { opacity: 0; } }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(760px, 94vw);
  background: var(--bg);
  z-index: 61;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideIn .22s cubic-bezier(.22,.8,.3,1);
}
@keyframes slideIn { from { transform: translateX(24px); opacity: .4; } }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.drawer-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 30px; }

/* ── 模态 ── */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 30, 50, .38);
  backdrop-filter: blur(2px);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .14s;
}
.modal {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: min(720px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modalIn .18s cubic-bezier(.22,.8,.3,1);
}
@keyframes modalIn { from { transform: translateY(10px) scale(.99); opacity: 0; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-foot:empty { display: none; }

/* ── 表单 ── */
.form-row { margin-bottom: 15px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fbfcfe;
  outline: none;
  transition: .15s;
}
.input:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(43,108,163,.1); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
select.input { padding-right: 30px; }

.btn {
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  transition: .15s;
}
.btn:hover { background: #f8fafd; color: var(--ink); }
.btn.solid { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.solid:hover { background: var(--brand-2); }
.btn.danger { color: var(--danger); border-color: #f0d3cf; }
.btn.danger:hover { background: var(--danger-bg); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── 拖放上传 ── */
.drop-zone {
  border: 1.5px dashed var(--line);
  border-radius: var(--r-md);
  padding: 32px 20px;
  text-align: center;
  background: #fbfcfe;
  transition: .16s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.over {
  border-color: var(--brand-2);
  background: #f3f8fd;
}
.drop-zone .dz-icon { color: var(--ink-4); margin-bottom: 10px; }
.drop-zone .dz-main { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.drop-zone .dz-sub { font-size: 12px; color: var(--ink-3); line-height: 1.6; }

/* ── 统计条 ── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.stat-strip > div { background: #fff; padding: 11px 13px; }
.ss-k { font-size: 11px; color: var(--ink-3); }
.ss-v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ss-v.good { color: var(--ok); }
.ss-v.warn { color: var(--warn); }
.ss-v.danger { color: var(--danger); }

/* ── Toast ── */
.toast-wrap {
  position: fixed;
  top: 74px;
  right: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-2);
  border-radius: var(--r-sm);
  padding: 11px 15px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  color: var(--ink);
  max-width: 360px;
  animation: toastIn .2s cubic-bezier(.22,.8,.3,1);
  line-height: 1.5;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateX(14px); } }

/* ── 空区块 ── */
.note {
  background: #f7fafd;
  border: 1px solid #e2ebf5;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.7;
}
.note b { color: var(--ink); }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.note li { margin-bottom: 3px; }

.kv-grid { display: grid; grid-template-columns: 118px 1fr; gap: 9px 14px; font-size: 13px; }
.kv-k { color: var(--ink-3); }
.kv-v { color: var(--ink); font-weight: 500; }

/* ── 底部 ── */
.foot {
  border-top: 1px solid var(--line);
  padding: 15px 22px;
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  background: #fff;
}
.foot-sep { color: var(--ink-4); }

/* ══════════════ 响应式 ══════════════ */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 26px 34px; min-height: 240px; justify-content: flex-start; gap: 26px; }
  .brand-main { margin-top: 0; }
  .brand-main h1 { font-size: 30px; }
  .brand-desc { margin-bottom: 20px; }
  .login-panel { padding: 26px 18px 44px; }
  .login-card { padding: 28px 24px 24px; box-shadow: none; border: none; background: transparent; }
  .g3 { grid-template-columns: 1fr; }
  .cycle-chip { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 14px; height: 58px; }
  .tabs { top: 58px; padding: 0 10px; }
  .main { padding: 16px 13px 32px; }
  .g4, .g2 { grid-template-columns: 1fr; }
  .kpi { padding: 13px 15px 12px; }
  .kpi-value { font-size: 26px; }
  .kpi-label { margin-bottom: 5px; }
  .sync-pill { padding: 4px 9px; }
  .sync-line2 { display: none; }
  .user-meta { display: none; }
  .hero { flex-direction: column; align-items: stretch; gap: 16px; padding: 16px; }
  .ring { align-self: center; }
  .card-body { padding: 14px; }
  .card-head { padding: 12px 14px; }
  .sec-title { margin: 20px 0 10px; }
  .toast-wrap { left: 13px; right: 13px; top: 66px; }
  .toast { max-width: none; }
  .foot { font-size: 10.5px; padding: 12px 14px; }
}
