/* =====================================================================
   灵然智能 控制台 · 设计系统 (Design Tokens + Components)
   来源技能：品牌设计风格专家(fec-ui-design) · UI/UX设计大师(design-master)
   视觉锚点：墨黑中性底 + 钴蓝主行动色 + 柠檬绿(Lime)数据高亮
   ===================================================================== */

:root {
  /* ---- 中性墨阶 (ink) ---- */
  --ink-950: #0B0E14;
  --ink-900: #11141B;
  --ink-850: #151A23;
  --ink-800: #1A1F2B;
  --ink-700: #252B39;
  --ink-600: #37404F;
  --ink-500: #5A6473;
  --ink-400: #8A93A3;
  --ink-300: #B7BECB;
  --ink-200: #DDE1E8;
  --ink-100: #EEF1F5;
  --ink-50:  #F6F7F9;

  /* ---- 品牌 / 语义色 ---- */
  --brand:        #2B59FF;   /* 钴蓝：主行动色 */
  --brand-600:    #1F46E0;
  --brand-700:    #1736B8;
  --brand-soft:   #EAF0FF;
  --accent:       #C6F432;   /* 柠檬绿：AI/数据高亮锚点 */
  --accent-ink:   #1B2A00;
  --teal:         #00B8A3;   /* 数据辅助 */
  --success:      #16A34A;
  --success-soft: #E7F6EC;
  --warning:      #F59E0B;
  --warning-soft: #FEF3E2;
  --danger:       #EF4444;
  --danger-soft:  #FDECEC;
  --info:         #2B59FF;

  /* ---- 语义 token（light） ---- */
  --bg:            var(--ink-50);
  --bg-elevated:   #FFFFFF;
  --surface:       #FFFFFF;
  --surface-2:     var(--ink-100);
  --border:        #E4E8EF;
  --border-strong: #D2D8E2;
  --card-border:        #E9E3FB;
  --card-border-hover:  #D6C8F6;
  --text:          #14181F;
  --text-secondary:#5A6473;
  --text-muted:    #8A93A3;
  --text-on-brand: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(16,21,30,.06), 0 1px 3px rgba(16,21,30,.04);
  --shadow-md: 0 4px 14px rgba(16,21,30,.08);
  --shadow-lg: 0 18px 48px rgba(16,21,30,.16);
  --focus-ring: 0 0 0 3px rgba(43,89,255,.35);

  /* ---- 间距刻度 (4px base) ---- */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px;
  --sp-6:24px; --sp-7:32px; --sp-8:40px; --sp-9:48px; --sp-10:64px;

  /* ---- 圆角 ---- */
  --r-sm:6px; --r-md:10px; --r-lg:14px; --r-xl:20px; --r-full:999px;

  /* ---- 字体 ---- */
  --font-display: "Space Grotesk","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  --font-body: "Inter",-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  --font-mono: "JetBrains Mono",ui-monospace,SFMono-Regular,Consolas,monospace;

  /* ---- 侧边栏 / 顶栏尺寸 ---- */
  --sidebar-w: 248px;
  --topbar-h: 60px;

  --ease: cubic-bezier(.22,1,.36,1); /* ease-out-quart */
  --ease-expo: cubic-bezier(.16,1,.3,1); /* expo-out：入场编排缓动 */
  --dur-fast: .16s; --dur-mid: .24s; --dur-slow: .42s;

  /* ---- 流式排版刻度（clamp：随视口平滑伸缩，响应式核心） ---- */
  --fs-hero:    clamp(2rem, 1.15rem + 3.4vw, 3.4rem);   /* 32→54px */
  --fs-page:    clamp(1.4rem, 1.1rem + 1vw, 1.875rem);  /* 22→30px */
  --fs-section: clamp(1.15rem, 1rem + .5vw, 1.5rem);    /* 18→24px */
  --fs-stat:    clamp(1.6rem, 1.15rem + 1.8vw, 2.25rem);/* 26→36px */

  /* ---- 营销强调红（首页 CTA / 价格高亮，统一为 token） ---- */
  --mark: #d8341f; --mark-soft: #fff7f5;
}

[data-theme="dark"] {
  --bg:            var(--ink-950);
  --bg-elevated:   var(--ink-900);
  --surface:       var(--ink-850);
  --surface-2:     var(--ink-800);
  --border:        #232A37;
  --border-strong: #2E3744;
  --card-border:        rgba(124,107,245,.30);
  --card-border-hover:  rgba(124,107,245,.55);
  --text:          #E6E9EF;
  --text-secondary:#9AA3B2;
  --text-muted:    #6B7484;
  --brand-soft:    rgba(43,89,255,.16);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 22px 56px rgba(0,0,0,.6);
  --focus-ring: 0 0 0 3px rgba(43,89,255,.5);
}

