/* ============================================================
   TokenRelay · Design System (Dark Tech)
   ============================================================ */
:root {
  --bg: #0a0c12;
  --bg-soft: #0e1118;
  --surface: #12151f;
  --surface-2: #171b28;
  --surface-3: #1d2231;
  --border: #232940;
  --border-soft: #1c2133;

  --text: #e8ecf4;
  --text-dim: #98a1b8;
  --text-faint: #5b6478;

  --accent: #6366f1;
  --accent-2: #22d3ee;
  --accent-soft: rgba(99, 102, 241, .14);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, .13);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .13);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .13);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --glow: 0 0 0 1px rgba(99, 102, 241, .35), 0 0 24px rgba(99, 102, 241, .18);

  --sidebar-w: 236px;
  --topbar-h: 62px;

  --font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

/* 暗色主题：仪表盘区域柔和背景（紫蓝冷光） */
body {
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(124, 92, 255, .10), transparent 60%),
    radial-gradient(900px 440px at -8% 108%, rgba(34, 211, 238, .08), transparent 60%),
    radial-gradient(700px 360px at 50% 50%, rgba(99, 102, 241, .05), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

/* 卡片基础渐变升级 */
.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 35%),
    linear-gradient(180deg, var(--surface), color-mix(in oklab, var(--surface) 94%, #1a2240));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 6px 24px rgba(0, 0, 0, .32);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
/* 浅色主题卡片整体加淡淡蓝色背景，让非业务卡片也带色 */
[data-theme="light"] .card:not(.model-card):not(.upstream-card):not(.group-card) {
  background:
    linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--surface) 90%, #d6e1f5));
}
/* 深色主题：所有非业务卡片加淡淡桔黄色背景 */
[data-theme="dark"] .card:not(.model-card):not(.upstream-card):not(.group-card) {
  background:
    linear-gradient(180deg, var(--surface), color-mix(in oklab, var(--surface) 90%, #f0a850));
}
.card:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 32px rgba(0, 0, 0, .45); }

/* ============ 浅色主题 ============ */
[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-soft: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f1f4fa;
  --surface-3: #e6ebf3;
  --border: #d6dde9;
  --border-soft: #e3e9f2;

  --text: #1a2236;
  --text-dim: #5a6478;
  --text-faint: #8b95a8;

  --accent: #6366f1;
  --accent-2: #0891b2;
  --accent-soft: rgba(99, 102, 241, .10);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, .12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, .12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .10);

  --shadow: 0 6px 20px rgba(15, 23, 42, .08);
  --glow: 0 0 0 1px rgba(99, 102, 241, .3), 0 0 18px rgba(99, 102, 241, .14);
}
[data-theme="light"] body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(99, 102, 241, .06), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(8, 145, 178, .04), transparent 60%),
    var(--bg);
}
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c4ccdb; border: 2px solid var(--bg); }
[data-theme="light"] .card { box-shadow: 0 1px 3px rgba(15, 23, 42, .05); }

/* 浅色主题：侧边栏 / 顶栏跟随变浅 */
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(238, 241, 247, .97));
  border-right-color: var(--border);
}
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, .78);
}
[data-theme="light"] .nav-item.active {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(99, 102, 241, .16), rgba(99, 102, 241, .04));
}
[data-theme="light"] .modal-mask {
  background: rgba(15, 23, 42, .32);
}
[data-theme="light"] .card.model-card.clickable:hover { box-shadow: 0 10px 28px rgba(99, 102, 241, .14); border-color: rgba(99, 102, 241, .4); }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(99, 102, 241, .09), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(34, 211, 238, .06), transparent 60%),
    var(--bg);
  /* 页面主体保持固定视口，顶层菜单通过 body portal 显示 */
}
html { overflow: hidden; }

::selection { background: rgba(99, 102, 241, .35); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2a3148; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a4262; }
::-webkit-scrollbar-track { background: transparent; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ============ 布局 ============ */
/* 关键：保持 body { display:flex } 让侧栏/主区并排；顶层菜单使用 body portal。 */
body { display: flex; }
/* 初始隐藏主内容，等 auth 检测完成后再显示（防止页面刷新/登出时闪烁） */
body.auth-pending .app,
body.auth-pending .sidebar,
body.auth-pending .topbar,
body.auth-pending .content,
body.auth-pending .footer { display: none !important; }
.app { flex: 1; display: flex; min-width: 0; height: 100vh; isolation: isolate; }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(18, 21, 31, .92), rgba(10, 12, 18, .96));
  border-right: 1px solid var(--border-soft);
  transition: margin-left .25s ease;
  z-index: 40;
}
body.sidebar-collapsed .sidebar { margin-left: calc(var(--sidebar-w) * -1); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.content { flex: 1; overflow-y: auto; padding: 24px 28px; scroll-behavior: smooth; }

.footer {
  padding: 10px 28px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 12px;
  font-family: var(--mono);
}

/* ============ 侧边栏 ============ */
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 14px;
}
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 18px rgba(99, 102, 241, .45);
}
.logo-mark svg { width: 20px; height: 20px; }
/* 上传自定义图标后隐藏渐变底色，直接展示图片 */
.logo-mark.has-image { background: none; box-shadow: none; }
#site-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
#site-logo-img[hidden] { display: none; }
.logo-text strong { display: block; font-size: 15px; letter-spacing: .3px; }
.logo-text small { color: var(--text-faint); font-size: 11px; font-family: var(--mono); }

/* ============ 站点图标上传 / 正方形裁剪 ============ */
.logo-upload {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 14px; border: 1px dashed var(--border); border-radius: 12px;
  background: var(--bg-2);
}
.logo-upload-row { display: flex; align-items: center; gap: 14px; }
.logo-upload-req { margin: 0; font-size: 12px; line-height: 1.6; color: var(--text-faint); }
.doc-file-name {
  min-width: 160px; font-size: 13px; color: var(--text);
  padding: 8px 12px; border-radius: 8px;
  background: var(--surface-3); border: 1px solid var(--border-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px;
}
.logo-preview {
  width: 56px; height: 56px; border-radius: 12px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--border-soft);
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-preview-empty { font-size: 11px; color: var(--text-faint); }
.logo-upload-actions { display: flex; gap: 8px; }
.crop-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#crop-canvas {
  width: 320px; height: 320px; border-radius: 12px; cursor: grab;
  background: var(--bg-2); border: 1px solid var(--border-soft);
  touch-action: none; max-width: 100%;
}
#crop-canvas:active { cursor: grabbing; }
#crop-zoom { width: 320px; max-width: 100%; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.nav-group-label {
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  color: var(--text-faint);
  padding: 16px 10px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 500;
  transition: all .15s ease;
  position: relative;
}
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(99, 102, 241, .22), rgba(99, 102, 241, .05));
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 20%;
  height: 60%; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.nav-badge {
  margin-left: auto;
  font-size: 11px; font-family: var(--mono);
  background: var(--surface-3); color: var(--text-dim);
  padding: 1px 7px; border-radius: 20px;
}

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border-soft); }
.sys-status {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  border: 1px solid rgba(52, 211, 153, .25);
}
.sys-status-text strong { font-size: 12.5px; display: block; }
.sys-status-text small { color: var(--text-dim); font-size: 11px; font-family: var(--mono); }

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; position: relative; flex-shrink: 0; }
.pulse-dot.ok { background: var(--success); }
.pulse-dot.ok::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--success);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.6); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.user-card { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #f472b6, var(--accent));
}
/* Sidebar user card: the email has the whole first line (cut with "…" only when too long);
   below, 余额 over the amount on the left, the role badge on the right, vertically centred */
.user-card .avatar { flex-shrink: 0; }
.user-meta { flex: 1; min-width: 0; }
.user-meta strong { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: var(--text-faint); font-size: 11px; display: flex; align-items: center; gap: 6px; }
.user-balance-box { display: flex; flex-direction: column; min-width: 0; }
.user-meta .role-badge { margin-left: auto; flex-shrink: 0; white-space: nowrap; }

/* ============ 顶栏 ============ */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 12, 18, .7);
  backdrop-filter: blur(10px);
  position: relative; z-index: 30;
  /* 顶层菜单通过 body portal 显示，不受 topbar 局部层级影响 */
  isolation: isolate;
}
.topbar-title h1 { font-size: 17px; font-weight: 650; }
.topbar-title p { font-size: 12px; color: var(--text-faint); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.topbar-search {
  display: flex; align-items: center; gap: 8px;
  width: 300px; padding: 0 12px; height: 38px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-faint);
  transition: border-color .15s;
}
.topbar-search:focus-within { border-color: var(--accent); box-shadow: var(--glow); }
.topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; font-family: inherit;
}
.topbar-search input::placeholder { color: var(--text-faint); }
.topbar-search kbd {
  font-family: var(--mono); font-size: 10px;
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 5px; color: var(--text-faint);
}

