/* =========================================================================
   TANK 中转站 · 设计系统 v2
   深色分层 + 单一主色（蓝）+ 发丝边。所有页面只认这套 token。
   ========================================================================= */

:root {
  /* 底：带蓝相的深色，不用纯黑；三层可辨 */
  --bg: #080a0f;
  --bg-2: #0a0e15;
  --surface: #10151f;
  --surface-2: #151b27;
  --surface-3: #1b2331;
  --surface-4: #222b3b;

  /* 描边：发丝级，半透明 */
  --line: rgba(255, 255, 255, 0.07);
  --line-soft: rgba(255, 255, 255, 0.045);
  --line-strong: rgba(255, 255, 255, 0.13);

  /* 文字：正文对比度宁高勿低 */
  --text: #eaf0f9;
  --text-2: #a3b1c4;
  --text-3: #7b8a9f;

  /* 品牌：只留一处主色 */
  --brand: #3b82f6;
  --brand-2: #60a5fa;
  --brand-deep: #1d4ed8;
  --brand-soft: rgba(59, 130, 246, 0.13);
  --ok: #22c58b;
  --warn: #f0a72c;
  --bad: #f05466;
  --ok-soft: rgba(34, 197, 139, 0.12);
  --warn-soft: rgba(240, 167, 44, 0.12);
  --bad-soft: rgba(240, 84, 102, 0.12);

  /* 间距刻度：4 的倍数 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  --r1: 8px;
  --r2: 10px;
  --r3: 14px;
  --r4: 18px;
  --r5: 22px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 12px 32px -12px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-3: 0 32px 80px -24px rgba(0, 0, 0, 0.8), 0 8px 20px rgba(0, 0, 0, 0.35);

  --ease-out: cubic-bezier(0.2, 0.9, 0.3, 1.1);
  --ease-move: cubic-bezier(0.32, 0.72, 0, 1);

  --rail: 236px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB',
    'Noto Sans SC', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 背景：大而模糊的光晕 + 极淡噪点，避免死黑和色带 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(880px 520px at 8% -12%, rgba(59, 130, 246, 0.16), transparent 62%),
    radial-gradient(680px 420px at 96% 0%, rgba(37, 99, 235, 0.1), transparent 64%),
    radial-gradient(900px 700px at 60% 115%, rgba(15, 23, 42, 0.6), transparent 70%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--brand-2);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

::selection {
  background: rgba(59, 130, 246, 0.4);
  color: #fff;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.11);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
  background-clip: padding-box;
}

/* ---------- 焦点：必须看得见 ---------- */
:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 6px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* =========================================================================
   骨架：左栏 + 主区
   ========================================================================= */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 20, 30, 0.82), rgba(8, 10, 15, 0.55));
  backdrop-filter: blur(16px) saturate(120%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 26px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #4f93ff, #1d5fe0);
  box-shadow: 0 8px 20px -8px rgba(59, 130, 246, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.brand-text {
  min-width: 0;
}
.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.25;
}
.brand-sub {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-label {
  padding: 18px 12px 8px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.16s var(--ease-move), color 0.16s var(--ease-move), border-color 0.16s;
  user-select: none;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.055));
  border-color: rgba(59, 130, 246, 0.26);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 11px;
  bottom: 11px;
  width: 2.5px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #7db4ff, var(--brand));
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}
.nav-item svg {
  flex: none;
  opacity: 0.85;
}
.nav-item.active svg {
  opacity: 1;
}

.rail-foot {
  margin-top: auto;
  padding: 14px 6px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #dbeafe;
  background: linear-gradient(145deg, #24324a, #182132);
  border: 1px solid var(--line-strong);
}
.who {
  min-width: 0;
  line-height: 1.3;
  flex: 1;
}
.who-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who-role {
  font-size: 10.5px;
  color: var(--text-3);
}

/* =========================================================================
   主区
   ========================================================================= */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 58px;
  padding: 0 clamp(18px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 15, 0.7);
  backdrop-filter: blur(16px) saturate(140%);
}
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  min-width: 0;
}
.crumb-root {
  white-space: nowrap;
}
.crumb svg {
  opacity: 0.55;
}
.crumb-now {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 139, 0.15);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.content {
  padding: clamp(20px, 3vw, 36px) clamp(18px, 3vw, 40px) 64px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  animation: rise 0.34s var(--ease-move) both;
}

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

