/* ============================================================
   金豚云 · TikHub 风设计系统（T0）
   ============================================================ */

:root {
  --bg: #f9fafb;
  --bg-app: #f9fafb;
  --panel: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;

  --text: #1a1a1a;
  --text-2: #374151;
  --text-3: #6b7280;
  --text-4: #9ca3af;

  /* 主操作：黑（TikHub primary） */
  --primary: #1a1a1a;
  --primary-hover: #2d2d2d;
  --primary-fg: #fafaf9;

  /* 点缀：靛蓝（链接 / focus / 选中） */
  --accent: #6366f1;
  --accent-2: #4f46e5;
  --accent-hover: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);

  --gold: #1a1a1a;
  --gold-hover: #2d2d2d;
  --gold-soft: #f1f5f9;

  --green: #10b981;
  --red: #ef4444;
  --warn: #f59e0b;

  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --shadow-sm: none;
  --shadow: none;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 12px;
  --radius-pill: 999px;

  --font-display: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Code", monospace;

  --control-h: 44px;
  --control-h-sm: 40px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

#starfield,
.aurora { display: none !important; }

main, .topbar, .footer { position: relative; z-index: 10; }

a { color: inherit; text-decoration: none; }

/* ============================================================
   顶栏导航
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 60px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand .logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.brand .logo svg { display: block; }
.brand .logo .logo-img {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  background: #fff;
}
body.is-app .app-brand .logo .logo-img,
.app-sidebar-brand .logo .logo-img { border-radius: 8px; }
.auth-split-brand .logo .logo-img,
.auth-brand .logo .logo-img { border-radius: 9px; }

.brand .brand-name b { color: var(--accent); font-weight: 700; }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 7px 16px;
  border-radius: 8px;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a.active {
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 600;
}

.nav-user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-3); }
.nav-user .phone { font-weight: 500; color: var(--text-2); }
.nav-user .logout { color: var(--text-4); }
.nav-user .logout:hover { color: var(--red); }

/* ============================================================
   容器
   ============================================================ */
.container { max-width: 880px; margin: 0 auto; padding: 40px 20px 56px; width: 100%; }

/* ============================================================
   落地页 Hero（精简，聚焦登录框）
   ============================================================ */
.hero {
  padding: 48px 20px 36px;
  text-align: center;
}
.hero .hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 9999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}
.hero h1 {
  font-size: 44px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.15;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .tagline {
  font-size: 18px;
  color: var(--text-2);
  margin-bottom: 10px;
  font-weight: 400;
}
.hero .trust {
  font-size: 13px;
  color: var(--text-4);
  margin-bottom: 40px;
}
.hero .trust span { margin: 0 6px; color: var(--text-3); }

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 780px;
  margin: 0 auto 40px;
  text-align: left;
}
.feature {
  background: rgba(20,22,26,0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color .2s, transform .2s;
}
.feature:hover {
  border-color: rgba(34,211,238,0.4);
  transform: translateY(-2px);
}
.feature .icon { font-size: 22px; margin-bottom: 12px; }
.feature .title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.feature .desc { font-size: 13px; color: var(--text-3); line-height: 1.6; }

/* ============================================================
   登录框（玻璃卡片）
   ============================================================ */
.login-wrap { max-width: 400px; margin: 0 auto; }
.login-box {
  background: rgba(25,26,27,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.login-box h2 { font-size: 20px; color: var(--text); text-align: center; margin-bottom: 6px; font-weight: 600; }
.login-box .sub { font-size: 13px; color: var(--text-4); text-align: center; margin-bottom: 26px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-3); margin-bottom: 6px; font-weight: 500; }
.field input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
  transition: border .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--text-4); }
.field input:not([type="checkbox"]):not([type="radio"]):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.18);
}

/* 主按钮：青蓝渐变 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, #38bdf8, #06b6d4);
  color: #031018;
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.32);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .05s;
  letter-spacing: 0.5px;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }
.btn.block { width: 100%; }
.btn.ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn.ghost:hover { background: rgba(255,255,255,0.08); }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

.hint { font-size: 12px; color: var(--text-4); text-align: center; margin-top: 14px; line-height: 1.6; }
.msg { font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }

/* ============================================================
   卡片（玻璃拟态）
   ============================================================ */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}
.card h2 { font-size: 16px; color: var(--text); margin-bottom: 16px; font-weight: 600; }
.card .card-sub { font-size: 13px; color: var(--text-3); margin-bottom: 16px; line-height: 1.6; }

/* ============================================================
   统计卡片
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(8px);
}
.stat .label { font-size: 13px; color: var(--text-3); margin-bottom: 10px; }
.stat .value { font-size: 28px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.stat .value.gold { color: var(--gold); text-shadow: 0 0 24px rgba(230,180,80,0.25); }
.stat .unit { font-size: 14px; font-weight: 400; color: var(--text-4); margin-left: 3px; }

/* ============================================================
   Key 展示
   ============================================================ */
.key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  margin-bottom: 10px;
}
.key-box code {
  flex: 1;
  font-size: 13px;
  word-break: break-all;
  color: var(--text-2);
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, Consolas, monospace;
}
.key-box .copy {
  padding: 7px 14px;
  background: rgba(34,211,238,0.14);
  color: var(--accent-hover);
  border: 1px solid rgba(34,211,238,0.35);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.key-box .copy:hover { background: rgba(34,211,238,0.24); }

/* ============================================================
   步骤引导
   ============================================================ */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.step .txt { font-size: 14px; color: var(--text-2); line-height: 1.7; }
.step .txt b { color: var(--text); }

/* ============================================================
   充值
   ============================================================ */
.balance-banner {
  background: linear-gradient(135deg, rgba(34,211,238,0.16), rgba(37,99,235,0.12));
  border: 1px solid rgba(34,211,238,0.28);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}
.balance-banner .label { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.balance-banner .amount { font-size: 40px; font-weight: 600; color: var(--gold); text-shadow: 0 0 28px rgba(230,180,80,0.3); }
.balance-banner .amount small { font-size: 20px; font-weight: 500; }

.amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.amount-grid button {
  padding: 18px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
}
.amount-grid button:hover, .amount-grid button.selected {
  border-color: var(--accent);
  background: rgba(34,211,238,0.12);
  color: var(--text);
}
.amount-grid button .bonus { display: block; font-size: 11px; font-weight: 500; color: var(--gold); margin-top: 3px; }

.pay-method { display: flex; gap: 12px; margin-bottom: 22px; }
.pay-method label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  transition: all .15s;
}
.pay-method label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(34,211,238,0.12);
  color: var(--text);
}
.pay-method input { display: none; }

/* ============================================================
   模型卡片
   ============================================================ */
.category-block { margin-bottom: 28px; }
.category-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.category-title h3 { font-size: 16px; color: var(--text); font-weight: 600; }
.category-title .count { font-size: 12px; color: var(--text-4); }
.category-desc { font-size: 12px; color: var(--text-4); margin-bottom: 12px; }

.model-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.model-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 16px;
  transition: border-color .15s;
}
.model-card:hover { border-color: rgba(34,211,238,0.45); }
.model-card .m-vendor { font-size: 12px; color: var(--accent-hover); font-weight: 500; margin-bottom: 4px; }
.model-card .m-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.model-card .m-id {
  font-size: 11px;
  color: var(--text-4);
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  word-break: break-all;
}

.search-box {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 26px;
  transition: border .15s;
}
.search-box::placeholder { color: var(--text-4); }
.search-box:focus { outline: none; border-color: var(--accent); }

/* ============================================================
   页脚
   ============================================================ */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: rgba(15,16,17,0.5);
  padding: 28px 20px 32px;
  text-align: center;
}
.footer .f-brand { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.footer .f-links { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.footer .f-links a { margin: 0 10px; }
.footer .f-links a:hover { color: var(--accent-hover); }

/* ============================================================
   控制台 · 明亮企业布局（侧栏 + 页头 + 内容区）
   ============================================================ */
body.is-app {
  min-height: 100vh;
  background: var(--bg-app);
}

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

.app-nav-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-2);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.app-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.35);
}

.app-sidebar {
  width: 256px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--border);
  box-shadow: none;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  text-decoration: none;
  color: inherit;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}
body.is-app .app-brand .logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: none;
  color: #fff;
}
.app-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 12px 12px;
}
.app-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}
.app-nav-item.active .nav-icon { opacity: 1; stroke: var(--accent-2); }
.app-nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.app-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 600;
}
body.is-app .app-nav-item.active {
  background: transparent;
  color: var(--accent-2);
}
.app-sidebar-foot {
  padding: 16px 18px 20px;
  border-top: 1px solid var(--border);
}
.app-user-phone {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
  font-weight: 500;
}
.app-logout {
  font-size: 13px;
  color: var(--text-4);
  text-decoration: none;
}
.app-logout:hover { color: var(--red); }

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 36px 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}
.page-header-main h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -0.03em;
}
.page-header-main p {
  font-size: 13px;
  color: var(--text-3);
  margin: 0 0 20px;
}
.page-header-aside {
  text-align: right;
  padding-bottom: 20px;
}
.aside-label {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
}
.aside-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.app-content {
  flex: 1;
  padding: 20px 36px 48px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.metric-row-3 {
  grid-template-columns: repeat(3, 1fr);
}
.metric-row-4 {
  grid-template-columns: repeat(4, 1fr);
}
.metric {
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.metric-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.metric-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.metric-value.accent-gold { color: var(--gold); }
.metric-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-4);
}

.section-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.section-head p,
.section-card > .subsection h3 {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
}
.subsection {
  margin: 20px 0 16px;
}
.subsection h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin: 0 0 12px;
}

.empty-hint {
  font-size: 13px;
  color: var(--text-3);
  padding: 12px 0 4px;
}

.guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guide-list li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: baseline;
  font-size: 13px;
  color: #94a3b8;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.guide-list li:first-child { border-top: none; padding-top: 0; }
.guide-list li strong {
  color: #e2e8f0;
  font-weight: 600;
}

.toolbar {
  margin-bottom: 20px;
}
.toolbar .search-box {
  margin-bottom: 0;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

body.is-app .btn-primary,
body.is-auth .btn-primary,
.btn.btn-primary,
.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: none;
  letter-spacing: 0;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  min-height: var(--control-h);
  padding: 0 24px;
}
body.is-app .btn-primary:hover:not(:disabled),
body.is-auth .btn-primary:hover:not(:disabled),
.btn.btn-primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  filter: none;
  opacity: 1;
}
body.is-app .btn-primary.sm,
body.is-auth .btn-primary.sm,
.btn.btn-primary.sm {
  min-height: var(--control-h-sm);
  padding: 0 16px;
  font-size: 13px;
}
body.is-app .btn:not(.btn-ghost):not(.ghost) {
  box-shadow: none;
}
body.is-app .btn.sm {
  padding: 8px 14px;
  font-size: 13px;
}

body.is-app .key-box {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
body.is-app .key-box code { flex: 1; min-width: 180px; }
body.is-app .copy {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.25);
  color: #7dd3fc;
}

body.is-app .amount-grid button {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
body.is-app .amount-grid button.selected {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.1);
}
body.is-app .amount-grid .bonus {
  display: block;
  margin-top: 4px;
}