.dot-badge { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border); cursor: pointer;
  transition: all .15s; position: relative;
}
.icon-btn:hover { color: var(--text); border-color: #323a56; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 15px;
  border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
  font-size: 13px; font-weight: 550; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #38405f; background: var(--surface-3); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  border: none; color: #fff;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  box-shadow: 0 4px 16px rgba(99, 102, 241, .35);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 4px 22px rgba(99, 102, 241, .5); }
.btn-danger { color: var(--danger); border-color: rgba(248, 113, 113, .35); background: var(--danger-soft); }
.btn-danger:hover { background: rgba(248, 113, 113, .22); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 7px; }

/* ============ 卡片 ============ */
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-title h3 { font-size: 14.5px; font-weight: 600; }
.card-title .sub { font-size: 12px; color: var(--text-faint); font-weight: 400; }
.card-title .spacer { flex: 1; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-21 { grid-template-columns: 2fr 1fr; }
.mt { margin-top: 16px; }

/* 统计卡 */
.stat-card { position: relative; overflow: hidden; padding: 18px 18px 20px;
  opacity: 0; transform: translateY(6px);
  animation: stat-card-in .45s ease forwards;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: .06s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card:nth-child(4) { animation-delay: .18s; }
.stat-card:nth-child(5) { animation-delay: .24s; }
@keyframes stat-card-in { to { opacity: 1; transform: translateY(0); } }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 14px 36px rgba(0,0,0,.45); border-color: rgba(124,92,255,.35); }
.stat-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(124, 92, 255, .12), rgba(34, 211, 238, .04) 60%);
  pointer-events: none;
}
.stat-card::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, .16), transparent 70%);
  pointer-events: none;
  transition: transform .6s ease;
}
.stat-card:hover::after { transform: scale(1.25); }
.stat-card > * { position: relative; }
.stat-card .stat-label {
  font-size: 12.5px; color: var(--text-dim);
  display: flex; align-items: center; gap: 7px; letter-spacing: .3px;
}
.stat-card .stat-value {
  font-size: 28px; font-weight: 700; margin: 10px 0 2px;
  letter-spacing: -.5px; font-variant-numeric: tabular-nums;
}
.stat-card .stat-trend {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 11.5px; color: var(--text-faint); margin-top: 2px;
}
.stat-card .stat-trend b { color: var(--text-dim); font-weight: 600; }
.stat-tokens { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 6px; }
.stat-token { background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.04); border-radius: 8px; padding: 8px 10px; }
.stat-token-head { display: flex; align-items: baseline; gap: 8px; }
.stat-token-name { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.stat-token-name::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.stat-token-value { margin-left: auto; font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-token-spark { margin-top: 4px; }
.stat-sub-tokens {
  display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px;
  font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.stat-sub-tokens span { display: inline-flex; align-items: center; gap: 5px; }
.stat-sub-tokens i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.stat-label { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 7px; }
.stat-value { font-size: 27px; font-weight: 700; margin: 8px 0 2px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.stat-sub b { color: var(--accent-2); font-weight: 600; font-size: 13.5px; }
.stat-balance {
  margin-top: 10px; padding: 8px 12px; border-radius: 10px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  background: linear-gradient(120deg, rgba(124, 92, 255, .18), rgba(34, 211, 238, .14) 70%);
  border: 1px solid rgba(124, 92, 255, .35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.stat-balance-label { font-size: 12px; color: var(--text-dim); letter-spacing: .4px; }
.stat-balance-value {
  font-size: 17px; font-weight: 700; color: #b39bff; letter-spacing: -.3px;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(124, 92, 255, .35);
}
[data-theme="light"] .stat-balance {
  background: linear-gradient(120deg, rgba(124, 92, 255, .14), rgba(34, 211, 238, .08) 70%);
  border-color: rgba(124, 92, 255, .25);
}
[data-theme="light"] .stat-balance-value { color: #5b3df5; text-shadow: none; }
.stat-value small { font-size: 13px; color: var(--text-faint); font-weight: 500; }
.stat-delta { font-size: 12px; font-family: var(--mono); display: inline-flex; align-items: center; gap: 4px; }

/* 仪表盘专用样式 */
.dashboard-grid-stats { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-grid-stats.dashboard-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 1280px) {
  .dashboard-grid-stats.dashboard-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dashboard-grid-stats.dashboard-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 公告栏：高度可容纳 ≥3 行公告（约 220px），内部滚动 */
.dashboard-ann-card {
  display: flex; flex-direction: column;
  height: 240px;
  overflow: hidden;
}
.dashboard-ann-card .card-title { margin-bottom: 6px; flex-shrink: 0; }
.dashboard-ann-list {
  flex: 1; min-height: 0; overflow-y: auto;
  margin: 0 -4px; padding: 0 4px;
}
.dashboard-ann-list::-webkit-scrollbar { width: 6px; }
.dashboard-ann-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }
/* 单条公告：左侧图标 + 标题 + 置顶/动态化提示 + 时间 */
.dashboard-ann-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-soft); cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .18s ease;
  opacity: 0; transform: translateY(6px);
  animation: ann-row-in .36s ease forwards;
}
.dashboard-ann-row + .dashboard-ann-row { margin-top: 6px; }
.dashboard-ann-row:hover { background: var(--bg); border-color: var(--text-faint); transform: translateY(-1px); }
/* 置顶项：浅高亮 + 左侧细色条 */
.dashboard-ann-row.is-pinned {
  border-color: rgba(245, 158, 11, .35);
  background: linear-gradient(90deg, rgba(245, 158, 11, .08), var(--bg-soft) 40%);
}
.dashboard-ann-row.is-pinned::before {
  content: ''; width: 3px; align-self: stretch; border-radius: 2px;
  background: linear-gradient(180deg, #f59e0b, #f97316);
  margin-right: -4px;
}
.dashboard-ann-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(99, 102, 241, .18), rgba(34, 211, 238, .12));
  color: #818cf8; font-size: 14px; line-height: 1;
}
.dashboard-ann-row.is-pinned .dashboard-ann-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, .22), rgba(249, 115, 22, .14));
  color: #f59e0b;
}
.dashboard-ann-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dashboard-ann-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dashboard-ann-pin-tag {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 10.5px; color: #f59e0b; font-weight: 600;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .3);
  flex-shrink: 0;
}
.dashboard-ann-preview {
  font-size: 11.5px; color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dashboard-ann-time { font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.dashboard-ann-empty { padding: 24px 0; text-align: center; color: var(--text-faint); font-size: 12.5px; }
@keyframes ann-row-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 公告管理 — 顶部操作栏 */
.ann-actions { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 12px; gap: 8px; }

/* 公告管理表格 */
.ann-table { width: 100%; font-size: 13px; }
.ann-table th { padding: 10px 12px; font-size: 12.5px; color: var(--text-faint); font-weight: 600; text-align: left; }
.ann-table td { padding: 10px 12px; border-top: 1px solid var(--border-soft); vertical-align: top; }
.ann-table .cell-main { color: var(--text); font-weight: 500; }
.ann-table .cell-sub { color: var(--text-faint); font-size: 12px; margin-top: 2px; max-width: 480px; overflow: hidden; text-overflow: ellipsis; }
.dashboard-trend-card {
  padding: 18px 22px 20px;
  display: flex; flex-direction: column;
  min-height: 320px; max-height: 360px;
}
.dashboard-trend-card .card-title { margin-bottom: 6px; }
.dashboard-trend-card .chart-legend {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 8px;
  font-size: 12px; color: var(--text-dim);
}
.chart-legend .dot {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
}
.chart-legend .dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}
.dashboard-trend-card .chart-box {
  flex: 1; min-height: 0; padding: 4px 0;
  position: relative;
}
.dashboard-trend-card canvas {
  display: block; width: 100%;
  height: 100%;
  max-height: 240px;
}

/* 浅色主题适配 */
[data-theme="light"] .stat-card::before {
  background: linear-gradient(135deg, rgba(124, 92, 255, .08), rgba(34, 211, 238, .02) 60%);
}
[data-theme="light"] .stat-token { background: rgba(0, 0, 0, .025); border-color: rgba(0, 0, 0, .04); }
[data-theme="light"] .chart-legend .dot { background: rgba(0, 0, 0, .025); border-color: rgba(0, 0, 0, .05); }
[data-theme="light"] .stat-card .stat-trend { color: var(--text-faint); }
[data-theme="light"] .stat-card .stat-trend b { color: var(--text-dim); }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }
.stat-spark { margin-top: 10px; height: 34px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 10px 14px;
  color: var(--text-faint); font-weight: 550; font-size: 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; letter-spacing: .02em;
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
tbody tr:last-child td { border-bottom: none; }
tr.expandable { cursor: pointer; }
tr.log-detail > td { background: var(--bg-soft); padding: 0 14px; }
.log-detail pre {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.7;
  color: var(--text-dim); padding: 14px 0; white-space: pre-wrap; word-break: break-all;
}

.cell-main { font-weight: 550; }
.cell-sub { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); margin-top: 2px; }
.mono { font-family: var(--mono); font-size: 12px; }

.key-box {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  padding: 4px 8px; border-radius: 7px; font-family: var(--mono); font-size: 12px;
  color: var(--text-dim);
}
.key-copy { background: none; border: none; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; padding: 2px; border-radius: 4px; }
.key-copy:hover { color: var(--accent-2); background: var(--surface-3); }
.key-copy svg { width: 13px; height: 13px; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--success); background: var(--success-soft); }
.badge.warn { color: var(--warning); background: var(--warning-soft); }
.badge.err { color: var(--danger); background: var(--danger-soft); }
.badge.info { color: var(--accent-2); background: rgba(34, 211, 238, .1); }
.badge.plain { color: var(--text-dim); background: var(--surface-3); }
.badge.plain::before { display: none; }