.page-head {
  margin-bottom: var(--s6);
}
.page-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 10px;
}
.eyebrow::before {
  content: '';
  width: 14px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.8;
}
h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.2;
  font-weight: 660;
  letter-spacing: -0.02em;
}
.page-sub {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.65;
  max-width: 66ch;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================================
   卡片：双层壳体（外壳 1px 渐变边 + 内核底色）
   ========================================================================= */
.card {
  position: relative;
  border-radius: var(--r4);
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px -28px rgba(0, 0, 0, 0.9);
}
.card-inner {
  border-radius: calc(var(--r4) - 1px);
  background: linear-gradient(180deg, #151b27 0%, #10151f 58%, #0f141d 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 1px 0 rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent);
}
.card-title {
  font-size: 14.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.card-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.5;
}
.card-body {
  padding: 22px;
}
.card-body.tight {
  padding: 12px 0;
}
.card-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
  font-size: 12px;
  color: var(--text-3);
}

/* 统计卡：第一张为主卡，数字用等宽、更大；其余是次级指标 */
.stat-grid {
  display: grid;
  grid-template-columns: 1.42fr 1fr 1fr 1fr;
  gap: 14px;
}
.stat {
  position: relative;
  overflow: hidden;
  padding: 17px 20px 18px;
  border-radius: var(--r3);
  background: linear-gradient(165deg, #151b27 0%, #111722 62%, #10151f 100%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s, transform 0.2s var(--ease-move);
}
.stat:hover {
  border-color: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}
.stat::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.14), transparent 70%);
  pointer-events: none;
}
.stat.feature {
  background: linear-gradient(150deg, rgba(59, 130, 246, 0.18) 0%, #151b27 46%, #10151f 100%);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 34px -24px rgba(37, 99, 235, 0.85);
}
.stat.feature::after {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.28), transparent 70%);
  top: -60px;
  right: -30px;
  width: 180px;
  height: 180px;
}
.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-icon {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
}
.stat.feature .stat-icon {
  color: #a9cbff;
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.28);
}
.stat-value {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #f2f6fd;
}
.stat.feature .stat-value {
  font-size: 40px;
  font-weight: 620;
  color: #fff;
  margin-top: 12px;
}
.stat-value small {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}
.stat-foot {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.stat.feature .stat-foot {
  padding-right: 86px;
}
.stat-side {
  position: absolute;
  right: 20px;
  bottom: 19px;
  text-align: right;
  line-height: 1.2;
}
.stat-side .v {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-side .k {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.delta.up {
  color: #4ade9f;
  background: rgba(34, 197, 139, 0.1);
}
.delta.down {
  color: #ff8f9c;
  background: rgba(240, 84, 102, 0.1);
}
.delta.flat {
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.05);
}

/* =========================================================================
   按钮
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.12s, opacity 0.15s, box-shadow 0.15s;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.19);
}
.btn:active {
  transform: scale(0.985);
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: linear-gradient(180deg, #4a8dff, #2563eb);
  border-color: rgba(147, 197, 253, 0.32);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(37, 99, 235, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #5b98ff, #2f6cf0);
  border-color: rgba(191, 219, 254, 0.45);
}
.btn-danger {
  color: #ff9aa5;
  border-color: rgba(240, 84, 102, 0.32);
  background: rgba(240, 84, 102, 0.09);
}
.btn-danger:hover {
  background: rgba(240, 84, 102, 0.17);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: transparent;
}
.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
  gap: 5px;
}
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 9px;
}
.btn-sm.btn-icon {
  width: 28px;
  height: 28px;
}
.btn-block {
  width: 100%;
}

.spin {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  flex: none;
}
.spin.dark {
  border-color: rgba(59, 130, 246, 0.25);
  border-top-color: var(--brand-2);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================================
   表单
   ========================================================================= */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field-label {
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 550;
  display: flex;
  align-items: center;
  gap: 5px;
}
.field-hint {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.55;
}
.input,
.select,
.textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.26);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
  min-width: 0;
}
.input::placeholder,
.textarea::placeholder {
  color: #5b6a80;
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
.textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3b1c4' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.select option {
  background: #10151f;
  color: var(--text);
}
.input-error {
  border-color: var(--bad) !important;
}
.err-text {
  font-size: 12px;
  color: #ff9aa5;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.5;
}
.checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.check-row label {
  font-size: 13px;
  cursor: pointer;
  min-width: 0;
}
.check-row .field-hint {
  margin-top: 2px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grid-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid .span-2 {
  grid-column: span 2;
}

/* 开关 */
.switch {
  position: relative;
  width: 40px;
  height: 24px;
  flex: none;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.09);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #93a1b5;
  transition: transform 0.22s var(--ease-out), background 0.2s;
}
.switch[aria-checked='true'] {
  background: linear-gradient(180deg, #4a8dff, #2563eb);
  border-color: rgba(96, 165, 250, 0.55);
}
.switch[aria-checked='true']::after {
  transform: translateX(16px);
  background: #fff;
}
.switch-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
}