body.is-app .pay-method label {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
}
body.is-app .model-card {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.07);
}
body.is-app .model-card:hover {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(255, 255, 255, 0.04);
}
body.is-app .category-block {
  margin-bottom: 24px;
}
body.is-app .category-title h3 {
  font-size: 14px;
  font-weight: 600;
}
body.is-app .model-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  body.is-app .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 控制台扩展组件 */
.alert-banner {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.alert-banner a { color: #7dd3fc; margin-left: 4px; }
.alert-banner.warn {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}
.alert-banner.danger {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.25);
}
.hint-line {
  margin: 12px 0 0;
  font-size: 12px;
  color: #64748b;
}
.hint-line a { color: #7dd3fc; }
.tab-bar {
  display: flex;
  gap: 4px;
}
.tab-bar .tab {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
}
.tab-bar .tab.active {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.25);
  color: #7dd3fc;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.select-sm {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: #cbd5e1;
  font-size: 13px;
}
.search-box.compact {
  max-width: 160px;
  padding: 8px 12px;
  font-size: 13px;
}
.status-pill.recharge { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-pill.consume { background: rgba(148,163,184,0.12); color: #94a3b8; }
.data-table td.pos { color: #4ade80; }
.data-table td.neg { color: #94a3b8; }
.data-table code.xs { font-size: 11px; color: #64748b; }
.code.xs.block { display: block; margin-top: 4px; }
.m-price {
  font-size: 12px;
  color: #7dd3fc;
  margin: 6px 0 4px;
}
.m-price.muted { color: #64748b; }
.app-content .legal-page {
  max-width: 720px;
}
body.is-legal .container,
body.is-legal main {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}
.legal-page h1 {
  font-size: 28px;
  color: #f1f5f9;
  margin: 0 0 8px;
}
.legal-page .legal-meta {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 32px;
}
.legal-page section {
  margin-bottom: 24px;
}
.legal-page h2 {
  font-size: 16px;
  color: #e2e8f0;
  margin: 0 0 8px;
}
.legal-page p {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.7;
  margin: 0;
}
.legal-page a { color: #7dd3fc; }
.section-card.compact { padding: 16px 20px; }
.budget-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
}
.budget-label { color: #64748b; }
.budget-nums { color: #e2e8f0; font-weight: 500; }
.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  transition: width 0.3s;
}
.key-row {
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.key-row:first-of-type { border-top: none; padding-top: 0; }
.key-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.key-name { font-size: 14px; font-weight: 600; color: #f1f5f9; }
.key-date { font-size: 12px; color: #64748b; }
.key-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.btn-ghost {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,0.04); color: #e2e8f0; }
.btn-ghost.sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost.xs { padding: 3px 8px; font-size: 11px; }
.btn-ghost.danger:hover { color: #f87171; border-color: rgba(248,113,113,0.3); }
.config-grid { display: flex; flex-direction: column; gap: 16px; }
.config-item .config-label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}
.config-value-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.config-value-row code {
  font-size: 13px;
  color: #7dd3fc;
  background: rgba(0,0,0,0.25);
  padding: 8px 12px;
  border-radius: 6px;
  word-break: break-all;
}
.config-value-row code.muted { color: #64748b; }
.code-block {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
  overflow-x: auto;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}
.info-list { margin: 0; }
.info-list > div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 13px;
}
.info-list > div:first-child { border-top: none; }
.info-list dt { color: #64748b; margin: 0; }
.info-list dd { color: #e2e8f0; margin: 0; }
.info-list .accent-gold { color: #e6b450; }
.setup-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.setup-checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.setup-checklist li.ok { border-color: rgba(34,197,94,0.2); }
.setup-checklist li.fail { border-color: rgba(248,113,113,0.25); background: rgba(248,113,113,0.06); }
.setup-checklist li.warn { border-color: rgba(251,191,36,0.25); }
.setup-checklist .check-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
}
.setup-checklist li.ok .check-icon { background: rgba(34,197,94,0.15); color: #4ade80; }
.setup-checklist li.fail .check-icon { background: rgba(248,113,113,0.15); color: #f87171; }
.setup-checklist li strong { display: block; color: #f1f5f9; margin-bottom: 2px; }
.setup-checklist li span { color: #64748b; }
.setup-checklist li code { font-size: 12px; color: #7dd3fc; }
.setup-checklist .check-env { display: block; margin-top: 4px; font-size: 11px; }
.compact-checklist li { padding: 10px 14px; }

.system-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(20,26,34,0.85);
}
.system-summary.ready { border-color: rgba(34,197,94,0.25); background: rgba(34,197,94,0.06); }
.system-summary.pending { border-color: rgba(251,191,36,0.2); background: rgba(251,191,36,0.05); }
.system-summary-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.system-summary.ready .system-summary-icon { background: rgba(34,197,94,0.15); color: #4ade80; }
.system-summary.pending .system-summary-icon { background: rgba(251,191,36,0.15); color: #fbbf24; }
.system-summary strong { display: block; color: #f1f5f9; margin-bottom: 2px; }
.system-summary span { font-size: 13px; color: #94a3b8; }
.env-check-table code { font-size: 11px; }
.steps-list {
  margin: 0; padding-left: 20px; color: #94a3b8; font-size: 13px; line-height: 1.8;
}
.steps-list code { color: #7dd3fc; font-size: 12px; }
.form-stack { max-width: 360px; }
.form-stack .field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
  color: #f1f5f9;
  font-size: 14px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.data-table th { color: #64748b; font-weight: 500; }
.data-table td { color: #cbd5e1; }
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}
.status-pill.paid { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-pill.pending { background: rgba(251,191,36,0.12); color: #fbbf24; }
.status-pill.expired { background: rgba(148,163,184,0.12); color: #94a3b8; }
.status-pill.failed { background: rgba(248,113,113,0.12); color: #f87171; }

.pay-modal { max-width: 400px; text-align: center; }
.pay-modal-meta strong { color: #fbbf24; font-weight: 600; }
.pay-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 14px;
  padding: 12px;
  background: #fff;
  border-radius: 10px;
}
.pay-qr { display: block; width: 220px; height: 220px; }
.pay-order-no code { font-size: 11px; color: #cbd5e1; }
.pay-countdown { color: #fbbf24; font-size: 12px; margin-bottom: 0; }
.m-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.m-id-row .m-id { flex: 1; min-width: 0; }

/* 本地开发提示 */
.dev-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.22);
}
.dev-banner strong { color: #bae6fd; font-weight: 600; }
.dev-banner span { color: #94a3b8; }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 32px 20px;
}
.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: rgba(103, 232, 249, 0.08);
  color: #67e8f9;
}
.empty-state.compact { padding: 20px; }
.empty-state .empty-title {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 8px;
}
.empty-state .empty-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 16px;
}

/* Toast */
.toast-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-color: rgba(34,197,94,0.35); }
.toast.err { border-color: rgba(248,113,113,0.35); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-box {
  width: 100%;
  max-width: 420px;
  background: #141a22;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0 0 14px;
}
.modal-text {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 12px;
  line-height: 1.6;
}
.modal-key { font-size: 11px; word-break: break-all; margin-bottom: 0; }
.modal-box .field { margin-bottom: 14px; }
.modal-box .field label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}
.modal-box .field input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.25);
  color: #f1f5f9;
  font-size: 14px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* 模型页 */
.toolbar-split {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.toolbar-split .search-box { flex: 1; min-width: 200px; margin-bottom: 0; }
.toolbar-meta { font-size: 12px; color: #64748b; white-space: nowrap; }
.model-card .m-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #67e8f9;
  background: rgba(103,232,249,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.recharge-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .recharge-layout { grid-template-columns: 1fr; }
}
.pay-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.amount-grid button .amt { display: block; font-size: 18px; font-weight: 600; }

@media (max-width: 900px) {
  .app-nav-toggle { display: flex; }
  .app-sidebar-backdrop[hidden] { display: none; }
  .app-sidebar-backdrop:not([hidden]) { display: block; }
  .app-shell { flex-direction: column; }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 50;
    flex-direction: column;
    flex-wrap: nowrap;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
    padding: 0;
  }
  body.nav-open .app-sidebar { transform: translateX(0); }
  .app-brand { padding: 18px 16px 12px; padding-left: 56px; }
  .app-nav {
    flex: 1;
    flex-direction: column;
    padding: 8px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    mask-image: none;
  }
  .app-sidebar-foot {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
  }
  .app-user-phone { margin-bottom: 0; }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 56px 20px 0;
  }
  .page-header-aside { text-align: left; padding-bottom: 16px; }
  .app-content { padding: 16px 20px 32px; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .metric-row-3 { grid-template-columns: 1fr; }
  .guide-list li { grid-template-columns: 1fr; gap: 4px; }
  .overview-hero { flex-direction: column; }
}

/* ============================================================
   登录页 · 大厂级 Landing
   ============================================================ */
body.is-landing {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: #030a14;
}
body.is-landing .landing-main {
  max-width: none;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}
body.is-landing .aurora {
  opacity: 0.48;
  background:
    radial-gradient(ellipse 22% 20% at 94% 46%, rgba(14,165,233,0.05), transparent 50%),
    radial-gradient(ellipse 38% 32% at 12% 8%, rgba(37,99,235,0.12), transparent 58%),
    radial-gradient(ellipse 55% 24% at 50% 108%, rgba(6,182,212,0.05), transparent 60%);
}

.landing {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding: clamp(16px, 2.5vh, 24px) clamp(8px, 1.5vw, 20px) clamp(16px, 2.5vh, 24px) clamp(24px, 5vw, 64px);
}
.landing-glow {
  position: fixed;
  inset: auto 0 0 0;
  height: 24vh;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse 50% 65% at 50% 100%, rgba(14,165,233,0.06), transparent 66%),
    radial-gradient(ellipse 22% 28% at 90% 88%, rgba(34,211,238,0.03), transparent 62%);
}

.landing-nav {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: clamp(52px, 7vh, 64px);
}
.landing-nav .brand {
  text-decoration: none;
  color: inherit;
}

.landing-body {
  position: relative;
  z-index: 12;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(400px, 540px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  overflow: visible;
}

.landing-copy {
  position: relative;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 36px;
  justify-content: center;
  min-height: 0;
  max-width: 520px;
  width: 100%;
  color: var(--text);
  animation: landing-in 0.7s cubic-bezier(.22,1,.36,1) both;
}
@keyframes landing-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.landing-copy h1 {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0;
  color: #f1f5f9;
  white-space: nowrap;
}
.landing-copy h1 em {
  font-style: normal;
  color: #67e8f9;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.model-tags span {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  padding: 7px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-panel {
  padding: 30px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.login-panel .field { margin-bottom: 12px; }
.login-panel .field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 6px;
}
.login-panel .field input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 15px;
  color: #f8fafc;
  transition: border-color 0.2s, background 0.2s;
}
.login-panel .field input::placeholder { color: #475569; }
.login-panel .field input:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.32);
}
.login-panel .field input:focus {
  outline: none;
  border-color: rgba(103, 232, 249, 0.5);
  background: rgba(0, 0, 0, 0.38);
}

.panel-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: #64748b;
  text-align: center;
  line-height: 1.5;
}

.trust-line {
  margin: 0;
  font-size: 12px;
  color: #475569;
  text-align: center;
  letter-spacing: 0.04em;
}

.btn-primary {
  margin-top: 8px;
  padding: 0 24px;
  min-height: var(--control-h);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-fg);
  background: var(--primary);
  box-shadow: none;
}
.btn-primary:hover:not(:disabled) {
  opacity: 1;
  background: var(--primary-hover);
  filter: none;
  box-shadow: none;
}
.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.btn-primary.is-loading .btn-label { opacity: 0.85; }

.login-panel .msg {
  margin-top: 10px;
  min-height: 18px;
}

.meta-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #cbd5e1;
}
.meta-steps b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(56,189,248,0.35), rgba(14,165,233,0.2));
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
.meta-steps .sep {
  width: 16px;
  height: 1px;
  background: linear-gradient(90deg, rgba(148,163,184,0.35), rgba(148,163,184,0.08));
}

.landing-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: visible;
  padding-right: 0;
  pointer-events: none;
  animation: landing-in 0.9s cubic-bezier(.22,1,.36,1) 0.08s both;
}
.earth-stage {
  position: relative;
  flex-shrink: 0;
  width: min(78vh, 100%, 680px);
  height: min(78vh, 100%, 680px);
  margin: 0 auto;
  perspective: 1000px;
  transform-style: preserve-3d;
  pointer-events: none;
}

/* 立体轨道：后半段在地球后面，前半段在地球前面，整体缓慢旋转 */
.orbit-scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}
.orbit-back {
  z-index: 1;
  clip-path: inset(0 0 50% 0);
  -webkit-clip-path: inset(0 0 50% 0);
}
.orbit-front {
  z-index: 3;
  clip-path: inset(50% 0 0 0);
  -webkit-clip-path: inset(50% 0 0 0);
}
.orbit-spinner {
  position: absolute;
  inset: 10%;
  transform-style: preserve-3d;
  animation: orbit-spin 32s linear infinite;
}
.orbit-ring {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  transform-style: preserve-3d;
  backface-visibility: visible;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.08);
}
.orbit-back .orbit-ring:nth-child(1) { transform: rotateX(68deg) rotateY(0deg); border-color: rgba(255,255,255,0.38); }
.orbit-back .orbit-ring:nth-child(2) { transform: rotateX(68deg) rotateY(72deg); border-color: rgba(255,255,255,0.32); }
.orbit-back .orbit-ring:nth-child(3) { transform: rotateX(68deg) rotateY(144deg); border-color: rgba(255,255,255,0.28); }
.orbit-front .orbit-ring:nth-child(1) { transform: rotateX(68deg) rotateY(0deg); border-color: rgba(255,255,255,0.55); }
.orbit-front .orbit-ring:nth-child(2) { transform: rotateX(68deg) rotateY(72deg); border-color: rgba(255,255,255,0.48); }
.orbit-front .orbit-ring:nth-child(3) { transform: rotateX(68deg) rotateY(144deg); border-color: rgba(255,255,255,0.42); }
@keyframes orbit-spin {
  from { transform: rotateY(0deg) rotateX(10deg); }
  to   { transform: rotateY(360deg) rotateX(10deg); }
}

@media (prefers-reduced-motion: reduce) {
  .orbit-spinner { animation: none; }
}
.earth-glow {
  position: absolute;
  inset: 16%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,0.14) 0%, rgba(34,211,238,0.05) 40%, transparent 52%);
  filter: blur(4px);
  pointer-events: none;
}
.earth-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 82%;
  transform: translate(-50%, -50%);
  line-height: 0;
  animation: earth-float 7s ease-in-out infinite;
}
@keyframes earth-float {
  0%, 100% { transform: translate(-50%, -50%); }
  50%      { transform: translate(-50%, calc(-50% - 10px)); }
}
.earth-wrap img {
  width: 100%;
  height: auto;
  display: block;
  filter:
    saturate(1.1)
    contrast(1.06)
    drop-shadow(0 0 18px rgba(56, 189, 248, 0.4))
    drop-shadow(0 0 32px rgba(34, 211, 238, 0.12));
}
.earth-sphere {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.35) 0%, transparent 42%),
    radial-gradient(circle at 70% 65%, #1e4d7a 0%, #0c2d4a 38%, #061525 72%);
  box-shadow:
    inset -18px -22px 40px rgba(0,0,0,0.45),
    0 0 60px rgba(56, 189, 248, 0.12);
  filter:
    drop-shadow(0 0 12px rgba(56, 189, 248, 0.38))
    drop-shadow(0 0 22px rgba(34, 211, 238, 0.1));
}

.landing-foot {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 clamp(14px, 2vh, 20px);
  font-size: 12px;
  color: #475569;
}
.landing-foot a {
  color: #64748b;
  transition: color 0.15s;
}
.landing-foot a:hover { color: #94a3b8; }
.landing-foot .foot-sep { color: #334155; user-select: none; }

@media (max-width: 900px) {
  .landing-body {
    grid-template-columns: 1fr;
    gap: clamp(8px, 1.5vh, 16px);
    align-content: center;
  }
  .landing-visual {
    order: -1;
    justify-content: center;
    max-height: min(34vh, 300px);
    padding-right: 0;
  }
  .earth-stage {
    width: min(72vw, min(34vh, 300px));
    height: min(72vw, min(34vh, 300px));
    margin-right: auto;
    transform: none;
  }
  .landing-copy {
    max-width: 400px;
    margin: 0 auto;
    gap: 24px;
  }
  .landing-copy h1 {
    font-size: 24px;
    white-space: normal;
  }
  .model-tags span { font-size: 11px; padding: 5px 10px; }
  .login-panel { padding: 22px; }
}
@media (max-width: 640px) {
  .landing { padding: 0 18px; }
  .login-panel .field input { padding: 12px; }
  .hero h1 { font-size: 38px; }
  .hero-features { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .model-grid { grid-template-columns: 1fr; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
}

.footer .f-copy { font-size: 12px; color: var(--text-4); line-height: 1.7; }
.footer .f-support { color: #64748b; }

/* 新手引导 */
.onboarding-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.onboarding-step.done {
  border-color: rgba(34,197,94,0.2);
  background: rgba(34,197,94,0.04);
}
.onboarding-step.active {
  border-color: rgba(103,232,249,0.25);
  background: rgba(103,232,249,0.06);
}
.step-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  color: #94a3b8;
}
.onboarding-step.done .step-mark {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}
.onboarding-step.active .step-mark {
  background: rgba(103,232,249,0.15);
  color: #67e8f9;
}
.step-body { flex: 1; min-width: 0; }
.step-body strong { display: block; color: #f1f5f9; font-size: 14px; }
.step-body span { font-size: 12px; color: #64748b; }
.step-link {
  font-size: 12px;
  color: #67e8f9;
  white-space: nowrap;
}

/* 接入页 */
.connect-test-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .recommend-grid { grid-template-columns: 1fr; }
}
.recommend-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}
.recommend-title { font-weight: 600; color: #f1f5f9; margin-bottom: 4px; }
.recommend-desc { font-size: 12px; color: #64748b; margin-bottom: 8px; line-height: 1.5; }
.recommend-id { display: block; font-size: 11px; color: #7dd3fc; margin-bottom: 8px; word-break: break-all; }
.guide-list.steps-plain li { grid-template-columns: 28px 1fr; }
.model-browse-cat {
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 0 12px 8px;
}
.model-browse-cat summary {
  cursor: pointer;
  padding: 12px 0;
  color: #e2e8f0;
  font-weight: 600;
}
.model-browse-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.faq-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.faq-list li {
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
}
.faq-list strong { display: block; color: #e2e8f0; margin-bottom: 2px; }
.muted.xs { font-size: 11px; color: #64748b; margin-left: 8px; }

/* 首页 Key  spotlight */
.key-spotlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid rgba(103, 232, 249, 0.2);
  background: rgba(103, 232, 249, 0.05);
  margin-bottom: 12px;
}
.key-spotlight-label {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}
.key-spotlight-name {
  display: block;
  color: #f1f5f9;
  font-size: 15px;
  margin-bottom: 6px;
}
.key-spotlight-main code {
  font-size: 12px;
  color: #7dd3fc;
  word-break: break-all;
}
.key-spotlight-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.key-manage-fold {
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 8px;
}
.key-manage-fold summary {
  cursor: pointer;
  font-size: 13px;
  color: #64748b;
  padding: 8px 0;
  user-select: none;
}
.key-manage-fold summary:hover { color: #94a3b8; }
.key-manage-body { padding-top: 8px; }

/* 接入：测试结果 */
.connect-test-block { margin-top: 16px; }
.connect-test-label { font-size: 12px; color: #64748b; margin-right: 8px; }
.test-model-pill {
  font-size: 12px;
  color: #7dd3fc;
  margin-right: 12px;
}
.test-result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.test-result.ok {
  border-color: rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.08);
}
.test-result.err {
  border-color: rgba(248,113,113,0.25);
  background: rgba(248,113,113,0.06);
}
.test-result-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.test-result.ok .test-result-icon {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}
.test-result.err .test-result-icon {
  background: rgba(248,113,113,0.15);
  color: #f87171;
}
.test-result strong { display: block; color: #f1f5f9; font-size: 14px; margin-bottom: 2px; }
.test-result p { margin: 0; font-size: 13px; color: #94a3b8; line-height: 1.5; }

.guide-fold summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
  padding: 4px 0;
}
.guide-fold-body { padding-top: 12px; }
.guide-fold-h {
  font-size: 13px;
  color: #94a3b8;
  margin: 16px 0 8px;
  font-weight: 600;
}
.guide-fold-h:first-child { margin-top: 0; }

/* 模型抽屉 */
body.drawer-open { overflow: hidden; }
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}
.drawer-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.drawer-panel {
  width: min(480px, 100vw);
  height: 100%;
  background: #0f1419;
  border-left: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-shadow: -12px 0 40px rgba(0,0,0,0.35);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer-overlay.show .drawer-panel { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.drawer-head h2 { margin: 0 0 4px; font-size: 18px; color: #f1f5f9; }
.drawer-head p { margin: 0; font-size: 12px; color: #64748b; }
.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}
.config-value-wrap { flex-wrap: wrap; }

/* ============================================================
   B-1 / B-2 明亮企业覆盖层
   ============================================================ */
body.is-app .guide-list li {
  color: var(--text-3);
  border-top-color: var(--border-subtle);
}
body.is-app .guide-list li strong { color: var(--text); }
body.is-app .toolbar .search-box {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}
body.is-app .key-box {
  background: var(--surface-2);
  border-color: var(--border);
}
body.is-app .key-box code { color: var(--accent-2); }
body.is-app .key-name { color: var(--text); }
body.is-app .alert-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a5f;
}
body.is-app .alert-banner a { color: var(--accent-2); }
body.is-app .alert-banner.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #78350f;
}
body.is-app .alert-banner.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
}
body.is-app .onboarding-step {
  border-color: var(--border);
  background: var(--surface-2);
}
body.is-app .onboarding-step.done {
  border-color: rgba(5, 150, 105, 0.25);
  background: rgba(5, 150, 105, 0.06);
}
body.is-app .onboarding-step.active {
  border-color: rgba(13, 148, 136, 0.35);
  background: var(--accent-soft);
}
body.is-app .step-mark {
  background: #e2e8f0;
  color: var(--text-3);
}
body.is-app .onboarding-step.done .step-mark {
  background: rgba(5, 150, 105, 0.15);
  color: var(--green);
}
body.is-app .onboarding-step.active .step-mark {
  background: var(--accent-soft);
  color: var(--accent-2);
}
body.is-app .step-body strong { color: var(--text); }
body.is-app .step-body span { color: var(--text-3); }
body.is-app .step-link { color: var(--accent-2); font-weight: 600; }
body.is-app .recommend-card {
  border-color: var(--border);
  background: var(--surface-2);
}
body.is-app .recommend-title { color: var(--text); }
body.is-app .recommend-desc { color: var(--text-3); }
body.is-app .recommend-id { color: var(--accent-2); }
body.is-app .key-spotlight {
  border-color: rgba(13, 148, 136, 0.25);
  background: var(--accent-soft);
}
body.is-app .key-spotlight-name { color: var(--text); }
body.is-app .key-spotlight-main code { color: var(--accent-2); }
body.is-app .test-model-pill { color: var(--accent-2); }
body.is-app .test-result {
  border-color: var(--border);
  background: var(--surface-2);
}
body.is-app .test-result.ok {
  border-color: rgba(5, 150, 105, 0.3);
  background: rgba(5, 150, 105, 0.08);
}
body.is-app .test-result.err {
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.06);
}
body.is-app .test-result.ok .test-result-icon {
  background: rgba(5, 150, 105, 0.15);
  color: var(--green);
}
body.is-app .test-result.err .test-result-icon {
  background: rgba(220, 38, 38, 0.12);
  color: var(--red);
}
body.is-app .test-result strong { color: var(--text); }
body.is-app .test-result p { color: var(--text-3); }
body.is-app .guide-fold summary { color: var(--text); }
body.is-app .guide-fold-h { color: var(--text-2); }
body.is-app .drawer-panel {
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
}
body.is-app .drawer-head h2 { color: var(--text); }
body.is-app .model-browse-cat {
  border-color: var(--border);
}
body.is-app .model-browse-cat summary { color: var(--text); }
body.is-app .model-browse-row {
  border-top-color: var(--border-subtle);
}
body.is-app .modal-box {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow);
}
body.is-app .modal-title { color: var(--text); }
body.is-app .modal-text { color: var(--text-3); }
body.is-app .modal-box .field input:not([type="checkbox"]):not([type="radio"]) {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
body.is-app .code-block,
body.is-app .modal-key {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
body.is-app .toast {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow);
}
body.is-app .empty-title { color: var(--text); }
body.is-app .empty-desc { color: var(--text-3); }
body.is-app .empty-icon { color: var(--text-4); }
body.is-app .config-label { color: var(--text-3); }
body.is-app .config-item code,
body.is-app .config-value-row code { color: var(--accent-2); }
body.is-app .btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: none;
  text-shadow: none;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  min-height: var(--control-h-sm);
  padding: 0 16px;
}
body.is-app .input,
body.is-app select.input,
body.is-app textarea.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  color: var(--text-1, #0f172a);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: none;
  text-shadow: none;
  transition: border-color 0.15s ease;
}
body.is-app .input:focus,
body.is-app select.input:focus,
body.is-app textarea.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
body.is-app .btn,
body.is-app a.btn {
  box-shadow: none;
  text-shadow: none;
}
body.is-app.is-admin .table-scroll {
  max-height: none;
  overflow: visible;
  border: none;
  border-radius: 0;
}
body.is-app .btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
body.is-app .btn-ghost.danger { color: var(--red); }
body.is-app .select-sm {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
body.is-app .footer {
  background: transparent;
  border-top-color: var(--border);
}
body.is-app .key-row {
  border-top: 1px solid var(--border-subtle);
  padding: 16px 0;
}
body.is-app .key-list .key-row:first-child {
  border-top: none;
  padding-top: 0;
}
body.is-app .key-box .copy {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-2);
}

/* 概览页 */
.overview-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.overview-hero-copy {
  flex: 1;
  min-width: 0;
}
.overview-hero-copy h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  color: var(--text);
}
.overview-hero-copy p {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.55;
  max-width: 36em;
}
.overview-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.overview-hero-balance {
  flex-shrink: 0;
  min-width: 160px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #f8fafc, #f0fdfa);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.overview-balance-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.overview-balance-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.03em;
}
.overview-balance-link {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
}
.endpoint-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.endpoint-summary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}
.endpoint-summary-row .config-label {
  min-width: 72px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}
.endpoint-summary-row code {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--accent-2);
  word-break: break-all;
}
.muted { color: var(--text-4); font-size: 13px; }

/* 接入分步 */
.connect-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.connect-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.connect-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-2);
}
.connect-step-body {
  flex: 1;
  min-width: 0;
}
.connect-step-body strong {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text);
}
.connect-step .config-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.connect-step .config-value-row code {
  font-size: 13px;
  color: var(--accent-2);
  word-break: break-all;
}

/* 登录页保留深色氛围（与控制台浅色分离） */
body.is-landing {
  --bg: #030914;
  --text: #f0f7ff;
  --text-2: #c5d7ef;
  --text-3: #7f9bb8;
  --text-4: #4d6a85;
  --accent: #22d3ee;
  --accent-2: #0891b2;
  --accent-hover: #67e8f9;
  --border: rgba(255,255,255,0.08);
  background: #030914;
  color: #f0f7ff;
}
body.is-landing .brand .logo {
  color: #031018;
  background: linear-gradient(135deg, #22d3ee, #0891b2);
}
body.is-landing .brand .brand-name b { color: #22d3ee; }

/* ============================================================
   B-3：浅色登录 + 账单/充值/团队
   ============================================================ */
body.is-auth {
  min-height: 100vh;
  background: var(--bg-app);
  color: var(--text);
  display: flex;
  flex-direction: column;
}
body.is-auth .auth-main {
  max-width: none;
  width: 100%;
  flex: 1;
  padding: 0;
  display: flex;
  min-height: 0;
}
.auth-page {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 24px 20px;
}
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 10% -5%, rgba(13, 148, 136, 0.14), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 85%, rgba(14, 116, 144, 0.1), transparent 50%),
    linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
}
.auth-top,
.auth-body,
.auth-foot {
  position: relative;
  z-index: 1;
}
.auth-top {
  padding: 22px 0 8px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}
.auth-brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}
.auth-brand .logo {
  color: #fff;
}
.auth-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 0 40px;
}
.auth-intro .auth-brand-mark {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin: 0 0 14px;
  text-transform: none;
}
.auth-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 14px;
  color: var(--text);
}
.auth-lead {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-3);
  margin: 0;
  max-width: 28em;
}
.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 28px 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}
.auth-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.auth-card-sub {
  font-size: 13px;
  color: var(--text-3);
  margin: 0 0 22px;
}
body.is-auth .field { margin-bottom: 14px; }
body.is-auth .field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
body.is-auth .field input {
  width: 100%;
  min-height: var(--control-h);
  padding: 0 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body.is-auth .field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.auth-captcha-row input {
  flex: 1;
  text-transform: uppercase;
}
.auth-captcha-row img {
  flex-shrink: 0;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
}
body.is-auth .btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: none;
  margin-top: 8px;
  letter-spacing: 0;
  border: none;
}
body.is-auth .btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  opacity: 1;
}
body.is-auth .msg { margin-top: 12px; min-height: 20px; }
body.is-auth .msg.err { color: var(--red); }
body.is-auth .msg.ok { color: var(--green); }
.auth-foot {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 8px;
  font-size: 12px;
  color: var(--text-4);
}
.auth-foot a { color: var(--text-3); }
.auth-foot a:hover { color: var(--accent-2); }
.auth-foot .foot-sep { color: var(--text-4); }
@media (max-width: 820px) {
  .auth-body {
    grid-template-columns: 1fr;
    gap: 28px;
    align-content: start;
    padding-top: 12px;
  }
  .auth-intro h1 { font-size: 26px; }
}

body.is-app .data-table th { color: var(--text-3); }
body.is-app .data-table td { color: var(--text-2); border-top-color: var(--border-subtle); }
body.is-app .data-table td.pos { color: var(--green); font-weight: 600; }
body.is-app .data-table td.neg { color: var(--text-2); }
body.is-app .data-table code.xs { color: var(--text-4); }
body.is-app .status-pill.recharge { background: rgba(5, 150, 105, 0.12); color: var(--green); }
body.is-app .status-pill.consume { background: #f1f5f9; color: var(--text-3); }
body.is-app .status-pill.paid { background: rgba(5, 150, 105, 0.12); color: var(--green); }
body.is-app .status-pill.pending { background: #fffbeb; color: #b45309; }
body.is-app .status-pill.expired { background: #f1f5f9; color: var(--text-4); }
body.is-app .status-pill.failed { background: #fef2f2; color: var(--red); }
body.is-app .tab-bar .tab {
  color: var(--text-3);
  border-color: var(--border);
  background: #fff;
}
body.is-app .tab-bar .tab.active {
  color: var(--accent-2);
  border-color: var(--accent);
  background: var(--accent-soft);
}
body.is-app .info-list > div { border-top-color: var(--border-subtle); }
body.is-app .info-list dd { color: var(--text); }
body.is-app .info-list .accent-gold { color: var(--gold); }
body.is-app .faq-list li { border-top-color: var(--border-subtle); color: var(--text-3); }
body.is-app .faq-list strong { color: var(--text); }
body.is-app .amount-grid button {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
body.is-app .amount-grid button:hover,
body.is-app .amount-grid button.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
}
body.is-app .custom-amount label {
  display: block;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.custom-amount-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.custom-amount-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
}
.pay-status-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}
.table-scroll { overflow-x: auto; }
.td-model-name { font-weight: 500; color: var(--text); }
.td-tokens { font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-cost { font-weight: 600; white-space: nowrap; }
.td-time { white-space: nowrap; color: var(--text-3) !important; font-size: 13px; }

.role-guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.role-guide-item {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.role-guide-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
}
.role-guide-item span {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3);
}
.role-guide-item em { font-style: normal; color: var(--warn); font-weight: 600; }
.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--text-3);
}
.role-badge.role-owner { background: var(--accent-soft); color: var(--accent-2); }
.role-badge.role-admin { background: #eff6ff; color: #1d4ed8; }
.role-badge.role-member { background: #f1f5f9; color: var(--text-3); }
.member-row .key-date { display: block; margin-top: 2px; }
.invite-result { margin-top: 12px; }
.invite-result code {
  display: block;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  word-break: break-all;
  font-size: 12px;
  color: var(--accent-2);
}
.invite-once { font-size: 13px; color: var(--text-3); margin: 0; }
body.is-app .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
body.is-app .form-row input,
body.is-app .form-row select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
}
body.is-app .form-stack .field input {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
body.is-app .form-stack .field label { color: var(--text-2); }
@media (max-width: 900px) {
  .role-guide { grid-template-columns: 1fr; }
}

/* A4：管理后台健康看板 */
.health-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.health-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.health-pill.health-ok {
  background: rgba(5, 150, 105, 0.12);
  color: var(--green);
}
.health-pill.health-warn {
  background: #fffbeb;
  color: #b45309;
}
.health-pill.health-critical {
  background: #fef2f2;
  color: var(--red);
}
.health-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 10px;
}
.health-meta code {
  font-size: 12px;
  color: var(--accent-2);
}
.td-err {
  max-width: 280px;
  font-size: 12px;
  color: var(--text-3);
  word-break: break-word;
}
body.is-app .status-pill.pending,
body.is-app .status-pill.retry,
body.is-app .status-pill.running {
  background: #fffbeb;
  color: #b45309;
}
body.is-app .status-pill.failed,
body.is-app .status-pill.reported {
  background: #fef2f2;
  color: var(--red);
}
body.is-app .status-pill.succeeded,
body.is-app .status-pill.active {
  background: rgba(5, 150, 105, 0.12);
  color: var(--green);
}
body.is-app .status-pill.disabled {
  background: #f1f5f9;
  color: var(--text-4);
}
.auth-body-single {
  grid-template-columns: 1fr;
  max-width: 420px;
  justify-items: stretch;
}
body.is-app .field {
  margin-bottom: 14px;
}
body.is-app .field label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}
body.is-app .field input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-height: var(--control-h);
  padding: 0 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body.is-app .field input:not([type="checkbox"]):not([type="radio"]):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================================================
   B+ polish：冲 8 分 UI/UX
   ============================================================ */

body.is-app .app-nav-item {
  position: relative;
  border-left: none;
  margin-left: 0;
  padding-left: 12px;
}
body.is-app .app-nav-item.active {
  border-left-color: transparent;
  font-weight: 600;
}
.app-user-block {
  margin-bottom: 10px;
}
.app-user-balance {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 4px;
}
.app-sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 901px) {
  body.is-app .section-card {
    transition: box-shadow 0.15s ease;
  }
  body.is-app .section-card:hover {
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
  }
}

body.is-app .btn.is-loading {
  opacity: 0.85;
  cursor: wait;
}
body.is-app .empty-state {
  text-align: center;
  padding: 28px 16px;
}
body.is-app .empty-state .empty-icon {
  color: var(--text-4);
  margin-bottom: 12px;
}
body.is-app .empty-state .empty-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
}
body.is-app .empty-state .empty-desc {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 14px;
  line-height: 1.55;
}
body.is-app .empty-state .btn {
  margin-top: 4px;
}

/* 表格增强 */
body.is-app .data-table-pro {
  width: 100%;
  border-collapse: collapse;
}
body.is-app .data-table-pro thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-weight: 600;
  text-align: left;
}
body.is-app .data-table-pro tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  font-size: 13px;
}
body.is-app .data-table-pro tbody tr:last-child td {
  border-bottom: none;
}
body.is-app .data-table-pro .col-num,
body.is-app .td-cost,
body.is-app .td-tokens {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
body.is-app .table-scroll {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

/* 手机卡片列表 */
.record-cards {
  display: none;
  flex-direction: column;
  gap: 10px;
}
.record-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.record-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.record-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.record-label {
  color: var(--text-4);
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}
@media (max-width: 768px) {
  .desktop-table { display: none !important; }
  .mobile-cards { display: flex; }
}

/* 账单工具栏 */
.billing-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.billing-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.billing-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
@media (max-width: 900px) {
  .billing-filter-toggle { display: inline-flex; }
  .billing-detail-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0 16px 12px;
  }
  .billing-detail-toolbar .billing-toolbar-actions {
    margin-left: 0;
    width: 100%;
    padding-bottom: 0;
    flex-wrap: wrap;
  }
  .billing-filters:not([hidden]) {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .billing-filters .search-box,
  .billing-filters .select-sm {
    width: 100%;
    max-width: none;
  }
}
@media (min-width: 901px) {
  .billing-filter-toggle { display: none; }
  .billing-filters { display: flex !important; }
}

/* 概览紧凑接入条 */
.endpoint-summary-compact {
  padding: 16px 20px !important;
}
.endpoint-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.endpoint-inline code {
  font-size: 12px;
  color: var(--accent-2);
  word-break: break-all;
}
.endpoint-dot {
  color: var(--text-4);
  user-select: none;
}

/* Key 卡片 */
.key-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  margin-bottom: 12px;
}
.key-card:last-child { margin-bottom: 0; }
.key-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.key-card-meta .key-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.key-card-meta .key-date {
  font-size: 12px;
  color: var(--text-4);
}
.key-menu-wrap {
  position: relative;
  flex-shrink: 0;
}
.key-menu-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-3);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.key-menu-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.key-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 120px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 20;
  overflow: hidden;
}
.key-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.key-menu button:hover {
  background: var(--surface-2);
}
.key-menu button.danger {
  color: var(--red);
}
.key-card .key-box {
  margin-top: 0;
}

/* 充值页 v2 */
.recharge-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
}
.recharge-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 54%) minmax(360px, 46%);
  gap: 16px;
  align-items: stretch;
}
.recharge-layout-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.recharge-layout-main .recharge-form-card {
  flex: 1;
  margin-bottom: 0;
}
.recharge-layout-main .recharge-balance-strip {
  margin-bottom: 0;
  flex-shrink: 0;
}
.recharge-balance-strip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #faf5ff 100%);
}
.recharge-balance-label {
  font-size: 13px;
  color: var(--text-3);
}
.recharge-balance-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: -0.02em;
}
.recharge-form-card,
.recharge-records-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 24px 28px;
  margin-bottom: 0;
}
.recharge-records-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.recharge-records-head {
  flex-shrink: 0;
}
.recharge-records-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.recharge-records-card .table-scroll {
  border: none;
  border-radius: 0;
  max-height: none;
  overflow: visible;
}
body.is-app .recharge-records-body .table-scroll {
  max-height: none;
  overflow: visible;
}
.recharge-records-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  box-shadow: 0 1px 0 var(--border-subtle);
}
.recharge-records-card .empty-state.compact {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
}
.recharge-form-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px 20px;
  align-items: start;
  margin-bottom: 22px;
}
.recharge-form-row:last-child,
.recharge-submit-row {
  margin-bottom: 0;
}
.recharge-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  line-height: 36px;
  white-space: nowrap;
}
.recharge-label .req {
  color: var(--red);
  margin-right: 2px;
}
.amount-grid-recharge-v2 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
  gap: 10px;
}
.amount-grid-recharge-v2 .amount-pick {
  padding: 12px 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.amount-grid-recharge-v2 .amount-pick .amt {
  font-weight: 400;
  font-size: 14px;
}
.amount-grid-recharge-v2 .amount-pick:hover,
.amount-grid-recharge-v2 .amount-pick.selected {
  border-color: var(--accent-2);
  background: var(--accent-soft);
  color: var(--accent-2);
}
.recharge-custom-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
}
.recharge-custom-inline input {
  width: 180px;
  flex: 0 0 180px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.recharge-custom-inline input:focus,
.recharge-custom-inline input:focus-visible {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: none;
}
.recharge-custom-inline .btn-primary.sm {
  margin-top: 0;
  flex-shrink: 0;
  min-width: 72px;
  padding: 9px 16px;
}
.pay-method-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.pay-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}
.pay-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pay-chip.active,
.pay-chip:has(input:checked) {
  border-color: #1677ff;
  background: rgba(22, 119, 255, 0.06);
  color: #1677ff;
}
.pay-icon-alipay-sm {
  display: block;
  border-radius: 6px;
  flex-shrink: 0;
}
.recharge-verify {
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
}
.recharge-verify-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 300px;
  padding: 10px 28px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.recharge-verify-btn:hover {
  border-color: var(--accent);
  background: #fff;
  color: var(--text-2);
}
.recharge-verify-done {
  display: none;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 240px;
  padding: 10px 28px;
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: 8px;
  background: rgba(5, 150, 105, 0.08);
  color: var(--green);
  font-size: 14px;
  font-weight: 500;
}
.recharge-verify.is-verified .recharge-verify-btn {
  display: none;
}
.recharge-verify.is-verified .recharge-verify-done {
  display: flex;
}
.recharge-submit-row .recharge-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.recharge-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 300px;
  max-width: none;
  margin-top: 0 !important;
  padding: 11px 36px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
}
.recharge-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.recharge-agreement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  max-width: 100%;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-3);
  cursor: pointer;
}
.recharge-agreement input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-2);
  cursor: pointer;
}
.recharge-agreement a {
  color: var(--accent-2);
}
.recharge-page .pay-status-hint {
  margin-top: 10px;
  text-align: left;
  font-size: 12px;
  color: var(--text-4);
}
.recharge-page .msg {
  text-align: left;
}
.recharge-records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.recharge-records-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.recharge-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.recharge-records-card .table-scroll {
  border: none;
  border-radius: 0;
  max-height: none;
}
.recharge-records-table .td-order-no {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
}
.order-no-text {
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(280px, 100%);
  display: inline-block;
  vertical-align: middle;
}
.order-copy-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 4px;
  border-radius: 6px;
  color: var(--text-4);
  cursor: pointer;
  flex-shrink: 0;
  line-height: 0;
}
.order-copy-btn:hover {
  color: var(--accent-2);
  background: var(--accent-soft);
}
.recharge-channel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}
body.is-app .status-pill.recharge-status-paid,
body.is-app .recharge-status-paid {
  background: rgba(5, 150, 105, 0.12);
  color: var(--green);
}
.recharge-record-cards {
  padding: 0;
}