.code-badge {
  font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
}
.code-badge.c2 { color: var(--success); background: var(--success-soft); }
.code-badge.c4 { color: var(--warning); background: var(--warning-soft); }
.code-badge.c5 { color: var(--danger); background: var(--danger-soft); }

/* 进度条 */
.progress { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; min-width: 90px; }
.progress > i {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .4s ease;
}
.progress.warn > i { background: linear-gradient(90deg, #f59e0b, var(--warning)); }
.progress.danger > i { background: linear-gradient(90deg, #ef4444, var(--danger)); }
.progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 5px; font-family: var(--mono); }

/* ============ 开关 ============ */
.switch { position: relative; width: 36px; height: 20px; display: inline-block; cursor: pointer; flex-shrink: 0; }
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0; border-radius: 20px;
  background: var(--surface-3); border: 1px solid var(--border);
  transition: all .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-dim); transition: all .2s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { left: 18px; background: #fff; }

/* ============ 工具栏 / 筛选 ============ */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

.select, .input {
  height: 36px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  font-size: 13px; font-family: inherit; outline: none;
  transition: border-color .15s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: var(--glow); }
.select { cursor: pointer; appearance: none; padding-right: 30px;
  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='%2398a1b8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.search-input { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.search-input svg { width: 15px; height: 15px; color: var(--text-faint); }
.search-input input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 200px; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
}
.seg button {
  border: none; background: none; color: var(--text-dim);
  font-size: 12.5px; font-weight: 550; padding: 6px 14px;
  border-radius: 7px; cursor: pointer; transition: all .15s;
}
.seg button.active { background: var(--accent); color: #fff; }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 14px; font-size: 12.5px; color: var(--text-dim); }
.pagination button {
  min-width: 30px; height: 30px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; font-size: 12.5px;
}
.pagination button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: default; }

/* ============ 上游卡片 ============ */
.upstream-card { display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.upstream-head { display: flex; align-items: center; gap: 12px; }
.upstream-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  color: #fff;
}
.upstream-head .grow { flex: 1; min-width: 0; }
.upstream-head strong { display: block; font-size: 14.5px; }
.upstream-head small { color: var(--text-faint); font-family: var(--mono); font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upstream-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.upstream-stat { background: var(--bg-soft); border-radius: 8px; padding: 8px 10px; text-align: center; }
.upstream-stat b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.upstream-stat span { font-size: 10.5px; color: var(--text-faint); }

/* ============ 图表 ============ */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { display: block; width: 100%; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; }

.rank-row { display: grid; grid-template-columns: 130px 1fr 64px; gap: 12px; align-items: center; padding: 9px 0; }
.rank-row + .rank-row { border-top: 1px solid var(--border-soft); }
.rank-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-family: var(--mono); font-size: 12px; color: var(--text-dim); text-align: right; }

/* ============ 活动/日志时间线 ============ */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.feed-item p { font-size: 13px; line-height: 1.5; }
.feed-item p b { font-weight: 600; }
.feed-item time { font-size: 11px; color: var(--text-faint); font-family: var(--mono); }

/* ============ 空状态 ============ */
.empty { text-align: center; padding: 48px 20px; color: var(--text-faint); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 12px; }
.empty p { font-size: 13px; }

/* ============ 设置页 ============ */
.settings-grid { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; }
.settings-nav button {
  text-align: left; padding: 10px 14px; border-radius: 9px;
  background: none; border: none; color: var(--text-dim);
  font-size: 13.5px; font-weight: 550; cursor: pointer; transition: all .15s;
}
.settings-nav button.active { background: var(--accent-soft); color: var(--accent-2); }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 7px; }
.form-row .hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.form-row .input, .form-row .select { width: 100%; }
.form-switch-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border-soft); }
.form-switch-row:last-child { border-bottom: none; }
.form-switch-row .info strong { font-size: 13.5px; display: block; margin-bottom: 2px; }
.form-switch-row .info span { font-size: 12px; color: var(--text-faint); }

/* ============ 弹窗 ============ */
.modal-mask {
  /* 层级：需高于页面列表的吸顶表头(z-index:999)、侧边栏(40)与顶栏(30)，
     确保弹窗打开时遮住页面标题栏；toast 再高于本层 */
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(4, 6, 10, .68);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  animation: fadeIn .18s ease;
  padding: 24px;
}
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: slideUp .22s cubic-bezier(.2, .9, .3, 1.2);
}
.modal.modal-sm { max-width: 400px; }
.modal-head { display: flex; align-items: center; padding: 18px 22px 0; }
.modal-head h3 { font-size: 16px; font-weight: 650; }
.modal-head .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px) scale(.98); } }

/* ============ Toast ============ */
.toast-root {
  /* 全局最顶层：高于登录屏(.auth-screen=1000)与弹窗(.modal-mask=1200)，
     保证推送消息始终可见 */
  position: fixed; right: 22px; bottom: 22px; z-index: 3000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 380px;
  padding: 12px 16px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toastIn .25s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ============ 响应式 ============ */
@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-21 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  body.sidebar-collapsed .sidebar { margin-left: 0; position: fixed; left: 0; box-shadow: var(--shadow); }
  .sidebar { position: fixed; left: calc(var(--sidebar-w) * -1); height: 100vh; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; position: static; }
  .topbar-search { width: 160px; }
  .topbar-search kbd { display: none; }
}