/* ============================== Reset ============================== */
*,*::before,*::after { box-sizing: border-box; }
html,body { margin:0; padding:0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { font-family: var(--font-display); margin:0; font-weight:600; letter-spacing:-.01em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul { margin:0; padding:0; list-style:none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* ============================== Layout ============================== */
.app { display: flex; min-height: 100vh; }

/* 首页（overview）全宽展示，隐藏左侧菜单、控制台 topbar 与移动端菜单按钮 */
.app.home .sidebar { display: none; }
.app.home .topbar { display: none; }
.app.home .topbar__menu { display: none !important; }
/* 首页内容取消居中容器限制，让顶部导航真正顶到屏幕左右两端 */
.app.home .content { max-width: none; padding: 0; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: transform .3s var(--ease);
  z-index: 40;
}
.sidebar__brand {
  display:flex; align-items:center; gap:10px;
  height: var(--topbar-h); padding: 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width:30px; height:30px; border-radius:9px;
  background: conic-gradient(from 210deg, var(--brand), var(--accent) 130%, var(--teal));
  display:grid; place-items:center; color:#0B0E14; font-weight:700; font-family:var(--font-display);
  box-shadow: 0 2px 10px rgba(43,89,255,.35);
}
.brand-name { font-family: var(--font-display); font-weight:700; font-size:16px; color:#11151C; letter-spacing:-.01em; }
[data-theme="dark"] .brand-name { color:#EDEFF3; }
.sidebar__nav { flex:1; overflow-y:auto; padding: var(--sp-4) var(--sp-3); scroll-behavior: smooth; }
.sidebar__nav::-webkit-scrollbar { width:8px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.sidebar__nav::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.nav-group { margin-bottom: var(--sp-5); }
.nav-group__title {
  font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase;
  color: var(--text-muted); padding: 0 var(--sp-3); margin-bottom: var(--sp-2);
}
/* Sidebar nav items → 卡片样式（复用功能入口卡片视觉） */
.nav-item {
  display:flex; align-items:center; gap:10px;
  padding: 9px 10px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-secondary); font-size:13.5px; font-weight:500;
  cursor:pointer; position:relative;
  transition: transform .15s var(--ease), border-color .15s, box-shadow .15s, background .15s, color .15s;
}
.nav-item:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-md); color: var(--text); }
.nav-item.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-600); font-weight:600; box-shadow:none; transform:none; }
[data-theme="dark"] .nav-item.active { color: #AFC0FF; }
.ico { width:18px; height:18px; flex-shrink:0; display:inline-block; vertical-align:middle; }
/* 图标放入卡片 chip 中 */
.nav-item .ico {
  width: 36px; height: 36px; flex-shrink:0; padding: 9px; box-sizing: border-box;
  border-radius: 10px; background: var(--brand-soft); color: var(--brand-600); opacity:1;
  transition: background .15s, color .15s;
}
[data-theme="dark"] .nav-item .ico { color: #AFC0FF; }
.nav-item:hover .ico { background: color-mix(in srgb, var(--brand) 24%, transparent); }
.nav-item.active .ico { background: var(--brand); color: #fff; }
[data-theme="dark"] .nav-item.active .ico { color: #0B0E14; }
.nav-item .badge-dot { margin-left:auto; width:6px; height:6px; border-radius:50%; background: var(--accent); }
.nav-item .tag-lock { margin-left:auto; font-size:10px; color: var(--text-muted); border:1px solid var(--border); padding:1px 6px; border-radius: var(--r-full); flex-shrink:0; }

/* Main */
.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar {
  height: var(--topbar-h); flex-shrink:0;
  display:flex; align-items:center; gap: var(--sp-4);
  padding: 0 var(--sp-6);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top:0; z-index:30;
}
.topbar__menu { display:none; }
.search {
  display:flex; align-items:center; gap:8px;
  background: var(--surface-2); border:1px solid var(--border);
  border-radius: var(--r-full); padding: 7px 14px; width: 320px; max-width:40vw;
  color: var(--text-muted);
}
.search input { border:none; background:none; outline:none; flex:1; min-width:0; color: var(--text); }
.search kbd { font-family: var(--font-mono); font-size:11px; border:1px solid var(--border-strong); border-radius:5px; padding:1px 6px; }
.topbar__right { margin-left:auto; display:flex; align-items:center; gap: var(--sp-2); }
.icon-btn {
  width:38px; height:38px; border-radius: var(--r-md); display:grid; place-items:center;
  color: var(--text-secondary); transition: background .15s, color .15s; position:relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position:absolute; top:8px; right:9px; width:7px; height:7px; border-radius:50%; background: var(--danger); border:2px solid var(--surface); }
.avatar {
  width:34px; height:34px; border-radius:50%;
  background: var(--surface-2);
  border:1px solid var(--border);
  display:grid; place-items:center; color: var(--text-secondary);
}
.avatar .ico { width:18px; height:18px; }
.user-chip { display:flex; align-items:center; gap:10px; padding-left: var(--sp-2); }
.user-chip .meta { line-height:1.25; }
.user-chip .label { font-size:11px; color: var(--text-muted); }
.user-chip .name { font-size:13px; font-weight:600; color: var(--text); font-family: var(--font-mono); letter-spacing:.02em; }
.user-chip .copy-user { margin-left:2px; }

.content { padding: var(--sp-7) var(--sp-7) var(--sp-9); width:100%; flex:1; min-height:0; display:flex; flex-direction:column; }

/* ============================== Page ============================== */
.page { display:none; animation: fade .35s var(--ease); container-type: inline-size; }
.page.active { display:flex; flex-direction:column; flex:1; min-height:0; }
@keyframes fade { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform:none; } }

/* 组件级响应式：网格随内容宽度（而非仅视口）自适应 —— 与视口媒体查询互补 */
@container (max-width: 720px) {
  .stat-grid, .promo-stats { grid-template-columns: 1fr; }
}

/* ============ 页面高度填充 + 底栏吸底 ============
   让激活页面撑满内容区，底部分页/工具栏吸附到视口底部，
   避免内容（尤其表格较短时）堆在屏幕上半部、底部大片留白。 */
#page-apikey .table-card { flex: 1; min-height: 0; }
.apikey-pagination { flex-shrink: 0; margin-top: auto; }

/* 推广管理：数据卡片内表格撑满、卡片内分页吸底 */
.card:has(.pm-pagination) { display: flex; flex-direction: column; }
.card:has(.pm-pagination) .table-card { flex: 1; min-height: 0; }
.pm-pagination { flex-shrink: 0; }

/* 统计看板/使用日志等：若页面末位为分页/工具栏，吸底 */
.page.active > .pagination { flex-shrink: 0; margin-top: auto; }
@container (max-width: 1080px) and (min-width: 721px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); flex-wrap:wrap; }
.page-head h1 { font-size: var(--fs-page); letter-spacing: -.02em; }
.page-head .crumb { font-size:12px; color: var(--text-muted); margin-bottom:6px; }
.page-head .crumb span { color: var(--text-secondary); }

/* ============================== Components ============================== */
/* Buttons */
.btn {
  display:inline-flex; align-items:center; gap:7px; justify-content:center;
  padding: 9px 16px; border-radius: var(--r-md); font-weight:600; font-size:13.5px;
  transition: background .15s, transform .1s, box-shadow .15s; white-space:nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color:#fff; box-shadow: 0 2px 10px rgba(43,89,255,.3); }
.btn-primary:hover { background: var(--brand-600); }
.btn-outline { background: var(--surface); border:1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #FBD9D9; }
.btn-sm { padding: 6px 12px; font-size:12.5px; border-radius: var(--r-sm); }
.btn-block { width:100%; }
.btn:disabled { opacity:.5; cursor:not-allowed; }

/* Card */
.card { background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.card-head { display:flex; align-items:center; justify-content:space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.card-head h3 { font-size:15px; }
.card-head .sub { font-size:12px; color: var(--text-muted); }

/* Account management rows */
.am-rows { display:flex; flex-direction:column; }
.am-row { display:flex; align-items:center; justify-content:space-between; gap: var(--sp-4); padding: 16px 2px; border-bottom:1px solid var(--border); }
.am-row:last-child { border-bottom:none; }
.am-k { font-weight:600; font-size:14px; }
.am-v { font-size:13px; color: var(--text-muted); margin-right:auto; padding-left:16px; }
.am-d { font-size:12px; margin-top:3px; }

/* Toggle switch */
.switch { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.switch input { opacity:0; width:0; height:0; }
.switch > span { position:absolute; cursor:pointer; inset:0; background: var(--border-strong, #D4D9E2); border-radius:999px; transition:.2s; }
.switch > span::before { content:""; position:absolute; height:18px; width:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; box-shadow:0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand, #2B59FF); }
.switch input:checked + span::before { transform: translateX(20px); }

/* Stat cards */
.stat-grid { display:grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-4); }
.stat {
  background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-5); position:relative; overflow:hidden; transition: box-shadow .2s, transform .2s;
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat__label { font-size:12.5px; color: var(--text-secondary); display:flex; align-items:center; gap:6px; }
.stat__value { font-family: var(--font-display); font-size: var(--fs-stat); font-weight:600; margin-top:8px; letter-spacing:-.02em; }
.stat__delta { font-size:12px; margin-top:6px; display:inline-flex; align-items:center; gap:4px; }
.stat__delta.up { color: var(--success); }
.stat__delta.down { color: var(--danger); }
.stat__spark { position:absolute; right:14px; bottom:12px; opacity:.9; }

/* Tags / badges */
.tag { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; padding:3px 10px; border-radius: var(--r-full); }
.tag-success { background: var(--success-soft); color: var(--success); }
.tag-warning { background: var(--warning-soft); color: #B9760A; }
.tag-danger  { background: var(--danger-soft);  color: var(--danger); }
.tag-info    { background: var(--brand-soft);   color: var(--brand-600); }
.tag-muted   { background: var(--surface-2);    color: var(--text-secondary); }
.tag-new     { background: #EAFBEF; color: #0E9F4F; }
.tag-drop    { background: #FDECEC; color: #E03A3A; }
.dot { width:7px; height:7px; border-radius:50%; display:inline-block; }
.dot-green{background:var(--success);} .dot-amber{background:var(--warning);} .dot-red{background:var(--danger);} .dot-gray{background:var(--ink-400);}

/* Table */
.table-card { background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg); overflow:hidden; box-shadow: var(--shadow-sm); display:flex; flex-direction:column; }
.table-scroll { overflow:auto; flex:1; min-height:0; }
table.data { width:100%; border-collapse: collapse; font-size:13.5px; }
table.data thead th {
  text-align:left; font-weight:600; color: var(--text-secondary); font-size:12.5px;
  background: var(--surface-2); padding: 11px var(--sp-4); white-space:nowrap;
  border-bottom: 1px solid var(--border);
}
table.data tbody td { padding: 13px var(--sp-4); border-bottom:1px solid var(--border); vertical-align:middle; }
table.data tbody tr:last-child td { border-bottom:none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .mono { color: var(--text-secondary); }

/* Filters */
.filters { display:flex; flex-wrap:wrap; gap: var(--sp-3); align-items:flex-end; margin-bottom: var(--sp-4); }
.field { display:flex; flex-direction:column; gap:6px; }
.field label { font-size:12px; color: var(--text-secondary); font-weight:500; }
.input, .select {
  height:38px; padding: 0 12px; border:1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); min-width:160px; transition: border .15s, box-shadow .15s;
}
textarea.input { height:auto; padding:10px 12px; resize:vertical; min-width:0; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: var(--focus-ring); outline:none; }
.input::placeholder { color: var(--text-muted); }

/* Tabs */
.tabs { display:inline-flex; gap:4px; background: var(--surface-2); padding:4px; border-radius: var(--r-md); }
.tab { padding: 7px 16px; border-radius: var(--r-sm); font-size:13px; font-weight:600; color: var(--text-secondary); transition: background .15s, color .15s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .tab.active { color:#AFC0FF; }

/* Segmented (time range) */
.seg { display:inline-flex; gap:2px; background: var(--surface-2); border-radius: var(--r-md); padding:3px; }
.seg button { padding:6px 13px; border-radius: var(--r-sm); font-size:12.5px; font-weight:600; color: var(--text-secondary); }
.seg button.active { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow-sm); }

/* Date range (time dimension) */
.date-range { display:inline-flex; align-items:flex-end; gap:10px; flex-wrap:wrap; }
.date-range .field { gap:5px; }
.date-range .field > span { font-size:12px; color: var(--text-secondary); font-weight:500; }
.date-range .input { height:36px; min-width:150px; }
.date-range input[type="datetime-local"] { min-width:200px; }
.date-sep { color: var(--text-muted); font-size:13px; padding-bottom:9px; }

/* ============================== Statistics dashboard ============================== */
.stats-filter-bar {
  display:flex; align-items:flex-end; justify-content:space-between; gap: var(--sp-4);
  background: var(--surface-2); border:1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4);
  flex-wrap:wrap;
}
.stats-filter { display:flex; align-items:flex-end; gap: var(--sp-5); flex-wrap:wrap; }
.stats-filter .field { gap:6px; }
.stats-filter .field > span { font-size:12px; color: var(--text-secondary); font-weight:500; }
.stats-filter .select { height:36px; min-width:140px; padding-right:30px; }
.stats-filter__actions { display:flex; align-items:center; gap: var(--sp-4); }
.link-muted { color: var(--text-secondary); font-size:13px; text-decoration:none; }
.link-muted:hover { color: var(--brand-600); }

.datetime-range { display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; }
.datetime-range .input { height:36px; min-width:180px; padding:0 10px; font-size:13px; }
.dt-sep { color: var(--text-muted); font-size:13px; }
.dt-cal {
  width:36px; height:36px; border-radius: var(--r-md); border:1px solid var(--border);
  background: var(--surface); display:grid; place-items:center; color: var(--text-secondary);
  transition: background .15s, color .15s, border-color .15s;
}
.dt-cal:hover { background: var(--surface-2); color: var(--brand-600); border-color: var(--border-strong); }
.dt-cal .ico { width:16px; height:16px; }

.stats-kpi-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.stats-kpi {
  background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5); box-shadow: var(--shadow-sm);
  display:flex; flex-direction:column; gap: var(--sp-3);
  transition: box-shadow .2s, transform .2s;
}
.stats-kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stats-kpi__head { display:flex; align-items:center; gap:8px; }
.stats-kpi__icon {
  width:32px; height:32px; border-radius: var(--r-md); display:grid; place-items:center;
  background: var(--brand-soft); color: var(--brand-600); flex-shrink:0;
}
.stats-kpi__icon .ico { width:16px; height:16px; }
.stats-kpi__title { font-size:14px; font-weight:600; color: var(--text); flex:1; }
.stats-kpi__head .btn { padding:4px 12px; font-size:12px; }
.stats-kpi__body { display:flex; flex-direction:column; gap: var(--sp-2); }
.stats-kpi__row { display:flex; align-items:baseline; justify-content:space-between; gap: var(--sp-3); }
.stats-kpi__label { font-size:12.5px; color: var(--text-secondary); }
.stats-kpi__value { font-size:18px; font-weight:600; color: var(--text); font-family: var(--font-display); letter-spacing:-.01em; }

.stats-card-head {
  display:flex; align-items:flex-start; justify-content:space-between; gap: var(--sp-4);
  margin-bottom: var(--sp-4); flex-wrap:wrap;
}
.stats-card-head h3 { font-size:16px; font-weight:600; }
.stats-card-head__sub { font-size:12px; color: var(--text-muted); margin-top:4px; }
.stats-card-head__sub #statsTotal { font-size:13px; }

/* ====================== Usage Logs page ====================== */
.logs-metrics-bar {
  display:flex; align-items:center; justify-content:space-between;
  background: var(--bg-soft, #F4F6FA); border:1px solid var(--card-border);
  border-radius: var(--r-md); padding: 10px 14px; margin-bottom: var(--sp-3);
}
.logs-metrics { display:flex; align-items:stretch; gap:0; }
.logs-metric {
  display:flex; align-items:center; gap:8px; padding: 6px 18px;
  font-size:13px; color: var(--text-secondary);
  border-right: 1px solid var(--card-border);
}
.logs-metric:first-child { padding-left: 4px; }
.logs-metric:last-child { border-right: none; padding-right: 4px; }
.logs-metric__bar { display:inline-block; width:3px; height:14px; border-radius:2px; }
.logs-metric__label { color: var(--text-muted); font-size:12.5px; }
.logs-metric__value { color: var(--text); font-weight:600; font-size:14px; }
.logs-metrics__actions { display:flex; align-items:center; gap:6px; }
.btn.btn-text { background:transparent; border:0; color: var(--text-secondary); padding: 6px 12px; height:32px; font-size:13px; }
.btn.btn-text:hover { color: var(--text); background: rgba(0,0,0,.04); }
[data-theme="dark"] .btn.btn-text:hover { background: rgba(255,255,255,.06); }

.logs-filters {
  display:grid; grid-template-columns: 1.4fr repeat(5, 1fr) 0.8fr; gap: 10px;
  margin-bottom: var(--sp-4);
}
.logs-filters .input, .logs-filters .select { height:36px; }
.logs-date-range { display:flex; align-items:center; gap:6px; }
.logs-date-range .input { flex:1; min-width:0; height:36px; }
.logs-date-sep { color: var(--text-muted); font-size:13px; padding: 0 2px; }
.logs-date-btn { width:36px; height:36px; display:grid; place-items:center; background: var(--surface); border:1px solid var(--card-border); border-radius: var(--r-sm); color: var(--text-muted); cursor:pointer; }
.logs-date-btn:hover { color: var(--text); border-color: var(--brand); }

.logs-table-card { position:relative; min-height: 360px; }
.logs-table th { white-space: nowrap; }
.logs-table th.num, .logs-table td.num { text-align: right; }
.logs-table th, .logs-table td { font-size:12.5px; }
.logs-table thead th { background: var(--bg-soft, #F4F6FA); color: var(--text-secondary); font-weight:500; }

.logs-empty {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding: 60px 20px 80px; color: var(--text-muted);
}
.logs-empty svg { margin-bottom: 8px; }
.logs-empty__text { font-size:13px; color: var(--text-muted); }

@media (max-width: 1024px) {
  .logs-filters { grid-template-columns: 1fr 1fr 1fr; }
  .logs-date-range { grid-column: span 3; }
  .logs-metrics-bar { flex-direction:column; align-items:flex-start; gap:10px; }
  .logs-metrics__actions { width:100%; justify-content:flex-end; }
}
@media (max-width: 640px) {
  .logs-filters { grid-template-columns: 1fr 1fr; }
  .logs-date-range { grid-column: span 2; }
  .logs-metrics { flex-wrap: wrap; }
  .logs-metric { padding: 6px 10px; }
}

@media (max-width: 1024px) {
  .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .stats-kpi-grid { grid-template-columns: 1fr; }
  .stats-filter-bar { flex-direction:column; align-items:stretch; }
  .stats-filter__actions { justify-content:flex-end; }
}

/* Modal */
.overlay {
  position: fixed; inset:0; background: rgba(8,11,16,.55); backdrop-filter: blur(2px);
  display:none; align-items:center; justify-content:center; z-index:100; padding: var(--sp-4);
}
.overlay.open { display:flex; animation: fade .2s var(--ease); }
.modal {
  background: var(--surface); border-radius: var(--r-xl); width: 560px; max-width: 94vw;
  max-height: 88vh; display:flex; flex-direction:column; box-shadow: var(--shadow-lg);
  animation: pop .25s var(--ease);
}
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity:0; } to { transform:none; opacity:1; } }
.modal__head { display:flex; align-items:center; justify-content:space-between; padding: var(--sp-5) var(--sp-6); border-bottom:1px solid var(--border); }
.modal__head h3 { font-size:17px; }
.modal__body { padding: var(--sp-6); overflow-y:auto; }
.modal__foot { padding: var(--sp-4) var(--sp-6); border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }
.icon-close { width:32px; height:32px; border-radius: var(--r-md); display:grid; place-items:center; color: var(--text-muted); font-size:20px; }
.icon-close:hover { background: var(--surface-2); color: var(--text); }

/* Forms in modal */
.form-grid { display:grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-grid .full { grid-column: 1 / -1; }
.help { font-size:12px; color: var(--text-muted); margin-top:5px; }

/* Pagination */
.pagination { display:flex; align-items:center; justify-content:flex-end; gap:6px; margin-top: var(--sp-4); }
.pagination button { min-width:34px; height:34px; border-radius: var(--r-md); border:1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size:13px; }
.pagination button.active { background: var(--brand); color:#fff; border-color: var(--brand); }
.pagination button:hover:not(.active) { background: var(--surface-2); }

/* Toast */
.toast-wrap { position: fixed; top: 18px; left:50%; transform: translateX(-50%); z-index: 200; display:flex; flex-direction:column; gap:10px; align-items:center; }
.toast { background: var(--ink-900); color:#fff; padding: 11px 18px; border-radius: var(--r-md); font-size:13.5px; box-shadow: var(--shadow-lg); display:flex; align-items:center; gap:9px; animation: fade .25s var(--ease); }
[data-theme="dark"] .toast { background: #000; }
.toast .ok { color: var(--accent); }

/* States: skeleton / empty / error */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius:6px; }
@keyframes sk { from{background-position:100% 0} to{background-position:-100% 0} }
.empty, .error-state { text-align:center; padding: var(--sp-9) var(--sp-5); color: var(--text-muted); }
.empty .em-ico, .error-state .em-ico { width:56px; height:56px; border-radius: var(--r-lg); background: var(--surface-2); display:grid; place-items:center; margin:0 auto var(--sp-4); color: var(--text-secondary); }
.empty h4, .error-state h4 { color: var(--text); font-size:15px; margin-bottom:6px; }

/* ============================== Module-specific ============================== */
/* Dashboard announcement */
.announce { display:flex; gap: var(--sp-4); padding: var(--sp-4); border:1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); transition: box-shadow .2s; }
.announce:hover { box-shadow: var(--shadow-md); }
.announce__ico { width:40px; height:40px; border-radius: var(--r-md); flex-shrink:0; display:grid; place-items:center; font-size:18px; }
.announce__ico.new { background:#EAFBEF; } .announce__ico.drop{ background: var(--danger-soft);} .announce__ico.feat{ background: var(--brand-soft);} .announce__ico.warn{ background: var(--warning-soft);}
.announce__title { font-weight:600; font-size:13.5px; }
.announce__meta { font-size:11.5px; color: var(--text-muted); margin-top:2px; }
.quick-grid { display:grid; grid-template-columns: repeat(2,1fr); gap: var(--sp-4); }
.quick { display:flex; align-items:center; gap:10px; padding:14px; border:1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-decoration:none; font-weight:600; font-size:13.5px; transition: box-shadow .2s, transform .2s, border-color .2s; }
.quick:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--brand); }
.quick .ico { width:20px; height:20px; color: var(--brand); }

/* Model cards */
.model-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.model-card { background: var(--surface); border:1px solid var(--card-border); border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-5) var(--sp-3); transition: box-shadow .2s, transform .2s, border-color .2s; cursor:pointer; position:relative; display:flex; flex-direction:column; }
.model-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--card-border-hover); }
.model-card__top { display:flex; align-items:center; gap:12px; margin-bottom: var(--sp-3); }
.model-logo { width:42px; height:42px; border-radius:12px; display:grid; place-items:center; font-family:var(--font-display); font-weight:700; color:#fff; font-size:16px; }
.model-logo svg, .mdl-logo svg { width:56%; height:56%; display:block; }
.model-card__name { font-weight:600; font-size:15px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0; }
.model-card__namecol { flex:1; min-width:0; }
.model-card__name .card-copy { margin-left:auto; flex-shrink:0; }
.card-copy {
  position:relative; width:24px; height:24px; border-radius:7px; flex-shrink:0; padding:0; cursor:pointer;
  display:grid; place-items:center; color: var(--text-secondary);
  border:1px solid var(--border); background: var(--surface);
  transition: background .15s, color .15s, border-color .15s;
}
.card-copy:hover { background: var(--surface-2); color: var(--brand-600); border-color: var(--border-strong); }
.card-copy .ico { width:14px; height:14px; }
.card-copy.is-copied { color: var(--success); border-color: var(--success); background: var(--success-soft); }
.card-copy__tip {
  position:absolute; bottom: calc(100% + 6px); left:50%; transform: translateX(-50%) translateY(4px);
  background: var(--ink-900); color:#fff; font-size:11px; padding:3px 8px; border-radius:6px; white-space:nowrap;
  opacity:0; pointer-events:none; transition: opacity .15s, transform .15s; z-index:5;
}
[data-theme="dark"] .card-copy__tip { background:#000; }
.card-copy.is-copied .card-copy__tip { opacity:1; transform: translateX(-50%) translateY(0); }
/* 模型类型标签（名字后） */
.type-badge { font-size:11px; font-weight:600; color: var(--brand-600); background: var(--brand-soft); padding:2px 9px; border-radius: var(--r-full); white-space:nowrap; }
[data-theme="dark"] .type-badge { color:#AFC0FF; }
.model-card__desc { font-size:12.5px; color: var(--text-secondary); line-height:1.6; margin-bottom: var(--sp-3); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.model-card__rule { height:0; border-top:1px solid var(--border-strong); }
.model-card__footrow { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top: var(--sp-2); }
.price-ref { font-size:11.5px; color: var(--text-secondary); letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.price-chip { flex-shrink:0; display:inline-flex; align-items:center; font-size:12px; font-weight:600; color: var(--text-secondary); background: var(--surface-2); border:1px solid var(--border); border-radius: var(--r-md); padding:5px 12px; }
/* 卡片底部能力/价格样式已按需求移除 */

/* ===================== Model shop (模型广场新版) ===================== */
.model-tabs { display:flex; align-items:center; gap: var(--sp-6); border-bottom:1px solid var(--border); margin-bottom: var(--sp-4); }
.model-tab {
  background:transparent; border:0; padding: 14px 4px; font-size:15px; font-weight:500; color: var(--text-secondary);
  cursor:pointer; position:relative; display:inline-flex; align-items:center; gap:8px;
  transition: color .15s;
}
.model-tab:hover { color: var(--text); }
.model-tab.active { color: var(--text); font-weight:600; }
.model-tab.active::after {
  content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px;
  background: linear-gradient(90deg, #5D47FE, #7C3AED); border-radius:2px;
}
.model-tab__badge {
  font-size:11px; font-weight:600; color: var(--brand-600); background: var(--brand-soft);
  padding:1px 8px; border-radius: var(--r-full);
}

.models-layout { display:grid; grid-template-columns: 224px 1fr; gap: var(--sp-5); align-items:flex-start; }

.model-aside { background: var(--surface-2); border:1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); position:sticky; top: var(--sp-4); }
.aside-title { font-size:13px; font-weight:600; color: var(--text-secondary); padding: 0 4px 12px; }
.filter-group + .filter-group { margin-top: 18px; }
.filter-group__head { font-size:12px; font-weight:600; color: var(--text-muted); padding: 0 4px 8px; letter-spacing:.2px; }
.filter-list { display:flex; flex-direction:column; gap:6px; }
.filter-pill {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  background:transparent; border:1px solid transparent; border-radius: var(--r-md);
  padding: 7px 10px; font-size:12.5px; color: var(--text-secondary);
  cursor:pointer; transition: background .12s, color .12s, border-color .12s;
  text-align:left; width:100%;
}
.filter-pill:hover { background: var(--surface); color: var(--text); }
.filter-pill.active { background: var(--brand-soft); color: var(--brand-600); border-color: var(--brand-soft); font-weight:500; }
[data-theme="dark"] .filter-pill.active { background: rgba(91,61,245,.18); color:#C9B8FF; border-color: transparent; }
.filter-pill__count { font-size:11px; color: var(--text-muted); background: var(--surface); border:1px solid var(--border); padding:1px 7px; border-radius: var(--r-full); flex-shrink:0; }
.filter-pill.active .filter-pill__count { background:#fff; color: var(--brand-600); border-color: transparent; }
[data-theme="dark"] .filter-pill.active .filter-pill__count { background: rgba(255,255,255,.06); color:#C9B8FF; }
.filter-pill--more { color: var(--brand-600); background:transparent; justify-content:flex-start; padding-left: 4px; }
.filter-pill--more:hover { background:transparent; text-decoration: underline; }
.filter-pill--more::before { content:"⌄"; margin-right:4px; }
.filter-group--footer { padding-top: 8px; border-top: 1px dashed var(--border); margin-top: 22px; padding-top: 18px; }

.models-main { min-width:0; }
.models-toolbar { display:flex; align-items:center; gap:12px; margin-bottom: var(--sp-4); flex-wrap:wrap; }
.models-toolbar__count { font-size:13px; color: var(--text-secondary); padding-right:4px; }
.models-toolbar__count .tabular { color: var(--text); font-weight:600; margin-left:2px; }
.models-toolbar__search { flex:1; min-width: 220px; max-width: 460px; position:relative; }
.models-toolbar__search .ico { position:absolute; left:10px; top:50%; transform: translateY(-50%); width:16px; height:16px; color: var(--text-muted); }
.models-toolbar__search .input { padding-left: 32px; }
.icon-btn {
  width:34px; height:34px; border-radius: var(--r-md); border:1px solid var(--border); background: var(--surface);
  display:grid; place-items:center; color: var(--text-secondary); cursor:pointer; transition: background .12s, color .12s, border-color .12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn--active { background: var(--brand-soft); color: var(--brand-600); border-color: var(--brand-soft); }

.models-grid { display:grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: var(--sp-4); }

/* 小卡（模型广场专用变体） */
.model-card--shop { padding: var(--sp-4) var(--sp-4) var(--sp-3); }
.model-card--shop .model-card__top { margin-bottom: 10px; }
.model-card--shop .model-card__desc { font-size:12px; line-height:1.55; -webkit-line-clamp:2; margin-bottom: 10px; }
.model-card__icons { position:absolute; top:10px; right:10px; display:flex; gap:6px; opacity:0; transition: opacity .15s; z-index:2; }
.model-card--shop:hover .model-card__icons { opacity:1; }
.card-ico {
  width:26px; height:26px; border-radius:7px; border:1px solid var(--border); background: var(--surface);
  display:grid; place-items:center; color: var(--text-secondary); cursor:pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.card-ico:hover { background: var(--surface-2); color: var(--brand-600); border-color: var(--border-strong); }
.card-ico .ico { width:14px; height:14px; }
.card-ico.is-active { color: var(--brand-600); border-color: var(--brand-soft); background: var(--brand-soft); }
.model-card__tags { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom: 10px; min-height:22px; }
.model-card__tag { font-size:11px; padding:2px 8px; border-radius: var(--r-full); }
.model-card__discount { font-size:11px; color: var(--text-muted); margin-left:auto; }
.model-card__discount strong { color: #C2410C; font-weight:700; }
.model-card__price { font-size:11.5px; color: var(--text-secondary); padding-top: 8px; }
.model-card__price .tabular { color: var(--text); font-weight:500; }

/* 类型徽章颜色变体 */
.type-badge--text { color:#C2410C; background:#FFEDD5; }
.type-badge--vision { color:#6D28D9; background:#EDE9FE; }
.type-badge--image { color:#1D4ED8; background:#DBEAFE; }
.type-badge--video { color:#B91C1C; background:#FEE2E2; }
[data-theme="dark"] .type-badge--text { color:#FDBA74; background: rgba(251,146,60,.16); }
[data-theme="dark"] .type-badge--vision { color:#C4B5FD; background: rgba(139,92,246,.18); }
[data-theme="dark"] .type-badge--image { color:#93C5FD; background: rgba(59,130,246,.18); }
[data-theme="dark"] .type-badge--video { color:#FCA5A5; background: rgba(239,68,68,.18); }

@media (max-width: 1280px) {
  .models-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .models-layout { grid-template-columns: 1fr; }
  .model-aside { position:static; }
  .models-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .models-grid { grid-template-columns: 1fr; }
  .models-toolbar { gap:8px; }
  .models-toolbar__search { max-width: none; }
}

/* Playground */
.pg { display:grid; grid-template-columns: 240px 1fr; gap: var(--sp-4); height: calc(100vh - var(--topbar-h) - var(--sp-9) - 40px); min-height: 480px; }
.pg__models { background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg); overflow-y:auto; padding: var(--sp-3); }
.pg__model { display:flex; align-items:center; gap:10px; padding:10px; border-radius: var(--r-md); cursor:pointer; margin-bottom:4px; }
.pg__model.active { background: var(--brand-soft); }
.pg__model .m-logo { width:30px; height:30px; border-radius:8px; display:grid; place-items:center; color:#fff; font-weight:700; font-size:13px; }
.pg__chat { background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg); display:flex; flex-direction:column; overflow:hidden; }
.pg__msgs { flex:1; overflow-y:auto; padding: var(--sp-5); display:flex; flex-direction:column; gap: var(--sp-4); }
.msg { display:flex; gap:10px; max-width:80%; }
.msg.user { align-self:flex-end; flex-direction:row-reverse; }
.msg .bubble { padding: 11px 15px; border-radius: var(--r-lg); font-size:13.5px; line-height:1.6; }
.msg.bot .bubble { background: var(--surface-2); border:1px solid var(--border); }
.msg.user .bubble { background: var(--brand); color:#fff; }
.msg .avatar-sm { width:30px; height:30px; border-radius:8px; flex-shrink:0; display:grid; place-items:center; font-size:13px; }
.pg__input { border-top:1px solid var(--border); padding: var(--sp-4); display:flex; gap: var(--sp-3); align-items:flex-end; }
.pg__input textarea { flex:1; resize:none; height:46px; }

/* Agency board */
.board-grid { display:grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-4); margin-bottom: var(--sp-6); }

/* Recharge */
.recharge-grid { display:grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.pay-opt { border:1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); cursor:pointer; transition: border-color .15s, box-shadow .15s; }
.pay-opt.active { border-color: var(--brand); box-shadow: var(--focus-ring); }
.amount-grid { display:grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-3); }
.amount-chip { border:1px solid var(--border-strong); border-radius: var(--r-md); padding:12px; text-align:center; cursor:pointer; font-family:var(--font-display); font-weight:600; transition: border-color .15s, background .15s; }
.amount-chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-600); }
.amount-chip input { width:100%; border:none; background:none; text-align:center; font-family:var(--font-display); font-weight:600; font-size:15px; outline:none; color:inherit; }

/* ============== API Key Management (令牌管理) ============== */
.apikey-page-head { display:flex; align-items:flex-end; justify-content:space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.apikey-page-head h1 { font-size:22px; font-weight:600; margin: 0; }
.apikey-page-sub { font-size:13px; color: var(--text-secondary); margin-top: 4px; }
.apikey-actions { display:flex; align-items:center; gap: 14px; }
.apikey-actions .btn { display:inline-flex; align-items:center; gap: 6px; }
.apikey-btn-danger { color: #DC2626; }
.apikey-btn-danger:hover { color: #B91C1C; background: rgba(220,38,38,.06); }

.apikey-filter-bar {
  display:grid; grid-template-columns: 1fr 1fr auto; gap: var(--sp-4);
  align-items:end; padding: var(--sp-4) var(--sp-5);
  background: var(--surface); border:1px solid var(--card-border); border-radius: var(--r-lg);
  margin-bottom: var(--sp-4);
}
.apikey-filter-field { display:flex; flex-direction:column; gap: 6px; min-width:0; }
.apikey-filter-field label { font-size:12px; color: var(--text-secondary); }
.apikey-filter-field .input { height:36px; }
.apikey-filter-btns { display:flex; align-items:center; gap: 10px; }
.apikey-filter-btns .btn { height:36px; display:inline-flex; align-items:center; gap: 6px; padding: 0 16px; }

.apikey-table th, .apikey-table td { font-size:12.5px; vertical-align: middle; }
.apikey-table th { color: var(--text-secondary); font-weight:500; background: var(--bg-soft, #F4F6FA); }
.apikey-table tbody tr:hover { background: var(--surface-2); }

.apikey-name-link { color: var(--text); font-weight:500; text-decoration: none; }
.apikey-name-link:hover { color: var(--brand-600); }

.apikey-time { color: var(--text-secondary); font-size:12px; white-space: nowrap; }
.apikey-never { color: var(--text-muted); font-size:12px; }

/* status / quota / group pills */
.status-pill { display:inline-flex; align-items:center; padding: 2px 8px; border-radius: 4px; font-size:11.5px; line-height: 18px; font-weight: 500; }
.status-pill--ok { color: #16A34A; background: rgba(22,163,74,.10); }
.status-pill--off { color: #DC2626; background: rgba(220,38,38,.10); }
.quota-pill { display:inline-flex; align-items:center; padding: 2px 10px; border-radius: 12px; font-size:11.5px; line-height: 18px; font-weight: 500; color: #6B3DF5; background: rgba(91,61,245,.10); }
.group-pill { display:inline-flex; align-items:center; padding: 2px 10px; border-radius: 12px; font-size:11.5px; line-height: 18px; font-weight: 500; color: #2563EB; background: rgba(43,89,255,.10); }

/* key cell with copy */
.apikey-key { display:inline-flex; align-items:center; gap: 6px; }
.apikey-key__text { color: var(--text); font-size:12.5px; letter-spacing: .2px; }
.apikey-key__copy { display:inline-flex; align-items:center; justify-content:center; width: 24px; height: 24px; border-radius: 4px; border:none; background: transparent; color: var(--text-muted); cursor: pointer; transition: all .15s; }
.apikey-key__copy:hover { background: var(--surface-2); color: var(--brand-600); }

/* row icon buttons (edit / delete) */
.row-icon-btns { display:flex; align-items:center; gap: 4px; }
.row-icon-btn { display:inline-flex; align-items:center; justify-content:center; width: 28px; height: 28px; border-radius: 4px; border:none; background: transparent; color: var(--text-muted); cursor: pointer; transition: all .15s; }
.row-icon-btn:hover { background: var(--surface-2); color: var(--brand-600); }
.row-icon-btn--danger:hover { background: rgba(220,38,38,.08); color: #DC2626; }

/* pagination */
.apikey-pagination { display:flex; align-items:center; justify-content:space-between; gap: var(--sp-4); padding: 12px var(--sp-4); flex-wrap: wrap; }
.apikey-pagination__info { font-size:12.5px; color: var(--text-secondary); }
.apikey-pagination__center { display:flex; align-items:center; gap: 6px; }
.apikey-pagination__total { font-size:12.5px; color: var(--text-secondary); margin-right: 6px; }
.apikey-pager-btn { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 4px; border:1px solid transparent; background: transparent; color: var(--text-secondary); font-size:12.5px; cursor: pointer; transition: all .15s; }
.apikey-pager-btn:hover { background: var(--surface-2); color: var(--text); }
.apikey-pager-btn.is-active { background: var(--brand-50, #EAF0FF); color: var(--brand-600); border-color: var(--brand-200, #C7D4FF); }
.apikey-pager-ellipsis { color: var(--text-muted); font-size:12.5px; padding: 0 2px; }
.apikey-pagination__size { display:flex; align-items:center; gap: 6px; font-size:12.5px; color: var(--text-secondary); }
.apikey-pagination__size .select { height: 28px; padding: 0 24px 0 8px; font-size:12.5px; }
.select--sm { height: 28px; padding: 0 8px; font-size:12.5px; }

@media (max-width: 1024px) {
  .apikey-filter-bar { grid-template-columns: 1fr 1fr; }
  .apikey-filter-btns { grid-column: span 2; justify-content: flex-end; }
}
@media (max-width: 640px) {
  .apikey-filter-bar { grid-template-columns: 1fr; }
  .apikey-filter-btns { grid-column: span 1; }
  .apikey-actions { flex-wrap: wrap; }
}

/* API key rows (legacy kept for modal preview) */
.key-row { display:flex; align-items:center; gap: var(--sp-3); padding: var(--sp-4); border:1px solid var(--border); border-radius: var(--r-lg); margin-bottom: var(--sp-3); background: var(--surface); }
.key-row .k-name { font-weight:600; }
.key-row .k-val { font-family: var(--font-mono); font-size:12.5px; color: var(--text-secondary); background: var(--surface-2); padding:6px 10px; border-radius: var(--r-sm); flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.key-actions { display:flex; gap:6px; }

/* Auth steps */
.steps { display:flex; gap:0; margin-bottom: var(--sp-6); }
.step { flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; position:relative; }
.step::before { content:""; position:absolute; top:13px; left:-50%; width:100%; height:2px; background: var(--border); z-index:0; }
.step:first-child::before { display:none; }
.step .num { width:28px; height:28px; border-radius:50%; background: var(--surface-2); border:2px solid var(--border); display:grid; place-items:center; font-weight:600; font-size:13px; z-index:1; color: var(--text-secondary); }
.step.done .num { background: var(--success); border-color: var(--success); color:#fff; }
.step.done::before { background: var(--success); }
.step.current .num { background: var(--brand); border-color: var(--brand); color:#fff; }

/* Drawer (mobile sidebar / profile) */
.drawer-mask { position:fixed; inset:0; background:rgba(8,11,16,.5); z-index:45; display:none; }
.drawer-mask.open { display:block; }

/* Charts */
.chart-card { background: var(--surface); border:1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--shadow-sm); }
.chart-legend { display:flex; gap: var(--sp-4); flex-wrap:wrap; margin-top: var(--sp-3); }
.chart-legend span { display:flex; align-items:center; gap:6px; font-size:12px; color: var(--text-secondary); }
.chart-legend__item { cursor: pointer; user-select: none; padding: 2px 4px; border-radius: 4px; transition: opacity .15s, background .15s; }
.chart-legend__item:hover { background: var(--surface-2); }
.chart-legend__item.is-off { opacity: .42; text-decoration: line-through; }
.chart-legend__item.is-off .dot { background: var(--text-muted) !important; }
/* SVG chart elements (colors via CSS so theme vars resolve) */
.chart-svg .grid { stroke: var(--border); }
.chart-svg .axis-label { fill: var(--text-muted); font-size: 10px; }
.chart-svg .line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .area { fill: url(#lg); }
.chart-svg .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-svg .bar { fill: var(--brand); }
.chart-svg .bar.last { fill: var(--accent); }
.chart-svg .donut-center { fill: var(--text); font-size: 22px; font-weight: 600; font-family: var(--font-display); }
.chart-svg .donut-sub { fill: var(--text-muted); font-size: 11px; }

/* misc */
.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.grid-3 { display:grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-4); }
.mt-4{margin-top:var(--sp-4);} .mt-5{margin-top:var(--sp-5);} .mt-6{margin-top:var(--sp-6);}
.mb-4{margin-bottom:var(--sp-4);} .mb-5{margin-bottom:var(--sp-5);} .mb-6{margin-bottom:var(--sp-6);}
.flex { display:flex; } .between{justify-content:space-between;} .center{align-items:center;} .gap-2{gap:var(--sp-2);} .gap-3{gap:var(--sp-3);} .gap-4{gap:var(--sp-4);} .wrap{flex-wrap:wrap;}
.text-muted{color:var(--text-muted);} .text-sec{color:var(--text-secondary);}
.divider { height:1px; background: var(--border); margin: var(--sp-5) 0; }

/* ============================== Responsive ============================== */
@media (max-width: 1024px) {
  .stat-grid, .board-grid { grid-template-columns: repeat(2,1fr); }
  .model-grid { grid-template-columns: repeat(2,1fr); }
  .content { padding: var(--sp-5); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { position: fixed; left:0; top:0; transform: translateX(-100%); width:260px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .topbar__menu { display:grid; }
  .search { display:none; }
  .user-chip .meta { display:none; }
  .stat-grid, .board-grid, .model-grid, .recharge-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .pg { grid-template-columns: 1fr; height: auto; }
  .pg__models { display:none; }
  .content { padding: var(--sp-4); }
  .page-head h1 { font-size:20px; }
}
@media (max-width: 420px) {
  .amount-grid { grid-template-columns: repeat(2,1fr); }
  .topbar { padding: 0 var(--sp-4); gap: var(--sp-2); }
}

/* ===== 动效编排（Impeccable：transform/opacity + expo 缓动 + 交错入场） ===== */
@keyframes riseIn { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform:none; } }
.page.active .stat,
.page.active .promo-stat,
.page.active .promo-card,
.page.active .card,
.page.active .home-price-card { animation: riseIn var(--dur-slow) var(--ease-expo) both; }
.page.active .stat:nth-child(2),
.page.active .promo-stat:nth-child(2),
.page.active .card:nth-child(2) { animation-delay: .06s; }
.page.active .stat:nth-child(3),
.page.active .promo-stat:nth-child(3),
.page.active .card:nth-child(3) { animation-delay: .12s; }
.page.active .stat:nth-child(4),
.page.active .promo-stat:nth-child(4),
.page.active .card:nth-child(4) { animation-delay: .18s; }

/* 卡片悬浮微交互（GPU 加速，不触发 reflow；统一过渡 token） */
.promo-card, .promo-stat { transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.stat:hover, .promo-stat:hover, .promo-card:hover, .card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  will-change: transform;
}

/* 无障碍：尊重 prefers-reduced-motion，关闭非必要动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .page.active [class] { animation: none !important; }
}

/* ============================== Model Detail Modal ============================== */
/* 纯介绍 + 价格弹窗：分组仅展示、不可点选；无订阅/开通按钮 */
.mdl-overlay {
  position: fixed; inset:0; background: rgba(8,11,16,.55); backdrop-filter: blur(2px);
  display:none; align-items: stretch; justify-content: flex-end; z-index:110; padding: 0;
}
.mdl-overlay.open { display:flex; animation: fade .2s var(--ease); }
.mdl-modal {
  background: var(--surface); border-radius: var(--r-xl) 0 0 var(--r-xl); width: 820px; max-width: 100vw;
  height: 100vh; max-height: 100vh; display:flex; flex-direction:column; box-shadow: var(--shadow-lg);
  animation: drawerIn .28s var(--ease); overflow:hidden;
}
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: none; } }
.mdl-modal__head {
  display:flex; align-items:flex-start; justify-content:space-between; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6); border-bottom:1px solid var(--border);
}
.mdl-head { display:flex; align-items:center; gap:14px; min-width:0; }
.mdl-logo {
  width:52px; height:52px; border-radius:14px; flex-shrink:0; display:grid; place-items:center;
  color:#fff; font-family:var(--font-display); font-weight:700; font-size:22px;
  box-shadow: 0 6px 18px rgba(43,89,255,.2);
}
.mdl-titlerow { display:flex; align-items:center; gap:10px; min-width:0; }
.mdl-titlewrap { min-width:0; }
.mdl-title { font-family:var(--font-display); font-size:20px; font-weight:700; letter-spacing:-.01em; line-height:1.25; }
.mdl-copy {
  position:relative; width:30px; height:30px; border-radius:8px; flex-shrink:0;
  display:grid; place-items:center; color: var(--text-secondary);
  border:1px solid var(--border); background: var(--surface);
  transition: background .15s, color .15s, border-color .15s;
}
.mdl-copy:hover { background: var(--surface-2); color: var(--brand-600); border-color: var(--border-strong); }
.mdl-copy .ico { width:16px; height:16px; }
.mdl-copy.is-copied { color: var(--success); border-color: var(--success); background: var(--success-soft); }
.mdl-copy__tip {
  position:absolute; bottom: calc(100% + 8px); left:50%; transform: translateX(-50%) translateY(4px);
  background: var(--ink-900); color:#fff; font-size:11px; padding:3px 8px; border-radius:6px; white-space:nowrap;
  opacity:0; pointer-events:none; transition: opacity .15s, transform .15s;
}
[data-theme="dark"] .mdl-copy__tip { background:#000; }
.mdl-copy.is-copied .mdl-copy__tip { opacity:1; transform: translateX(-50%) translateY(0); }
.mdl-close { width:34px; height:34px; border-radius: var(--r-md); display:grid; place-items:center; color: var(--text-muted); font-size:22px; flex-shrink:0; }
.mdl-close:hover { background: var(--surface-2); color: var(--text); }

.mdl-modal__body { padding: var(--sp-6); overflow-y:auto; }
.mdl-modal__foot { padding: var(--sp-4) var(--sp-6); border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }

/* sections */
.mdl-sec { margin-bottom: var(--sp-6); }
.mdl-sec:last-child { margin-bottom:0; }
.mdl-sec__title { font-size:13px; font-weight:700; color: var(--text-secondary); margin-bottom: var(--sp-3); display:flex; align-items:center; gap:8px; }
.mdl-sec__title::before { content:""; width:3px; height:14px; border-radius:2px; background: var(--brand); }

/* folded-in block inside 模型基本信息 (适用场景列表) */
.mdl-block { margin-top: var(--sp-6); }

/* folded-in text content (模型基本信息 一句话简介) */
.mdl-text { font-size:13.5px; color: var(--text-secondary); line-height:1.95; }

/* price table — display only, no selection */
.mdl-plans-note { font-size:12px; color: var(--text-muted); margin-bottom: var(--sp-4); }
.mdl-ptable-wrap { border:1px solid var(--border); border-radius: var(--r-lg); overflow:hidden; }
.mdl-ptable { width:100%; border-collapse:collapse; font-size:13px; }
.mdl-ptable th { text-align:left; font-size:12px; font-weight:600; color: var(--text-muted); padding:11px 14px; background: var(--surface-2); border-bottom:1px solid var(--border); white-space:nowrap; }
.mdl-ptable td { padding:12px 14px; border-bottom:1px solid var(--border); color: var(--text-secondary); vertical-align:middle; }
.mdl-ptable tbody tr:last-child td { border-bottom:none; }
.mdl-ptable .mdl-num { font-family: var(--font-mono); color: var(--text); white-space:nowrap; }
.mdl-ptable .mdl-pnote { color: var(--text-muted); font-size:12.5px; }
/* 阶梯两档竖排（合并进同一分组行） */
.mdl-tiers { display:flex; flex-direction:column; }
.mdl-tier { padding:6px 0; border-bottom:1px dashed var(--border); line-height:1.4; }
.mdl-tier:last-child { border-bottom:none; padding-bottom:0; }
.mdl-ptable td .mdl-tiers .mdl-tier { font-family: var(--font-mono); color: var(--text); }
.mdl-grp-badge { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; padding:4px 11px; border-radius: var(--r-full); }
.mdl-grp-badge.official { background: var(--brand-soft); color: var(--brand-600); }
[data-theme="dark"] .mdl-grp-badge.official { color:#AFC0FF; }
.mdl-grp-badge.promo { background: #FFF1E0; color: #C2410C; }
[data-theme="dark"] .mdl-grp-badge.promo { background: rgba(245,158,11,.18); color:#FBBF24; }

/* use cases */
.mdl-usecases { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.mdl-usecases li { display:flex; gap:8px; align-items:flex-start; font-size:13px; color: var(--text-secondary); background: var(--surface-2); padding:10px 12px; border-radius: var(--r-md); line-height:1.5; }
.mdl-usecases li .ico { width:16px; height:16px; flex-shrink:0; color: var(--brand-600); margin-top:2px; }

/* API endpoints */
.mdl-endpoints { display:flex; flex-direction:column; gap:8px; }
.mdl-ep { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 12px; border:1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.mdl-ep__method { font-family: var(--font-display); font-size:11px; font-weight:700; letter-spacing:.04em; color:#fff; background: var(--brand); padding:3px 8px; border-radius: var(--r-sm); flex-shrink:0; }
.mdl-ep__path { font-family: var(--font-mono); font-size:12.5px; color: var(--brand-600); background: var(--brand-soft); padding:3px 8px; border-radius:6px; flex-shrink:0; }
[data-theme="dark"] .mdl-ep__path { color:#AFC0FF; }
.mdl-ep__desc { font-size:12.5px; color: var(--text-secondary); }
.mdl-ep__base { font-size:12px; color: var(--text-muted); line-height:1.7; margin-top: var(--sp-3); }
.mdl-ep__base code { font-family: var(--font-mono); color: var(--brand-600); background: var(--brand-soft); padding:1px 6px; border-radius:5px; }
[data-theme="dark"] .mdl-ep__base code { color:#AFC0FF; }

/* remark */
.mdl-remark { background: var(--surface-2); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); font-size:12.5px; color: var(--text-secondary); line-height:1.65; display:flex; gap:10px; }
.mdl-remark .ico { width:18px; height:18px; flex-shrink:0; color: var(--brand-600); margin-top:1px; }

/* ============================== API Key Drawer (左滑) ============================== */
.ak-drawer {
  position: fixed; inset: 0;
  background: rgba(8,11,16,.5); backdrop-filter: blur(2px);
  display: none; z-index: 110;
}
.ak-drawer.open { display: block; animation: fade .2s var(--ease); }
.ak-drawer__panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 620px; max-width: 96vw; background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: akDrawerIn .3s var(--ease);
  overflow: hidden;
}
@keyframes akDrawerIn { from { transform: translateX(-100%); } to { transform: none; } }

/* head */
.ak-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ak-drawer__head-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ak-drawer__head h3 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.ak-tag-new {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 12px;
  background: #E6F4D8; color: #4D7C0F;
}
[data-theme="dark"] .ak-tag-new { background: rgba(132,204,22,.18); color: #BEF264; }
.ak-drawer__close {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1; color: var(--text-muted);
  background: transparent; border: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.ak-drawer__close:hover { background: var(--surface-2); color: var(--text); }

/* body */
.ak-drawer__body {
  flex: 1; overflow-y: auto;
  padding: 22px 28px 16px;
}

/* section */
.ak-sec {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 20px 20px; margin-bottom: 18px;
  background: var(--surface);
}
.ak-sec__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ak-sec__icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
}
.ak-sec__icon--blue { background: #DBEAFE; color: #2563EB; }
[data-theme="dark"] .ak-sec__icon--blue { background: rgba(59,130,246,.18); color: #93C5FD; }
.ak-sec__icon--green { background: #DCFCE7; color: #16A34A; }
[data-theme="dark"] .ak-sec__icon--green { background: rgba(34,197,94,.18); color: #86EFAC; }
.ak-sec__title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2; }
.ak-sec__sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* field */
.ak-field { margin-bottom: 14px; }
.ak-field:last-child { margin-bottom: 0; }
.ak-label {
  display: block; font-size: 12.5px; color: var(--text-secondary);
  margin-bottom: 6px; font-weight: 500;
}
.ak-req { color: #EF4444; margin-left: 2px; }
.ak-input {
  width: 100%; box-sizing: border-box;
  height: 36px; padding: 0 12px;
  font: inherit; font-size: 13px;
  color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ak-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,89,255,.12); }
.ak-help { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

/* radio */
.ak-radio-group { display: flex; flex-wrap: wrap; gap: 18px; padding: 2px 0; }
.ak-radio { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.ak-radio input { position: absolute; opacity: 0; pointer-events: none; }
.ak-radio__dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  position: relative; flex-shrink: 0;
  transition: border-color .15s;
}
.ak-radio input:checked ~ .ak-radio__dot { border-color: var(--brand); }
.ak-radio input:checked ~ .ak-radio__dot::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--brand);
}
.ak-radio input:checked ~ span:last-child { color: var(--brand-600); font-weight: 600; }
[data-theme="dark"] .ak-radio input:checked ~ span:last-child { color: #AFC0FF; }

/* select */
.ak-select-wrap { position: relative; }
.ak-select {
  width: 100%; box-sizing: border-box;
  height: 36px; padding: 0 32px 0 12px;
  font: inherit; font-size: 13px;
  color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); outline: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.ak-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,89,255,.12); }
.ak-select__chev {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text-muted); pointer-events: none;
}

/* 2-col grid for 过期时间 + 快捷设置 */
.ak-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* input with icon (calendar) */
.ak-input-with-icon { position: relative; }
.ak-input-with-icon .ak-input { padding-right: 36px; }
.ak-input__icon {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; display: flex;
}

/* pill buttons (过期时间快捷设置) */
.ak-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ak-pill {
  font: inherit; font-size: 12.5px;
  height: 32px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text-secondary);
  cursor: pointer; transition: all .15s;
}
.ak-pill:hover { border-color: var(--border-strong); color: var(--text); }
.ak-pill.is-active {
  background: var(--brand-soft); color: var(--brand-600);
  border-color: var(--brand);
}
[data-theme="dark"] .ak-pill.is-active { color: #AFC0FF; }

/* number stepper */
.ak-input-with-stepper { position: relative; }
.ak-input-with-stepper .ak-input { padding-right: 30px; }
.ak-stepper {
  position: absolute; right: 1px; top: 1px; bottom: 1px;
  width: 28px;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
}
.ak-stepper__btn {
  flex: 1; background: var(--surface);
  border: none; cursor: pointer;
  font-size: 9px; line-height: 1; color: var(--text-muted);
  transition: background .15s, color .15s;
}
.ak-stepper__btn:hover { background: var(--surface-2); color: var(--text); }
.ak-stepper__btn + .ak-stepper__btn { border-top: 1px solid var(--border); }

/* foot */
.ak-drawer__foot {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface);
}
.ak-agree { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-secondary); cursor: pointer; line-height: 1.5; }
.ak-agree input { position: absolute; opacity: 0; pointer-events: none; }
.ak-agree__box {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: inline-block; flex-shrink: 0; margin-top: 2px;
  position: relative;
  transition: background .15s, border-color .15s;
}
.ak-agree input:checked ~ .ak-agree__box { background: var(--brand); border-color: var(--brand); }
.ak-agree input:checked ~ .ak-agree__box::after {
  content: ""; position: absolute; left: 3px; top: 0px;
  width: 4px; height: 8px;
  border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.ak-agree a { color: var(--brand-600); text-decoration: none; }
.ak-agree a:hover { text-decoration: underline; }
.ak-drawer__foot-btns { display: flex; gap: 10px; flex-shrink: 0; }
.ak-btn-submit, .ak-btn-cancel { display: inline-flex; align-items: center; height: 36px; padding: 0 18px; font-size: 13px; font-weight: 600; }
.ak-btn-cancel { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.ak-btn-cancel:hover { background: var(--surface); border-color: var(--border-strong); color: var(--text); }

/* responsive */
@media (max-width: 768px) {
  .mdl-modal { width: 100vw; border-radius: 0; }
  .mdl-usecases { grid-template-columns: 1fr; }
  .mdl-ptable-wrap { overflow-x:auto; }
  .ak-drawer__panel { width: 100vw; }
  .ak-drawer__foot { flex-direction: column; align-items: stretch; }
  .ak-drawer__foot-btns { justify-content: flex-end; }
  .ak-grid-2 { grid-template-columns: 1fr; }
  .home-hero__title { font-size: 32px; }
  .home-hero__line--row { flex-wrap: wrap; }
  .home-price-toolbar { flex-direction: column; align-items: stretch; }
  .home-trans__inner { grid-template-columns: 1fr; }
  .home-trans__title { font-size: 36px; }
}

/* ===================== 营销首页（#page-overview） ===================== */
.page-home { background: #fafbfc; padding: 0; }
.page-home .page-head,
.page-home .stat-grid,
.page-home .grid-2 { display: none; }

/* ----- 顶部横向功能入口（参考豆包智能官网导航） ----- */
.home-topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  height: 64px; padding: 0 32px;
  background: rgba(250, 251, 252, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 230, 236, .8);
}
.home-topnav__brand {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  cursor: pointer;
}
.home-topnav__brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
.home-topnav__brand .brand-name { font-size: 18px; font-weight: 700; color: #0f172a; letter-spacing: -.02em; }

.home-topnav__nav {
  display: flex; align-items: center; gap: 6px; flex: 1;
  overflow-x: auto; scrollbar-width: none;
}
.home-topnav__nav::-webkit-scrollbar { display: none; }

.home-topnav__link,
.home-topnav__toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: #334155;
  background: transparent; border: none; cursor: pointer; white-space: nowrap;
  transition: color .15s, background .15s;
}
.home-topnav__link:hover,
.home-topnav__toggle:hover { color: #2B59FF; background: rgba(43, 89, 255, .06); }
.home-topnav__link.active { color: #2B59FF; background: rgba(43, 89, 255, .08); font-weight: 600; }
.home-topnav__toggle .ico-chevron { width: 14px; height: 14px; opacity: .6; transition: transform .2s; }
.home-topnav__group.open .ico-chevron { transform: rotate(180deg); }

.home-topnav__group { position: relative; }
.home-topnav__dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 180px;
  background: #fff; border: 1px solid #e2e6ec; border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, .14);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.home-topnav__group.open .home-topnav__dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.home-topnav__dropitem {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13.5px; color: #334155; cursor: pointer;
  transition: background .15s, color .15s;
}
.home-topnav__dropitem:hover { background: #f1f5ff; color: #2B59FF; }
.home-topnav__dropitem .ico { width: 16px; height: 16px; color: #2B59FF; }

.home-topnav__actions {
  display: flex; align-items: center; gap: 18px; flex-shrink: 0; margin-left: auto;
  padding-left: 20px; border-left: 1px solid rgba(226, 230, 236, .8);
}
[data-theme="dark"] .home-topnav__actions { border-left-color: rgba(255, 255, 255, .12); }
.home-topnav__secondary {
  font-size: 14px; font-weight: 500; color: #475569; cursor: pointer; white-space: nowrap;
  transition: color .15s;
}
.home-topnav__secondary:hover { color: #2B59FF; }
.home-topnav__cta {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 22px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap;
  background: #2B59FF; box-shadow: 0 4px 12px -4px rgba(43, 89, 255, .45);
  cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s;
}
.home-topnav__cta:hover { background: #1f45d1; transform: translateY(-1px); }
.home-topnav__cta .ico-arrow { width: 15px; height: 15px; }

.home-topnav__mobile-menu {
  display: none; width: 36px; height: 36px; border-radius: 8px;
  border: none; background: transparent; color: #334155; cursor: pointer;
}
.home-topnav__mobile-menu:hover { background: rgba(43, 89, 255, .06); }

/* 暗色主题适配 */
[data-theme="dark"] .home-topnav { background: rgba(11, 14, 20, .92); border-bottom-color: rgba(255, 255, 255, .08); }
[data-theme="dark"] .home-topnav__brand .brand-name { color: #EDEFF3; }
[data-theme="dark"] .home-topnav__link,
[data-theme="dark"] .home-topnav__toggle,
[data-theme="dark"] .home-topnav__secondary { color: #a9b2c0; }
[data-theme="dark"] .home-topnav__link:hover,
[data-theme="dark"] .home-topnav__toggle:hover,
[data-theme="dark"] .home-topnav__secondary:hover { color: #AFC0FF; background: rgba(175, 192, 255, .08); }
[data-theme="dark"] .home-topnav__dropdown { background: #141824; border-color: rgba(255, 255, 255, .1); }
[data-theme="dark"] .home-topnav__dropitem { color: #a9b2c0; }
[data-theme="dark"] .home-topnav__dropitem:hover { background: rgba(175, 192, 255, .12); color: #AFC0FF; }

/* 顶部导航响应式 */
@media (max-width: 1100px) {
  .home-topnav { gap: 16px; padding: 0 20px; }
  .home-topnav__nav { gap: 2px; }
}
@media (max-width: 920px) {
  .home-topnav__nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 12px 20px 20px; background: rgba(250, 251, 252, .98); border-bottom: 1px solid #e2e6ec; box-shadow: 0 12px 24px -8px rgba(15,23,42,.1); }
  .home-topnav.open .home-topnav__nav { display: flex; }
  .home-topnav__link,
  .home-topnav__toggle { justify-content: space-between; width: 100%; padding: 12px 8px; border-radius: 0; border-bottom: 1px solid rgba(226, 230, 236, .6); }
  .home-topnav__group { width: 100%; }
  .home-topnav__dropdown { position: static; opacity: 1; visibility: visible; transform: none; display: none; box-shadow: none; border: none; background: transparent; padding: 0 8px 8px; }
  .home-topnav__group.open .home-topnav__dropdown { display: block; }
  .home-topnav__mobile-menu { display: inline-grid; place-items: center; }
}
@media (max-width: 540px) {
  .home-topnav__secondary { display: none; }
  .home-topnav__actions { border-left: none; padding-left: 0; gap: 12px; }
}

/* ----- Hero ----- */
.home-hero { position: relative; overflow: hidden; padding: 64px 24px 56px; }
/* 品牌色柔光：意图性装饰，非霓虹/AI-slop 套路 */
.home-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(58% 48% at 50% 0%, color-mix(in srgb, var(--brand) 11%, transparent), transparent 70%);
}
.home-hero__bg { position: absolute; inset: 0; z-index: 0; background-color: #fff; background-image: linear-gradient(rgba(15,23,42,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(15,23,42,.04) 1px, transparent 1px); background-size: 32px 32px; background-position: -1px -1px; mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 60%, transparent 100%); -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 60%, transparent 100%); }
.home-hero__inner { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; text-align: center; }
.home-hero__eyebrow { display: inline-block; font-size: 12px; color: #6b7280; background: #fff; border: 1px solid #eef0f4; padding: 4px 10px; border-radius: 999px; margin-bottom: 18px; letter-spacing: .5px; }
.home-hero__title { margin: 0; font-size: var(--fs-hero); line-height: 1.12; font-weight: 800; color: #0f172a; letter-spacing: -.02em; display: flex; flex-direction: column; gap: 6px; }
.home-hero__line--row { display: inline-flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.home-hero__plus { font-weight: 600; color: #94a3b8; font-size: 36px; }
.home-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 18px; border-radius: 999px; font-weight: 800; font-size: 40px; line-height: 1.1; }
.home-pill__dot { display: inline-flex; width: 28px; height: 28px; border-radius: 999px; align-items: center; justify-content: center; font-size: 14px; color: #fff; }
.home-pill--orange { background: #fff1ea; color: #ea580c; }
.home-pill--orange .home-pill__dot { background: #ea580c; }
.home-pill--blue { background: #eef2ff; color: #4f46e5; }
.home-pill--blue .home-pill__dot { background: #4f46e5; }

/* URL 选择器 */
.home-hero__url { display: inline-flex; align-items: center; margin-top: 28px; background: #fff; border: 1px solid #e2e6ec; border-radius: 10px; padding: 4px; box-shadow: 0 1px 0 rgba(15,23,42,.02), 0 6px 20px -8px rgba(15,23,42,.08); }
.home-hero__proto { border: none; background: #f6f7f9; font-size: 13px; color: #1a1f2c; padding: 6px 10px; border-radius: 6px; outline: none; cursor: pointer; }
.home-hero__addr { width: 360px; border: none; outline: none; padding: 6px 10px; font-size: 14px; color: #1a1f2c; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: transparent; }
.home-hero__copy { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: #f6f7f9; border: none; border-radius: 6px; color: #4a5160; cursor: pointer; }
.home-hero__copy:hover { background: #eceff3; color: #1a1f2c; }

/* CTA */
.home-hero__cta { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; }
.home-cta { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 22px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s, color .12s; border: 1px solid transparent; }
.home-cta--primary { background: var(--mark); color: #fff; box-shadow: 0 6px 16px -6px rgba(216,52,31,.55); }
.home-cta--primary:hover { background: #b82a17; }
.home-cta--ghost { background: #fff; color: #1a1f2c; border-color: #e2e6ec; }
.home-cta--ghost:hover { border-color: #c7ccd4; }
.home-cta-wrap { position: relative; display: inline-flex; }
.home-cta__badge { position: absolute; top: -8px; right: -8px; z-index: 2; font-size: 10px; font-weight: 700; color: #fff; background: var(--mark); padding: 2px 6px; border-radius: 999px; box-shadow: 0 2px 6px -2px rgba(216,52,31,.5); }

/* QR */
.home-hero__qr { position: absolute; right: 24px; bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.home-hero__qr-img { width: 80px; height: 80px; padding: 4px; background: #fff; border: 1px solid #eef0f4; border-radius: 6px; }
.home-hero__qr-label { font-size: 11px; color: #6b7280; }

/* ----- Section（实时价格）----- */
.home-section { max-width: 1200px; margin: 0 auto; padding: 48px 24px 72px; }
#homePrice { scroll-margin-top: 80px; }
.home-price-card { background: #fff; border: 1px solid #eef0f4; border-radius: 14px; padding: 22px 24px 6px; box-shadow: 0 1px 0 rgba(15,23,42,.02); }
.home-price-head { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid #f1f3f7; margin-bottom: 14px; gap: 16px; flex-wrap: wrap; }
.home-section__title { font-size: var(--fs-section); font-weight: 800; color: #0f172a; margin: 0 0 4px; letter-spacing: -.01em; }
.home-section__sub { margin: 0; font-size: 13px; color: #6b7280; }
.home-section__link { color: var(--mark); text-decoration: none; margin-left: 6px; }
.home-section__link:hover { text-decoration: underline; }
.home-price-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; }
.home-price-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.home-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid #e2e6ec; color: #4a5160; font-size: 13px; cursor: pointer; transition: color .12s, background .12s, border-color .12s; }
.home-chip:hover { color: #1a1f2c; border-color: #c7ccd4; }
.home-chip.is-active { color: var(--mark); border-color: #f6c2bd; background: #fff7f5; }
.home-price-search { margin-left: auto; display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #f6f7f9; border-radius: 999px; min-width: 240px; }
.home-price-search input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; color: #1a1f2c; }



/* 表格 */
.home-price-table-wrap { overflow-x: auto; }
.home-price-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.home-price-table th, .home-price-table td { padding: 12px 12px; border-bottom: 1px solid #f1f3f7; text-align: left; vertical-align: middle; }
.home-price-table th { font-weight: 600; color: #6b7280; font-size: 12px; background: #fafbfc; }
.home-price-table th.is-tr { color: var(--mark); }
.home-price-table .th-sub { font-weight: 400; color: #94a3b8; font-size: 11px; }
.home-price-table .th-sub--tr { color: var(--mark); opacity: .8; }
.home-price-table tbody tr:last-child td { border-bottom: none; }
.home-price-table tbody tr:hover { background: #fafbfc; }
.home-price-table td.num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.home-price-table td.num-main { color: var(--mark); font-weight: 600; }
.home-price-table td .cached { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; }
.home-price-table .discount { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--mark); }
.home-price-empty { padding: 40px 20px; text-align: center; color: #94a3b8; font-size: 13px; }

/* ===================== 首页 · 统一 API 代码演示 ===================== */
.home-api-head { text-align: center; margin: 4px auto 18px; max-width: 880px; }
.home-api-head .home-section__title { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); }
.home-api-head .home-section__sub { margin-top: 10px; font-size: 14px; line-height: 1.7; }

/* ========== 首页顶部品牌区 + 模型选择 ========== */
.home-hero2 {
  position: relative; overflow: hidden;
  padding: 88px 24px 36px;
  text-align: center;
  background: linear-gradient(180deg, #fbfbff 0%, #ffffff 70%);
}
.home-hero2__bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.home-hero2__bg .blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.home-hero2__bg .blob--lt { width: 520px; height: 520px; left: -160px; top: -160px;
  background: radial-gradient(circle, #c9d6ff 0%, rgba(201,214,255,0) 70%); }
.home-hero2__bg .blob--rb { width: 460px; height: 460px; right: -120px; top: -40px;
  background: radial-gradient(circle, #ffd6e8 0%, rgba(255,214,232,0) 70%); }
.home-hero2__inner { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; }
.home-hero2__title {
  font-size: clamp(2.4rem, 1.8rem + 3.4vw, 4.4rem);
  font-weight: 800; line-height: 1.15; letter-spacing: -.02em;
  background: linear-gradient(90deg, #2B59FF 0%, #7C3AED 45%, #EC4899 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 0;
}
.home-hero2__title-accent { padding: 0 .05em; }
.home-hero2__sub {
  margin: 18px auto 0; max-width: 720px;
  font-size: 15px; line-height: 1.85; color: #475569;
}
.home-hero2__feature {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 22px 0 26px; padding: 8px 16px;
  border-radius: 999px;
  background: rgba(43,89,255,.06);
  border: 1px solid rgba(43,89,255,.12);
  color: #1e293b; font-size: 14px;
}
.home-hero2__feature .sparkle { color: #2B59FF; font-size: 16px; }
.home-hero2__feature-link {
  margin-left: 8px; padding: 2px 10px; border-radius: 999px;
  background: linear-gradient(90deg,#FF7A1A,#EC4899);
  color: #fff; font-weight: 600; text-decoration: none; font-size: 12.5px;
}
.home-hero2__cta { display: inline-flex; gap: 14px; margin-top: 4px; }

/* 通用按钮 */
.btn {
  appearance: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 26px; border-radius: 999px;
  font: 600 14px/1 'Inter', sans-serif; letter-spacing: .02em;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn--gradient {
  color: #fff;
  background: linear-gradient(90deg, #2B59FF 0%, #7C3AED 50%, #EC4899 100%);
  box-shadow: 0 12px 28px -10px rgba(124,58,237,.55);
}
.btn--outline {
  color: #2B59FF; background: #fff;
  border: 1.5px solid rgba(43,89,255,.45);
}
.btn--outline:hover { border-color: #2B59FF; background: rgba(43,89,255,.04); }
.btn--ghost { background: #fff; color: #475569; border: 1px solid #e2e8f0; }
.btn--sm { padding: 7px 14px; font-size: 12.5px; }

/* 模型网格：与二级页面 model-card--shop 完全一致，仅调整外层栅格与「更多模型」卡 */
.home-models { padding: 32px 24px 88px; max-width: 1280px; margin: 0 auto; }
.home-models__grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
/* 让卡片撑满等高（与二级页面 grid-auto-rows 一致） */
.home-models__grid > .model-card { height: 100%; }
/* 「更多模型」卡：居中、CTA 风格 */
.model-card--more {
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, #f8faff, #ffffff);
  border-style: dashed;
  border-color: #dde3f5;
}
.model-card--more .model-card__name { font-size: 16px; font-weight: 700; }
.model-card--more .model-card__price { color: var(--text); font-weight: 500; }
.model-card--more:hover { transform: translateY(-3px); }

/* 移动端：模型网格 2 列 */
@media (max-width: 980px) {
  .home-models__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .home-models__grid { grid-template-columns: 1fr; }
  .home-hero2 { padding: 56px 18px 28px; }
  .home-hero2__cta { flex-direction: column; gap: 10px; width: 100%; }
  .home-hero2__cta .btn { width: 100%; }
  .home-hero2__feature { font-size: 13px; padding: 6px 12px; }
}

/* 首页代码演示区：固定宽 880、高度固定 440 不随打字撑大 */
#homeApi.home-section { max-width: 960px; padding: 36px 24px 56px; }
.home-code {
  max-width: 1180px; margin: 0 auto;   /* 与上方标题字体宽度协调，居中 */
  background: #0b1020;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 30px 60px -20px rgba(43,89,255,.35), 0 0 0 1px rgba(255,255,255,.02) inset;
  overflow: hidden;
}
.home-code__tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 12px 0;
  background: linear-gradient(180deg, #11173a, #0b1020);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.home-code__tab {
  appearance: none; border: none; background: transparent;
  color: rgba(255,255,255,.55); font: 500 13px/1 'Inter', sans-serif;
  padding: 10px 14px 12px; cursor: pointer; position: relative;
  border-radius: 8px 8px 0 0;
  transition: color .2s ease, background .2s ease;
}
.home-code__tab:hover { color: rgba(255,255,255,.85); }
.home-code__tab.is-active { color: #fff; background: rgba(255,255,255,.04); }
.home-code__tab.is-active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, #2B59FF, #C6F432);
  border-radius: 2px;
}
.home-code__tab-spacer { flex: 1; }
.home-code__copy {
  appearance: none; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04);
  width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.7); cursor: pointer; transition: all .2s ease;
}
.home-code__copy:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.home-code__copy.is-done { color: #C6F432; border-color: rgba(198,244,50,.4); }
.home-code__copy .ico { width: 14px; height: 14px; }

.home-code__panel {
  position: relative;
  height: 440px;            /* 固定高度：打字再多也不会撑高 */
  min-height: 440px;
  max-height: 440px;
  overflow: hidden;         /* 外框大小锁死 */
  display: flex; align-items: stretch;
  padding: 18px 0 18px 0;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  background:
    radial-gradient(900px 320px at 0% 0%, rgba(43,89,255,.18), transparent 60%),
    radial-gradient(700px 300px at 100% 100%, rgba(91,61,245,.18), transparent 60%),
    #0b1020;
}
.home-code__gutter {
  flex: 0 0 auto;
  width: 52px;
  padding: 0 12px 0 18px;
  text-align: right;
  font-size: 13px; line-height: 1.75;
  color: #4b5876;
  user-select: none;
  border-right: 1px solid rgba(255,255,255,.04);
  background: rgba(255,255,255,.015);
  overflow: hidden;
  white-space: pre;
  scrollbar-width: none;
}
.home-code__gutter::-webkit-scrollbar { display: none; }
.home-code__pre {
  margin: 0; padding: 0 28px;
  flex: 1; min-width: 0;
  font-size: 13.5px; line-height: 1.75;
  color: #e7ecff;
  white-space: pre;
  overflow-y: auto;          /* 内容溢出时内部滚动，外框大小不变 */
  overflow-x: hidden;
  tab-size: 4;
  scrollbar-width: none;
}
.home-code__pre::-webkit-scrollbar { display: none; }
.home-code__body { color: #e7ecff; }
.home-code__caret {
  display: inline-block; width: 8px; height: 1.5em; vertical-align: text-bottom;
  margin-left: 1px;
  background: #C6F432; border-radius: 1px;
  animation: caretBlink 1s steps(2, end) infinite;
  box-shadow: 0 0 10px rgba(198,244,50,.7);
}
@keyframes caretBlink { 50% { opacity: 0; } }

/* 简易语法高亮 token */
.tok-kw    { color: #C792EA; }
.tok-str   { color: #C3E88D; }
.tok-num   { color: #F78C6C; }
.tok-com   { color: #6b7794; font-style: italic; }
.tok-fn    { color: #82AAFF; }
.tok-prop  { color: #FFCB6B; }
.tok-op    { color: #89DDFF; }
.tok-punc  { color: #b3bcd9; }
.tok-var   { color: #e7ecff; }

.home-code__meta {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-top: 1px solid rgba(255,255,255,.05);
  font-size: 12px; color: rgba(255,255,255,.5);
  background: rgba(0,0,0,.2);
}
.home-code__meta-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #C6F432;
  box-shadow: 0 0 8px #C6F432;
  animation: metaPulse 1.6s ease-in-out infinite;
}
@keyframes metaPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* 响应式：移动端单列、面板更紧凑 */
@media (max-width: 768px) {
  #homeApi.home-section { padding: 24px 14px 36px; }
  .home-code { border-radius: 10px; }
  .home-code__panel { height: 360px; min-height: 360px; max-height: 360px; padding: 14px 0; }
  .home-code__gutter { width: 42px; padding: 0 8px 0 12px; font-size: 11.5px; }
  .home-code__pre { font-size: 11.5px; padding: 0 14px; }
  .home-code__tab { padding: 9px 10px 11px; font-size: 12px; }
}

/* 暗色主题适配（沿用现有 [data-theme=dark] 切换） */
[data-theme="dark"] .home-code {
  background: #06091a;
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 30px 60px -20px rgba(91,61,245,.4), 0 0 0 1px rgba(255,255,255,.03) inset;
}
[data-theme="dark"] .home-code__tabs { background: linear-gradient(180deg, #0d1230, #06091a); }

/* ===================== 代理推广面板（#page-agency） ===================== */
.promo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); margin: var(--sp-6) 0; }
.promo-stat { position: relative; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--shadow-sm); overflow: hidden; }
.promo-stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--brand), #6f8bff); }
.promo-stat__label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.promo-stat__main { display: flex; align-items: baseline; gap: 6px; margin-top: 10px; }
.promo-stat__value { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.4rem); font-weight: 700; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.promo-stat__unit { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.promo-stat__sub { margin-top: 8px; font-size: 12px; color: var(--text-muted); }

.promo-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--sp-5); margin-bottom: var(--sp-5); align-items: start; }
.promo-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--shadow-sm); }
.promo-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: var(--sp-5); }
.promo-card__head h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }
.promo-card__head .sub { font-size: 12px; color: var(--text-muted); }

.promo-link-row { display: flex; gap: 10px; }
.promo-link-input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); font-size: 13.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.promo-link-input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }

.promo-qr { display: flex; gap: var(--sp-5); align-items: center; margin-top: var(--sp-6); }
.promo-qr__box { width: 160px; height: 160px; flex-shrink: 0; border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px; background: #fff; display: grid; place-items: center; }
.promo-qr__box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.promo-qr__title { font-size: 14px; font-weight: 600; color: var(--text); }
.promo-qr__hint { margin-top: 6px; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; max-width: 320px; }

.promo-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.promo-point { display: flex; gap: 12px; align-items: flex-start; }
.promo-point__ico { width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--r-md); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-600); }
.promo-point__ico .ico { width: 20px; height: 20px; }
.promo-point__title { font-size: 14px; font-weight: 600; color: var(--text); }
.promo-point__desc { margin-top: 3px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }

.promo-materials__body { display: grid; grid-template-columns: 1fr 260px; gap: var(--sp-6); }
.promo-copy-list { display: flex; flex-direction: column; gap: var(--sp-4); }
.promo-copy-item { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); background: var(--surface-2); }
.promo-copy-item__top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.promo-copy-item__tag { font-size: 11px; font-weight: 600; color: var(--brand-600); background: var(--brand-soft); padding: 2px 8px; border-radius: var(--r-full); }
.promo-copy-item__title { font-size: 13px; font-weight: 600; color: var(--text); }
.promo-copy-item__text { font-size: 13px; color: var(--text-secondary); line-height: 1.65; word-break: break-all; }
.promo-copy-btn { margin-top: 10px; }
.promo-poster { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.promo-poster__img { width: 100%; aspect-ratio: 3 / 4; border-radius: var(--r-md); background: linear-gradient(160deg, #0B0E14, #1A1F2B 58%, #2B59FF); color: #fff; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-md); overflow: hidden; }
.promo-poster__brand { font-size: 13px; font-weight: 600; opacity: .92; }
.promo-poster__line { font-size: 22px; font-weight: 800; line-height: 1.25; }
.promo-poster__line b { color: var(--accent); }
.promo-poster__line--sm { font-size: 12.5px; font-weight: 600; opacity: .85; }
.promo-poster__qr { align-self: flex-start; width: 64px; height: 64px; border-radius: 8px; background: #fff; color: #0B0E14; display: grid; place-items: center; font-size: 10px; font-weight: 700; }

@media (max-width: 1080px) {
  .promo-grid { grid-template-columns: 1fr; }
  .promo-materials__body { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .promo-stats { grid-template-columns: 1fr; }
  .promo-qr { flex-direction: column; align-items: flex-start; }
}

/* ===================== 推广管理（#page-customer） ===================== */
.input--sm { height: 34px; padding: 0 10px; font-size: 13px; }
.modal--sm { max-width: 420px; }
.status-pill--warn { color: #C9821A; background: rgba(201,130,26,.12); }

/* 模块1：顶部统计卡片 */
.pm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: var(--sp-6); }
.pm-stat-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-5); box-shadow: var(--shadow-sm);
}
.pm-stat-card__ico {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-600);
}
.pm-stat-card__ico .ico { width: 22px; height: 22px; }
.pm-stat-card__ico--orange { background: rgba(255,122,26,.12); color: #FF7A1A; }
.pm-stat-card__ico--green { background: rgba(34,197,94,.12); color: #16A34A; }
.pm-stat-card__ico--purple { background: rgba(124,58,237,.12); color: #7C3AED; }
.pm-stat-card__body { min-width: 0; }
.pm-stat-card__label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.pm-stat-card__value { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--text); letter-spacing: -.5px; }
.pm-stat-card__foot { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }

/* 工具条（筛选 / 搜索 / 导出） */
.pm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.pm-toolbar__left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pm-toolbar__right { display: flex; align-items: center; gap: 8px; }
.pm-search { position: relative; display: inline-flex; align-items: center; }
.pm-search .ico { position: absolute; left: 10px; pointer-events: none; }
.pm-search .input { height: 34px; padding-left: 32px; min-width: 220px; }
.pm-date-range { display: inline-flex; align-items: center; gap: 8px; }
.pm-date-sep { color: var(--text-muted); font-size: 13px; }

/* 分页 */
.pm-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: var(--sp-4); }
.pm-pagination__info { font-size: 12.5px; color: var(--text-muted); }
.pm-pagination__pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pm-page-btn {
  min-width: 32px; height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.pm-page-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-600); }
.pm-page-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pm-page-btn:disabled { opacity: .45; cursor: not-allowed; }
.pm-page-ellipsis { color: var(--text-muted); padding: 0 2px; }

.pm-empty { text-align: center; color: var(--text-muted); padding: 26px 0 !important; font-size: 13px; }

/* 模块4：提现 */
.pm-withdraw-grid { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.pm-withdraw-summary {
  background: var(--brand-soft); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-5); display: flex; flex-direction: column; gap: 14px;
}
.pm-withdraw-summary__row { display: flex; flex-direction: column; gap: 4px; }
.pm-withdraw-summary__row span { font-size: 12.5px; color: var(--text-secondary); }
.pm-withdraw-summary__row strong { font-size: 20px; color: var(--brand-600); font-weight: 700; }

/* 提现弹窗表单 */
.pm-withdraw-form { display: flex; flex-direction: column; gap: 14px; }
.pm-withdraw-form__avail { font-size: 13px; color: var(--text-secondary); }
.pm-withdraw-form__avail strong { color: var(--text); font-size: 15px; }
.pm-withdraw-form__hint { font-size: 12.5px; color: var(--danger); min-height: 16px; }

@media (max-width: 1080px) {
  .pm-stats { grid-template-columns: repeat(2, 1fr); }
  .pm-withdraw-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .pm-stats { grid-template-columns: 1fr; }
  .pm-search .input { min-width: 0; width: 100%; }
}

