:root {
  --bg: #070b12;
  --sidebar: #0c121d;
  --card: #111827;
  --raised: #182234;
  --line: #233146;
  --line-strong: #324461;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-2: #06b6d4;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif; font-size: 13px; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ── 旗舰分栏登录页 ── */
.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
  background: #060a12;
}
.login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 45%, black 35%, transparent 80%);
  pointer-events: none;
}
.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.login-bg-orb--a { width: 420px; height: 420px; top: -120px; left: -80px; background: rgba(37, 99, 235, 0.24); }
.login-bg-orb--b { width: 380px; height: 380px; bottom: -120px; right: -80px; background: rgba(6, 182, 212, 0.18); }

.login-showcase {
  position: relative;
  z-index: 1;
  width: min(940px, 100%);
  min-height: 540px;
  display: grid;
  grid-template-columns: 1.15fr 0.92fr;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
}

.login-promo {
  padding: 38px 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  background: linear-gradient(148deg, #10203a 0%, #0d182b 52%, #0a1220 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.14);
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff; display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
.brand-wordmark { font-size: 19px; font-weight: 750; letter-spacing: -0.02em; color: #fff; }
.brand-wordmark span { color: #38bdf8; }
.brand-pill {
  padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(56, 189, 248, 0.3); color: #7dd3fc;
}
.promo-headline { margin: 22px 0 10px; font-size: 26px; font-weight: 750; letter-spacing: -0.025em; line-height: 1.28; color: #f8fafc; }
.promo-desc { margin: 0; font-size: 13px; line-height: 1.65; color: #94a3b8; }

.promo-features { display: flex; flex-direction: column; gap: 11px; }
.promo-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(148, 163, 184, 0.1);
}
.promo-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(59, 130, 246, 0.15); color: #60a5fa;
}
.promo-item strong { display: block; font-size: 13px; font-weight: 650; color: #f1f5f9; }
.promo-item p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; color: #94a3b8; }

.promo-foot {
  padding-top: 14px; border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8;
}
.status-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2); }

.login-pane {
  padding: 42px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}
.login-pane-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.login-pane-head p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.input-icon-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.input-icon-wrap input {
  width: 100%; height: 42px; padding: 0 38px 0 38px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: rgba(7, 11, 18, 0.72); color: var(--ink);
  font-size: 13.5px; transition: border-color 140ms ease, box-shadow 140ms ease;
}
.input-icon-wrap input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.eye-btn {
  position: absolute; right: 6px; width: 30px; height: 30px; border-radius: 7px; border: 0;
  background: transparent; color: var(--muted); display: grid; place-items: center;
}
.eye-btn:hover { background: rgba(255,255,255,0.06); color: var(--ink); }

/* ── 主控制台布局 ── */
.admin-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.sidebar-brand strong { display: block; font-size: 15px; }
.sidebar-brand small { color: var(--muted); font-size: 11px; }
.nav-list { display: flex; flex-direction: column; gap: 6px; }
.nav-btn { width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 9px; transition: background-color 140ms ease, color 140ms ease; }
.nav-btn:hover { background: var(--raised); color: var(--ink); }
.nav-btn.is-active { background: var(--accent-soft); border-color: rgba(59,130,246,.32); color: #93c5fd; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.sidebar-foot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.admin-badge { padding: 10px 12px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); }
.admin-badge strong { display: block; font-size: 13px; }
.admin-badge small { color: var(--muted); font-size: 11px; }

.main-area { padding: 24px 28px 36px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 20px; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.muted-text { color: var(--muted); font-size: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi-card.is-highlight { border-color: rgba(16,185,129,.35); }
.kpi-card.is-accent { border-color: rgba(59,130,246,.38); }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11.5px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.empty-cell { text-align: center; color: var(--muted); padding: 28px !important; }

.tenants-list { display: flex; flex-direction: column; gap: 12px; }
.tenant-card { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.tenant-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tenant-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tenant-title strong { font-size: 15px; }
.tenant-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tenant-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.grant-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.grant-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.progress-bar { height: 6px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; }

.models-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.model-card { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.model-meta { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.model-meta code { background: var(--card); padding: 2px 6px; border-radius: 5px; color: var(--ink); }
.model-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--raised); border: 1px solid var(--line); color: var(--muted); }
.pill-green { background: var(--green-soft); border-color: rgba(16,185,129,.32); color: var(--green); }
.pill-blue { background: var(--accent-soft); border-color: rgba(59,130,246,.32); color: #93c5fd; }

.btn { height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent; font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: filter 140ms ease, border-color 140ms ease, background-color 140ms ease; }
.btn-lg { height: 42px; font-size: 14px; border-radius: 10px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--raised); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: #475569; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { background: var(--raised); color: var(--ink); }
.btn-danger { background: var(--danger-soft); border-color: rgba(239,68,68,.3); color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,.24); }

.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.field span { color: var(--ink); font-weight: 600; }
.field > input, .field > select { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.field > input:focus, .field > select:focus { outline: none; border-color: var(--accent); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); }
.alert { padding: 10px 12px; border-radius: 9px; background: var(--danger-soft); border: 1px solid rgba(239,68,68,.32); color: #fca5a5; font-size: 12.5px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 999; padding: 11px 16px; border-radius: 10px; background: #1e293b; border: 1px solid var(--accent); color: #fff; box-shadow: 0 14px 36px rgba(0,0,0,.4); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(2,6,14,.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.modal-card { width: min(540px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: 0 28px 72px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 14px; }
.modal-card--sm { width: min(420px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; }
.icon-close { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .login-showcase { grid-template-columns: 1fr; max-width: 440px; }
  .login-promo { display: none; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .form-row { grid-template-columns: 1fr; }
}