/* =========================================================================
   表格
   ========================================================================= */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #71809a;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: rgba(16, 21, 31, 0.92);
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(6px);
}
.tbl th:first-child,
.tbl td:first-child {
  padding-left: 20px;
}
.tbl th:last-child,
.tbl td:last-child {
  padding-right: 20px;
}
.tbl td {
  height: 48px;
  padding: 9px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: middle;
}
.tbl .badge,
.tbl .chip {
  vertical-align: middle;
}
.tbl .chip {
  height: 21px;
}
.tbl tbody tr {
  transition: background 0.14s;
}
.tbl tbody tr:hover {
  background: rgba(255, 255, 255, 0.024);
}
.tbl tbody tr:last-child td {
  border-bottom: none;
}
.tbl .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  text-align: right;
  white-space: nowrap;
}
.tbl .mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: -0.01em;
}
.tbl .shrink {
  width: 1%;
  white-space: nowrap;
}
.tbl .actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}
.row-clickable {
  cursor: pointer;
}
.row-clickable:focus-visible {
  outline-offset: -2px;
}
.table-note {
  padding: 10px 16px;
  font-size: 11.5px;
  color: var(--text-3);
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.12);
}
/* 展开的日志详情 */
tr.detail-row > td {
  height: auto;
  padding: 0;
  background: rgba(0, 0, 0, 0.22);
}
.detail-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px 24px;
  padding: 15px 22px 17px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.detail-box .k {
  color: var(--text-3);
  font-size: 11px;
  margin-bottom: 1px;
}
.detail-box .v {
  color: var(--text-2);
  word-break: break-all;
}
.detail-box .err {
  grid-column: 1 / -1;
  color: #ff9aa5;
  line-height: 1.6;
  background: rgba(240, 84, 102, 0.07);
  border: 1px solid rgba(240, 84, 102, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
}

/* =========================================================================
   徽标 / 状态
   ========================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  border: 1px solid transparent;
  vertical-align: middle;
}
.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge-ok {
  color: #4ee0aa;
  background: var(--ok-soft);
  border-color: rgba(34, 197, 139, 0.24);
}
.badge-warn {
  color: #ffc766;
  background: var(--warn-soft);
  border-color: rgba(240, 167, 44, 0.24);
}
.badge-bad {
  color: #ff94a0;
  background: var(--bad-soft);
  border-color: rgba(240, 84, 102, 0.24);
}
.badge-mute {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line);
}
.badge-brand {
  color: #9ec5ff;
  background: var(--brand-soft);
  border-color: rgba(59, 130, 246, 0.28);
}

/* 模型/标签胶囊 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-brand {
  background: var(--brand-soft);
  border-color: rgba(59, 130, 246, 0.26);
  color: #a9cbff;
}
.chip-ok {
  background: var(--ok-soft);
  border-color: rgba(34, 197, 139, 0.22);
  color: #7ee7bd;
}

/* 密钥展示 */
.keybox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  font-family: var(--mono);
  font-size: 12.5px;
  color: #c2dbff;
  word-break: break-all;
  line-height: 1.5;
}

/* 额度进度条 */
.quota-bar {
  height: 5px;
  width: 100%;
  max-width: 110px;
  margin: 7px 0 0 auto;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.13);
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.35);
}
.quota-bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  min-width: 2px;
}