@media (max-width: 960px) {
  .recharge-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .recharge-records-card {
    min-height: 320px;
    height: auto;
  }
}

@media (max-width: 768px) {
  .recharge-form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .recharge-label {
    line-height: 1.4;
  }
  .amount-grid-recharge-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recharge-custom-inline {
    max-width: none;
    width: 100%;
  }
  .recharge-custom-inline input {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .recharge-submit-btn,
  .recharge-verify,
  .recharge-agreement {
    max-width: none;
  }
}

/* 充值页节奏（旧 layout 兼容） */
.recharge-layout .section-card .amount-grid {
  margin-bottom: 20px;
}
.recharge-layout .custom-amount {
  margin-bottom: 20px;
}
.recharge-layout .subsection {
  margin-bottom: 20px;
}
.recharge-layout .btn.block {
  margin-top: 8px;
}

/* 说明型页面 */
.info-page .info-list > div {
  padding: 12px 0;
}
.info-page .faq-list {
  margin-top: 8px;
}

/* ============================================================
   B+-3 polish：admin 对齐 + 说明页 + 微交互
   ============================================================ */

.alert-spaced { margin-top: 14px; }
.metric-row-spaced { margin-top: 14px; }
.msg-spaced { margin-top: 12px; }
.section-head-actions { margin-top: 8px; }

body.is-admin .admin-badge {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}
body.is-admin .admin-topbar-badge {
  width: auto;
  min-width: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
}

/* 成员列表 */
.member-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.member-row {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
}
.member-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-2);
  letter-spacing: -0.02em;
}
.member-row-info {
  flex: 1;
  min-width: 0;
}
.member-row-info strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}
.member-row-info .key-date {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-4);
}
.member-row .key-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* role-badge 与 health/status 色系对齐 */
.role-badge.role-owner {
  background: rgba(5, 150, 105, 0.12);
  color: var(--green);
}
.role-badge.role-admin {
  background: #eff6ff;
  color: #1d4ed8;
}
.role-badge.role-member {
  background: #f1f5f9;
  color: var(--text-3);
}

/* 说明页 FAQ */
.info-page .faq-list li {
  padding: 14px 0;
}
.info-page .faq-list li:first-child {
  border-top: 1px solid var(--border-subtle);
}
.info-page .hint-line {
  margin-top: 16px;
  font-size: 13px;
}

/* 模态：只显示一次 */
.modal-once-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.modal-once-banner strong {
  font-size: 13px;
  color: #b45309;
}
.modal-once-banner span {
  font-size: 12px;
  line-height: 1.5;
  color: #92400e;
}
body.is-app .modal-box {
  padding: 22px 24px 20px;
}
body.is-app .modal-title {
  margin-bottom: 10px;
}
body.is-app .modal-text {
  margin-bottom: 14px;
}
body.is-app .modal-actions {
  margin-top: 18px;
  gap: 10px;
}
body.is-app .modal-key {
  margin-bottom: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* 按钮微交互 */
body.is-app .btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}
body.is-app .btn-ghost:active:not(:disabled),
body.is-app .btn:not(.btn-primary):not(.btn-ghost):active:not(:disabled) {
  transform: translateY(1px);
}
body.is-app .btn,
body.is-app .btn-ghost,
body.is-app .key-menu-btn {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}
body.is-app .btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border);
}

/* 接入页复制按钮统一宽度 */
.connect-step .config-value-row .btn-ghost.sm {
  min-width: 64px;
  justify-content: center;
}
.connect-test-row .btn-primary.sm {
  min-width: 96px;
}

/* 焦点可见性（轻量 a11y） */
body.is-app a:focus-visible,
body.is-app button:focus-visible,
body.is-app input:focus-visible,
body.is-app select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body.is-app .recharge-custom-inline input:focus,
body.is-app .recharge-custom-inline input:focus-visible {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: none;
}

/* ============================================================
   模型广场 · 卡片市场（4 列网格）
   ============================================================ */

.app-content.workspace.models-workspace {
  padding: 20px 24px 36px;
}

.models-market {
  max-width: 1440px;
  margin: 0 auto;
}

.models-alert {
  margin-bottom: 12px;
}

.models-onboarding-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.models-onboarding-bar-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
}
.models-onboarding-bar-main strong {
  font-size: 14px;
  color: var(--text);
}
.models-onboarding-bar-main span {
  font-size: 12px;
  color: var(--text-3);
}
.models-onboarding-bar-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}
.models-onboarding-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  background: #fff;
  border: 1px solid var(--border);
  text-decoration: none;
}
.models-onboarding-pill.active {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.models-onboarding-pill.done {
  color: var(--green);
  border-color: rgba(5, 150, 105, 0.25);
  background: rgba(5, 150, 105, 0.06);
}

.models-toolbar {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.models-search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.models-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-4);
  pointer-events: none;
}
.models-search {
  width: 100%;
  min-height: var(--control-h);
  padding: 0 16px 0 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.models-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
body.is-app .models-search:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.models-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.models-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 2px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.models-cat-tab:hover {
  color: var(--text);
  background: transparent;
}
.models-cat-tab.active {
  border-color: var(--primary);
  background: transparent;
  color: var(--text);
  font-weight: 600;
}
.models-cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  color: var(--text-4);
}
.models-cat-tab.active .models-cat-count {
  background: transparent;
  color: var(--text-3);
}

.models-section-label {
  margin-bottom: 12px;
}
.models-section-label h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.models-section-label p {
  margin: 0;
  font-size: 13px;
  color: var(--text-3);
}

.models-domestic {
  margin-bottom: 18px;
}
.models-domestic-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.models-domestic-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #e8edf4;
  border-radius: 10px;
  background: #fafbfd;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  min-height: 100%;
}
.models-domestic-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.models-domestic-row:hover {
  border-color: #cbd5e1;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.models-domestic-vendor-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
}

.models-domestic-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.models-domestic-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.models-domestic-letter {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.models-domestic-body {
  flex: 1;
  min-width: 0;
}
.models-domestic-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.models-domestic-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.models-domestic-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-3);
}
.models-domestic-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.models-domestic-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 7px;
  box-sizing: border-box;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.models-domestic-test {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-2);
  background: #fff;
  border: 1px solid #cbd5e1;
}
.models-domestic-test:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}
.models-domestic-copy {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-3);
}
.models-domestic-copy:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--text-2);
}
.btn.xs {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 7px;
}


.models-grid-section {
  margin-bottom: 8px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}
