/* ─────────────────────────────────────────────────────────────
   保护伞组织 · 卡密分发控制台
   视觉沿用模块 WebUI：黑底 / 保护伞红白 / 扫描线 / 等宽标签
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #070709;
  --bg-deep: #050506;
  --card: #111116;
  --card-2: #0c0c10;
  --line: #26262e;
  --line-soft: #1b1b22;
  --text: #e9e7e2;
  --text-dim: #97969e;
  --text-faint: #5e5d66;
  --red: #c8102e;
  --red-bright: #ff2b3e;
  --red-soft: rgba(200, 16, 46, .16);
  --white: #f1efe9;
  --amber: #d99a3d;
  --ok: #48a57a;
  --radius: 10px;
  --font-ui: -apple-system, "SF Pro Text", "Noto Sans SC", "PingFang SC",
             "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% -8%, rgba(200, 16, 46, .16), transparent 62%),
    radial-gradient(80% 42% at 50% 108%, rgba(200, 16, 46, .07), transparent 70%),
    linear-gradient(180deg, #09090c 0%, #060608 100%);
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: .16;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, .045) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

[hidden] { display: none !important; }

a { color: var(--red-bright); }

.mono { font-family: var(--font-mono); }
.mono--sm { font-size: 11.5px; letter-spacing: .01em; overflow-wrap: anywhere; }
.dim { color: var(--text-faint); }
.ok-text { color: var(--text); display: inline-flex; align-items: center; gap: 7px; }

/* ───────── 通用组件 ───────── */

.card {
  position: relative;
  padding: 16px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 2px;
  background: var(--red);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.card__head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
}

.card__tag {
  font: 8.5px var(--font-mono);
  letter-spacing: .18em;
  color: var(--text-faint);
  white-space: nowrap;
}

.card__tag.is-warn { color: var(--amber); }

.card__hint {
  margin: 11px 0 0;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.card__hint.is-warn { color: var(--amber); }

.card__hint code {
  font: 10px var(--font-mono);
  color: var(--red-bright);
}

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}

.kv:first-of-type { border-top: 0; padding-top: 2px; }

.kv__k { flex: none; font-size: 11.5px; color: var(--text-dim); }

.kv__v { min-width: 0; text-align: right; }

.kv__v strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .015em;
  overflow-wrap: anywhere;
}

.kv__v small {
  display: block;
  margin-top: 3px;
  font: 9.5px var(--font-mono);
  color: var(--text-faint);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 8.5px var(--font-mono);
  letter-spacing: .1em;
  color: var(--text-dim);
  white-space: nowrap;
}

.badge--on {
  color: var(--red-bright);
  border-color: rgba(200, 16, 46, .42);
  background: rgba(200, 16, 46, .08);
}

.badge--off {
  color: var(--amber);
  border-color: rgba(217, 154, 61, .38);
  background: rgba(217, 154, 61, .07);
}

.badge--ok {
  color: var(--white);
  border-color: rgba(200, 16, 46, .38);
  background: rgba(200, 16, 46, .06);
}

.badge--fail {
  color: var(--amber);
  border-color: rgba(217, 154, 61, .38);
  background: rgba(217, 154, 61, .07);
}

.notice {
  margin: 12px 0;
  padding: 9px 11px;
  border: 1px solid rgba(217, 154, 61, .35);
  border-left: 2px solid var(--amber);
  border-radius: 4px;
  background: rgba(217, 154, 61, .06);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--amber);
}

/* ───────── 按钮 / 表单 ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, opacity .2s, border-color .2s, background .2s;
}

.btn:active { transform: translateY(1px); }

.btn:disabled { opacity: .5; cursor: default; }

.btn--primary {
  width: 100%;
  background: linear-gradient(180deg, #d4142f 0%, #a30c22 100%);
  border-color: #e0213b;
  color: #fff;
  letter-spacing: .08em;
  box-shadow: 0 8px 24px -8px rgba(200, 16, 46, .65), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 12px;
}

.btn--ghost:hover { border-color: #3a3a44; color: var(--text); }

.btn--small { font-size: 10.5px; padding: 7px 11px; }

.btn--xs { font-size: 9.5px; padding: 5px 8px; border-radius: 5px; letter-spacing: .02em; }

.btn--auto { width: auto; }

.btn--ghost.is-danger { color: var(--amber); border-color: rgba(217, 154, 61, .28); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}

.icon-btn:hover { border-color: var(--red); color: var(--red-bright); }

.icon-btn svg { width: 15px; height: 15px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field + .field { margin-top: 12px; }

.field > span {
  font-size: 9.5px;
  color: var(--text-dim);
  letter-spacing: .04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field input,
.field select,
.select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0a0d;
  color: var(--text);
  font: 11.5px var(--font-mono);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.field input::placeholder { color: #48474f; font-family: var(--font-ui); }

.field input:focus,
.field select:focus,
.select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(200, 16, 46, .22);
}

.select {
  width: auto;
  min-width: 126px;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-dim);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

/* ───────── 认证页 ───────── */