/* ============ 模型广场 ============ */
.model-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 100%; padding: 14px; transition: transform .18s, border-color .18s, box-shadow .18s; position: relative; }
.model-card:hover { transform: translateY(-3px); border-color: rgba(99, 102, 241, .45); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.card-copy-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 26px; height: 26px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elev2, rgba(255,255,255,.06));
  border: 1px solid var(--border-soft, rgba(255,255,255,.1));
  border-radius: 6px;
  color: var(--text-dim, #9ca3af);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s, border-color .15s;
}
.model-card:hover .card-copy-btn,
.card-copy-btn:focus-visible { opacity: 1; }
.card-copy-btn:hover { color: var(--text, #e5e7eb); background: rgba(99,102,241,.18); border-color: rgba(99,102,241,.5); }
.model-head { display: flex; align-items: center; gap: 12px; }
.model-ico {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; letter-spacing: .5px;
  border: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.model-title { min-width: 0; }
.model-title strong { display: block; font-size: 15px; }
.model-title small { color: var(--text-faint); font-size: 11.5px; font-family: var(--mono); }
.model-desc {
  font-size: 12.5px; color: var(--text-dim); line-height: 1.55;
  min-height: 0; margin: 0;
  /* 至多 2 行高度，超出显示 … */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.model-tags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 0; }
.model-tag {
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-dim);
  border: 1px solid var(--border-soft);
}
.model-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 10px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
}
.model-meta div { text-align: center; }
.model-meta span { display: block; font-size: 11px; color: var(--text-faint); margin-bottom: 3px; }
.model-meta b { font-size: 14px; font-variant-numeric: tabular-nums; }
.model-meta small { font-size: 10.5px; color: var(--text-faint); margin-left: 1px; }
.model-foot { display: flex; gap: 8px; }
.model-foot .btn-sm { flex: 1; justify-content: center; }

/* ============ 小统计块（映射页/定价页顶部） ============ */
.mini-stat { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.mini-stat small { font-size: 11.5px; color: var(--text-faint); }
.mini-stat b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============ 上游编辑：连接验证栏 + 模型池 ============ */
.conn-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px; margin: 4px 0 10px;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.conn-bar .btn { height: 32px; }
.conn-status { font-size: 12.5px; font-family: var(--mono); color: var(--text-faint); margin-left: auto; }

.model-pool {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 12px; min-height: 56px;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: 10px; max-height: 180px; overflow-y: auto;
}
.model-chip {
  font-size: 12px; font-family: var(--mono);
  padding: 4px 10px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent-2);
  border: 1px solid rgba(99, 102, 241, .25);
  transition: all .15s; cursor: default;
}
.model-chip:hover { background: rgba(99, 102, 241, .25); transform: translateY(-1px); }

/* ============ 分组管理卡片 ============ */
.group-card { display: flex; flex-direction: column; gap: 12px; }
.group-head { display: flex; align-items: center; justify-content: space-between; }
.group-head strong { font-size: 16px; }
.group-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.group-foot .btn-sm { padding: 0 8px; }

/* ============ 业务卡片层次：模型广场 / 上游渠道 / 分组 ============
   用更高特异性双类选择器（.card.model-card）确保压过 .card 基础样式 */
.card.model-card,
.card.upstream-card,
.card.group-card {
  background:
    linear-gradient(135deg, rgba(99, 102, 241, .14), transparent 42%) !important,
    linear-gradient(180deg, color-mix(in oklab, var(--surface) 92%, var(--accent)), var(--surface)) !important;
  border-color: color-mix(in oklab, var(--border) 60%, var(--accent)) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .06) inset,
    0 8px 22px rgba(0, 0, 0, .28),
    0 0 0 1px rgba(99, 102, 241, .08);
}
.card.model-card::before,
.card.upstream-card::before,
.card.group-card::before {
  content: "";
  position: absolute;
  top: 0; left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 200, 140, .65), rgba(99, 102, 241, .45), transparent);
  opacity: .72;
  pointer-events: none;
}
[data-theme="light"] .card.model-card::before,
[data-theme="light"] .card.upstream-card::before,
[data-theme="light"] .card.group-card::before {
  background: linear-gradient(90deg, transparent, rgba(99, 142, 241, .55), rgba(99, 142, 241, .35), transparent);
}
.card.model-card:hover,
.card.upstream-card:hover,
.card.group-card:hover {
  border-color: color-mix(in oklab, var(--accent-2) 48%, var(--border));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .07) inset,
    0 14px 32px rgba(0, 0, 0, .34),
    0 0 0 1px rgba(34, 211, 238, .08);
}