.models-grid-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-3);
}
.models-connect-filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.models-connect-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.models-connect-tab:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.models-connect-tab.active {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}
.models-connect-tab.active .models-cat-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.model-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.model-status-badge--ready,
.model-status-badge--synced {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.model-status-badge--route {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.model-status-badge--catalog {
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.models-domestic-test.is-disabled,
.models-market .models-domestic-test.is-disabled {
  color: #94a3b8;
  background: #f8fafc;
  border-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 0.85;
}
.models-domestic-test.is-disabled:hover {
  color: #94a3b8;
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.is-app .models-market .model-card--catalog {
  background: #fafbfd;
}
body.is-app .models-market .model-card--catalog:hover {
  border-color: #dbe3ef;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transform: none;
}

.model-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
body.is-app .models-market .model-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
body.is-app .models-market .model-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
  background: #fff;
}
.model-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.model-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}
.model-card[hidden] {
  display: none !important;
}
.model-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.model-card-head-text {
  flex: 1;
  min-width: 0;
}
.model-card-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.model-card-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}
.model-card-avatar-wrap {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-sizing: border-box;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.model-card-avatar-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  background: transparent;
  border: none;
  padding: 0;
}
.model-card-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.model-card-vendor {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-card-blurb {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}
.model-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.model-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.model-tag--chat {
  color: #0369a1;
  background: #e0f2fe;
  border-color: #bae6fd;
}
.model-tag--code {
  color: #047857;
  background: #d1fae5;
  border-color: #a7f3d0;
}
.model-tag--route {
  color: #334155;
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.model-tag--vision {
  color: #b45309;
  background: #fef3c7;
  border-color: #fde68a;
}
.model-tag--image {
  color: #be185d;
  background: #fce7f3;
  border-color: #fbcfe8;
}
.model-tag--video {
  color: #c2410c;
  background: #ffedd5;
  border-color: #fed7aa;
}
.model-tag--free {
  color: #15803d;
  background: #dcfce7;
  border-color: #bbf7d0;
}
.model-tag--reason {
  color: #6d28d9;
  background: #ede9fe;
  border-color: #ddd6fe;
}
.model-tag--fast {
  color: #0d9488;
  background: #ccfbf1;
  border-color: #99f6e4;
}
.model-tag-price {
  color: var(--text-2);
  background: #f8fafc;
  border-color: #e2e8f0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.model-card-id {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-card-test-link {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
}
.model-card-test-link:hover {
  text-decoration: underline;
}

.models-empty-filter {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}

@media (max-width: 900px) {
  .model-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .models-domestic-list {
    grid-template-columns: 1fr;
  }
  .model-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .model-card-grid {
    grid-template-columns: 1fr;
  }
  .models-onboarding-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================================
   概览页 v2：统计优先 + 双栏（参考 Stripe / OpenRouter）
   ============================================================ */

.metric-foot-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
}
.metric-foot-link:hover {
  color: var(--accent-hover);
}
.metric-highlight {
  border-color: rgba(124, 58, 237, 0.18);
  background: linear-gradient(180deg, #fff 0%, #faf5ff 100%);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
}
.dash-panel {
  margin-bottom: 0;
  height: 100%;
}

.connect-quick {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.connect-quick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}
.connect-quick-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  min-width: 56px;
}
.connect-quick-code {
  flex: 1;
  min-width: 180px;
  font-size: 13px;
  color: var(--text-2);
  word-break: break-all;
}
.connect-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-link-item {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quick-link-item:hover {
  border-color: var(--border);
  background: var(--surface-2);
}
.quick-link-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.quick-link-desc {
  display: block;
  font-size: 12px;
  color: var(--text-4);
}

.onboarding-primary {
  border-color: rgba(124, 58, 237, 0.14);
}

@media (max-width: 900px) {
  .metric-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .metric-row-4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   硅基风：登录分屏 + 体验中心 Playground
   ============================================================ */

body.auth-split-layout {
  background: #fff;
}
body.auth-split-layout .auth-main {
  padding: 0;
  min-height: 100vh;
}
.auth-split {
  display: grid;
  grid-template-columns: minmax(380px, 1.15fr) minmax(380px, 0.85fr);
  min-height: 100vh;
  width: 100%;
}
.auth-split-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 36px 48px 28px;
  color: #fff;
  background:
    radial-gradient(ellipse 70% 50% at 12% 8%, rgba(167, 139, 250, 0.38), transparent 55%),
    radial-gradient(ellipse 80% 60% at 92% 88%, rgba(56, 189, 248, 0.18), transparent 52%),
    linear-gradient(148deg, #160c28 0%, #24145a 46%, #1e1b4b 100%);
  overflow: hidden;
}
.auth-globe {
  position: absolute;
  right: -22%;
  bottom: -28%;
  width: min(78vh, 720px);
  height: min(78vh, 720px);
  pointer-events: none;
  z-index: 0;
  perspective: 900px;
}
.auth-globe-glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.45), transparent 68%);
  filter: blur(18px);
}
.auth-globe-orb {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.42), transparent 22%),
    radial-gradient(circle at 68% 74%, rgba(251, 191, 36, 0.28), transparent 26%),
    radial-gradient(circle at 48% 52%, #4c1d95 0%, #1e1b4b 52%, #020617 100%);
  box-shadow:
    0 0 80px 12px rgba(124, 58, 237, 0.28),
    inset -28px -18px 50px rgba(15, 23, 42, 0.55);
  overflow: hidden;
}
.auth-globe-lights {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 28% 42%, rgba(251, 191, 36, 0.9) 0 1.2px, transparent 1.6px),
    radial-gradient(circle at 46% 58%, rgba(253, 224, 71, 0.75) 0 1px, transparent 1.4px),
    radial-gradient(circle at 62% 38%, rgba(250, 204, 21, 0.7) 0 1px, transparent 1.4px),
    radial-gradient(circle at 54% 72%, rgba(253, 230, 138, 0.65) 0 1.1px, transparent 1.5px),
    radial-gradient(circle at 37% 66%, rgba(252, 211, 77, 0.8) 0 0.9px, transparent 1.3px),
    radial-gradient(circle at 71% 61%, rgba(250, 204, 21, 0.55) 0 0.8px, transparent 1.2px);
  opacity: 0.85;
}
.auth-globe-atm {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px rgba(56, 189, 248, 0.18), 0 0 40px rgba(56, 189, 248, 0.25);
}
.auth-globe-orbit {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 1px solid rgba(196, 181, 253, 0.28);
  transform: rotateX(66deg) rotateZ(-18deg);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.2);
}
.auth-globe-orbit-2 {
  inset: -2%;
  border-color: rgba(125, 211, 252, 0.22);
  transform: rotateX(68deg) rotateZ(28deg);
}
.auth-split-brand .auth-brand {
  position: relative;
  z-index: 2;
  color: #fff;
  flex: 0 0 auto;
}
.auth-split-brand .brand-name b {
  color: #c4b5fd;
}
.auth-split-brand .logo {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
}
.auth-split-copy {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  max-width: 460px;
}
.auth-split-tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #c4b5fd;
  margin: 0 0 16px;
}
.auth-split-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}
.auth-split-lead {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 22px;
}
.auth-split-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-split-points li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}
.auth-split-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c4b5fd;
  box-shadow: 0 0 8px rgba(196, 181, 253, 0.8);
}
.auth-split-foot {
  position: relative;
  z-index: 2;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}
.auth-split-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: #fff;
}
.auth-split-form .auth-card {
  width: 100%;
  max-width: 400px;
  box-shadow: none;
  border: none;
  padding: 0;
}
.auth-form-links {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-4);
  text-align: center;
}
.auth-form-links a {
  color: var(--accent-2);
}
.auth-form-links span {
  margin: 0 6px;
}

/* Playground */
.playground-card {
  border-color: rgba(124, 58, 237, 0.12);
}
.playground-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.playground-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}
.playground-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}
.playground-field-grow {
  flex: 1;
  min-width: 200px;
}
.playground-field-action .btn {
  min-width: 96px;
}
.playground-model-input {
  margin: 0;
  max-width: none;
  width: 100%;
}
.playground-static {
  font-size: 14px;
  color: var(--text-2);
  padding: 10px 0;
}
.playground-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-3);
}
.playground-hint {
  margin-top: 14px;
  margin-bottom: 0;
}
.connect-quick-stack {
  margin-bottom: 16px;
}

.keys-connect-panel {
  margin-top: 0;
  margin-bottom: 0;
  scroll-margin-top: 72px;
}
.keys-connect-import {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2, #f8fafc);
  color: var(--text-2);
  font-size: 13px;
}
.keys-connect-import code {
  font-size: 12px;
}
.connect-quick-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  background: var(--surface, #fff);
  color: var(--text);
}

/* 体验中心 */
.docs-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 14px;
  align-items: start;
}
.docs-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.docs-aside {
  position: sticky;
  top: 12px;
}
.docs-alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.55;
}
.docs-alert-warn {
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-2);
}
.docs-alert-warn a {
  color: var(--accent-2);
  font-weight: 600;
}
.docs-import-banner {
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(124, 58, 237, 0.18);
  background: rgba(124, 58, 237, 0.06);
  font-size: 13px;
  color: var(--text-2);
}
.docs-import-banner code {
  font-size: 12px;
  color: var(--accent-2);
}
.docs-playground-head {
  align-items: flex-start;
  gap: 12px;
}
.docs-playground-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.55;
}
.docs-balance-chip {
  flex-shrink: 0;
}
.docs-config-panel {
  border-color: rgba(124, 58, 237, 0.1);
}
.docs-config-panel .guide-fold {
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}
.docs-config-panel .guide-fold:first-of-type {
  border-top: none;
  padding-top: 0;
}
.docs-code-block {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-2);
  overflow-x: auto;
  white-space: pre;
}
.docs-faq-fold summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 4px 0;
}
.docs-faq-list {
  margin-top: 12px;
}
.docs-faq-list li {
  border-top-color: var(--border-subtle);
}
.docs-faq-list strong { color: var(--text); }
.docs-faq-list span { color: var(--text-3); }
.docs-faq-list a { color: var(--accent-2); }

.playground-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.playground-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 6px;
}
.playground-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 34px;
}
.playground-select-static {
  display: flex;
  align-items: center;
  background-image: none;
  padding-right: 12px;
  color: var(--text-2);
}

.model-picker {
  position: relative;
}
.model-picker-trigger {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.model-picker-trigger:hover {
  border-color: rgba(124, 58, 237, 0.35);
}
.model-picker-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.model-picker-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-picker-id {
  font-size: 11px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-picker-chevron {
  flex-shrink: 0;
  color: var(--text-4);
}
.model-picker-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.model-picker-panel[hidden] {
  display: none !important;
}
.model-picker-panel.is-open {
  display: flex;
}
.model-picker-head {
  padding: 10px 12px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}
.model-picker-search {
  margin: 8px 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  font-size: 13px;
}
.model-picker-search:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.35);
}
.model-picker-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 6px 6px;
  overflow-y: auto;
  flex: 1;
}
.model-picker-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.model-picker-list li:hover,
.model-picker-list li.is-selected {
  background: rgba(124, 58, 237, 0.06);
}
.model-picker-item-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.model-picker-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-picker-item-id {
  font-size: 11px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-picker-item-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
}
.model-picker-item-badge.ok {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
}
.model-picker-item-badge.muted {
  color: var(--text-4);
  background: var(--surface-2);
}
.model-picker-empty,
.model-picker-foot {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-4);
  text-align: center;
}
.model-picker-foot {
  border-top: 1px solid var(--border-subtle);
  margin: 0;
}

.playground-model-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  min-height: 24px;
}
.playground-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}
.playground-badge.ok {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
}
.playground-badge.warn {
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
}
.playground-meta-text {
  font-size: 12px;
  color: var(--text-4);
}
.playground-meta-text[hidden] {
  display: none !important;
}

.playground-quick-models {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.playground-quick-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-4);
}
.playground-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.playground-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #fff;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}
.playground-chip:hover {
  border-color: rgba(124, 58, 237, 0.25);
  color: var(--accent-2);
}

.playground-prompt-wrap {
  margin-top: 14px;
}
.playground-prompt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.playground-prompt-head label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}
.playground-prompt-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.playground-preset {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-3);
  cursor: pointer;
}
.playground-preset:hover {
  color: var(--accent-2);
  border-color: rgba(124, 58, 237, 0.2);
}
.playground-prompt {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  resize: vertical;
}
.playground-prompt:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

.playground-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.playground-actions-link {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent-2);
}

.playground-chat {
  margin-top: 14px;
  min-height: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  position: relative;
}
.playground-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 24px;
  text-align: center;
}
.playground-chat-empty[hidden],
.playground-chat-messages[hidden] {
  display: none !important;
}
.playground-chat-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--text-3);
}
.playground-chat-empty-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-4);
}
.playground-chat-messages {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}
.playground-msg {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border-subtle);
}
.playground-msg-user {
  border-color: var(--border-subtle);
}
.playground-msg-assistant {
  border-color: rgba(124, 58, 237, 0.12);
  background: linear-gradient(180deg, #fff 0%, #faf5ff 100%);
}
.playground-msg-system {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.06);
}
.playground-msg-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-4);
  margin-bottom: 4px;
}
.playground-msg p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.playground-msg-meta {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-4);
}
.playground-chat-loading {
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  color: var(--text-3);
  z-index: 2;
}
.playground-chat-loading[hidden] {
  display: none !important;
}
.playground-chat-loading.is-active {
  display: flex;
}
.playground-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: playground-spin 0.7s linear infinite;
}
@keyframes playground-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 960px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-aside {
    position: static;
  }
}
@media (max-width: 640px) {
  .playground-toolbar {
    grid-template-columns: 1fr;
  }
  .docs-playground-head {
    flex-direction: column;
  }
  .playground-actions-link {
    margin-left: 0;
  }
}

.model-browse-page {
  max-height: none;
  margin-top: 12px;
}

/* 概览 CTA */
.dash-cta-card {
  background: linear-gradient(135deg, #faf5ff 0%, #fff 55%);
  border-color: rgba(124, 58, 237, 0.12);
}
.dash-cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dash-cta-inner h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.dash-cta-inner p {
  margin: 0;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.55;
}
.dash-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 900px) {
  .auth-split {
    grid-template-columns: 1fr;
  }
  .auth-split-brand {
    min-height: auto;
    padding: 28px 24px 20px;
  }
  .auth-globe {
    right: -30%;
    bottom: -48%;
    width: 280px;
    height: 280px;
    opacity: 0.55;
  }
  .auth-split-copy {
    flex: none;
    justify-content: flex-start;
    margin: 20px 0 8px;
  }
  .auth-split-points {
    display: none;
  }
  .auth-split-foot {
    display: none;
  }
  .auth-split-form {
    padding: 8px 24px 32px;
  }
  .auth-split-form .auth-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 22px;
    box-shadow: var(--shadow-sm);
  }
}

/* ============================================================
   硅基壳 v2：顶栏 + 分组侧栏 + 全宽工作区
   ============================================================ */

body.is-app {
  background: #fff;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

/* 桌面：左侧栏固定，右侧顶栏+工作区独立滚动 */
body.is-app .app-shell {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body.is-app .app-sidebar {
  width: 256px;
  height: 100dvh;
  max-height: 100dvh;
  align-self: flex-start;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-right: 1px solid var(--border);
  box-shadow: none;
}

body.is-app .app-main {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

body.is-app .app-topbar {
  position: relative;
  top: auto;
  flex-shrink: 0;
}

body.is-app .app-content.workspace {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.app-sidebar-brand {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.app-sidebar-brand .app-brand {
  padding: 0;
}
.app-sidebar-brand .logo {
  background: transparent;
}

.app-nav {
  flex: 0 1 auto;
  padding: 6px 10px 12px;
  gap: 2px;
  overflow-y: auto;
}
.app-nav > .app-nav-item {
  margin-bottom: 2px;
}
.app-nav-group {
  margin-top: 4px;
}
.app-nav-group:first-of-type {
  margin-top: 6px;
}
.app-nav-label {
  display: block;
  padding: 6px 12px 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-4);
  text-transform: uppercase;
}
.app-nav-group .app-nav-item {
  margin-left: 0;
  border-left: none;
  padding-left: 12px;
}
body.is-app .app-nav-item {
  margin-left: 0;
  border-left: none;
  padding-left: 12px;
}
body.is-app .app-nav-item.active {
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius);
  font-weight: 600;
}
body.is-app .app-nav-item.active .nav-icon {
  opacity: 1;
  stroke: var(--accent);
}

.app-sidebar-foot {
  border-top: 1px solid rgba(124, 58, 237, 0.08);
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-link {
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
}
.sidebar-link:hover {
  color: var(--accent-2);
}
.sidebar-link-muted {
  color: var(--text-4);
}

.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #fff;
  overflow: hidden;
}
.app-main::after {
  content: "";
  position: fixed;
  right: -120px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  overflow: visible;
}
.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 101;
}
.app-topbar-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
}
.topbar-balance-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}
.topbar-balance-label {
  font-size: 12px;
  color: var(--text-3);
}
.topbar-balance-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.topbar-balance-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.topbar-balance-link:hover {
  text-decoration: underline;
}
.topbar-avatar-btn {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 0.15s ease;
  pointer-events: none;
}
.topbar-avatar-btn:hover .topbar-avatar {
  transform: none;
  background: var(--primary-hover);
  box-shadow: none;
}
.topbar-user-menu {
  position: relative;
  z-index: 200;
}
.topbar-user-menu.open .topbar-avatar {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}
.topbar-user-panel {
  position: fixed;
  top: 66px;
  right: 28px;
  width: 280px;
  padding: 0;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  z-index: 9999;
  overflow: hidden;
}
.topbar-user-panel[hidden] {
  display: none !important;
}
.topbar-user-profile {
  display: flex;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.topbar-user-avatar-lg {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-user-meta {
  flex: 1;
  min-width: 0;
}
.topbar-user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.topbar-user-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.topbar-user-badge {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.15);
}
.topbar-user-id-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.topbar-user-id-label code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--text-2);
  background: none;
  padding: 0;
}
.topbar-copy-id {
  flex-shrink: 0;
  padding: 2px 6px;
  border: none;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
}
.topbar-copy-id:hover {
  background: rgba(124, 58, 237, 0.08);
  color: var(--accent);
}
.topbar-user-actions {
  padding: 6px;
}
.topbar-user-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s ease;
}
.topbar-user-action:hover {
  background: var(--surface-2);
  color: var(--text);
}
.topbar-user-action-muted {
  color: var(--text-2);
}
.topbar-action-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-3);
}
.topbar-user-action:hover .topbar-action-icon {
  color: var(--text-2);
}
.topbar-action-chevron {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--text-3);
}
.topbar-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topbar-user-dropdown[hidden] {
  display: none !important;
}
.topbar-user-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}
.topbar-user-head strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}
.topbar-user-head span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}
.topbar-user-dropdown a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
}
.topbar-user-dropdown a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.topbar-user-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}
.topbar-user-switch {
  color: var(--accent-2) !important;
}
.topbar-user-logout {
  color: var(--text-3) !important;
}

.app-nav-toggle {
  display: none;
  position: static;
  width: 36px;
  height: 36px;
  box-shadow: none;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.app-content.workspace {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 28px 40px;
  position: relative;
  z-index: 1;
  min-height: 0;
}

.workspace-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.workspace-panel.table-panel {
  padding: 0;
  overflow: hidden;
}
.workspace-panel.table-panel .table-scroll {
  border: none;
  border-radius: 12px;
  max-height: none;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-head h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}
.panel-desc {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
  line-height: 1.5;
}

.page-toolbar {
  margin-bottom: 14px;
}

.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-cards-row-3 {
  grid-template-columns: repeat(3, 1fr);
}
.stat-cards-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px;
}
.stat-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-card-accent {
  border-color: var(--border);
  background: #fff;
}
.stat-card-label {
  font-size: 12px;
  color: var(--text-3);
}
.stat-card-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
}
.stat-card-accent .stat-card-value {
  color: var(--text);
}
.stat-card-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 4px;
}
.stat-card-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.stat-card-value-row .stat-card-value {
  flex: 1;
  min-width: 0;
}
.stat-card-value-row .stat-card-link {
  flex-shrink: 0;
  margin-top: 0;
  white-space: nowrap;
}