.auth {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth__inner { width: 100%; max-width: 372px; }

.auth__brand { text-align: center; margin-bottom: 20px; }

.auth__brand h1 {
  margin: 10px 0 5px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .1em;
}

.auth__brand p {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--text-dim);
}

.auth__card { padding: 20px; margin-bottom: 0; }

.auth__card .btn--primary { margin-top: 16px; }

.hero__code {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 10.5px var(--font-ui);
  letter-spacing: .14em;
  color: var(--text-dim);
}

.hero__code i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 9px var(--red-bright);
  animation: dotPulse 2.4s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.logo {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}

.logo--sm { width: 88px; height: 88px; }

.logo--xs { width: 42px; height: 42px; margin: 0; flex: none; }

.logo svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 18px rgba(200, 16, 46, .35));
}

.logo__ring {
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(200, 16, 46, .22);
  border-radius: 50%;
  animation: ringPulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

.logo--xs .logo__ring { inset: -4px; }

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: .45; }
  50% { transform: scale(1.04); opacity: 1; }
}

.footnote {
  margin: 18px 0 0;
  text-align: center;
  font: 8.5px var(--font-mono);
  letter-spacing: .24em;
  color: #414047;
}

/* ───────── 后台框架 ───────── */

.shell { position: relative; z-index: 1; min-height: 100dvh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 238px;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0a0a0e 0%, #060608 100%);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px 18px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
}

.sidebar__name { min-width: 0; }

.sidebar__name strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__name small {
  display: block;
  margin-top: 3px;
  font: 7.5px var(--font-mono);
  letter-spacing: .2em;
  color: var(--text-faint);
}

.nav { flex: 1; min-height: 0; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 11px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}

.nav__item svg { width: 16px; height: 16px; flex: none; }

.nav__idx {
  width: 15px;
  font: 8px var(--font-mono);
  letter-spacing: .08em;
  color: var(--text-faint);
}

.nav__item:hover { background: rgba(255, 255, 255, .025); color: var(--text); }

.nav__item.is-active {
  background: rgba(200, 16, 46, .09);
  border-color: rgba(200, 16, 46, .36);
  color: #fff;
}

.nav__item.is-active .nav__idx { color: var(--red-bright); }

.sidebar__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 6px 2px;
  border-top: 1px solid var(--line-soft);
  font: 8.5px var(--font-mono);
  letter-spacing: .12em;
  color: var(--text-faint);
}

.main {
  margin-left: 238px;
  padding: 26px 30px 56px;
  max-width: 1380px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-head__idx {
  font: 8.5px var(--font-mono);
  letter-spacing: .26em;
  color: var(--red-bright);
  opacity: .85;
}

.topbar h1 {
  margin: 5px 0 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: .07em;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font: 9px var(--font-mono);
  letter-spacing: .1em;
  color: var(--text-dim);
}

.status-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 8px var(--red-bright);
  animation: dotPulse 2.4s ease-in-out infinite;
}

.admin-chip {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font: 10px var(--font-mono);
  color: var(--text-dim);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view { display: none; }

.view.is-active { display: block; animation: fadeUp .28s ease both; }

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

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 10px var(--red-bright);
  animation: dotPulse 2s ease-in-out infinite;
}

/* ───────── 概览 ───────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 13px;
}

.stat { padding: 15px 16px 14px; margin-bottom: 0; }

.stat__label {
  font: 8.5px var(--font-mono);
  letter-spacing: .22em;
  color: var(--text-faint);
}

.stat strong {
  display: block;
  margin: 9px 0 5px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--text);
  line-height: 1;
}

.stat small { font-size: 9.5px; color: var(--text-dim); }

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

.grid-2 > .card { margin-bottom: 13px; }

.chart {
  display: flex;
  align-items: stretch;
  gap: 8px;
  height: 150px;
  padding-top: 6px;
}

.chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chart__bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 100%;
}

.chart__bar {
  width: 10px;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--red-bright), #a30c22);
  box-shadow: 0 0 10px -2px rgba(255, 43, 62, .55);
  transition: height .3s ease;
}

.chart__bar--fail {
  background: linear-gradient(180deg, var(--amber), #8c6124);
  box-shadow: none;
  opacity: .8;
}

.chart__col span {
  font: 8px var(--font-mono);
  color: var(--text-faint);
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 9.5px;
  color: var(--text-dim);
}

.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  display: inline-block;
}

.dot--ok { background: var(--red-bright); }
.dot--fail { background: var(--amber); }

.mini {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}

.mini:first-child { border-top: 0; padding-top: 2px; }

.mini__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
  background: var(--red-bright);
  box-shadow: 0 0 7px rgba(255, 43, 62, .5);
}

.mini__dot.is-fail { background: var(--amber); box-shadow: 0 0 7px rgba(217, 154, 61, .5); }

.mini__body { flex: 1; min-width: 0; }

.mini__body strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini__body small {
  display: block;
  margin-top: 2px;
  font: 9px var(--font-mono);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini time {
  font: 8.5px var(--font-mono);
  color: var(--text-faint);
  white-space: nowrap;
  flex: none;
}

/* ───────── 工具栏 / 搜索 ───────── */

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  margin-bottom: 13px;
  flex-wrap: wrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0a0a0d;
  transition: border-color .18s;
}