/* =========================================================================
   空态 / 加载 / 错误
   ========================================================================= */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 52px 24px;
  text-align: center;
  color: var(--text-3);
}
.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  color: var(--text-2);
  margin-bottom: 2px;
}
.empty-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.empty-desc {
  font-size: 12.5px;
  max-width: 46ch;
  line-height: 1.65;
}
.empty-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.skeleton {
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.085) 37%, rgba(255, 255, 255, 0.04) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
.skeleton-line {
  height: 12px;
}
.skeleton-card {
  height: 120px;
  border-radius: var(--r3);
  margin-bottom: 14px;
}

/* 提示条 */
.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
}
.notice svg {
  flex: none;
  margin-top: 2px;
}
.notice b {
  color: var(--text);
  font-weight: 600;
}
.notice-warn {
  border-color: rgba(240, 167, 44, 0.24);
  background: rgba(240, 167, 44, 0.06);
}
.notice-bad {
  border-color: rgba(240, 84, 102, 0.26);
  background: rgba(240, 84, 102, 0.07);
  color: #ffc3ca;
}
.notice-info {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.06);
}

/* 保存状态：就地反馈 */
.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  min-height: 20px;
}
.save-state.ok {
  color: #5fe3b1;
}
.save-state.bad {
  color: #ff9aa5;
}
.save-state.dirty {
  color: var(--warn);
}

/* 错误块：原因 + 下一步 + 重试 */
.errbox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 20px 22px;
}
.errbox .errbox-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.errbox .errbox-msg {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.65;
}
.errbox .errbox-next {
  font-size: 12px;
  color: var(--text-3);
}
.errbox .errbox-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