.billing-tab-stage {
  overflow: hidden;
  width: 100%;
  flex: 1;
  min-height: 0;
}
.billing-tab-track {
  display: flex;
  width: 200%;
  height: 100%;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.billing-tab-track.show-ledger {
  transform: translateX(-50%);
}
.billing-tab-pane {
  width: 50%;
  flex-shrink: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.billing-tab-body {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-app .billing-tab-body .table-scroll {
  max-height: none;
  overflow: visible;
  border: none;
  border-radius: 0;
}
.billing-sticky-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface, #fff);
  box-shadow: 0 1px 0 var(--border-subtle);
}
.billing-tab-foot {
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
}
.billing-tab-foot .billing-panel-hint {
  padding: 10px 20px 12px;
  margin: 0;
}
.billing-tab-empty {
  min-height: 220px;
  justify-content: center;
}
.billing-tab-body .mobile-cards {
  padding: 12px 16px 16px;
}

.billing-detail-shell {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface, #fff);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.billing-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 0 20px;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  --billing-ctrl-h: 32px;
}
.billing-detail-toolbar .billing-page-tabs {
  border-bottom: none;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.billing-detail-toolbar .billing-toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 10px 0;
}
.billing-detail-toolbar .billing-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}
.billing-detail-toolbar .billing-filters .select-sm,
.billing-detail-toolbar .billing-filters .search-box,
.billing-detail-toolbar .billing-toolbar-actions .btn,
.billing-detail-toolbar .billing-toolbar-actions .btn-ghost {
  height: var(--billing-ctrl-h);
  min-height: var(--billing-ctrl-h);
  box-sizing: border-box;
  margin: 0;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.billing-detail-toolbar .billing-filters .select-sm {
  padding: 0 28px 0 10px;
  min-width: 118px;
}
.billing-detail-toolbar .billing-filters .search-box.compact {
  width: 132px;
  max-width: 132px;
  margin-bottom: 0;
}
.billing-detail-toolbar .billing-toolbar-actions .btn-ghost.sm {
  padding: 0 12px;
  font-size: 13px;
}
.billing-detail-toolbar .billing-toolbar-actions .btn-primary {
  margin-top: 0;
}
.billing-detail-toolbar .billing-sync-meta {
  display: inline-flex;
  align-items: center;
  height: var(--billing-ctrl-h);
  margin: 0;
  line-height: 1;
  flex-shrink: 0;
}
.billing-filter-key {
  min-width: 118px;
}
.billing-filter-model {
  width: 132px;
  max-width: 132px;
}
.billing-toolbar-actions.ledger-mode .billing-filter-toggle,
.billing-toolbar-actions.ledger-mode .billing-filters,
.billing-toolbar-actions.ledger-mode .billing-export-btn {
  display: none !important;
}

/* 账单页：整页不滚动，仅明细框内滚动 */
body.is-app .app-shell:has(.billing-workspace) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
body.is-app .app-main:has(.billing-workspace) {
  height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
.app-content.workspace.billing-workspace {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
  box-sizing: border-box;
}
.billing-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.billing-page > .billing-detail-shell {
  margin-top: 16px;
}
.billing-page > :not(.billing-detail-shell) {
  flex-shrink: 0;
}

/* 充值页：撑满视口，仅记录区滚动 */
body.is-app .app-shell:has(.recharge-workspace) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
body.is-app .app-main:has(.recharge-workspace) {
  height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
.app-content.workspace.recharge-workspace {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  body.is-app .app-main:has(.recharge-workspace) {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .app-content.workspace.recharge-workspace {
    overflow: visible;
    display: block;
  }
  .recharge-page {
    overflow: visible;
  }
  .recharge-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .recharge-records-card {
    min-height: 360px;
    height: auto;
  }
}

@media (max-width: 900px) {
  body.is-app .app-main:has(.billing-workspace) {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .app-content.workspace.billing-workspace {
    overflow: visible;
    display: block;
  }
  .billing-page {
    overflow: visible;
  }
  .billing-page .billing-detail-shell {
    flex: none;
    min-height: auto;
  }
  .billing-tab-stage {
    height: clamp(300px, 52vh, 480px);
    flex: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .billing-tab-track {
    transition: none;
  }
}

.page-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.page-head-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}
.page-head-toolbar .page-tabs {
  border-bottom: none;
  flex: 1;
  min-width: 200px;
}
.page-head-toolbar .billing-toolbar-actions {
  padding-bottom: 8px;
}
.billing-panel-hint {
  padding: 12px 22px 16px;
  margin: 0;
}
.workspace-panel.table-panel .billing-panel-hint {
  border-top: 1px solid var(--border-subtle);
}

.billing-inline-alert {
  font-size: 13px;
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 8px;
  line-height: 1.5;
}
.billing-inline-alert a {
  color: var(--accent-2);
  margin-left: 4px;
}
.billing-inline-alert.warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.billing-inline-alert.danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.billing-key-summary {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0 14px;
}
.billing-key-summary summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 12px 0;
  list-style: none;
}
.billing-key-summary summary::-webkit-details-marker {
  display: none;
}
.billing-key-summary-list {
  list-style: none;
  margin: 0;
  padding: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.billing-key-summary-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}
.billing-key-summary-link:hover,
.billing-key-summary-link.active {
  background: #faf5ff;
  border-color: rgba(124, 58, 237, 0.12);
}
.billing-key-summary-name {
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
}
.billing-key-summary-stat {
  font-weight: 600;
  color: var(--accent-2);
}
.billing-key-summary-tokens {
  font-size: 12px;
  color: var(--text-4);
}

.billing-sync-meta {
  font-size: 12px;
  color: var(--text-4);
  white-space: nowrap;
}

.billing-time-date {
  display: block;
  font-weight: 500;
  color: var(--text-2);
}
.billing-time-clock {
  display: block;
  font-size: 11px;
  color: var(--text-4);
  margin-top: 2px;
}
.td-tokens-stack .token-in,
.td-tokens-stack .token-out {
  display: block;
  font-size: 12px;
  line-height: 1.45;
}
.td-tokens-stack .token-out {
  color: var(--text-4);
}
.td-model .billing-model-id {
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.cost-pending {
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  padding: 2px 8px;
  border-radius: 999px;
}
.cost-zero {
  color: var(--text-4);
}

.billing-period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.billing-period-label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}
.billing-period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.billing-period-tab {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  border: 1px solid var(--border);
  background: #fff;
}
.billing-period-tab:hover {
  color: var(--text);
  border-color: rgba(124, 58, 237, 0.2);
}
.billing-period-tab.active {
  color: var(--accent-2);
  border-color: rgba(124, 58, 237, 0.35);
  background: #faf5ff;
}
.billing-model-summary {
  margin-top: -6px;
}
.page-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 12px 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
}
.page-tab:hover {
  color: var(--text);
}
.page-tab.active {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
  font-weight: 600;
}
.tab-panel {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 0;
}

.alert-banner.info,
.keys-tip-banner {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
  margin-bottom: 14px;
}

.keys-table .td-key code {
  font-size: 13px;
  color: var(--text-2);
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
}
.key-inline-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-left: 6px;
  vertical-align: middle;
}
.keys-quota-text {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}
.keys-quota-text.keys-quota-full {
  color: #b45309;
}
.key-usage-link {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
}
.key-usage-link:hover .key-stat-main {
  color: var(--accent-2);
}
.key-usage-link.inline {
  display: inline;
  padding: 0;
  margin: 0;
  color: var(--accent-2);
}
.td-active .key-active-date {
  display: block;
  font-weight: 500;
  color: var(--text-2);
}
.td-active .key-active-time {
  display: block;
  font-size: 11px;
  color: var(--text-4);
  margin-top: 2px;
}
.td-key-name {
  min-width: 120px;
}
.key-name-text {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.key-creator-sub {
  display: block;
  font-size: 11px;
  color: var(--text-4);
  margin-top: 2px;
}
.key-creator-sub.block {
  margin-top: 4px;
}
.key-stat-main {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.key-stat-sub {
  display: block;
  font-size: 11px;
  color: var(--text-4);
  margin-top: 2px;
}
.key-stat-muted {
  color: var(--text-4);
}
.status-pill.key-status.active {
  background: rgba(5, 150, 105, 0.12);
  color: var(--green);
}
.status-pill.key-status.idle {
  background: #f1f5f9;
  color: var(--text-4);
}
.keys-mobile-cards {
  padding: 12px;
}
.key-record-card .key-mobile-secret {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.key-record-card .key-mobile-secret code {
  font-size: 12px;
  word-break: break-all;
}
.key-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.keys-table .col-actions {
  white-space: nowrap;
}
.keys-table .col-actions .link-btn {
  padding: 0 5px;
}
.keys-table th.col-num,
.keys-table td.col-num {
  min-width: 96px;
}
.keys-table th:nth-child(5),
.keys-table td.td-active {
  min-width: 72px;
}
.key-inline-btn {
  margin-right: 4px;
  vertical-align: middle;
}
.col-actions {
  text-align: right;
  white-space: nowrap;
}
.link-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0 6px;
  font-size: 13px;
  color: var(--accent-2);
  cursor: pointer;
}
.link-btn:hover {
  text-decoration: underline;
}
.link-btn.danger {
  color: var(--red);
}

.dash-cta-panel {
  background: linear-gradient(135deg, #faf5ff 0%, #fff 60%);
  border-color: rgba(124, 58, 237, 0.12);
}

@media (max-width: 900px) {
  .app-nav-toggle {
    display: inline-flex;
  }
  .app-topbar {
    padding: 0 16px;
  }
  body.is-app {
    height: auto;
    max-height: none;
    overflow: auto;
  }
  body.is-app .app-shell {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  body.is-app .app-sidebar {
    height: auto;
    max-height: none;
    position: fixed;
    overflow-y: auto;
  }
  body.is-app .app-main {
    overflow: visible;
  }
  body.is-app .app-content.workspace {
    overflow: visible;
    min-height: auto;
  }
  .app-content.workspace {
    padding: 16px;
  }
  .stat-cards-row,
  .stat-cards-row-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  body.is-app.nav-open .app-sidebar {
    transform: translateX(0);
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .app-sidebar-backdrop {
    display: block;
  }
}
@media (max-width: 520px) {
  .stat-cards-row,
  .stat-cards-row-3 {
    grid-template-columns: 1fr;
  }
}

/* 接入文档 /guide — 全宽布局 */
.guide-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.guide-intro .panel-desc strong {
  color: var(--text);
  font-weight: 600;
}
.guide-quick-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.guide-quick-steps li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  min-height: 100%;
}
.guide-quick-n {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}
.guide-quick-body {
  flex: 1;
  min-width: 0;
}
.guide-quick-body strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}
.guide-quick-body span {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
  line-height: 1.5;
}
.guide-quick-action {
  margin-top: auto;
}
.guide-connect {
  margin-bottom: 0;
}
.guide-connect-actions {
  flex-shrink: 0;
}
.guide-key-select {
  max-width: 360px;
  margin-bottom: 14px;
}
.guide-connect-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.guide-field-block {
  margin-bottom: 4px;
}
.guide-field-block .guide-field-hint {
  margin: 4px 0 8px;
  padding-left: 0;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
}
.guide-docs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.guide-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  position: sticky;
  top: 0;
  z-index: 8;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}
.guide-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.guide-nav-link:hover {
  border-color: rgba(124, 58, 237, 0.25);
  background: rgba(124, 58, 237, 0.06);
  color: var(--accent-2);
}
.guide-section {
  margin-bottom: 0;
  scroll-margin-top: 72px;
}
.guide-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.guide-param-table {
  width: 100%;
  table-layout: fixed;
}
.guide-param-table th,
.guide-param-table td {
  vertical-align: top;
  padding: 12px 14px;
  word-wrap: break-word;
}
.guide-param-table th:nth-child(1),
.guide-param-table td:nth-child(1) {
  width: 112px;
}
.guide-param-table th:nth-child(3),
.guide-param-table td:nth-child(3) {
  width: 34%;
}
.guide-section .guide-list.steps-plain {
  list-style: decimal;
  padding-left: 1.25rem;
  margin: 0;
}
.guide-section .guide-list.steps-plain li {
  display: list-item;
  padding: 8px 0;
  border: none;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}
.guide-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.guide-faq-grid li {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
}
.guide-faq-grid li strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}
.guide-faq-grid li span {
  display: block;
  font-size: 13px;
  line-height: 1.55;
}
.guide-notes {
  margin: 12px 0 0;
  padding-left: 1.2rem;
  font-size: 13px;
  color: var(--text-3);
}
.guide-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-3);
}
.guide-param-table code {
  font-size: 12px;
}
.guide-api-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.guide-api-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
}
.guide-api-method {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 6px;
}
.guide-api-card code {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  word-break: break-all;
}
.guide-api-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
}
.keys-guide-more {
  margin: 12px 0 0;
}

/* API 密钥页 — 全宽上下布局（与账单页一致） */
.keys-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.keys-list-panel.table-panel {
  overflow: hidden;
  margin-bottom: 0;
}
.keys-list-panel.table-panel .keys-panel-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.keys-list-panel:not(.table-panel) {
  padding: 20px 22px;
}
.keys-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
}
.keys-panel-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.keys-panel-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-3);
}
.keys-panel-desc a {
  color: var(--accent-2);
  text-decoration: none;
}
.keys-panel-desc a:hover {
  text-decoration: underline;
}
.keys-panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.keys-empty-inline {
  padding: 32px 12px 16px;
  text-align: center;
}
.keys-empty-inline .empty-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.keys-empty-inline .empty-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-3);
}
.keys-connect-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.keys-guide-link {
  font-size: 13px;
  color: var(--accent-2);
  text-decoration: none;
  white-space: nowrap;
}
.keys-guide-link:hover {
  text-decoration: underline;
}
.keys-connect-empty {
  padding: 8px 0 4px;
  text-align: center;
}
.keys-connect-empty p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-3);
}
.keys-connect-key-select {
  margin-bottom: 14px;
  max-width: 360px;
}
@media (max-width: 900px) {
  .keys-panel-head {
    flex-direction: column;
  }
  .keys-panel-head-actions {
    width: 100%;
  }
  .keys-connect-head {
    flex-direction: column;
    align-items: stretch !important;
  }
  .keys-connect-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 1100px) {
  .guide-quick-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .guide-quick-steps {
    grid-template-columns: 1fr;
  }
  .guide-nav-bar {
    position: static;
    box-shadow: none;
  }
  .guide-faq-grid {
    grid-template-columns: 1fr;
  }
  .guide-connect .panel-head {
    flex-direction: column;
    align-items: stretch !important;
  }
  .guide-connect-actions {
    width: 100%;
  }
}

/* 我的 /settings — 与账单页一致的统计卡片 + 全宽区块 */
.settings-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.settings-stat-row {
  margin-bottom: 0;
}
.stat-card-value-sm {
  font-size: 18px;
  letter-spacing: -0.01em;
}
.settings-id-stat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.settings-id-stat code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: none;
  padding: 0;
}
.settings-panel {
  margin-bottom: 0;
}
.settings-pwd-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 16px 20px;
  align-items: end;
}
.settings-pwd-form .field {
  margin: 0;
}
.settings-pwd-form input {
  width: 100%;
}
.settings-pwd-action {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.settings-pwd-action .msg {
  margin: 0;
}
.settings-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.settings-quick-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.settings-quick-link:hover {
  border-color: rgba(124, 58, 237, 0.25);
  background: rgba(124, 58, 237, 0.06);
  color: var(--accent-2);
}
.settings-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-2);
}
.settings-meta-row strong {
  color: var(--text-3);
  font-weight: 600;
  margin-right: 6px;
}
.settings-faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.settings-faq-item {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
}
.settings-faq-item strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}
.settings-faq-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3);
}
.settings-faq-item a {
  color: var(--accent-2);
}
.settings-legal-links {
  margin: 16px 0 0;
}
@media (max-width: 900px) {
  .settings-pwd-form {
    grid-template-columns: 1fr;
  }
  .settings-faq-grid {
    grid-template-columns: 1fr;
  }
  .settings-stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .settings-stat-row {
    grid-template-columns: 1fr;
  }
}