.search:focus-within { border-color: var(--red); }

.search svg { flex: none; width: 14px; height: 14px; color: var(--text-faint); }

.search input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 11.5px var(--font-ui);
  outline: none;
}

.search input::placeholder { color: var(--text-faint); }

/* ───────── 表格 ───────── */

.table-card { padding: 0; overflow: hidden; }

.table-wrap { overflow-x: auto; }

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

.table th {
  padding: 11px 14px;
  text-align: left;
  font: 8px var(--font-mono);
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--text-faint);
  background: rgba(255, 255, 255, .015);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table th.th-right { text-align: right; }

.table td {
  padding: 11px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  vertical-align: middle;
}

.table tbody tr:first-child td { border-top: 0; }

.table tbody tr:hover { background: rgba(255, 255, 255, .018); }

.table td .mono { font-size: 10.5px; color: var(--text-dim); }

.cell-sub {
  display: block;
  margin-top: 3px;
  font: 8.5px var(--font-mono);
  color: var(--text-faint);
  overflow-wrap: anywhere;
}

.link-code {
  padding: 0;
  border: 0;
  background: none;
  font: 11px var(--font-mono);
  letter-spacing: .02em;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.link-code:hover { color: var(--red-bright); }

.row-actions {
  text-align: right;
  white-space: nowrap;
}

.row-actions .btn { margin-left: 4px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  font: 9.5px var(--font-mono);
  color: var(--text-dim);
  flex-wrap: wrap;
}

.pager__btns { display: flex; gap: 6px; }

.pager button {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font: 9.5px var(--font-mono);
  cursor: pointer;
}

.pager button:hover:not(:disabled) { border-color: var(--red); color: var(--red-bright); }

.pager button:disabled { opacity: .35; cursor: default; }

.empty {
  padding: 30px 12px;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-faint);
}

.empty b {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ───────── 设置页 ───────── */

.code-box {
  margin-top: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0a0d;
  font: 10.5px var(--font-mono);
  line-height: 1.6;
  color: var(--text-dim);
  word-break: break-all;
  overflow-wrap: anywhere;
}

.code-box--secret { color: var(--text-faint); letter-spacing: .08em; }

.code-block {
  margin: 12px 0 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0a0d;
  font: 9.5px/1.7 var(--font-mono);
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.req-headers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* ───────── 弹窗 / 提示 ───────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 3, 5, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 101;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 28px));
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  animation: modalIn .2s ease both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.modal__head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
}

.modal__body {
  padding: 16px;
  overflow-y: auto;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text-dim);
}

.modal__body strong { color: var(--text); }

.modal__text { margin: 0; }

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
}

.modal__foot .btn { width: auto; }

.codes-box {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0a0d;
  color: var(--text);
  font: 10.5px/1.8 var(--font-mono);
  resize: vertical;
  outline: none;
}

.codes-box:focus { border-color: var(--red); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 200;
  transform: translate(-50%, 14px);
  max-width: calc(100vw - 40px);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--red);
  border-radius: 7px;
  background: rgba(14, 14, 18, .96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  font-size: 11.5px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.toast.is-error { border-left-color: var(--amber); color: var(--amber); }

/* ───────── 响应式 ───────── */

@media (max-width: 1120px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 14px 16px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar__brand {
    padding: 0 0 12px;
    margin-bottom: 10px;
  }

  .nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar { display: none; }

  .nav__item {
    width: auto;
    margin: 0;
    padding: 8px 10px;
    white-space: nowrap;
    font-size: 11.5px;
  }

  .nav__idx { display: none; }

  .sidebar__foot { display: none; }

  .main { margin-left: 0; padding: 18px 16px 44px; max-width: none; }

  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; }

  .topbar__right { justify-content: flex-start; }

  .stat-grid { gap: 9px; }
}

@media (max-width: 620px) {
  .stat-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .toolbar { gap: 7px; }
  .search { min-width: 100%; }
  .select { flex: 1; }
  .auth__brand h1 { font-size: 24px; }
  .table { min-width: 820px; }
  .modal { width: calc(100vw - 24px); }
}