[data-theme="light"] .card.model-card,
[data-theme="light"] .card.upstream-card,
[data-theme="light"] .card.group-card {
  /* 浅色主题：淡淡的蓝色（与背景清晰区分） */
  background:
    linear-gradient(135deg, rgba(99, 142, 241, .18), transparent 45%) !important,
    linear-gradient(180deg, #f3f8ff, color-mix(in srgb, var(--surface) 92%, #c7d6f0)) !important;
  border-color: color-mix(in srgb, var(--border) 64%, #7a98d8) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .95) inset,
    0 7px 18px rgba(40, 70, 130, .14),
    0 0 0 1px rgba(99, 142, 241, .08);
}
[data-theme="light"] .card.model-card:hover,
[data-theme="light"] .card.upstream-card:hover,
[data-theme="light"] .card.group-card:hover {
  border-color: rgba(79, 121, 220, .55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .98) inset,
    0 14px 28px rgba(60, 90, 150, .20),
    0 0 0 1px rgba(99, 142, 241, .14);
}

/* 深色主题：淡淡的桔黄色 */
[data-theme="dark"] .card.model-card,
[data-theme="dark"] .card.upstream-card,
[data-theme="dark"] .card.group-card {
  background:
    linear-gradient(135deg, rgba(255, 176, 87, .18), transparent 45%) !important,
    linear-gradient(180deg, color-mix(in oklab, var(--surface) 88%, #f0a850), var(--surface)) !important;
  border-color: color-mix(in oklab, var(--border) 50%, #f0a850) !important;
  box-shadow:
    0 1px 0 rgba(255, 200, 140, .08) inset,
    0 8px 22px rgba(0, 0, 0, .30),
    0 0 0 1px rgba(255, 176, 87, .08);
}
[data-theme="dark"] .card.model-card:hover,
[data-theme="dark"] .card.upstream-card:hover,
[data-theme="dark"] .card.group-card:hover {
  border-color: color-mix(in oklab, var(--accent-2) 50%, #f0a850);
  box-shadow:
    0 1px 0 rgba(255, 200, 140, .10) inset,
    0 14px 32px rgba(0, 0, 0, .38),
    0 0 0 1px rgba(255, 176, 87, .12);
}

/* 上游详情弹窗内的区块不使用列表卡片的立体背景 */
.upstream-detail-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

/* ============ 上游模型映射列表 ============ */
.model-map-list {
  max-height: 240px; overflow-y: auto;
  padding: 8px;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.model-map-row { display: flex; align-items: center; gap: 8px; }
.model-map-src {
  flex: 0 0 38%; font-size: 12px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 6px 8px; background: var(--surface-3); border-radius: 6px;
}
.model-map-arrow { color: var(--accent-2); font-weight: 700; }
.model-map-alias { flex: 1; height: 30px; font-size: 12.5px; }

/* ============ 智能路由卡片 ============ */
.rule-card { display: flex; flex-direction: column; gap: 12px; }
.rule-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rule-head strong { font-size: 15px; }
.rule-match { display: flex; gap: 6px; flex-wrap: wrap; }
.rule-match-tag {
  font-size: 11.5px; padding: 4px 10px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-dim);
  border: 1px solid var(--border-soft);
}
.rule-match-tag b { color: var(--accent-2); font-family: var(--mono); margin-left: 4px; }
.rule-targets { padding: 10px; background: var(--bg-soft); border-radius: 8px; border: 1px solid var(--border-soft); }
.rule-targets-label { font-size: 11.5px; color: var(--text-faint); margin-bottom: 8px; }
.rule-target-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.upstream-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rule-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-faint); }
.rule-foot { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border-soft); }

/* ============ 模型广场：分组倍率标签 ============ */
.card.model-card.clickable { cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.card.model-card.clickable:hover {
  transform: translateY(-3px);
}

.latency-badge {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-family: var(--mono); font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  background: var(--surface-3);
}

/* 模型广场 · 价格明细（卡片底部、mult-chips 上方，单行紧凑）
   外层容器只负责排版（flex-wrap），不再有背景/边框；每个 chip 单独成块。 */
.default-price{
  display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px;
  padding:0; line-height:1.45;
  background:transparent; border:0;
}
.default-price .dp-item{
  display:inline-flex; align-items:baseline; gap:3px;
  font-size:11.5px; color:var(--text-dim); font-weight:500;
  padding:1px 0; border-radius:0;
  background:transparent; line-height:1.4;
  white-space:nowrap;
  border:0;
}
.default-price .dp-item b{
  color:var(--text); font-weight:600; font-family:var(--mono);
  font-size:11.5px;
}
/* 单位后缀（如 /1M tok、/次、/张、/秒）：与 chip 同字号、颜色淡一些 */
.default-price .dp-item small{
  color:var(--text-faint); font-size:10.5px; margin-left:1px;
}
/* ¥ 符号后留出与数字的视觉空隙（不依赖字符级空格） */
.default-price .dp-item b.money::before{
  content:""; display:inline-block; width:3px;
}
/* 各计费类型用左侧小色点标识（不增加文字）
   颜色与 .billing-badge 系列的语义色保持一致，按大类区分：
     - 按量（usage）: 紫 #7c8cff（输入/输出/补全/缓存命中 同色）
     - 按次（call）: 橙 #f5a524
     - 按规格（size）: 绿 #3ad29f
     - 按时长（length）: 粉 #ec4899 */
.default-price .dp-usage-in::before,
.default-price .dp-usage-out::before,
.default-price .dp-usage-comp::before,
.default-price .dp-usage-cache::before,
.default-price .dp-usage-cache-write::before { content:""; display:inline-block; width:6px; height:6px; border-radius:50%; background:#7c8cff; margin-right:5px }
.default-price .dp-call::before        { content:""; display:inline-block; width:6px; height:6px; border-radius:50%; background:#f5a524; margin-right:5px }
.default-price .dp-size::before        { content:""; display:inline-block; width:6px; height:6px; border-radius:50%; background:#3ad29f; margin-right:5px }
.default-price .dp-length::before      { content:""; display:inline-block; width:6px; height:6px; border-radius:50%; background:#ec4899; margin-right:5px }
.default-price .dp-empty{ color:var(--text-faint); font-style:italic; font-size:11px }

.mult-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--border-soft); }
.mult-chips-label { font-size: 11px; font-weight: 600; color: var(--text-dim); margin-right: 2px; letter-spacing: .5px; }
.mult-chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 20px;
  background: var(--accent-soft); color: var(--text-dim);
  border: 1px solid rgba(99, 102, 241, .22);
}
.mult-chip b { color: var(--accent-2); font-weight: 600; margin-right: 3px; }

/* 模型广场 · 计费类型徽章（卡片标题下方一行） */
.billing-badges{
  display:flex; align-items:center; flex-wrap:wrap; gap:5px;
  margin:-2px 0 -2px;
}
.billing-badge{
  display:inline-flex; align-items:center; gap:3px;
  font-size:11px; font-weight:600; letter-spacing:.2px;
  padding:3px 8px; border-radius:999px;
  border:1px solid transparent;
}
.billing-badge::before{
  content:""; width:6px; height:6px; border-radius:50%;
  background:currentColor; opacity:.85;
}
.billing-call    { background:rgba(245,165,36,.10); color:#f5a524; border-color:rgba(245,165,36,.32) }
.billing-usage   { background:rgba(124,140,255,.10); color:#7c8cff; border-color:rgba(124,140,255,.32) }
.billing-size    { background:rgba(58,210,159,.10); color:#3ad29f; border-color:rgba(58,210,159,.32) }
.billing-length  { background:rgba(236,72,153,.10); color:#ec4899; border-color:rgba(236,72,153,.32) }

/* ============ 模型价格明细弹窗 ============ */
.detail-model-head { display: flex; align-items: center; gap: 14px; }
.detail-groups { display: flex; flex-direction: column; gap: 10px; }
.detail-group {
  border: 1px solid var(--border-soft); border-radius: 10px;
  background: var(--bg-soft); padding: 12px 14px;
}
.detail-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.detail-group-head b { font-size: 14px; }
.detail-prices { display: flex; flex-wrap: wrap; gap: 8px; }
/* 长上下文标签：夹在基础价格与复制的长上下文价格之间 */
.detail-long-badge {
  display: flex; align-items: center;
  margin: 8px 0 4px;
}
.detail-long-badge .badge {
  font-size: 11px;
  padding: 2px 10px;
}
.detail-price {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 6px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.detail-price span { color: var(--text-faint); }
.detail-price b { color: var(--accent-2); font-family: var(--mono); font-size: 13.5px; }
.detail-price small { color: var(--text-faint); font-size: 11px; }
/* 倍率色阶：>=1 加价（橙→红），=1 基础（蓝），<1 折扣（绿） */
.mult-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--mono);
  border: 1px solid transparent;
  white-space: nowrap;
}
/* 加价档：>=2 紫红、1.5-2 橙红、1.2-1.5 橙、1-1.2 浅橙 */
.mult-tag.mult-pm-1   { background: rgba(251, 191, 36, .15); color: #b45309; border-color: rgba(251, 191, 36, .45); }  /* 1.0-1.2 浅橙 */
.mult-tag.mult-pm-1_2 { background: rgba(245, 158, 11, .15); color: #c2410c; border-color: rgba(245, 158, 11, .45); }  /* 1.2-1.5 橙 */
.mult-tag.mult-pm-1_5 { background: rgba(234, 88, 12, .15);  color: #9a3412; border-color: rgba(234, 88, 12, .45); }   /* 1.5-2 橙红 */
.mult-tag.mult-pm-2   { background: rgba(192, 38, 211, .15); color: #86198f; border-color: rgba(192, 38, 211, .45); } /* >=2   紫红 */
/* 基础 */
.mult-tag.mult-base   { background: rgba(59, 130, 246, .12);  color: #2563eb; border-color: rgba(59, 130, 246, .35); }
/* 折扣档：0.8-1 浅绿、0.6-0.8 绿、0.4-0.6 深绿、<0.4 青 */
.mult-tag.mult-dc-0_8 { background: rgba(132, 204, 22, .15);  color: #4d7c0f; border-color: rgba(132, 204, 22, .45); }   /* 0.8-1 浅绿 */
.mult-tag.mult-dc-0_6 { background: rgba(16, 185, 129, .15);  color: #047857; border-color: rgba(16, 185, 129, .45); }  /* 0.6-0.8 绿 */
.mult-tag.mult-dc-0_4 { background: rgba(5, 150, 105, .15);   color: #065f46; border-color: rgba(5, 150, 105, .45); }   /* 0.4-0.6 深绿 */
.mult-tag.mult-dc-0   { background: rgba(14, 165, 233, .15);  color: #0e7490; border-color: rgba(14, 165, 233, .45); }  /* <0.4 青 */
/* 分组卡片左侧边框色（随主档取最强对比） */
.detail-group.detail-group-mult-base     { border-left: 3px solid rgba(59, 130, 246, .45); }
.detail-group.detail-group-mult-pm-1     { border-left: 3px solid rgba(251, 191, 36, .55); }
.detail-group.detail-group-mult-pm-1_2   { border-left: 3px solid rgba(245, 158, 11, .55); }
.detail-group.detail-group-mult-pm-1_5   { border-left: 3px solid rgba(234, 88, 12, .55); }
.detail-group.detail-group-mult-pm-2     { border-left: 3px solid rgba(192, 38, 211, .55); }
.detail-group.detail-group-mult-dc-0_8   { border-left: 3px solid rgba(132, 204, 22, .55); }
.detail-group.detail-group-mult-dc-0_6   { border-left: 3px solid rgba(16, 185, 129, .55); }
.detail-group.detail-group-mult-dc-0_4   { border-left: 3px solid rgba(5, 150, 105, .55); }
.detail-group.detail-group-mult-dc-0     { border-left: 3px solid rgba(14, 165, 233, .55); }
/* ============ 令牌页：接入地址栏 ============ */
.base-url-bar { margin-bottom: 16px; padding: 14px 16px; }
.base-url-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.base-url-list { display: flex; flex-direction: column; gap: 8px; }
.base-url-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--bg-soft);
  border: 1px solid var(--border-soft); border-radius: 8px;
}
.base-url-text { flex: 1; font-size: 13px; color: var(--accent-2); word-break: break-all; }

/* ============ 端点类型选择芯片 ============ */
.endpoint-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.endpoint-chip {
  position: relative; cursor: pointer;
  padding: 6px 14px; border-radius: 20px;
  background: var(--surface-3); border: 1px solid var(--border-soft);
  font-size: 12.5px; color: var(--text-dim);
  transition: all .15s; user-select: none;
}
.endpoint-chip input { position: absolute; opacity: 0; pointer-events: none; }
.endpoint-chip:hover { border-color: var(--accent-2); }
.endpoint-chip.on { background: var(--accent-soft); border-color: var(--accent-2); color: var(--accent-2); }

/* ============ 档位定价可视化编辑 ============ */
.tier-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.tier-row { display: flex; align-items: center; gap: 6px; }
.tier-row .tier-name { flex: 1; }
.tier-row .tier-price { width: 100px; flex-shrink: 0; text-align: right; }
.tier-row .tier-unit-select { width: 100px; flex-shrink: 0; padding-left: 8px; padding-right: 10px; }
.tier-unit { color: var(--text-faint); font-size: 12px; flex-shrink: 0; }
.tier-row .tier-del { color: var(--danger); padding: 5px 9px; flex-shrink: 0; }

/* 下游定价 · 长上下文分档（long_context）：与普通表单行融合，仅用间距区分 */
.ctx-tier-block {
  margin-top: 12px;
}
.ctx-tier-block .grid { margin-bottom: 0; }

/* 价格输入框：纯手工输入，隐藏 number 上下箭头 */
.price-input { -moz-appearance: textfield; appearance: textfield; }
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.auth-hint a { color: var(--accent-2); cursor: pointer; }
.auth-hint a:hover { text-decoration: underline; }

/* ============ 角色与权限 ============ */
.role-badge {
  font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 20px;
  vertical-align: middle; margin-left: 6px; white-space: nowrap;
}
.role-badge.admin { background: var(--accent-soft); color: var(--accent-2); border: 1px solid rgba(99,102,241,.3); }
.role-badge.user { background: var(--surface-3); color: var(--text-dim); }
.role-switch {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: 10px; margin-top: 10px;
}
.role-switch button {
  flex: 1; padding: 6px 0; border: none; border-radius: 7px;
  background: transparent; color: var(--text-faint);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.role-switch button:hover { color: var(--text-dim); }
.role-switch button.active { background: var(--accent); color: #fff; }

/* ============ 渠道余额 ============ */
.upstream-balance {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; margin: 10px 0;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: 8px; font-size: 13px;
}
.upstream-balance span { color: var(--text-faint); font-size: 12px; }
.upstream-balance b { font-family: var(--mono); font-size: 15px; }
.balance-warn { font-size: 11px; font-weight: 600; color: var(--danger) !important; font-family: var(--font) !important; }

/* ============ 扣费排行进度条 ============ */
.rank-bar { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ============ 上游日志明细展开 ============ */
tr.expandable .expand-arrow { color: var(--text-faint); font-size: 14px; font-weight: 700; text-align: center; transition: transform .15s; }
tr.expandable.expanded .expand-arrow { transform: rotate(90deg); color: var(--accent-2); }

.up-detail-err {
  margin: 12px 0; padding: 10px 14px; border-radius: 8px;
  background: var(--danger-soft); border: 1px solid rgba(248, 113, 113, .3);
  color: var(--danger); font-size: 12.5px;
}
.up-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 14px 0 4px;
}
.up-detail-block {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 12px 14px;
}
.up-detail-block h5 {
  font-size: 12.5px; font-weight: 650; color: var(--text);
  margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px;
}
.up-detail-block h5 small { font-weight: 400; color: var(--text-faint); font-size: 11px; }
.up-detail-kv {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 0; font-size: 12.5px; color: var(--text-dim);
  border-bottom: 1px dashed var(--border-soft);
}
.up-detail-kv:last-child { border-bottom: none; }
.up-detail-kv b { color: var(--text); font-weight: 600; }
.up-detail-kv.total b { color: var(--accent-2); font-size: 14px; }
.up-detail-result {
  background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.8; color: var(--text-dim);
}
.up-detail-json { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.json-pane {
  background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 8px;
  overflow: hidden;
}
.json-label {
  padding: 7px 12px; font-size: 11px; font-family: var(--mono);
  color: var(--text-faint); border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.json-pane pre {
  padding: 12px; font-family: var(--mono); font-size: 11px; line-height: 1.65;
  color: var(--text-dim); white-space: pre-wrap; word-break: break-all;
  max-height: 260px; overflow-y: auto; margin: 0;
}

/* ============ 左下角用户卡 ============ */
.user-card { cursor: pointer; border-radius: 10px; transition: background .15s; }
.user-card:hover { background: var(--surface-3); }
.user-card-arrow { width: 14px; height: 14px; color: var(--text-faint); margin-left: auto; flex-shrink: 0; }
.user-balance { color: var(--accent-2); font-weight: 650; }
.verify-ico {
  display: inline-grid; place-items: center; width: 13px; height: 13px;
  border-radius: 50%; background: var(--success); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
}

/* ============ 账户充值 ============ */
.recharge-balance {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-1));
}
.recharge-balance-num {
  font-size: 32px; font-weight: 750; font-family: var(--mono);
  color: var(--accent-2); margin-top: 4px; letter-spacing: .5px;
}
.recharge-balance-tip { font-size: 12.5px; color: var(--text-faint); max-width: 440px; line-height: 1.8; text-align: right; }
.pay-amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.pay-amount {
  padding: 10px 0; border: 1px solid var(--border-soft); background: var(--bg-soft);
  border-radius: 9px; color: var(--text-dim); font-weight: 650; font-size: 14px;
  cursor: pointer; font-family: var(--mono); transition: all .15s;
}
.pay-amount:hover { border-color: var(--accent-2); color: var(--text); }
.pay-amount.active { background: var(--accent-soft); border-color: var(--accent-2); color: var(--accent-2); }
.pay-amount-custom {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; color: var(--text-faint); border: 1px dashed var(--border-soft);
  border-radius: 9px; padding: 0 8px; white-space: nowrap;
}
.pay-amount-custom input {
  width: 64px; border: none; background: transparent; color: var(--text);
  font-family: var(--mono); font-size: 14px; font-weight: 650; outline: none; text-align: center;
}
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.pay-method {
  display: flex; align-items: center; justify-content: center; gap: 9px; padding: 11px;
  border: 1px solid var(--border-soft); border-radius: 10px; background: var(--bg-soft);
  color: var(--text-dim); font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.pay-method:hover { border-color: var(--text-faint); color: var(--text); }
.pay-method.active { border-color: var(--accent-2); background: var(--accent-soft); color: var(--text); }
.pay-ico {
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.qr-box {
  display: flex; gap: 18px; align-items: center;
  background: var(--bg-soft); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 16px;
}
.qr-wrap {
  width: 168px; height: 168px; background: #fff; border-radius: 12px;
  padding: 11px; flex-shrink: 0; border: 2px solid var(--brand, var(--accent));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand, var(--accent)) 12%, transparent);
}
.qr-svg { width: 100%; height: 100%; display: block; }
.qr-svg rect { fill: #1a1f2e; }
.qr-meta { display: flex; flex-direction: column; gap: 9px; font-size: 13px; color: var(--text-dim); }
.qr-amount { font-size: 22px; font-family: var(--mono); color: var(--text); margin-left: 4px; font-weight: 700; }
.pay-note { font-size: 12.5px; color: var(--text-faint); line-height: 1.85; margin: 14px 0; }
.btn-block { width: 100%; padding: 11px 16px; justify-content: center; }
.redeem-row { display: flex; gap: 10px; }
.redeem-row .input { flex: 1; }
.code-list { display: flex; flex-direction: column; gap: 8px; }
.code-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 10px;
  background: var(--bg-soft);
}
.code-item.used { opacity: .5; }
.code-item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.code-item-main b { font-size: 13px; letter-spacing: .3px; }
.code-item-main .hint { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-item-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.code-issued {
  margin: 14px 0; padding: 13px; background: var(--bg-soft);
  border: 1px dashed var(--accent-2); border-radius: 10px;
  font-size: 17px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--accent-2); text-align: center;
}
.pay-success { text-align: center; padding: 6px 0; }
.pay-success-ico {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--success-soft); color: var(--success);
  display: grid; place-items: center; font-size: 28px; font-weight: 700;
}

/* ============ 账户资料弹窗 ============ */
.profile-head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border-soft); margin-bottom: 16px;
}
.profile-balance { text-align: right; margin-left: auto; }
.profile-balance b { display: block; font-size: 20px; font-family: var(--mono); color: var(--accent-2); }
.profile-section { margin-bottom: 14px; }
.profile-section h5 { font-size: 13px; color: var(--text-faint); font-weight: 600; margin: 0 0 6px; }
.bind-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed var(--border-soft);
}
.bind-row:last-child { border-bottom: none; }
.bind-ico {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-2); font-size: 15px; flex-shrink: 0;
}
.bind-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bind-info strong { font-size: 13.5px; font-weight: 600; }
.bind-info span { font-size: 12px; color: var(--text-faint); }
.bind-row .btn { flex-shrink: 0; }

/* ============ 登录 / 注册屏（固定深色科技风） ============ */
.auth-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(1200px 800px at 70% -10%, #101736 0%, #070a14 55%);
  overflow: hidden; color: #e2e8f0; display: block;
}
.auth-screen[hidden] { display: none; }
#auth-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-glow { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .3; pointer-events: none; }
.auth-glow-1 { width: 520px; height: 520px; background: #6366f1; top: -140px; left: -120px; animation: authFloat 14s ease-in-out infinite; }
.auth-glow-2 { width: 460px; height: 460px; background: #0ea5e9; bottom: -160px; right: -100px; animation: authFloat 18s ease-in-out infinite reverse; }
@keyframes authFloat { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(46px, 30px); } }
.auth-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(99, 102, 241, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.auth-wrap {
  position: relative; z-index: 1;
  margin: 0 auto; top: 50%; transform: translateY(-50%);
  display: grid; grid-template-columns: 1.05fr 400px; gap: 64px; align-items: center;
  width: min(940px, 92vw);
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; }
.auth-side h1 {
  font-size: 38px; line-height: 1.3; font-weight: 800; margin: 24px 0 16px;
  background: linear-gradient(120deg, #ffffff 20%, #a5b4fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-side p { color: #94a3b8; font-size: 14.5px; line-height: 1.8; }
.auth-points { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: #cbd5e1; font-size: 13.5px; }
.auth-points b {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(99, 102, 241, .15); border: 1px solid rgba(129, 140, 248, .25); flex-shrink: 0;
}
.auth-card {
  background: rgba(15, 20, 36, .72); backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, .18); border-radius: 18px;
  padding: 30px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.auth-tabs {
  display: flex; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(148, 163, 184, .12); border-radius: 10px; padding: 4px; margin-bottom: 22px;
}
.auth-tabs button {
  flex: 1; padding: 9px 0; border: none; background: transparent; color: #94a3b8;
  font-weight: 650; font-size: 14px; border-radius: 8px; cursor: pointer;
  transition: all .18s; font-family: inherit;
}
.auth-tabs button.active {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff; box-shadow: 0 6px 18px rgba(99, 102, 241, .4);
}
.auth-card h2 { font-size: 22px; font-weight: 750; color: #f1f5f9; }
.auth-sub { color: #94a3b8; font-size: 12.5px; margin: 6px 0 20px; }
.auth-fields { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: #cbd5e1; }
.auth-field em { color: #64748b; font-style: normal; }
.auth-field input {
  background: rgba(255, 255, 255, .05) !important; border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 10px; padding: 11px 13px; color: #f1f5f9; font-size: 14px;
  outline: none; transition: border .15s, box-shadow .15s; font-family: inherit;
}
/* 浏览器自动填充时强制保持深色背景 */
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0e1118 inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
}
.auth-field input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99, 102, 241, .25); }
.auth-field input::placeholder { color: #475569; }
/* 密码框：外层定位包裹 + 右侧可见性切换按钮，保证与其它输入框渲染一致 */
.auth-field .input-wrapper { position: relative; display: block; }
.auth-field .input-wrapper input { width: 100%; padding-right: 42px; }
.toggle-password {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 8px;
  color: #94a3b8; cursor: pointer;
  transition: color .15s, background .15s;
}
.toggle-password:hover { color: #e2e8f0; background: rgba(148, 163, 184, .15); }
.toggle-password svg { width: 16px; height: 16px; display: block; }
.auth-hint { font-size: 12px; color: #64748b; margin: -6px 0 14px; text-align: center; }
/* 验证码：输入框 + 图片 + 刷新按钮 同行排布，固定行高 40px；宽度自动收缩不超出卡片 */
.auth-captcha { display: flex; align-items: center; gap: 6px; height: auto; width: 100%; }
.auth-captcha input {
  flex: 1 1 auto; min-width: 70px;
  padding: 11px 13px; font-size: 14px; letter-spacing: 1px;
  font-family: inherit;
  background: rgba(255, 255, 255, .05); color: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, .25); border-radius: 10px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-captcha input::placeholder { color: #475569; }
.auth-captcha input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99, 102, 241, .25); }
.auth-captcha-img {
  flex: 0 0 auto; width: 140px; height: 42px; border-radius: 10px; cursor: pointer;
  background: #fff; border: 1px solid rgba(148, 163, 184, .25);
  object-fit: fill; image-rendering: pixelated; display: block;
}
.auth-captcha-img.loading { opacity: .55; }
.auth-captcha-refresh {
  flex: 0 0 auto; width: 36px; height: 42px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .05); color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, .25); border-radius: 10px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.auth-captcha-refresh:hover { color: #e2e8f0; background: rgba(148, 163, 184, .12); border-color: #94a3b8; }
.auth-captcha-refresh svg { width: 16px; height: 16px; display: block; }
/* 登录/注册表单内联错误提示（显示在提交按钮上方，不依赖 toast） */
.auth-error {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 0 14px; padding: 10px 12px;
  border-radius: 10px; font-size: 12.5px; line-height: 1.5;
  background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .35);
  color: #fca5a5;
}
.auth-error[hidden] { display: none; }
.auth-error svg { flex-shrink: 0; margin-top: 1px; }
.auth-error.ok { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .35); color: #6ee7b7; }
.auth-submit { padding: 12px 16px; font-size: 15px; font-weight: 700; }
/* 登录表单"保持登录"复选框 */
.auth-remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: #94a3b8; cursor: pointer;
  margin: -4px 0 0; user-select: none;
}
.auth-remember input {
  width: 15px; height: 15px; margin: 0; cursor: pointer;
  accent-color: #6366f1; flex-shrink: 0;
}
.auth-remember:hover { color: #e2e8f0; }
/* 注册表单「同意服务协议与隐私政策」复选框：点链接打开协议页，点其余文字勾选 */
.auth-agree-check { margin: 2px 0 0; }
.auth-agree-check a { color: #818cf8; text-decoration: none; }
.auth-agree-check a:hover { text-decoration: underline; }
.auth-footer {
  position: absolute; bottom: 22px; left: 0; right: 0; text-align: center;
  color: #475569; font-size: 12px; z-index: 1;
}
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 0; }
  .auth-side { display: none; }
}

/* ============ 顶栏主题下拉 ============ */
.theme-menu-wrap { position: relative; }
/* 语言按钮：与 icon-btn 高度一致，宽度按文字自适应 */
.lang-btn { width: auto; min-width: 38px; padding: 0 10px; gap: 0; }
.lang-code { font-size: 12.5px; font-weight: 600; letter-spacing: .03em; line-height: 1; }
.lang-pop { min-width: 180px; }
.theme-pop {
  /* 默认隐藏，JS 在点击时显示并 portal 到 body 置顶 */
  position: fixed; display: none;
  min-width: 150px; padding: 6px;
  margin: 0;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  color: var(--text-dim);
  z-index: 2147483647;
  isolation: isolate;
}
[data-theme="light"] .theme-pop {
  background: #ffffff;
}
[data-theme="light"] .theme-pop button:hover { background: #f1f4fa; color: var(--text); }
.theme-pop.open { display: flex; flex-direction: column; gap: 2px; }
.theme-pop button {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-dim);
  font-size: 13px; font-family: inherit; text-align: left; cursor: pointer;
  transition: background .12s, color .12s;
}
.theme-pop button:hover { background: var(--surface-3); color: var(--text); }
.theme-pop button.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 650; }

/* ============================================================
   接口文档独立页（doc.html）—— 随系统主题
   ============================================================ */
.doc-page { display: flex; height: 100vh; width: 100vw; background: var(--bg); }
.doc-aside {
  width: 292px; min-width: 292px; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(18, 21, 31, .92), rgba(10, 12, 18, .96));
  border-right: 1px solid var(--border-soft); display: flex; flex-direction: column;
}
[data-theme="light"] .doc-aside {
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(238, 241, 247, .97));
}
.doc-aside-head {
  display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border-soft); position: sticky; top: 0;
  background: inherit; z-index: 2;
}
.doc-aside-head .logo-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
.doc-aside-head strong { font-size: 15px; color: var(--text); }
.doc-aside-head small { display: block; font-size: 11px; color: var(--text-faint); }
.doc-toc { padding: 12px 10px 28px; display: flex; flex-direction: column; gap: 1px; }
.doc-toc-empty { font-size: 12px; color: var(--text-faint); padding: 8px 10px; }
.doc-toc-item {
  display: block; padding: 7px 10px; border-radius: 8px; font-size: 13px;
  color: var(--text-dim); cursor: pointer; border: none; background: transparent;
  text-align: left; font-family: inherit; line-height: 1.45;
  transition: background .12s, color .12s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-toc-item:hover { background: var(--surface-3); color: var(--text); }
.doc-toc-item.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.doc-toc-item.lv1 { font-weight: 650; color: var(--text); }
.doc-toc-item.lv2 { padding-left: 22px; }
.doc-toc-item.lv3 { padding-left: 36px; font-size: 12.5px; }
.doc-main { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; }
.doc-main-inner { max-width: 960px; margin: 0 auto; padding: 40px 44px 96px; }
.doc-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  font-size: 12px; color: var(--text-faint);
}
.doc-meta .badge { font-size: 11px; }
.doc-empty {
  height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; color: var(--text-faint);
}
.doc-empty svg { width: 56px; height: 56px; opacity: .5; }
.doc-empty strong { font-size: 18px; color: var(--text-dim); font-weight: 650; }

/* Markdown 正文排版 */
.md-body { color: var(--text); font-size: 14.5px; line-height: 1.85; }
.md-body > *:first-child { margin-top: 0; }
.md-body h1 { font-size: 28px; font-weight: 720; margin: 0 0 18px; letter-spacing: -.3px; }
.md-body h2 {
  font-size: 21px; font-weight: 700; margin: 38px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.md-body h3 { font-size: 17px; font-weight: 680; margin: 26px 0 10px; }
.md-body h4 { font-size: 15px; font-weight: 650; margin: 20px 0 8px; }
.md-body p { margin: 0 0 14px; }
.md-body ul, .md-body ol { margin: 0 0 14px; padding-left: 24px; }
.md-body li { margin: 5px 0; }
.md-body a { color: var(--accent-2); text-decoration: none; }
.md-body a:hover { text-decoration: underline; }
.md-body strong { font-weight: 680; color: var(--text); }
.md-body hr { border: none; border-top: 1px solid var(--border-soft); margin: 28px 0; }
.md-body blockquote {
  margin: 0 0 16px; padding: 10px 16px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--text-dim);
}
.md-body code {
  font-family: var(--mono); font-size: 12.8px; padding: 2px 6px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--border-soft); color: var(--accent-2);
}
.md-body pre {
  margin: 0 0 18px; padding: 16px 18px; border-radius: 12px; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--border-soft);
}
.md-body pre code {
  background: transparent; border: none; padding: 0; font-size: 13px;
  color: var(--text); line-height: 1.7;
}
.md-body table {
  width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 13.5px;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.md-body th, .md-body td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-soft); }
.md-body th { background: var(--surface-2); font-weight: 650; color: var(--text); }
.md-body tr:last-child td { border-bottom: none; }

/* 接口文档下拉菜单（顶栏"文"字图标） */
.doc-dropdown-menu{
  position:absolute; top:calc(100% + 8px); right:0;
  min-width:280px; background:var(--surface-3);
  border:1px solid var(--border); border-radius:10px;
  padding:6px; box-shadow:var(--shadow);
  z-index:50;
}
.doc-dropdown-menu button{
  display:flex; gap:10px; align-items:flex-start;
  width:100%; padding:10px 12px; border:0; background:none;
  border-radius:8px; cursor:pointer; color:var(--text);
  text-align:left; font:inherit;
}
.doc-dropdown-menu button:hover{ background:var(--surface-2) }
.doc-dropdown-menu .dd-icon{ font-size:18px; line-height:1.2 }
.doc-dropdown-menu .dd-main{ display:flex; flex-direction:column; gap:2px }
.doc-dropdown-menu .dd-main b{ font-size:13px; font-weight:600 }
.doc-dropdown-menu .dd-main small{ color:var(--text-faint); font-size:11.5px; line-height:1.4 }

/* ---------------- 文档在线编辑器（modal） ---------------- */
.doc-editor-mask{
  position:fixed; inset:0; background:var(--bg-soft,.72);
  display:flex; align-items:stretch; justify-content:center;
  z-index:200; backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  animation:docEdFade .15s ease-out;
}
@keyframes docEdFade{ from{opacity:0} to{opacity:1} }
.doc-editor{
  width:min(1400px, 96vw); height:min(92vh, 880px); margin:auto;
  background:var(--surface-3); color:var(--text,#e8ecf3);
  border:1px solid var(--border); border-radius:14px;
  display:flex; flex-direction:column; overflow:hidden;
  box-shadow:var(--shadow);
  animation:docEdPop .18s ease-out;
}
@keyframes docEdPop{ from{transform:translateY(8px) scale(.985); opacity:.6} to{transform:none; opacity:1} }
.doc-editor-bar{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:12px 18px; border-bottom:1px solid var(--border);
  background:var(--surface-2);
}
.doc-editor-bar-left{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; min-width:0 }
.doc-editor-bar-left strong{ font-size:14px; font-weight:600 }
.doc-editor-name{
  background:var(--surface-3); color:var(--text,#e8ecf3);
  border:1px solid var(--border); border-radius:8px;
  padding:6px 10px; font-size:13px; min-width:220px; max-width:320px;
  outline:none; transition:border-color .15s;
}
.doc-editor-name:focus{ border-color:var(--accent,#7c8cff) }
.doc-editor-stat{ font-size:11.5px; color:var(--text-faint,#8c93a8) }
.doc-editor-bar-right{ display:flex; gap:8px; flex-shrink:0 }
.doc-editor-body{
  flex:1; display:grid; grid-template-columns:1fr 1fr; min-height:0;
}
.doc-editor-body textarea{
  width:100%; height:100%; resize:none;
  background:var(--surface-2); color:var(--text,#e8ecf3);
  border:none; border-right:1px solid var(--border);
  padding:18px 22px; font-family:"JetBrains Mono","SF Mono","Consolas","Menlo",monospace;
  font-size:13px; line-height:1.65; outline:none; tab-size:2;
}
.doc-editor-body textarea:focus{ background:var(--surface-3) }
.doc-editor-preview{
  height:100%; overflow:auto; padding:18px 24px;
  background:var(--surface-3);
  font-size:14px; line-height:1.75;
}
.doc-editor-preview h1,.doc-editor-preview h2,.doc-editor-preview h3,
.doc-editor-preview h4,.doc-editor-preview h5,.doc-editor-preview h6{
  margin:1.2em 0 .6em; font-weight:600; line-height:1.35;
}
.doc-editor-preview h1{ font-size:1.7em; padding-bottom:.3em; border-bottom:1px solid var(--border) }
.doc-editor-preview h2{ font-size:1.4em; padding-bottom:.25em; border-bottom:1px solid var(--border) }
.doc-editor-preview h3{ font-size:1.2em }
.doc-editor-preview p{ margin:.6em 0 }
.doc-editor-preview a{ color:var(--accent,#7c8cff); text-decoration:none }
.doc-editor-preview a:hover{ text-decoration:underline }
.doc-editor-preview ul,.doc-editor-preview ol{ margin:.5em 0; padding-left:1.6em }
.doc-editor-preview li{ margin:.2em 0 }
.doc-editor-preview blockquote{
  margin:.8em 0; padding:.5em .9em;
  border-left:3px solid var(--accent,#7c8cff);
  background:var(--surface-2); color:var(--text-faint,#8b95a8); border-radius:0 6px 6px 0;
}
.doc-editor-preview code{
  background:var(--surface-2); padding:1px 6px; border-radius:4px;
  font-family:"JetBrains Mono","SF Mono","Consolas","Menlo",monospace; font-size:.92em;
}
.doc-editor-preview pre{
  background:var(--surface-2); padding:14px 16px; border-radius:8px;
  overflow:auto; border:1px solid var(--border); line-height:1.55;
}
.doc-editor-preview pre code{ background:none; padding:0; font-size:.92em }
.doc-editor-preview table{
  border-collapse:collapse; width:100%; margin:.8em 0; font-size:.95em;
}
.doc-editor-preview th,.doc-editor-preview td{
  border:1px solid var(--border); padding:6px 10px; text-align:left;
}
.doc-editor-preview th{ background:var(--surface-2); font-weight:600 }
.doc-editor-preview hr{ border:none; border-top:1px solid var(--border); margin:1.4em 0 }
.doc-editor-preview img{ max-width:100%; height:auto; border-radius:6px }
.doc-editor-foot{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:8px 18px; border-top:1px solid var(--border);
  background:var(--surface-2); font-size:11.5px; color:var(--text-faint,#8b95a8);
}
.doc-editor-autosave{ font-style:italic; opacity:.85 }
.doc-editor-autosave.ok{ color:var(--success,#3ecf8e) }
.doc-editor-autosave.err{ color:var(--danger,#ff6b6b) }

@media (max-width: 860px){
  .doc-editor{ width:100vw; height:100vh; border-radius:0 }
  .doc-editor-body{ grid-template-columns:1fr; grid-template-rows:1fr 1fr }
  .doc-editor-body textarea{ border-right:none; border-bottom:1px solid var(--border) }
  .doc-editor-bar{ flex-direction:column; align-items:flex-start }
  .doc-editor-bar-right{ width:100%; justify-content:flex-end; flex-wrap:wrap }
  .doc-editor-name{ min-width:0; max-width:100%; flex:1 }
}

/* ---------------- 文档页顶部工具栏（doc.html） ---------------- */
.doc-toolbar{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; justify-content:space-between;
  padding:5px 18px; height:42px;
  background:var(--surface-3);
  border-bottom:1px solid var(--border);
  font-size:12.5px;
  backdrop-filter:saturate(160%) blur(8px); -webkit-backdrop-filter:saturate(160%) blur(8px);
}
.doc-toolbar-back,
.doc-toolbar-api{
  color:var(--text-dim,#9aa3b2); text-decoration:none;
  padding:4px 10px; border-radius:6px; transition:.15s;
}
.doc-toolbar-back:hover,
.doc-toolbar-api:hover{ background:var(--surface-2); color:var(--text,#e8ecf3); text-decoration:none }
.doc-toolbar-api{
  background:rgba(124,140,255,.10); color:var(--accent,#7c8cff);
  border:1px solid rgba(124,140,255,.25);
}
.doc-toolbar-api:hover{ background:rgba(124,140,255,.18); color:var(--accent,#7c8cff) }
.doc-toolbar-title{
  font-weight:600; color:var(--text,#e8ecf3);
  letter-spacing:.2px;
}