/* Admin — no glow on stat numbers */
body.is-admin .admin-accounts-balance-value,
body.is-admin .admin-accounts-mini-value,
body.is-admin .admin-dashboard-metric-value {
  text-shadow: none;
}
.admin-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.admin-search-form .input {
  flex: 1 1 280px;
  max-width: 420px;
}
.admin-pagination {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.stat-card-value-sm {
  font-size: 16px;
  line-height: 1.35;
  word-break: break-all;
}
.stat-card-warn {
  border-color: rgba(234, 88, 12, 0.25);
  background: linear-gradient(180deg, #fff 0%, #fff7ed 100%);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2, #f1f5f9);
  color: var(--text-2, #64748b);
}
.badge-ok {
  background: #ecfdf5;
  color: #047857;
}
.badge-warn {
  background: #fff7ed;
  color: #c2410c;
}

.admin-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 16px;
  align-items: end;
}
.admin-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2, #64748b);
}
.admin-filter-field .input,
.admin-filter-field select.input {
  width: 100%;
}
.admin-filter-dates {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-filter-dates .input {
  flex: 1;
  min-width: 0;
}
.admin-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.admin-textarea {
  min-height: 88px;
  resize: vertical;
  font-family: inherit;
}
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal-backdrop[hidden] {
  display: none !important;
}
body.admin-modal-open {
  overflow: hidden;
}
.admin-modal {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  padding: 20px 22px 22px;
}
.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.admin-modal-head h2 {
  margin: 0;
  font-size: 18px;
}
.admin-adjust-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

/* Admin operation pages */
.admin-workspace {
  width: 100%;
  max-width: none;
}
.admin-stat-row-narrow {
  max-width: 640px;
}
.workspace-panel.table-panel > .section-head,
.workspace-panel.table-panel > .panel-head {
  padding: 20px 22px 0;
  margin-bottom: 12px;
}
.workspace-panel.table-panel > .section-head.panel-head-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.workspace-panel.table-panel > .empty-hint {
  padding: 8px 22px 22px;
}
.workspace-panel.table-panel > .admin-pagination {
  padding: 0 22px 20px;
}
.admin-filter-field-wide {
  grid-column: span 2;
}
@media (max-width: 720px) {
  .admin-filter-field-wide {
    grid-column: span 1;
  }
}

.ops-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.ops-status-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.ops-status-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
}
.ops-status-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
}
.ops-status-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text-3, #64748b);
  line-height: 1.45;
}
.ops-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: #94a3b8;
}
.ops-status-ok .ops-status-dot { background: #10b981; }
.ops-status-warn .ops-status-dot { background: #f59e0b; }
.ops-status-info .ops-status-dot { background: #94a3b8; }
.ops-status-info { opacity: 0.85; }
.ops-status-fail .ops-status-dot { background: #ef4444; }
.ops-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ops-checklist {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}
.ops-checklist li {
  font-size: 13px;
  color: var(--text-2, #475569);
}
.ops-checklist strong {
  display: block;
  color: var(--text, #0f172a);
  margin-bottom: 2px;
}
.admin-filter-form-inline {
  margin-bottom: 16px;
}
.admin-error-details summary {
  cursor: pointer;
  color: #b45309;
}
.admin-error-pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.metric-value-sm {
  font-size: 14px;
  line-height: 1.35;
}
@media (max-width: 900px) {
  .ops-status-grid {
    grid-template-columns: 1fr;
  }
}

.site-maintenance-banner {
  margin: 0;
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.14);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.site-maintenance-banner-guest {
  margin: 12px auto 0;
  max-width: 960px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
body.is-app .site-maintenance-banner {
  color: #92400e;
  background: #fffbeb;
  border-bottom-color: #fcd34d;
}

.site-balance-banner {
  margin: 0;
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.14);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.site-balance-banner a { color: #fbbf24; font-weight: 600; text-decoration: underline; }
.site-balance-banner-danger {
  background: rgba(239, 68, 68, 0.16);
  border-bottom-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}
.site-balance-banner-danger a { color: #f87171; }
body.is-app .site-balance-banner {
  color: #92400e;
  background: #fffbeb;
  border-bottom-color: #fcd34d;
}
body.is-app .site-balance-banner-danger {
  color: #991b1b;
  background: #fef2f2;
  border-bottom-color: #fca5a5;
}

.models-overview-strip {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 20px;
  margin-bottom: 18px;
  background: var(--card, #111827);
  border: 1px solid var(--border, #1f2937);
  border-radius: 10px;
  flex-wrap: wrap;
}
.models-overview-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.models-overview-label {
  font-size: 12px;
  color: var(--muted-foreground, #94a3b8);
}
.models-overview-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground, #e5e7eb);
}
.models-overview-value-warn {
  color: #f59e0b;
}
.models-overview-link {
  margin-left: auto;
  font-size: 13px;
  color: var(--accent, #3b82f6);
  text-decoration: none;
}
.models-overview-link:hover { text-decoration: underline; }

.admin-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px 20px;
}
.admin-kv-label {
  display: block;
  font-size: 12px;
  color: var(--muted, #94a3b8);
  margin-bottom: 4px;
}
.admin-ops-form {
  display: grid;
  gap: 12px;
  max-width: 560px;
}
.admin-ops-form .admin-filter-actions {
  margin-top: 4px;
}

.admin-search-panel .admin-search-form {
  padding: 0 22px 22px;
}
.admin-search-input-wrap {
  position: relative;
  flex: 1 1 320px;
  max-width: 480px;
}
.admin-search-input-wrap .input {
  width: 100%;
  padding-left: 42px;
}
.admin-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-3, #94a3b8);
  pointer-events: none;
}
.admin-pay-method {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-1, #0f172a);
}
.admin-pay-method-dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #e2e8f0;
}
.admin-pay-method-dot.simulate {
  background: #cbd5e1;
}
body.is-admin .status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
body.is-admin .status-pill.paid {
  background: #ecfdf5;
  color: #047857;
}
body.is-admin .status-pill.pending {
  background: #fffbeb;
  color: #b45309;
}
body.is-admin .status-pill.expired,
body.is-admin .status-pill.failed {
  background: #fef2f2;
  color: #b91c1c;
}

.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 0 22px 22px;
}
.admin-quick-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border, #e2e8f0);
  background: linear-gradient(180deg, #fff 0%, #fafbff 100%);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-quick-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}
.admin-quick-card strong {
  font-size: 15px;
  color: var(--text-1, #0f172a);
}
.admin-quick-card span:last-child {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2, #64748b);
}
.admin-quick-icon {
  font-size: 20px;
  line-height: 1;
}
.admin-quick-card-muted {
  background: #f8fafc;
}
.admin-panel-form {
  padding: 0 22px 22px;
}
.admin-panel-foot {
  padding: 0 22px 20px;
}
.admin-panel-empty {
  padding: 12px 22px 24px;
}
.admin-pricing-form {
  display: grid;
  gap: 14px;
  max-width: 640px;
  padding: 0 22px 22px;
}
.admin-filter-form-inline {
  padding: 0 22px 16px;
}
body.is-admin .status-pill.ledger-recharge {
  background: #ecfdf5;
  color: #047857;
}
body.is-admin .status-pill.ledger-consume {
  background: #eff6ff;
  color: #1d4ed8;
}
body.is-admin .status-pill.ledger-adjust {
  background: #fff7ed;
  color: #c2410c;
}
.auth-card-foot {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
}
.auth-card-foot a {
  color: var(--accent, #6366f1);
  text-decoration: none;
}

/* Admin accounts — recharge-style two-column layout */
.admin-accounts-workspace {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.admin-accounts-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.admin-accounts-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(400px, 42%) minmax(420px, 58%);
  gap: 16px;
  align-items: start;
}
.admin-accounts-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.admin-accounts-balance-strip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 20px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #faf5ff 100%);
  flex-shrink: 0;
}
.admin-accounts-balance-label {
  font-size: 13px;
  color: var(--text-3, #94a3b8);
}
.admin-accounts-balance-value {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-2, #7c3aed);
  letter-spacing: -0.02em;
}
.admin-accounts-side-card {
  flex: 0 0 auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #fff;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.admin-accounts-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-accounts-mini-stat {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle, #eef2f7);
  background: #fafbff;
}
.admin-accounts-mini-stat-wide {
  grid-column: 1 / -1;
}
.admin-accounts-mini-label {
  display: block;
  font-size: 12px;
  color: var(--text-3, #94a3b8);
  margin-bottom: 6px;
}
.admin-accounts-mini-value {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1, #0f172a);
  letter-spacing: -0.02em;
}
.admin-accounts-search-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px 18px;
  align-items: start;
}
.admin-accounts-search-label {
  padding-top: 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2, #64748b);
}
.admin-accounts-search-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.admin-accounts-search-inline {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-accounts-search-inline:focus-within {
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.admin-accounts-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  flex-shrink: 0;
  color: var(--text-3, #94a3b8);
  background: #f8fafc;
  border-right: 1px solid var(--border-subtle, #eef2f7);
}
.admin-accounts-search-icon svg {
  width: 18px;
  height: 18px;
}
.admin-accounts-search-inline .input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 11px 14px;
  font-size: 14px;
}
.admin-accounts-search-inline .input:focus {
  outline: none;
  box-shadow: none;
}
.admin-accounts-search-inline .btn {
  flex-shrink: 0;
  margin: 4px;
  border-radius: 8px;
  min-width: 72px;
}
.admin-accounts-search-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3, #94a3b8);
}
.admin-accounts-clear {
  font-size: 12px;
  color: var(--accent-2, #7c3aed);
  text-decoration: none;
  align-self: flex-start;
}
.admin-accounts-clear:hover {
  text-decoration: underline;
}

.admin-query-page .admin-accounts-layout {
  width: 100%;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}
.admin-query-page .admin-accounts-main,
.admin-query-page .admin-accounts-records-card {
  width: 100%;
  min-width: 0;
}
.admin-query-page .admin-accounts-side-card {
  gap: 20px;
}
.admin-query-page .admin-accounts-search-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-query-page .admin-accounts-search-label {
  padding-top: 0;
}
.admin-query-page .admin-accounts-search-inline {
  min-height: 44px;
  border-radius: 12px;
}
.admin-query-page .admin-accounts-search-inline .input {
  padding: 12px 12px 12px 4px;
}
.admin-query-page .admin-accounts-search-inline .btn {
  margin: 5px;
  min-width: 84px;
  border-radius: 8px;
  height: auto;
  box-shadow: none;
}
.admin-accounts-money-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-accounts-mini-money {
  font-size: 18px;
}

.admin-accounts-records-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.admin-accounts-records-head {
  flex-shrink: 0;
  padding: 20px 22px 12px;
  border-bottom: 1px solid var(--border-subtle, #eef2f7);
}
.admin-accounts-records-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1, #0f172a);
}
.admin-accounts-records-desc {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-3, #94a3b8);
}
.admin-accounts-records-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
  padding: 0 22px 16px;
}
.admin-accounts-records-body .table-scroll {
  border: none;
  border-radius: 0;
  max-height: none;
  overflow: visible;
  margin: 0 -22px;
  padding: 0 22px;
}
body.is-app.is-admin .admin-accounts-records-body .table-scroll {
  max-height: none;
  overflow: visible;
  border: none;
  border-radius: 0;
}
body.is-app.is-admin .admin-accounts-records-card {
  max-height: calc(100vh - 112px);
  overflow: auto;
}
.admin-accounts-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  box-shadow: 0 1px 0 var(--border-subtle, #eef2f7);
  font-size: 12px;
}
.admin-accounts-table .account-code {
  font-size: 12px;
}
.admin-accounts-records-body .admin-pagination {
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border-subtle, #eef2f7);
}
.admin-accounts-records-body .empty-state.compact {
  min-height: 120px;
  justify-content: center;
}
@media (max-width: 1100px) {
  .admin-accounts-layout {
    grid-template-columns: 1fr;
  }
  .admin-orders-page .admin-accounts-layout,
  .admin-query-page .admin-accounts-layout {
    grid-template-columns: 1fr;
  }
  .admin-accounts-records-card {
    max-height: none;
  }
}
@media (max-width: 560px) {
  .admin-accounts-search-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .admin-accounts-search-label {
    padding-top: 0;
  }
  .admin-accounts-search-inline {
    flex-direction: column;
    overflow: visible;
    border: none;
    box-shadow: none;
    gap: 8px;
    background: transparent;
  }
  .admin-accounts-search-inline:focus-within {
    box-shadow: none;
  }
  .admin-accounts-search-icon {
    display: none;
  }
  .admin-accounts-search-inline .input {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  .admin-accounts-search-inline .btn {
    margin: 0;
    width: 100%;
  }
}

/* Admin orders — dual-column + filter polish */
.admin-orders-page .admin-accounts-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 16px;
}
.admin-orders-page .admin-accounts-main,
.admin-orders-page .admin-orders-records-card {
  width: 100%;
  min-width: 0;
}
.admin-orders-side-card {
  gap: 18px;
}
.admin-orders-mini-warn {
  border-color: rgba(234, 88, 12, 0.25);
  background: linear-gradient(180deg, #fff 0%, #fff7ed 100%);
}
.admin-orders-filter-form {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 14px;
  align-items: center;
}
.admin-orders-filter-row {
  display: contents;
}
.admin-orders-filter-row .admin-accounts-search-label {
  padding-top: 0;
  align-self: center;
}
.admin-orders-select,
.admin-orders-filter-row .input {
  width: 100%;
  border-radius: 10px;
  border-color: var(--border, #e2e8f0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.admin-orders-select:focus,
.admin-orders-filter-row .input:focus {
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.admin-orders-date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.admin-orders-date-range .input {
  width: 100%;
  min-width: 0;
  font-size: 13px;
}
.admin-orders-date-sep {
  font-size: 12px;
  color: var(--text-3, #94a3b8);
  flex-shrink: 0;
}
.admin-orders-filter-actions {
  grid-column: 2;
  display: flex;
  gap: 10px;
  padding-top: 2px;
}
.admin-orders-filter-actions .btn {
  min-width: 80px;
  padding: 9px 16px;
  font-size: 13px;
  box-shadow: none;
}
.admin-orders-filter-actions .btn-primary {
  flex: 1;
  max-width: 120px;
}
.admin-table-action {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-2, #7c3aed);
  text-decoration: none;
  white-space: nowrap;
}
.admin-table-action:hover {
  text-decoration: underline;
  color: #6d28d9;
}
.admin-orders-records-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.admin-orders-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.admin-orders-table {
  table-layout: fixed;
  width: 100%;
}
body.is-app.is-admin .admin-orders-table thead th,
body.is-app.is-admin .admin-orders-table tbody td {
  padding: 8px 10px;
  vertical-align: middle;
}
.admin-orders-table .td-order-no { width: 22%; }
.admin-orders-table .td-account { width: 16%; }
.admin-orders-table .col-num { width: 9%; }
.admin-orders-table .td-channel { width: 12%; }
.admin-orders-table .td-status { width: 10%; }
.admin-orders-table .td-time { width: 14%; }
.admin-orders-table .td-action { width: 8%; }
.admin-orders-table tbody tr {
  transition: background 0.12s ease;
}
.admin-orders-table tbody tr:hover {
  background: #fafbff;
}
.admin-orders-table .order-no-cell-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.admin-orders-table .order-no-link {
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
}
.admin-orders-table .order-no-text {
  display: block;
  font-size: 12px;
  color: var(--text-2, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-orders-account-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.admin-orders-account-cell code {
  font-size: 12px;
  white-space: nowrap;
}
.admin-orders-phone {
  font-size: 11px;
  color: var(--text-3, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-orders-table .col-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.admin-orders-table .td-time {
  font-size: 12px;
  color: var(--text-3, #64748b);
  white-space: nowrap;
}
.admin-orders-table .td-channel,
.admin-orders-table .td-status {
  white-space: nowrap;
}
.admin-orders-table .admin-pay-method {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.admin-orders-table .admin-pay-method .pay-icon-alipay-sm,
.admin-orders-table .admin-pay-method .pay-icon-wechat-sm {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.admin-orders-table .td-status .status-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 2px 8px;
  line-height: 1.3;
}
@media (max-width: 560px) {
  .admin-orders-filter-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .admin-orders-filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .admin-orders-filter-actions {
    grid-column: auto;
  }
  .admin-orders-date-range {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .admin-orders-date-sep {
    text-align: center;
  }
}

/* Admin usage — billing table polish */
.admin-usage-mini-compact {
  font-size: 20px;
}
.admin-usage-table .admin-usage-account {
  font-size: 12px;
}
.admin-usage-key {
  font-size: 13px;
  color: var(--text-1, #0f172a);
}
.admin-usage-model {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  vertical-align: bottom;
}
.admin-usage-cost {
  font-weight: 600;
  color: var(--accent-2, #7c3aed);
}

/* Admin dashboard — dual-column overview */
.admin-dashboard-today-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.admin-dashboard-today-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-dashboard-today-side {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.admin-dashboard-today-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-dashboard-today-label {
  font-size: 12px;
  color: var(--text-3, #94a3b8);
}
.admin-dashboard-today-num {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1, #0f172a);
  font-variant-numeric: tabular-nums;
}
.admin-dashboard-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2, #64748b);
}
.admin-dashboard-platform-stats {
  margin-bottom: 20px;
}
.admin-dashboard-mini-money {
  font-size: 18px;
}
.admin-dashboard-nav {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle, #eef2f7);
  border-radius: 10px;
  overflow: hidden;
}
.admin-dashboard-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-bottom: 1px solid var(--border-subtle, #eef2f7);
  transition: background 0.12s ease;
}
.admin-dashboard-nav-item:last-child {
  border-bottom: none;
}
.admin-dashboard-nav-item:hover {
  background: #fafbff;
}
.admin-dashboard-nav-item-muted {
  background: #f8fafc;
}
.admin-dashboard-nav-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.admin-dashboard-nav-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1, #0f172a);
}
.admin-dashboard-nav-desc {
  font-size: 12px;
  color: var(--text-3, #94a3b8);
  line-height: 1.4;
}
.admin-dashboard-nav-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-4, #cbd5e1);
}
.admin-dashboard-side-panel {
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.admin-dashboard-panel-block {
  padding: 18px 22px;
  flex-shrink: 0;
}
.admin-dashboard-panel-block .admin-accounts-records-head {
  padding: 0 0 10px;
  border-bottom: none;
}
.admin-dashboard-panel-divider {
  height: 1px;
  background: var(--border-subtle, #eef2f7);
  flex-shrink: 0;
}
.admin-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}
.admin-dashboard-metric {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle, #eef2f7);
  background: #fafbff;
}
.admin-dashboard-metric-label {
  display: block;
  font-size: 12px;
  color: var(--text-3, #94a3b8);
  margin-bottom: 4px;
}
.admin-dashboard-metric-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1, #0f172a);
  font-variant-numeric: tabular-nums;
}
.admin-dashboard-metric-warn {
  color: #c2410c;
}
.admin-dashboard-alert {
  margin-top: 12px;
}
.admin-dashboard-panel-foot {
  margin-top: 10px;
}
.admin-dashboard-pricing-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-dashboard-pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-dashboard-pricing-actions {
  display: flex;
  gap: 10px;
}
.admin-dashboard-pricing-actions .btn {
  min-width: 96px;
  box-shadow: none;
}
.admin-pricing-details {
  font-size: 12px;
  color: var(--text-3, #94a3b8);
  border: 1px solid var(--border-subtle, #eef2f7);
  border-radius: 8px;
  padding: 8px 12px;
  background: #f8fafc;
}
.admin-pricing-details summary {
  cursor: pointer;
  color: var(--accent-2, #7c3aed);
  font-weight: 500;
  list-style: none;
}
.admin-pricing-details summary::-webkit-details-marker {
  display: none;
}
.admin-pricing-details[open] summary {
  margin-bottom: 6px;
}
.admin-dashboard-pricing-form .msg {
  text-align: left;
  margin: 0;
  min-height: 0;
}
.admin-dashboard-nav-item {
  padding: 10px 14px;
}
.admin-dashboard-nav-desc {
  line-height: 1.35;
}
.admin-dashboard-platform-stats {
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .admin-dashboard-pricing-grid {
    grid-template-columns: 1fr;
  }
}
.admin-dashboard-pricing-form .admin-filter-field span {
  font-size: 12px;
  color: var(--text-3, #94a3b8);
  margin-bottom: 6px;
  display: block;
}
.admin-pricing-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3, #94a3b8);
}
.admin-pricing-hint strong {
  color: var(--text-2, #64748b);
  font-weight: 600;
}
.admin-pricing-guide {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-3, #94a3b8);
}
.admin-pricing-guide strong {
  color: var(--accent-2, #7c3aed);
  font-weight: 600;
}
.amount-grid-recharge-v2 .amount-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.amount-grid-recharge-v2 .amount-pick .amt-bonus {
  font-size: 11px;
  color: #b45309;
  font-weight: 500;
}
.amount-grid-recharge-v2 .amount-pick.selected .amt-bonus {
  color: #92400e;
}
@media (max-width: 560px) {
  .admin-dashboard-today-strip {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-dashboard-today-side {
    width: 100%;
    justify-content: space-between;
  }
}

/* Admin keys — dual-column health page */
.admin-keys-layout {
  grid-template-columns: minmax(340px, 38%) minmax(460px, 62%);
}
.admin-keys-status-strip {
  justify-content: space-between;
  align-items: center;
}
.admin-keys-status-pill-wrap .health-pill {
  font-size: 14px;
  padding: 6px 14px;
}
.admin-keys-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle, #eef2f7);
}
.admin-keys-meta p {
  margin: 0;
  font-size: 13px;
  color: var(--text-1, #0f172a);
}
.admin-keys-meta-label {
  display: inline-block;
  min-width: 72px;
  color: var(--text-3, #94a3b8);
  font-size: 12px;
}
.admin-keys-alert {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
.admin-keys-alert strong {
  display: block;
  margin-bottom: 4px;
}
.admin-keys-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3, #94a3b8);
}
.admin-keys-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-keys-records-panel {
  overflow: auto;
}
.admin-keys-section {
  flex-shrink: 0;
}
.admin-keys-section .admin-accounts-records-head {
  padding: 18px 22px 8px;
  border-bottom: none;
}
.admin-keys-section-body {
  padding: 0 22px 16px;
}
.admin-keys-section-body .table-scroll {
  margin: 0 -22px;
  padding: 0 22px;
  border: none;
  max-height: none;
}
.admin-keys-empty {
  min-height: 88px;
  padding: 8px 0;
}
@media (max-width: 1100px) {
  .admin-keys-layout {
    grid-template-columns: 1fr;
  }
  .admin-keys-records-panel {
    min-height: 480px;
  }
}

/* Admin ops — dual-column status page */
.admin-ops-layout {
  grid-template-columns: minmax(340px, 38%) minmax(460px, 62%);
}
.admin-ops-status-strip {
  justify-content: space-between;
  align-items: center;
}
.admin-ops-gateway-value {
  font-size: 24px;
}
.admin-ops-gateway-off {
  color: #b91c1c;
}
.admin-ops-backend-value {
  font-size: 18px;
}
.admin-ops-core-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-ops-link-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2, #7c3aed);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(124, 58, 237, 0.25);
  background: rgba(124, 58, 237, 0.06);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.admin-ops-link-btn:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.4);
}
.admin-ops-core-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle, #eef2f7);
  background: #fafbff;
}
.admin-ops-core-item strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1, #0f172a);
  margin-bottom: 2px;
}
.admin-ops-core-item span {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-3, #64748b);
  word-break: break-word;
}
.admin-ops-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-ops-records-panel {
  overflow: auto;
}
.admin-ops-section {
  flex-shrink: 0;
}
.admin-ops-section .admin-accounts-records-head {
  padding: 18px 22px 8px;
  border-bottom: none;
}
.admin-ops-section-body {
  padding: 0 22px 18px;
}
.admin-ops-extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.admin-ops-extras-grid .ops-status-card {
  margin: 0;
}
.admin-ops-form-wide {
  max-width: none;
}
.admin-ops-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-ops-checklist {
  margin: 0;
  padding-left: 20px;
}
@media (max-width: 1100px) {
  .admin-ops-layout {
    grid-template-columns: 1fr;
  }
  .admin-ops-records-panel {
    min-height: 480px;
  }
}
@media (max-width: 640px) {
  .admin-ops-form-grid {
    grid-template-columns: 1fr;
  }
  .admin-ops-extras-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin detail pages — same dual-column as list pages */
.admin-detail-side-compact .admin-accounts-mini-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.admin-detail-side-compact .admin-accounts-mini-stat {
  padding: 10px 12px;
}
.admin-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  padding: 4px 0 2px;
}
.admin-detail-meta-grid p {
  margin: 0;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-detail-meta-grid .admin-keys-meta-label {
  color: var(--text-3, #94a3b8);
  font-size: 12px;
}
.admin-detail-meta-grid .admin-detail-meta-full {
  grid-column: 1 / -1;
}
.admin-detail-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-detail-links-row .admin-detail-link {
  flex: 1 1 auto;
  text-align: center;
  font-size: 12px;
  padding: 8px 10px;
}

.admin-detail-page .admin-accounts-layout {
  grid-template-columns: minmax(320px, 36%) minmax(460px, 64%);
  align-items: stretch;
  height: calc(100vh - 160px);
  min-height: 480px;
}
.admin-detail-page .admin-accounts-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: visible;
}
.admin-detail-page .admin-accounts-main .admin-accounts-balance-strip {
  flex-shrink: 0;
}
.admin-detail-page .admin-accounts-side-card {
  flex-shrink: 0;
  gap: 14px;
  padding: 18px 20px;
}

/* 左侧：两排统计紧凑网格 */
.admin-detail-page .admin-accounts-side-card .admin-accounts-mini-stats {
  gap: 8px;
}
.admin-detail-page .admin-accounts-side-card .admin-accounts-mini-stat {
  padding: 10px 12px;
}

/* 右侧：拉满到底部 */
.admin-detail-records {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 100%;
}
.admin-detail-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-detail-tab {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  padding: 9px 16px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.admin-detail-tab:hover {
  color: var(--text-1);
  background: rgba(124, 58, 237, 0.06);
}
.admin-detail-tab.active {
  color: var(--accent-2, #7c3aed);
  border-bottom-color: var(--accent-2, #7c3aed);
  background: rgba(124, 58, 237, 0.05);
}
.admin-detail-tab-pane[hidden] {
  display: none;
}
.admin-detail-tab-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.admin-detail-tab-pane .admin-ops-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.admin-detail-tab-pane .admin-accounts-records-head {
  flex-shrink: 0;
}
.admin-detail-tab-pane .admin-ops-section-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-detail-records .admin-dashboard-panel-divider {
  display: none;
}



.admin-detail-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-detail-link {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1, #0f172a);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #eef2f7);
  background: #fafbff;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.admin-detail-link:hover {
  background: var(--accent-soft, rgba(124, 58, 237, 0.08));
  border-color: rgba(124, 58, 237, 0.2);
  color: var(--accent-2, #7c3aed);
}
.admin-detail-status-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2, #64748b);
}
.admin-detail-status-note strong {
  color: var(--text-1, #0f172a);
}
.admin-topbar-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2, #64748b);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.12s ease, color 0.12s ease;
}
.admin-topbar-link:hover {
  color: var(--accent-2, #7c3aed);
  background: var(--accent-soft, rgba(124, 58, 237, 0.08));
}
.app-topbar-right .admin-topbar-link {
  margin-left: 6px;
}
.admin-modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--text-3, #94a3b8);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}
.admin-modal-close:hover {
  color: var(--text-1, #0f172a);
  background: var(--surface-2, #f1f5f9);
}
@media (max-width: 1100px) {
  .admin-detail-page .admin-accounts-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== 厂商分组 + 能力筛选（2026-08-27，vendor-group 已废弃，勿覆盖 #modelGrid 网格） ===== */
.vendor-group { margin-bottom: 32px; }
.vendor-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.vendor-group-title { font-size: 17px; font-weight: 600; color: #e8eaf0; }
.vendor-group-count { font-size: 13px; color: #8b93a7; }
.vendor-group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.model-tag--audio { background: rgba(56, 189, 248, 0.14); color: #38bdf8; }

.vendor-group-sub { font-size: 12px; font-weight: 400; color: #8b93a7; margin-left: 10px; }


/* ── 定价通知页（admin-pricing）── */
.admin-pricing-last-check { font-size: 15px; }
.admin-pricing-actions { display: flex; gap: 6px; align-items: center; }
.admin-pricing-table td { vertical-align: middle; }
.admin-cell-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; line-height: 1.6; }
.admin-price-old { color: #94a3b8; text-decoration: line-through; }
.admin-price-new { color: #4ade80; font-weight: 600; }
.admin-pricing-hint { font-size: 12px; color: #94a3b8; margin-top: 12px; line-height: 1.7; }
.admin-pricing-hint a { color: #818cf8; text-decoration: none; }
.admin-pricing-hint a:hover { text-decoration: underline; }
.admin-pricing-empty { margin: 0; }

/* ============================================================
   TikHub T0 — 模块 / 壳子补充
   ============================================================ */
.brand .brand-name b { color: var(--accent); }

.app-topbar {
  background: #fff;
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
}

.workspace-panel,
.models-toolbar {
  box-shadow: none;
  border-radius: var(--radius-lg);
}

.models-toolbar {
  padding: var(--space-4) var(--space-5);
}

body.is-app .app-content.workspace {
  padding: var(--space-6) 28px;
  background: var(--bg);
}

.auth-form-links a {
  color: var(--accent);
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

body.is-app .btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

@media (max-width: 900px) {
  .topbar-balance-label { display: none; }
}

/* ============================================================
   TikHub T1 — 居中登录页
   ============================================================ */
body.auth-centered {
  background: var(--bg-app);
}

body.auth-centered .auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px 40px;
}

.auth-centered-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.auth-centered-head {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.auth-brand-mark .logo {
  width: 36px;
  height: 36px;
}

.auth-brand-mark .logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-card-centered {
  box-shadow: none;
  border-radius: var(--radius-lg);
  padding: 32px 28px 24px;
}

.auth-card-centered .auth-card-title {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.auth-card-centered .auth-card-sub {
  text-align: center;
  margin-bottom: 24px;
}

.auth-centered-foot {
  text-align: center;
  margin-top: 24px;
}

.auth-copy {
  margin: 0;
  font-size: 12px;
  color: var(--text-4);
}

body.auth-centered .auth-form-links a {
  color: var(--text-3);
}

body.auth-centered .auth-form-links a:hover {
  color: var(--text);
}

/* ============================================================
   TikHub T2 — 表格 / Badge / 充值表单
   ============================================================ */

/* 表格表头：灰色底 + 小号大写标签 */
body.is-app .data-table-pro thead th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 10px 14px;
}

.recharge-records-table thead th,
.billing-sticky-table thead th,
.admin-accounts-table thead th,
body.is-app.is-admin .admin-accounts-table thead th {
  background: var(--surface-2) !important;
  box-shadow: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-4);
}

body.is-app .table-scroll {
  border-color: var(--border);
  border-radius: var(--radius-lg);
}

body.is-app .data-table-pro tbody td {
  font-size: 14px;
  color: var(--text-2);
}

/* 状态 Badge：统一 pill 尺寸与淡色底 */
body.is-app .status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  border: 1px solid transparent;
}

body.is-app .status-pill.paid,
body.is-app .status-pill.recharge,
body.is-app .status-pill.recharge-status-paid,
body.is-app .status-pill.succeeded,
body.is-app .status-pill.active,
body.is-app .key-status.active {
  background: #ecfdf5;
  color: #047857;
  border-color: rgba(5, 150, 105, 0.14);
}

body.is-app .status-pill.pending,
body.is-app .status-pill.retry,
body.is-app .status-pill.running {
  background: #fffbeb;
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.12);
}

body.is-app .status-pill.failed,
body.is-app .status-pill.reported {
  background: #fef2f2;
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.12);
}

body.is-app .status-pill.consume,
body.is-app .status-pill.expired,
body.is-app .status-pill.disabled,
body.is-app .key-status.idle {
  background: var(--surface-2);
  color: var(--text-3);
  border-color: var(--border-subtle);
}

body.is-app .badge {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}

body.is-app .badge-ok {
  background: #ecfdf5;
  color: #047857;
  border-color: rgba(5, 150, 105, 0.14);
}

body.is-app .badge-warn {
  background: #fffbeb;
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.12);
}

/* 充值页：中性余额条 + 44px 控件 */
.recharge-balance-strip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.recharge-balance-value {
  color: var(--text);
  font-size: 24px;
}

.recharge-form-card,
.recharge-records-card,
.billing-detail-shell {
  border-radius: var(--radius-lg);
}

.recharge-form-row {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px 24px;
  margin-bottom: 20px;
}

.recharge-label {
  line-height: var(--control-h);
  font-size: 13px;
  color: var(--text-3);
}

.amount-grid-recharge-v2 .amount-pick {
  min-height: var(--control-h);
  border-radius: var(--radius-lg);
}

.amount-grid-recharge-v2 .amount-pick:hover {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.amount-grid-recharge-v2 .amount-pick.selected {
  border-color: var(--primary);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.recharge-custom-inline input {
  min-height: var(--control-h);
  padding: 0 16px;
  border-radius: var(--radius-lg);
  width: 200px;
  flex: 0 0 200px;
}

.recharge-custom-inline input:focus,
.recharge-custom-inline input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.recharge-custom-inline .btn-primary.sm {
  min-height: var(--control-h-sm);
  padding: 0 18px;
  border-radius: var(--radius-pill);
}

.pay-chip {
  min-height: var(--control-h);
  padding: 0 16px;
  border-radius: var(--radius-lg);
}

.recharge-verify-btn,
.recharge-verify-done {
  min-height: var(--control-h);
  padding: 0 20px;
  border-radius: var(--radius-lg);
}

.recharge-submit-btn {
  min-height: var(--control-h) !important;
  padding: 0 32px !important;
  border-radius: var(--radius-pill) !important;
  background: var(--primary) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.recharge-records-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

body.is-app .input,
body.is-app select.input {
  min-height: var(--control-h);
  padding: 0 16px;
  border-radius: var(--radius-lg);
}

body.is-app select.input {
  padding-right: 36px;
}

.billing-period-tab {
  border-radius: var(--radius-pill);
}

.billing-period-tab.active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}

/* ============================================================
   TikHub T3 — 体验中心 Playground
   ============================================================ */
.playground-card,
.docs-config-panel {
  border-color: var(--border);
  box-shadow: none;
}

.docs-page .workspace-panel {
  border-radius: var(--radius-lg);
}

.playground-select {
  min-height: var(--control-h);
  padding: 0 16px;
  border-radius: var(--radius-lg);
}

.playground-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.playground-prompt {
  border-radius: var(--radius-lg);
}

.playground-prompt:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.playground-chip {
  border-radius: var(--radius-pill);
  font-size: 13px;
}

.playground-chip:hover,
.playground-chip:focus-visible {
  border-color: var(--primary);
  background: var(--surface-2);
  color: var(--text);
}

.playground-badge {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}

.playground-badge.ok {
  background: #ecfdf5;
  color: #047857;
  border-color: rgba(5, 150, 105, 0.14);
}

.playground-badge.warn {
  background: #fffbeb;
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.12);
}

.playground-chat {
  border-radius: var(--radius-lg);
  border-color: var(--border);
  background: var(--surface-2);
}

.playground-actions .btn-primary {
  min-height: var(--control-h);
  border-radius: var(--radius-pill);
}

@media (max-width: 960px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   P1 — 引导条 / 试调用 / 账单折叠
   ============================================================ */
.models-onboarding-bar.onboarding-compact {
  padding: 10px 14px;
  margin-bottom: 12px;
  gap: 8px 12px;
  border-radius: var(--radius-lg);
  border-color: var(--border);
  background: var(--surface-2);
}

.models-onboarding-bar.onboarding-compact .models-onboarding-bar-main strong {
  font-size: 13px;
  font-weight: 600;
}

.models-onboarding-bar.onboarding-compact .models-onboarding-bar-main span {
  font-size: 12px;
}

.models-onboarding-bar.onboarding-compact .models-onboarding-pill {
  padding: 3px 9px;
  font-size: 11px;
}

.models-onboarding-bar.onboarding-compact .models-onboarding-cta {
  min-height: var(--control-h-sm);
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  white-space: nowrap;
}

.models-domestic-test {
  width: auto;
  min-width: 52px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
}

.models-domestic-test:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-fg);
}

.model-card-actions .models-domestic-test {
  height: 26px;
  min-width: 48px;
  font-size: 11px;
}

.billing-key-summary:not([open]) summary {
  margin-bottom: 0;
}

.billing-key-summary summary {
  cursor: pointer;
  user-select: none;
}

/* P-dedup — 体验中心侧栏：去重后仅保留下一步引导 */
.docs-next-panel {
  padding: 18px 20px;
  border-color: var(--border);
}

.docs-next-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.docs-next-desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-3);
}

.docs-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.docs-next-links {
  margin: 0;
  padding: 12px 0 0;
  list-style: none;
  border-top: 1px solid var(--border-subtle);
}

.docs-next-links li + li {
  margin-top: 8px;
}

.docs-next-links a {
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
}

.docs-next-links a:hover {
  color: var(--accent-2);
}

.docs-faq-more {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.settings-support-panel .settings-meta-row {
  margin-bottom: 12px;
}

.guide-connect-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.guide-preview-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.guide-preview-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  line-height: 1.5;
}

.guide-preview-value {
  display: block;
  font-size: 13px;
  word-break: break-all;
}

.guide-preview-note {
  grid-column: 2;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
}

.docs-next-panel--ready {
  border-color: rgba(5, 150, 105, 0.32);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.docs-next-panel--ready .docs-next-title {
  color: #047857;
}

.docs-next-panel--ready .docs-next-desc::before {
  content: '✓ ';
  color: #047857;
  font-weight: 600;
}

@keyframes docs-connect-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(17, 17, 17, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.14);
  }
}

.docs-connect-link--pulse {
  animation: docs-connect-pulse 1.1s ease 2;
}

/* P3 — 登录左屏步骤 + 统一空状态 */
.auth-split-steps {
  list-style: none;
  margin: 22px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 10px;
}

.auth-split-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}

.auth-split-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

body.is-app .empty-state-app {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

body.is-app .empty-state-app .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-3);
}

body.is-app .empty-state-app.compact {
  padding: 24px 16px;
}

.keys-list-panel .empty-state-app {
  margin-top: 8px;
}

.guide-connect .empty-state-app {
  margin-top: 4px;
}

/* P4 — 视觉细调（间距 / 面板 / 登录 / 对话） */
body.is-app .app-content.workspace {
  padding: 20px 24px 32px;
}

body.is-app .workspace-panel .panel-head h2,
body.is-app .workspace-panel .section-head h2 {
  font-size: 16px;
  letter-spacing: -0.02em;
}

body.is-app .stat-card {
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

@media (min-width: 901px) {
  body.is-app .stat-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  }
}

.settings-support-panel .settings-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-size: 13px;
  color: var(--text-2);
}

.settings-support-panel .settings-meta-row strong {
  color: var(--text);
  font-weight: 600;
}

.settings-legal-links {
  margin-top: 4px;
}

.models-empty-filter.empty-state-app {
  margin-top: 8px;
  padding: 28px 16px;
}

.guide-quick-steps li {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 901px) {
  .guide-quick-steps li:hover {
    border-color: var(--border);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  }
}

.auth-split-form {
  background: #fafafa;
}

.auth-card-login .auth-card-title {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.auth-card-login .auth-card-sub {
  margin-bottom: 24px;
}

body.auth-split-layout .field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.keys-quota-text {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.playground-chat-empty {
  padding: 28px 16px;
}

.playground-chat-empty p {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.playground-chat-empty-hint {
  font-size: 12px;
  color: var(--text-4);
}

.playground-msg {
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.playground-msg-assistant {
  border-color: var(--border);
  background: var(--surface);
}

.billing-inline-alert {
  margin-bottom: 12px;
}

.topbar-balance-wrap {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}

body.is-app .empty-state-app .empty-title {
  color: var(--text);
}

/* P5 — 模型广场：4 列网格 + 国产优选卡片 */
.models-market {
  max-width: none;
}

.model-card-grid,
.models-market #modelGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.models-domestic-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.models-domestic-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.models-domestic-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.models-domestic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.models-domestic-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.models-domestic-head-text {
  min-width: 0;
  flex: 1;
}

.models-domestic-vendor {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.models-domestic-card .models-domestic-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.models-domestic-card .models-domestic-title {
  font-size: 15px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.models-domestic-card .models-domestic-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.55em * 2);
}

.models-domestic-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 2px;
}

.models-domestic-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.models-domestic-id {
  flex-shrink: 0;
  max-width: 46%;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .models-domestic-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .models-domestic-id {
    max-width: 100%;
  }
}

/* ============================================================
   P6 — 模型广场：国产优选置顶 + Tab/搜索同行
   ============================================================ */
.models-market .models-toolbar {
  margin-bottom: 16px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.models-filter-row {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.models-market .models-cat-tabs {
  flex: 1 1 auto;
  min-width: 0;
}

.models-market .models-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 380px;
  min-width: min(100%, 240px);
  max-width: 420px;
  margin-left: auto;
  margin-bottom: 0;
  position: static;
}

.models-search-field {
  position: relative;
  flex: 1;
  min-width: 0;
}

.models-vendor-filter {
  height: var(--control-h, 36px);
  padding: 0 28px 0 12px;
  border-radius: var(--radius-lg, 9px);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}

.models-vendor-filter:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.models-search-field .models-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-4);
  pointer-events: none;
}

.models-market .models-search {
  width: 100%;
  min-height: var(--control-h, 36px);
  padding: 0 12px 0 38px;
  font-size: 13px;
}

.models-domestic {
  position: relative;
  margin-bottom: 16px;
}

.models-domestic-toggle {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 14px;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.models-domestic-toggle:hover {
  border-color: #cbd5e1;
  color: var(--text-2);
  background: var(--surface-2);
}

@media (max-width: 960px) {
  .models-filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .models-market .models-search-wrap {
    max-width: none;
    margin-left: 0;
  }
}

/* ============================================================
   P7 — 充值页：左栏收窄 + 右侧记录表完整排列
   ============================================================ */
.recharge-layout {
  grid-template-columns: minmax(300px, 40%) minmax(0, 1fr);
  gap: 20px;
}

.recharge-layout-main {
  max-width: 480px;
}

.recharge-form-card,
.recharge-layout-main .recharge-balance-strip {
  padding-left: 20px;
  padding-right: 20px;
}

.recharge-form-card {
  padding-top: 20px;
  padding-bottom: 20px;
}

.recharge-form-row {
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px 16px;
}

.amount-grid-recharge-v2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recharge-records-card {
  overflow: hidden;
  min-width: 0;
}

.recharge-records-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.recharge-records-card .table-scroll,
body.is-app .recharge-records-body .table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
}

.recharge-records-table {
  width: 100%;
  min-width: 620px;
  table-layout: auto;
}

.recharge-records-table thead th,
.recharge-records-table tbody td {
  padding: 10px 12px;
}

.recharge-records-table .td-order-no {
  max-width: 200px;
}

.recharge-records-table .td-time {
  white-space: nowrap;
}

.recharge-records-table .col-num,
.recharge-records-table td.col-num {
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 1100px) {
  .recharge-layout {
    grid-template-columns: minmax(280px, 44%) minmax(0, 1fr);
  }

  .recharge-layout-main {
    max-width: none;
  }
}

@media (max-width: 900px) {
  .recharge-layout {
    grid-template-columns: 1fr;
  }

  .recharge-layout-main {
    max-width: none;
  }

  .amount-grid-recharge-v2 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ============================================================
   P8 — 全局按钮尺寸 + 密钥表单行
   ============================================================ */
:root {
  --control-h: 36px;
  --control-h-sm: 32px;
  --control-h-xs: 28px;
}

body.is-app .btn-primary,
body.is-auth .btn-primary {
  min-height: var(--control-h);
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
}

body.is-app .btn-primary.sm,
body.is-auth .btn-primary.sm {
  min-height: var(--control-h-sm);
  padding: 0 14px;
  font-size: 13px;
}

body.is-app .btn-ghost.sm,
body.is-auth .btn-ghost.sm,
.connect-quick-row .btn-ghost {
  min-height: var(--control-h-sm);
  padding: 0 12px;
  font-size: 13px;
  line-height: 1.2;
  border-radius: var(--radius-pill);
}

body.is-app .btn-ghost.xs,
body.is-auth .btn-ghost.xs,
.keys-table .key-inline-btn {
  min-height: var(--control-h-xs);
  padding: 0 10px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: var(--radius-pill);
}

.keys-panel-head-actions .btn-primary,
.recharge-submit-btn,
.playground-actions .btn-primary {
  min-height: var(--control-h);
}

.keys-connect-head-actions .btn-primary.sm {
  min-height: var(--control-h-sm);
}

.keys-table tbody td {
  vertical-align: middle;
  white-space: nowrap;
}

.keys-table .td-key-name .key-name-text {
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.keys-table .td-key {
  max-width: 320px;
}

.keys-table .td-key code {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.keys-table .key-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.keys-table th.col-num,
.keys-table td.col-num {
  min-width: 168px;
}

.keys-table th:nth-child(5),
.keys-table td.td-active {
  min-width: 108px;
}

.keys-table .key-usage-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.keys-table .key-stat-main,
.keys-table .key-stat-sub {
  display: inline;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.keys-table .key-stat-sub {
  color: var(--text-3);
}

.keys-table .key-stat-sub::before {
  content: "·";
  margin: 0 4px;
  color: var(--text-4);
}

.keys-table .td-active .key-active-date,
.keys-table .td-active .key-active-time {
  display: inline;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin: 0;
}

.keys-table .td-active .key-active-time {
  font-weight: 400;
  color: var(--text-3);
}

.keys-table .td-active .key-active-time::before {
  content: " ";
}

.keys-table .col-actions .link-btn {
  font-size: 13px;
}

.connect-quick-row {
  flex-wrap: nowrap;
}

.connect-quick-row .btn-ghost {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .keys-table tbody td {
    white-space: normal;
  }

  .connect-quick-row {
    flex-wrap: wrap;
  }
}

/* ============================================================
   P9 — API 密钥页：双主按钮统一 + 状态对齐 + 配额/链接排版
   ============================================================ */
.keys-primary-action {
  min-height: var(--control-h-sm);
  min-width: 132px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.keys-panel-head-actions .btn-primary.keys-primary-action,
.keys-connect-head-actions .btn-primary.keys-primary-action {
  min-height: var(--control-h-sm);
}

.keys-panel-head-actions {
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.keys-panel-head-actions .keys-quota-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
  white-space: nowrap;
}

.keys-connect-head-actions {
  align-items: center;
  gap: 14px;
}

.keys-head-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.keys-connect-head-actions .keys-guide-link {
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.keys-table th.td-status,
.keys-table td.td-status {
  width: 84px;
  min-width: 84px;
  text-align: left;
  vertical-align: middle;
}

.keys-table td.td-status .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
}

.keys-table th.col-num {
  text-align: left;
}

@media (max-width: 768px) {
  .keys-panel-head-actions {
    align-items: stretch;
  }

  .keys-panel-head-actions .keys-quota-text {
    text-align: left;
    white-space: normal;
  }

  .keys-connect-head-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

/* ============================================================
   P10 — 账单页：时间范围 / 汇总表格 / 明细排版
   ============================================================ */
.is-hidden {
  display: none !important;
}

.billing-period-bar {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 16px;
}

.billing-period-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.billing-period-tab-btn {
  cursor: pointer;
  font-family: inherit;
}

.billing-custom-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2, #f8fafc);
}

.billing-custom-range-label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}

.billing-custom-range-sep {
  font-size: 13px;
  color: var(--text-4);
}

.billing-date-input {
  height: var(--control-h-sm, 32px);
  min-height: var(--control-h-sm, 32px);
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
}

.billing-date-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(124, 58, 237, 0.12));
}

.billing-page .stat-cards-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.billing-summary-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}

.billing-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  background: var(--surface-2, #f8fafc);
}

.billing-summary-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.billing-summary-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-4);
  white-space: nowrap;
}

.billing-summary-scroll {
  max-height: 280px;
  overflow: auto;
}

.billing-summary-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.billing-summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-align: left;
  background: #fff;
  border-bottom: 1px solid var(--border-subtle, var(--border));
}

.billing-summary-table thead th.col-num {
  text-align: right;
}

.billing-summary-table tbody td {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-subtle, var(--border));
  vertical-align: middle;
}

.billing-summary-table tbody tr:last-child td {
  border-bottom: none;
}

.billing-summary-table tbody td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-summary-table .col-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.billing-summary-table th:first-child,
.billing-summary-table td:first-child {
  width: 42%;
}

.billing-summary-cost {
  color: var(--accent, #2563eb);
  font-weight: 600;
}

.billing-summary-tokens {
  color: var(--text-3);
  font-size: 12px;
}

.billing-summary-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.billing-summary-link:hover {
  color: var(--accent);
}

.billing-summary-link.active {
  color: var(--accent-2, var(--accent));
  font-weight: 600;
}

.billing-sticky-table .td-time {
  white-space: nowrap;
}

.billing-sticky-table .billing-time-date,
.billing-sticky-table .billing-time-clock {
  display: inline;
  font-size: 13px;
}

.billing-sticky-table .billing-time-date {
  color: var(--text-2);
  font-weight: 500;
}

.billing-sticky-table .billing-time-clock {
  margin-top: 0;
  margin-left: 6px;
  color: var(--text-4);
}

@media (max-width: 960px) {
  .billing-summary-grid {
    grid-template-columns: 1fr;
  }

  .billing-page .stat-cards-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .billing-page .stat-cards-row {
    grid-template-columns: 1fr;
  }

  .billing-period-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .billing-custom-range {
    align-items: stretch;
  }

  .billing-date-input {
    flex: 1;
    min-width: 0;
  }
}

/* ============================================================
   P11 — API 密钥：状态/费用列 + 接入区工具栏
   ============================================================ */
.keys-table th.col-status,
.keys-table td.td-status {
  width: 76px;
  min-width: 76px;
  text-align: center;
}

.keys-table th.col-status {
  text-align: center;
}

.keys-table td.td-status .status-pill {
  min-width: 56px;
  justify-content: center;
}

.keys-table th.col-num,
.keys-table td.col-num,
.keys-table td.td-key-cost {
  text-align: right;
  min-width: 108px;
}

.keys-table th.col-num {
  text-align: right;
}

.keys-table .key-usage-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-decoration: none;
  white-space: nowrap;
}

.keys-table .key-usage-cell:hover .key-stat-main {
  text-decoration: underline;
}

.keys-table .key-usage-cell .key-stat-main {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.25;
}

.keys-table .key-usage-cell .key-stat-sub {
  display: block;
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-4);
  line-height: 1.25;
}

.keys-table .key-usage-cell .key-stat-sub::before {
  content: none;
}

.keys-table .key-stat-empty {
  color: var(--text-4);
  font-size: 13px;
}

.keys-connect-head {
  align-items: center;
}

.keys-connect-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.keys-head-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h-sm);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-pill);
}

.keys-connect-key-bar {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-2);
}

.keys-connect-key-label {
  flex-shrink: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.keys-connect-select {
  flex: 1;
  min-width: 0;
  max-width: 320px;
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
  padding: 0 32px 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  box-sizing: border-box;
}

.keys-connect-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(124, 58, 237, 0.12));
}

.keys-connect-fields .connect-quick-row {
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.keys-connect-fields .connect-quick-label {
  width: 72px;
  min-width: 72px;
  font-size: 13px;
}

.keys-connect-fields .connect-quick-code,
.keys-connect-model-input {
  flex: 1;
  min-width: 0;
}

.keys-connect-model-input {
  height: var(--control-h-sm);
  min-height: var(--control-h-sm);
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.2;
  box-sizing: border-box;
}

.keys-connect-model-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(124, 58, 237, 0.12));
}

.keys-connect-fields .connect-quick-row .btn-ghost {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .keys-connect-head {
    align-items: stretch;
  }

  .keys-connect-head-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .keys-connect-head-actions .keys-primary-action,
  .keys-connect-head-actions .keys-head-action-link {
    width: 100%;
    justify-content: center;
  }

  .keys-connect-key-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .keys-connect-select {
    max-width: none;
  }
}

/* ============================================================
   P12 — 账单页：工作区整页滚动（明细区不再被压成一条缝）
   ============================================================ */
body.is-app .app-shell:has(.billing-workspace) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body.is-app .app-main:has(.billing-workspace) {
  height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.app-content.workspace.billing-workspace {
  overflow-x: hidden;
  overflow-y: auto;
  display: block;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.billing-page {
  overflow: visible;
  flex: none;
  min-height: auto;
}

.billing-page > .billing-detail-shell {
  flex: none;
  min-height: auto;
  margin-top: 16px;
  margin-bottom: 8px;
}

.billing-detail-shell {
  flex: none;
  min-height: auto;
  overflow: hidden;
}

.billing-tab-stage {
  flex: none;
  min-height: auto;
  height: auto;
  overflow: hidden;
}

.billing-tab-track {
  height: auto;
  align-items: flex-start;
  isolation: isolate;
}

.billing-tab-pane {
  height: auto;
  overflow: hidden;
  min-height: auto;
}

.billing-tab-body {
  flex: none;
  min-height: auto;
  overflow: visible;
}

body.is-app .billing-tab-body .table-scroll {
  overflow: visible;
}

@media (max-width: 900px) {
  .billing-tab-stage {
    height: auto;
    flex: none;
  }

  .billing-tab-track {
    height: auto;
  }
}

/* ============================================================
   P13 — 充值页：左栏撑满网格，消除中间空白
   ============================================================ */
.recharge-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 16px;
  width: 100%;
}

.recharge-layout-main {
  max-width: none;
  width: 100%;
  min-width: 0;
}

.recharge-layout-main .recharge-balance-strip,
.recharge-layout-main .recharge-form-card {
  width: 100%;
  box-sizing: border-box;
}

.recharge-layout .amount-grid-recharge-v2 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.recharge-custom-inline {
  width: 100%;
}

.recharge-custom-inline input {
  flex: 1;
  min-width: 0;
}

.recharge-submit-row .recharge-submit-btn {
  width: 100%;
  min-width: 0;
}

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

  .recharge-layout .amount-grid-recharge-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ============================================================
   P19 — API 密钥：列表页 + 弹窗（唯一样式源）
   ============================================================ */

/* --- 列表页：权限范围列 --- */
.col-scope { width: 110px; }
.td-scope { font-size: 12px; }
.key-scope-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.key-scope-pill.limited {
  color: var(--accent-2, var(--accent));
  border-color: rgba(124, 58, 237, 0.24);
  background: #faf5ff;
}

/* --- 列表页：过期时间 + 操作图标 --- */
.keys-table th.col-expires,
.keys-table td.td-expires {
  min-width: 96px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-3);
}
.keys-table th.col-scope,
.keys-table td.td-scope { min-width: 100px; }
.keys-table th.col-actions,
.keys-table td.col-actions {
  width: 112px;
  min-width: 112px;
  text-align: center;
}
.keys-table th:nth-child(7),
.keys-table td.td-active { min-width: 88px; }
.keys-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.keys-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.keys-icon-btn svg { width: 16px; height: 16px; }
.keys-icon-btn:hover {
  border-color: var(--text-4);
  color: var(--text);
  background: #f8fafc;
}
.keys-icon-btn.danger:hover {
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
  background: #fef2f2;
}
.key-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 4px;
}

/* --- 弹窗容器 --- */
.modal-box-key-create {
  width: min(620px, calc(100vw - 32px));
  max-width: min(620px, calc(100vw - 32px));
  max-height: min(88vh, 680px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-box-key-create .modal-title {
  margin-bottom: 12px;
  flex-shrink: 0;
}
.modal-box-key-create .modal-actions {
  flex-shrink: 0;
  margin-top: 12px;
}

/* --- 弹窗：checkbox / radio 全局 reset（覆盖 .field input） --- */
.modal-box-key-create input[type="checkbox"]:not(.key-scope-check),
.modal-box-key-create input[type="radio"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  box-sizing: border-box;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  padding: 0 !important;
  margin: 0;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent;
  flex: 0 0 14px;
  accent-color: var(--green, #10b981);
}
.modal-box-key-create input[type="radio"] {
  -webkit-appearance: radio;
}
.modal-box-key-create .key-scope-option input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.modal-box-key-create .key-scope-field {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  overflow: hidden;
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle, #eef2f7);
}
.modal-box-key-create .key-scope-field.is-limited {
  flex: 1;
  min-height: 0;
}

/* --- 弹窗：顶部表单 --- */
.modal-box-key-create .key-form-compact {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.modal-box-key-create .key-form-row-basic {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 48px;
  grid-template-rows: 18px 32px;
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.modal-box-key-create .field { margin: 0; }
.modal-box-key-create .field label,
.modal-box-key-create .key-scope-label,
.modal-box-key-create .key-field-label {
  display: block;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 18px;
  white-space: nowrap;
}
.modal-box-key-create .key-field-label-toggle {
  text-align: center;
}
.modal-box-key-create .key-form-cell {
  min-width: 0;
  align-self: center;
}
.modal-box-key-create .field input.input,
.modal-box-key-create .field input[type="text"],
.modal-box-key-create .field input[type="date"],
.modal-box-key-create .key-form-input {
  width: 100%;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
}
.modal-box-key-create .key-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 32px;
}
.modal-box-key-create .key-date-input {
  flex: 1;
  min-width: 0;
  padding: 0 6px;
  font-size: 12px;
}
.modal-box-key-create .key-date-sep {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-4);
  line-height: 1;
}
.modal-box-key-create .key-toggle-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  margin: 0;
  cursor: pointer;
}
.modal-box-key-create .key-toggle-check {
  position: absolute;
  opacity: 0;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  min-height: 1px !important;
  max-width: 1px !important;
  max-height: 1px !important;
  margin: 0;
  padding: 0 !important;
  pointer-events: none;
}
.modal-box-key-create .key-toggle-track {
  display: block;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #e2e8f0;
  position: relative;
  transition: background 0.18s ease;
}
.modal-box-key-create .key-toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease;
}
.modal-box-key-create .key-toggle-check:checked + .key-toggle-track {
  background: var(--green, #10b981);
}
.modal-box-key-create .key-toggle-check:checked + .key-toggle-track::after {
  transform: translateX(16px);
}
.modal-box-key-create .key-toggle-check:focus-visible + .key-toggle-track {
  outline: 2px solid rgba(16, 185, 129, 0.35);
  outline-offset: 2px;
}

/* --- 弹窗：权限范围切换 --- */
.modal-box-key-create .key-scope-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-top: 14px;
  margin-bottom: 10px;
}
.modal-box-key-create .key-scope-head .key-scope-label {
  flex-shrink: 0;
  margin: 0;
  white-space: nowrap;
}
.modal-box-key-create .key-scope-options {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.modal-box-key-create .key-scope-option {
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
}
.modal-box-key-create .key-scope-option-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.modal-box-key-create .key-scope-option-card strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.modal-box-key-create .key-scope-option:hover .key-scope-option-card {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.modal-box-key-create .key-scope-option input:checked + .key-scope-option-card,
.modal-box-key-create .key-scope-option.is-active .key-scope-option-card {
  border-color: var(--primary);
  background: #f8fafc;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.06);
}
.modal-box-key-create .key-scope-picker[hidden] {
  display: none !important;
}

/* --- 弹窗：模型选择区 --- */
.modal-box-key-create .key-scope-picker {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2, #f8fafc);
  overflow: hidden;
}
.modal-box-key-create .key-scope-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
  margin-bottom: 8px;
}
.modal-box-key-create .key-scope-search-input {
  flex: 0 0 132px;
  width: 132px;
  min-width: 112px;
  margin-left: auto;
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  box-sizing: border-box;
}
.modal-box-key-create .key-scope-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.modal-box-key-create .key-scope-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
}
.modal-box-key-create .key-scope-count {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-4);
  white-space: nowrap;
}
.modal-box-key-create .key-scope-tab {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.modal-box-key-create .key-scope-tab:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.modal-box-key-create .key-scope-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-fg, #fff);
}
.modal-box-key-create .key-scope-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.modal-box-key-create .key-scope-tab:not(.active) .key-scope-tab-count {
  background: var(--surface-2);
  color: var(--text-3);
}
.modal-box-key-create .key-scope-toolrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 8px;
}
.modal-box-key-create .key-scope-nav-btn {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}
.modal-box-key-create .key-scope-grid {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: min(40vh, 320px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.modal-box-key-create label.key-scope-item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 5px 12px;
  margin: 0;
  border-bottom: 1px solid var(--border-subtle, #eef2f7);
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
}
.modal-box-key-create .key-scope-item {
  min-height: 36px;
  padding: 5px 12px;
  margin: 0;
  border-bottom: 1px solid var(--border-subtle, #eef2f7);
  background: #fff;
  cursor: pointer;
}
.modal-box-key-create .key-scope-item:last-child { border-bottom: none; }
.modal-box-key-create .key-scope-item:hover { background: #f8fafc; }
.modal-box-key-create .key-scope-item.is-selected,
.modal-box-key-create .key-scope-item:has(input:checked) {
  background: #faf5ff;
}
.modal-box-key-create .key-scope-item-main {
  grid-column: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.modal-box-key-create .key-scope-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}
.modal-box-key-create .key-scope-item-meta {
  font-size: 11px;
  color: var(--text-4);
  line-height: 1.3;
  word-break: break-all;
}
.modal-box-key-create .key-scope-check {
  grid-column: 2;
  justify-self: end;
  align-self: center;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: none;
  accent-color: var(--green, #10b981);
  cursor: pointer;
}
.modal-box-key-create .key-scope-empty {
  padding: 24px 12px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

@media (max-width: 640px) {
  .modal-box-key-create .key-form-row-basic {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, auto);
    row-gap: 4px;
  }
  .modal-box-key-create .key-field-label-toggle {
    text-align: left;
  }
  .modal-box-key-create .key-toggle-switch {
    justify-content: flex-start;
  }
  .modal-box-key-create .key-scope-options {
    width: 100%;
  }
  .modal-box-key-create .key-scope-option {
    flex: 1;
  }
  .modal-box-key-create .key-scope-option-card {
    width: 100%;
  }
  .modal-box-key-create .key-scope-filter-row {
    flex-wrap: wrap;
  }
  .modal-box-key-create .key-scope-search-input {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
  }
}

/* ============================================================
   P20 — 账单 Tab 切换：裁切隐藏面板（消费明细 ↔ 余额变动）
   ============================================================ */
.billing-detail-shell .billing-tab-stage,
.billing-detail-shell .billing-tab-pane,
.billing-detail-shell .billing-tab-body {
  overflow-x: hidden;
}
.billing-detail-shell .billing-tab-track.show-ledger .billing-tab-pane:first-child,
.billing-detail-shell .billing-tab-track:not(.show-ledger) .billing-tab-pane:last-child {
  visibility: hidden;
  pointer-events: none;
}

/* ===== 运维总览 消耗/成本/盈利 统计条（2026-08-29） ===== */
.admin-ops-profit-strip {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--surface, #fff);
}
.admin-ops-profit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-ops-profit-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface-2, #f1f5f9);
}
.admin-ops-profit-tabs button {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3, #6b7280);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s ease;
}
.admin-ops-profit-tabs button:hover { color: var(--text-2, #374151); }
.admin-ops-profit-tabs button.active {
  color: #fff;
  background: var(--accent, #7c3aed);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.admin-ops-profit-custom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-ops-profit-date {
  width: 150px !important;
  min-height: var(--control-h-sm, 34px);
  font-size: 13px;
}
.admin-ops-profit-sep { color: var(--text-4, #9ca3af); font-size: 12px; }
.admin-ops-profit-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.admin-ops-profit-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2, #f8fafc);
}
.admin-ops-profit-num {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .admin-ops-profit-stats { grid-template-columns: 1fr; }
  .admin-ops-profit-date { width: 120px !important; }
}

/* ── 盈利类指标的统一修饰类（总览页 / 账户页共用，2026-09-11）── */
.admin-ops-profit-num.is-profit{color:#4ade80;font-weight:800;}
.admin-ops-profit-num.is-profit-soft{color:#4ade80;opacity:.85;}
.admin-ops-profit-num.is-muted{opacity:.6;}
.admin-ops-profit-num.is-compact{font-size:15px;}