/* =========================================================================
   弹窗 / 提示
   ========================================================================= */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade 0.18s ease both;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--r4);
  background: linear-gradient(180deg, #171e2b, #10151f);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-3);
  animation: pop 0.26s var(--ease-out) both;
  overflow: hidden;
}
.modal.wide {
  max-width: 760px;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.modal-title {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.modal-desc {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.55;
}
.modal-body {
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

/* 提示条 */
.toast-wrap {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 240px;
  max-width: 400px;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  background: #1a2230;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  animation: toastIn 0.28s var(--ease-out) both;
  pointer-events: auto;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}
.toast.ok {
  border-color: rgba(34, 197, 139, 0.4);
}
.toast.bad {
  border-color: rgba(240, 84, 102, 0.4);
}
.toast.warn {
  border-color: rgba(240, 167, 44, 0.4);
}
.toast svg {
  flex: none;
  margin-top: 2px;
}

/* =========================================================================
   图表 / 排行
   ========================================================================= */
.chart-wrap {
  padding: 18px 22px 16px;
}
.chart-svg {
  width: 100%;
  display: block;
  overflow: visible;
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11.5px;
  color: var(--text-3);
}
.chart-legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--brand);
}
.legend-dot.bad {
  background: var(--bad);
}
.chart-axis {
  display: flex;
  justify-content: space-between;
  padding: 8px 2px 0;
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.chart-summary {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
.chart-summary .k {
  font-size: 11px;
  color: var(--text-3);
}
.chart-summary .v {
  font-size: 18px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

/* 柱状图 */
.chart-plot {
  --bar-gap: clamp(3px, 0.7vw, 10px);
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: var(--bar-gap);
  position: relative;
  background-image: repeating-linear-gradient(
    to top,
    rgba(255, 255, 255, 0.055) 0,
    rgba(255, 255, 255, 0.055) 1px,
    transparent 1px,
    transparent 33.33%
  );
}
.bars::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line-soft);
}
.bar-col {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  cursor: default;
}
.bar-stack {
  width: 100%;
  max-width: 34px;
  margin: 0 auto;
  border-radius: 5px 5px 2px 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  transition: filter 0.15s;
}
.bar-col:hover .bar-stack {
  filter: brightness(1.35);
}
.bar-ok {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #4f93ff, #2563eb);
}
.bar-fail {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #ff7a89, #e11d48);
}
.bar-col.is-zero .bar-stack {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 2px;
}
.bar-labels {
  display: flex;
  gap: var(--bar-gap);
  margin-top: 9px;
}
.bar-x {
  flex: 1;
  text-align: center;
  font-size: 10px;
  line-height: 1;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

.rank {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.rank-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.rank-no {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  text-align: right;
}
.rank-main {
  min-width: 0;
}
.rank-name {
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  letter-spacing: -0.01em;
}
.rank-bar {
  height: 4px;
  margin-top: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.rank-bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.rank-val {
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* =========================================================================
   工具类
   ========================================================================= */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.wrap {
  flex-wrap: wrap;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.flex-1 {
  flex: 1;
  min-width: 0;
}
.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}
.mt-5 {
  margin-top: 24px;
}
.mt-6 {
  margin-top: 32px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 12px;
}
.muted {
  color: var(--text-3);
}
.dim {
  color: var(--text-2);
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.01em;
}
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
.nowrap {
  white-space: nowrap;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.small {
  font-size: 12px;
}
.tiny {
  font-size: 11px;
}
.hide {
  display: none !important;
}
.center {
  text-align: center;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 工具条 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-left {
  flex: 1;
  min-width: 0;
}
.toolbar-right {
  margin-left: auto;
}
.toolbar .select {
  width: auto;
  min-width: 132px;
  flex: 0 0 auto;
}
.toolbar .search-field {
  width: 250px;
}
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 240px;
  max-width: 100%;
}
.search-field svg {
  position: absolute;
  left: 11px;
  color: var(--text-3);
  pointer-events: none;
}
.search-field .input {
  padding-left: 33px;
}
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
  gap: 2px;
}
.seg button {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.seg button:hover {
  color: var(--text);
}
.seg button[aria-pressed='true'],
.seg button[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 550;
}

/* 费率徽标（分组） */
.rate-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(240, 167, 44, 0.28);
  background: rgba(240, 167, 44, 0.1);
  color: #ffc766;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* 接入指南：步骤 / 代码 / 端点 */
.step-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.step-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: var(--r3);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #151b27 0%, #111722 70%, #10151f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.step-no {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--brand-2);
}
.step-title {
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.01em;
}
.step-desc {
  flex: 1;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
}
.step-link {
  align-self: flex-start;
  margin-top: 4px;
  padding: 0;
  height: 28px;
  color: var(--brand-2);
}
.step-link:hover {
  color: #bfdbfe;
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}
.code-lang {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}
.code-copy {
  margin-left: auto;
  height: 26px;
}
.code-body {
  background: rgba(0, 0, 0, 0.32);
}
pre.code {
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  max-height: 430px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  color: #c8d8ef;
  white-space: pre;
  tab-size: 2;
}
pre.code:focus-visible {
  outline-offset: -2px;
}
.find-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.find-row:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line-strong);
}
.find-k {
  font-size: 12.5px;
  font-weight: 550;
}
.find-d {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}
.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 28px;
}
.endpoint-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.endpoint-method {
  flex: none;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.04);
}
.endpoint-method.get {
  color: #7ee7bd;
  border-color: rgba(34, 197, 139, 0.28);
  background: rgba(34, 197, 139, 0.09);
}
.endpoint-method.post {
  color: #9ec5ff;
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(59, 130, 246, 0.09);
}
.endpoint-path {
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
}
.endpoint-desc {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.code-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
}
.code-pill.warn {
  color: #ffc766;
  border-color: rgba(240, 167, 44, 0.26);
  background: rgba(240, 167, 44, 0.09);
}
.code-pill.bad {
  color: #ff94a0;
  border-color: rgba(240, 84, 102, 0.26);
  background: rgba(240, 84, 102, 0.09);
}
.code-pill.mute {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
}

/* 渠道卡片内部 */
.ch-meta {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
}
.ch-meta-item {
  padding: 9px 16px;
  min-width: 96px;
  border-right: 1px solid var(--line-soft);
}
.ch-meta-item:last-child {
  border-right: 0;
}
.ch-meta-k {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.ch-meta-v {
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.ch-meta-hint {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 1px;
}
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px 7px 12px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line-soft);
}
.key-row:hover {
  border-color: var(--line);
}
.key-label {
  font-size: 12.5px;
  font-weight: 550;
}
.key-mask {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
}
.ch-sync-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-3);
}

/* 登录页：左侧品牌叙事 + 右侧登录卡 */
.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
}
.login-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 6vw, 88px);
  border-right: 1px solid var(--line);
  background: radial-gradient(720px 540px at 18% 8%, rgba(59, 130, 246, 0.14), transparent 66%);
  overflow: hidden;
}
.login-aside-brand {
  margin-bottom: 44px;
}
.login-hero {
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  max-width: 15ch;
  margin: 0;
}
.login-hero-sub {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.75;
  max-width: 46ch;
  margin: 18px 0 0;
}
.login-points {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-2);
  max-width: 46ch;
}
.login-points b {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 1px;
}
.login-point-icon {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--brand-2);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.22);
}
.login-aside-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 44px;
  font-size: 11.5px;
  color: var(--text-3);
}
.login-main {
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 56px);
}
.login-card {
  width: 100%;
  max-width: 404px;
  padding: 32px;
  border-radius: var(--r5);
  background: linear-gradient(180deg, rgba(23, 30, 43, 0.96), rgba(16, 21, 31, 0.99));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: pop 0.4s var(--ease-out) both;
}
.login-card-brand {
  display: none;
}
.login-h {
  font-size: 23px;
  font-weight: 680;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.login-sub {
  font-size: 13px;
  color: var(--text-3);
  margin: 0 0 22px;
  line-height: 1.6;
}
.login-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.7;
}

/* =========================================================================
   响应式：侧栏变横条
   ========================================================================= */
@media (max-width: 1180px) {
  :root {
    --rail: 210px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }
  .rail {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 58px;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    background: rgba(9, 12, 18, 0.9);
  }
  .brand {
    padding: 0 12px 0 2px;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }
  .brand-mark svg {
    width: 16px;
    height: 16px;
  }
  .brand-text {
    display: none;
  }
  .nav {
    flex-direction: row;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav-label {
    display: none;
  }
  .nav-item {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    flex: none;
  }
  .nav-item span {
    display: none;
  }
  .nav-item.active::before {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: -9px;
    width: auto;
    height: 2.5px;
    border-radius: 3px 3px 0 0;
  }
  .rail-foot {
    margin-top: 0;
    padding: 0 0 0 10px;
    border-top: none;
    flex: none;
  }
  .who {
    display: none;
  }
  .topbar {
    height: 52px;
  }
  .topbar .live-pill {
    display: none;
  }
  .content {
    padding: 22px 18px 56px;
  }
  .grid-sidebar,
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-head {
    margin-bottom: 22px;
  }
  h1 {
    font-size: 24px;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: 48px;
    padding: 0 14px;
  }
  .bar-labels .bar-x {
    visibility: hidden;
  }
  .bar-labels .bar-x:nth-child(3n + 1) {
    visibility: visible;
  }
  .chart-legend {
    display: none;
  }
  .crumb-root,
  .crumb svg {
    display: none;
  }
  .content {
    padding: 18px 14px 48px;
  }
  .step-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .endpoint-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .code-bar {
    flex-wrap: wrap;
  }
  pre.code {
    font-size: 11.5px;
    padding: 14px;
  }
  .page-head-row {
    align-items: flex-start;
  }
  .page-actions {
    width: 100%;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat {
    padding: 14px 15px 15px;
  }
  .stat-value {
    font-size: 22px;
  }
  .stat.feature .stat-value {
    font-size: 30px;
  }
  .stat-side {
    display: none;
  }
  .stat.feature .stat-foot {
    padding-right: 0;
  }
  .card-head,
  .card-body,
  .card-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid .span-2 {
    grid-column: span 1;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar .search-field,
  .search-field {
    width: 100%;
  }
  .toolbar-right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .ch-meta-item {
    flex: 1 1 50%;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 8px 12px;
  }
  .ch-meta-item:nth-child(odd) {
    border-right: 1px solid var(--line-soft);
  }
  .ch-meta-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .ch-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .ch-head .ch-actions {
    width: 100%;
    justify-content: flex-start !important;
  }
  .rank-item {
    grid-template-columns: 14px minmax(0, 1fr) auto;
    gap: 8px;
  }
  .btn {
    height: 36px;
  }
  .btn-sm {
    height: 30px;
  }
  .btn-icon {
    width: 34px;
    height: 34px;
  }
  .toast-wrap {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
  .toast {
    max-width: none;
    min-width: 0;
  }
  .overlay {
    padding: 12px;
  }
  .modal {
    max-height: 92vh;
  }
  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .login-card {
    padding: 26px 22px 22px;
    max-width: 420px;
  }
}

/* 登录页在窄屏收成单列：只留登录卡 */
@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-aside {
    display: none;
  }
  .login-main {
    padding: 28px 16px 44px;
    place-items: center;
  }
  .login-card-brand {
    display: block;
    margin-bottom: 20px;
  }
  .login-card {
    border-radius: var(--r4);
  }
}

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

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