/* ═══════════════════════════════════════════════════════════════════
   AI 算力平台 — Design System v2.0
   Brand: 凹凸科技蓝 · Card-first · Spring Physics
   ═══════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
  /* 品牌主色：电光蓝 → 紫罗兰（去除热粉，更高级克制） */
  --primary:       #2563EB;
  --primary-hover: #1D4ED8;
  --accent:        #6D5AE6;
  --accent-2:      #06B6D4;
  --primary-light: rgba(37, 99, 235, 0.10);
  --primary-glow:  rgba(37, 99, 235, 0.18);
  --gradient-brand: linear-gradient(135deg, #2563EB 0%, #6D5AE6 58%, #06B6D4 130%);
  --gradient-border: linear-gradient(135deg, rgba(37,99,235,0.42), rgba(109,90,230,0.38) 52%, rgba(6,182,212,0.28));
  --cyan:   #06B6D4;
  --violet: #6D5AE6;
  --pink:   #A855F7;
  --amber:  #F59E0B;
  --success:       #10B981;
  --success-light: rgba(16, 185, 129, 0.12);
  --warning:       #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.12);
  --danger:        #EF4444;
  --danger-light:  rgba(239, 68, 68, 0.12);

  /* 中性色：更冷、更深、更高对比 */
  --heading:       #0B1220;
  --body:          #3B4A63;
  --muted:         #8A94A8;
  --border:        #C6D2E4;
  --bg:            #F5F7FC;
  --card:          rgba(255, 255, 255, 0.34);
  --card-border:   rgba(148, 163, 184, 0.55);
  --disabled:      #C6CFDD;

  /* 玻璃拟态（高透明 · 液态玻璃 · 明显描边） */
  --glass:         rgba(255, 255, 255, 0.30);
  --glass-border:  rgba(148, 163, 184, 0.55);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.55);

  /* 分层阴影（更柔和、更大、带轻微蓝晕） */
  --shadow-sm:     0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md:     0 2px 6px rgba(15, 23, 42, 0.05), 0 10px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg:     0 4px 12px rgba(15, 23, 42, 0.06), 0 20px 48px rgba(15, 23, 42, 0.10);
  --shadow-xl:     0 8px 24px rgba(15, 23, 42, 0.08), 0 32px 72px rgba(15, 23, 42, 0.14);
  --shadow-blue:   0 10px 24px -8px rgba(37, 99, 235, 0.45);
  --shadow-glow:   0 12px 32px -10px rgba(109, 90, 230, 0.45);

  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --radius-pill:   9999px;

  --font-sans:     "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display:  "Archivo", "Space Grotesk", -apple-system, "PingFang SC", sans-serif;
  --font-mono:     "JetBrains Mono", "SF Mono", "Monaco", "Menlo", monospace;

  /* Spring tokens (used via @property or JS) */
  --spring-default:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-light:    cubic-bezier(0.34, 1.4, 0.64, 1);
  --spring-heavy:    cubic-bezier(0.34, 1.8, 0.64, 1);
}


/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--body);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}


/* ═══════════════════════════════════════════════════════════════════
   App Shell — 左侧边栏 + 右侧主区
   ═══════════════════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 272px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  z-index: 40;
  transition: width 0.4s var(--spring-default);
}

.app-sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 18px 12px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  min-width: 0;
}
.app-brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -3px rgba(59, 130, 246, 0.5);
}
.app-brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: opacity 0.25s ease, width 0.25s ease;
}

.sidebar-collapse {
  position: absolute;
  top: 24px;
  right: -13px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  transition: color 0.3s ease, transform 0.4s var(--spring-default), background 0.3s ease;
}
.sidebar-collapse:hover { color: var(--primary); }
.sidebar-collapse i { font-size: 16px; }
.app-shell.collapsed .sidebar-collapse { transform: rotate(180deg); }

.app-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.5s var(--spring-light), background 0.5s var(--spring-light);
}
.app-nav-item i {
  font-size: 20px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.5s var(--spring-default);
}
.app-nav-item span { transition: opacity 0.25s ease; }
.app-nav-item:hover { color: var(--primary); background: rgba(59, 130, 246, 0.08); }
.app-nav-item:hover i { transform: scale(1.08); }
.app-nav-item.active {
  color: var(--primary);
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(139,92,246,0.12));
  font-weight: 600;
}
.app-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 3px;
  background: var(--gradient-brand);
}

.app-sidebar-foot {
  padding: 14px 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 侧边栏分组标题 */
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-group + .nav-group {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}
.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 14px 4px;
  white-space: nowrap;
  transition: opacity 0.25s ease, width 0.25s ease;
}

/* 侧边栏余额卡 */
.sidebar-balance {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(109, 90, 230, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.12);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.sidebar-balance:hover { border-color: rgba(37, 99, 235, 0.28); }
.sidebar-balance-icon {
  font-size: 20px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: var(--primary);
}
.sidebar-balance-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.2;
  transition: opacity 0.25s ease, width 0.25s ease;
}
.sidebar-balance-label { font-size: 11px; color: var(--muted); }
.sidebar-balance-value {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.01em;
}

/* 账户区（侧边栏底部） */
.app-account { position: relative; }
.app-account-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  color: var(--body);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.5s var(--spring-light);
}
.app-account-btn:hover { background: rgba(59, 130, 246, 0.08); }
.app-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}
.app-account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  line-height: 1.25;
  transition: opacity 0.25s ease;
}
.app-account-name { font-size: 13px; font-weight: 600; color: var(--heading); white-space: nowrap; }
.app-account-phone { font-size: 11px; color: var(--muted); white-space: nowrap; }
.app-account-caret { font-size: 12px; margin-left: auto; transition: transform 0.25s ease, opacity 0.25s ease; }
.app-account.open .app-account-caret { transform: rotate(180deg); }

.account-menu {
  position: absolute;
  left: calc(100% + 10px);
  bottom: 0;
  width: 280px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 8px;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.app-account.open .account-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.account-menu-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.account-name { font-weight: 600; color: var(--heading); font-size: 14px; }
.account-phone { font-size: 12px; color: var(--muted); margin-top: 2px; }
.account-section { padding: 8px 12px; }
.account-section + .account-section { border-top: 1px solid var(--border); }
.account-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.account-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 8px;
}
.account-input:focus { outline: none; border-color: var(--primary); }
.account-submit { width: 100%; }

/* 主区 */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.app-main .container { animation: pageEnter 0.5s var(--spring-default) both; }
.app-main.is-leaving .container { animation: pageLeave 0.17s ease forwards; }
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pageLeave {
  to { opacity: 0; transform: translateY(6px); }
}

/* 折叠态 */
.app-shell.collapsed .app-sidebar { width: 80px; }
.app-shell.collapsed .app-brand-name,
.app-shell.collapsed .app-nav-item span,
.app-shell.collapsed .app-account-meta,
.app-shell.collapsed .app-account-caret,
.app-shell.collapsed .nav-group-label,
.app-shell.collapsed .sidebar-balance-meta {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}
.app-shell.collapsed .app-nav-item,
.app-shell.collapsed .app-account-btn { justify-content: center; }
.app-shell.collapsed .app-nav-item i { margin: 0; }
.app-shell.collapsed .sidebar-balance { justify-content: center; padding-left: 0; padding-right: 0; }
.app-shell.collapsed .app-sidebar-head { padding: 20px 12px 12px; justify-content: center; }

/* 移动端抽屉 */
.sidebar-backdrop { display: none; }
.mobile-toggle { display: none; }

@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100dvh;
    width: 264px;
    transform: translateX(-100%);
    transition: transform 0.35s var(--spring-default);
    z-index: 70;
  }
  .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
  .app-shell.collapsed .app-sidebar { width: 264px; }
  .app-shell.collapsed .app-brand-name,
  .app-shell.collapsed .app-nav-item span,
  .app-shell.collapsed .app-account-meta,
  .app-shell.collapsed .app-account-caret,
  .app-shell.collapsed .nav-group-label,
  .app-shell.collapsed .sidebar-balance-meta {
    opacity: 1;
    width: auto;
    overflow: visible;
    pointer-events: auto;
  }
  .app-shell.collapsed .app-nav-item,
  .app-shell.collapsed .app-account-btn { justify-content: flex-start; }
  .app-shell.collapsed .sidebar-balance { justify-content: flex-start; padding-left: 14px; padding-right: 14px; }
  .app-shell.collapsed .app-sidebar-head { padding: 20px 18px 12px; justify-content: flex-start; }
  .sidebar-collapse { display: none; }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .app-shell.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }

  .mobile-toggle {
    display: inline-flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 50;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--heading);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
  }
  .mobile-toggle i { font-size: 20px; }
  .app-main .container { padding-top: 68px; }

  .account-menu {
    left: 8px;
    right: 8px;
    bottom: calc(100% + 8px);
    width: auto;
    transform: translateY(6px);
  }
  .app-account.open .account-menu { transform: translateY(0); }
}


/* ── Container ──────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 72px;
  flex: 1;
  position: relative;
  z-index: 1;
}



/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.6s var(--spring-light),
              box-shadow 0.6s var(--spring-light),
              background 0.6s var(--spring-light),
              color 0.6s var(--spring-light),
              border-color 0.6s var(--spring-light);
  user-select: none;
}

.btn i { font-size: 18px; transition: transform 0.5s var(--spring-default); }

.btn:hover { transform: translateY(-2px); }
.btn:hover i { transform: scale(1.1); }

.btn:active { transform: scale(0.96); }

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Primary */
.btn-primary {
  background: linear-gradient(120deg, #2563EB, #4F46E5, #6D5AE6, #2563EB);
  background-size: 220% 100%;
  background-position: 0% 0;
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
  background-position: 100% 0;
  box-shadow: var(--shadow-glow);
}

.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-lg i { font-size: 20px; }

/* Secondary */
.btn-secondary {
  background: transparent;
  color: var(--body);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* Success / Warning / Danger */
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.55); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #D97706; box-shadow: 0 8px 20px -6px rgba(245, 158, 11, 0.55); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; box-shadow: 0 8px 20px -6px rgba(239, 68, 68, 0.55); }

/* Sizes */
.btn-sm { padding: 5px 14px; font-size: 13px; }
.btn-sm i { font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}
.pagination-info { font-size: 13px; color: var(--muted); }
.pagination .btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Filter bar (call records) */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-bar .input-inline { width: auto; margin: 0; }

/* SMS code input + send button row */
.code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.code-row input { flex: 1; min-width: 0; }
.code-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Billing standard note (dashboard) */
.pricing-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  background: var(--primary-light, #eef2ff);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin: 0 0 24px;
}
.pricing-note i { color: var(--primary); font-size: 16px; }

/* API Key quick-fill bar (docs) */
.apikey-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 24px;
  background: var(--primary-light, #eef2ff);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.apikey-bar label {
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
}
.apikey-bar input {
  flex: 1;
  min-width: 220px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 13px;
}
.apikey-bar input:focus {
  outline: none;
  border-color: var(--primary);
}
.apikey-hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Call records fragment */
.cr-info,
.key-info {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
#callRecordsBody {
  transition: opacity 0.15s ease;
}
#callRecordsBody.cr-loading,
#adminModelsBody.cr-loading,
#adminUsersBody.cr-loading,
#adminRechargesBody.cr-loading {
  opacity: 0.45;
  pointer-events: none;
}
/* Fixed-length list: placeholder rows keep the table height constant */
.cr-table tbody tr,
.key-table tbody tr { height: 41px; }
.cr-empty-row td,
.key-empty-row td { color: transparent; }
.cr-empty-row:hover,
.key-empty-row:hover { background: transparent !important; }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
  box-shadow: none;
}
.btn-ghost:hover { color: var(--primary); background: var(--primary-light); }


/* ── Forms ──────────────────────────────────────────────────────── */
.form-container {
  position: relative;
  max-width: 420px;
  margin: 56px auto;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  padding: 36px 32px 32px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow-lg);
}

.form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24%;
  right: 24%;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--gradient-brand);
}

.form-container h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 700;
  color: var(--heading);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
}

.form-group input {
  width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-sans);
  color: var(--heading);
  background: rgba(255, 255, 255, 0.7);
  transition: border-color 0.6s var(--spring-light),
              box-shadow 0.6s var(--spring-light),
              background 0.6s var(--spring-light);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-group input::placeholder { color: var(--muted); }

.form-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

.form-footer a { color: var(--primary); font-weight: 500; text-decoration: none; }
.form-footer a:hover { text-decoration: underline; }


/* ── Alerts ─────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
}

.alert-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(245, 63, 63, 0.2);
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(0, 180, 42, 0.2);
}

.key-display {
  background: #F8FAFC;
  border: 1px dashed var(--primary);
  padding: 12px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--heading);
}

/* Key display + copy button row */
.key-display-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}
.key-display-row .key-display {
  flex: 1;
  margin-top: 0;
}
.key-display-row .btn {
  white-space: nowrap;
  align-self: stretch;
}


/* ── Tables ─────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.table th, .table td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  font-size: 14px;
}

.table th {
  background: rgba(15, 23, 42, 0.02);
  font-weight: 600;
  color: var(--heading);
  font-size: 13px;
  letter-spacing: 0.01em;
}

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

.table tbody tr { transition: background 0.3s ease; }
.table tbody tr:hover td { background: rgba(59, 130, 246, 0.05); }


/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
}

.badge-active { background: var(--success-light); color: var(--success); }
.badge-inactive { background: var(--danger-light); color: var(--danger); }
.badge-openai { background: rgba(22, 93, 255, 0.08); color: var(--primary); }
.badge-anthropic { background: rgba(162, 28, 175, 0.08); color: #A21CAF; }


/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow-md);
  padding: 26px;
  transition: transform 0.6s var(--spring-default),
              box-shadow 0.6s var(--spring-default),
              border-color 0.6s var(--spring-default);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-highlight), var(--shadow-lg);
  border-color: rgba(59, 130, 246, 0.18);
}


/* ── Sections ───────────────────────────────────────────────────── */
.section { margin-bottom: 40px; }
.section h3 {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--heading);
}

.inline-form { display: flex; gap: 10px; align-items: center; }

.input-inline {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--heading);
  flex: 1;
  max-width: 300px;
  background: rgba(255, 255, 255, 0.7);
  transition: border-color 0.6s var(--spring-light),
              box-shadow 0.6s var(--spring-light),
              background 0.6s var(--spring-light);
}

.input-inline:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-inline::placeholder { color: var(--muted); }


/* ── Page Title ─────────────────────────────────────────────────── */
.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  font-family: var(--font-display);
}

.page-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 32px;
}

.welcome { color: var(--muted); margin-bottom: 24px; font-size: 15px; }
.empty { color: var(--muted); font-style: italic; font-size: 14px; }


/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 64px 20px 48px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 16px;
  letter-spacing: -0.025em;
}

.hero-sub {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 20px;
  font-weight: 500;
}

.hero-desc {
  color: var(--muted);
  margin-bottom: 36px;
  line-height: 1.8;
  font-size: 16px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; }


/* ── Features Grid ──────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 48px 0;
}

.feature-card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  padding: 28px 24px;
  box-shadow: var(--glass-highlight), var(--shadow-md);
  transition: transform 0.6s var(--spring-default),
              box-shadow 0.6s var(--spring-default),
              border-color 0.6s var(--spring-default);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--glass-highlight), var(--shadow-lg);
  border-color: rgba(59, 130, 246, 0.18);
}

.feature-card h3 { color: var(--heading); margin-bottom: 8px; font-size: 18px; font-weight: 600; }
.feature-card p { color: var(--muted); font-size: 15px; line-height: 1.7; }

.feature-card .feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--gradient-brand);
  color: #fff;
  margin-bottom: 16px;
  font-size: 22px;
  box-shadow: 0 8px 18px -6px rgba(99, 102, 241, 0.55);
}


/* ── Usage Section ──────────────────────────────────────────────── */
.usage-section { margin: 48px 0; }
.usage-section h2 { margin-bottom: 16px; font-size: 30px; font-weight: 600; color: var(--heading); }


/* ── Code Blocks ────────────────────────────────────────────────── */
.code-block {
  background: #1E1E2E;
  color: #CDD6F4;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.8;
  font-family: var(--font-mono);
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.05);
}

.code-block code { font-family: var(--font-mono); }

/* In-page debugger (API docs) */
.debug-wrap { position: relative; }
.debug-wrap .code-block { padding-top: 42px; }
.debug-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.debug-btn:hover { opacity: 1; transform: translateY(-1px); }
.debug-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.debug-btn i { font-size: 14px; }
.debug-resp {
  margin: -8px 0 16px;
  padding: 16px 20px;
  background: #11131c;
  color: #CDD6F4;
  border: 1px solid rgba(255,255,255,.08);
  border-top: 2px solid var(--primary);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow-y: auto;
}
.debug-resp-error { border-top-color: var(--danger); color: #F8B4B4; }
.docs-resp-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 4px 0 8px;
}


/* ── Balance Bar ────────────────────────────────────────────────── */
.balance-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.balance-item {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  padding: 22px 24px;
  box-shadow: var(--glass-highlight), var(--shadow-md);
  flex: 1;
  min-width: 160px;
  text-align: center;
  transition: transform 0.6s var(--spring-default),
              box-shadow 0.6s var(--spring-default),
              border-color 0.6s var(--spring-default);
}

.balance-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--glass-highlight), var(--shadow-lg);
  border-color: rgba(59, 130, 246, 0.18);
}

.balance-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.balance-value { font-size: 26px; font-weight: 700; color: var(--heading); font-family: var(--font-display); letter-spacing: -0.01em; }
.balance-cost { color: var(--danger); }


/* ═══════════════════════════════════════════════════════════════════
   API Docs
   ═══════════════════════════════════════════════════════════════════ */
.docs-container h2 { margin-bottom: 8px; }
.docs-intro { color: var(--muted); margin-bottom: 36px; line-height: 1.7; font-size: 15px; }
.docs-section { margin-bottom: 40px; }

.docs-section h3 {
  color: var(--heading);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--card-border);
  font-size: 18px;
  font-weight: 600;
}

.docs-section h4 {
  color: var(--body);
  margin: 18px 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.docs-section p { margin-bottom: 10px; color: var(--body); line-height: 1.7; font-size: 15px; }

.docs-list { padding-left: 20px; color: var(--body); font-size: 15px; }
.docs-list li { margin-bottom: 8px; line-height: 1.6; }


/* ═══════════════════════════════════════════════════════════════════
   Playground 2.0
   ═══════════════════════════════════════════════════════════════════ */

.pg-config-bar {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.pg-config-row { display: flex; align-items: center; gap: 10px; }

.pg-config-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--body);
  white-space: nowrap;
}

.pg-key-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--heading);
  background: var(--card);
  transition: border-color 0.6s var(--spring-light),
              box-shadow 0.6s var(--spring-light);
}

.pg-key-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}


/* Section */
.pg-section {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.pg-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 16px;
}


/* Quick test buttons */
.pg-quick-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.pg-test-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  cursor: pointer;
  transition: transform 0.6s var(--spring-light),
              box-shadow 0.6s var(--spring-light),
              border-color 0.6s var(--spring-light),
              background 0.6s var(--spring-light);
  text-align: left;
  min-width: 180px;
}

.pg-test-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.12);
  transform: translateY(-2px);
}

.pg-test-btn:active { transform: scale(0.97); }

.pg-test-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.pg-test-btn-all {
  border-color: var(--primary);
  background: var(--primary-light);
}

.pg-btn-icon {
  font-size: 22px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}

.pg-test-btn-stream .pg-btn-icon { background: rgba(255, 125, 0, 0.08); color: var(--warning); }
.pg-test-btn-all .pg-btn-icon { background: rgba(22, 93, 255, 0.12); }

.pg-btn-text { font-size: 14px; font-weight: 600; color: var(--heading); }
.pg-btn-text small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 1px; }


/* Stress test controls */
.pg-stress-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }

.pg-stress-field { display: flex; flex-direction: column; gap: 4px; }

.pg-stress-field label { font-size: 13px; color: var(--muted); font-weight: 500; }

.pg-stress-field input, .pg-stress-field select {
  width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--heading);
  background: var(--card);
  transition: border-color 0.6s var(--spring-light),
              box-shadow 0.6s var(--spring-light);
}

.pg-stress-field select { width: auto; cursor: pointer; }

.pg-stress-field input:focus, .pg-stress-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}


/* Progress bar */
.pg-progress { margin-top: 16px; display: flex; align-items: center; gap: 12px; }

.pg-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--card-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.pg-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 0.3s var(--spring-light);
  width: 0;
}

.pg-progress-text { font-size: 13px; font-weight: 600; color: var(--primary); white-space: nowrap; min-width: 48px; text-align: right; }


/* Summary cards */
.pg-summary-cards { display: flex; gap: 12px; flex-wrap: wrap; }

.pg-card {
  flex: 1;
  min-width: 100px;
  background: #F8FAFC;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-align: center;
  border: 1px solid var(--card-border);
}

.pg-card-success { background: var(--success-light); border-color: rgba(0, 180, 42, 0.2); }
.pg-card-fail { background: var(--danger-light); border-color: rgba(245, 63, 63, 0.2); }

.pg-card-val { display: block; font-size: 22px; font-weight: 600; color: var(--heading); }
.pg-card-success .pg-card-val { color: var(--success); }
.pg-card-fail .pg-card-val { color: var(--danger); }
.pg-card-lbl { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 500; }


/* Model stats */
.pg-model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

.pg-model-card {
  background: #F8FAFC;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  border-left: 3px solid var(--primary);
  border: 1px solid var(--card-border);
}

.pg-model-name { font-weight: 600; font-size: 14px; color: var(--heading); margin-bottom: 10px; display: flex; justify-content: space-between; }
.pg-model-total { font-weight: 400; font-size: 12px; color: var(--muted); }

.pg-model-bars { display: flex; flex-direction: column; gap: 4px; }

.pg-model-bar-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

.pg-bar-val { min-width: 28px; text-align: right; font-weight: 500; font-size: 12px; }
.pg-c-green { color: var(--success); }
.pg-c-red { color: var(--danger); }

.pg-bar { height: 5px; border-radius: var(--radius-pill); min-width: 2px; transition: width 0.6s var(--spring-default); }
.pg-bar-success { background: var(--success); }
.pg-bar-fail { background: var(--danger); }


/* Log table */
.pg-log-table-wrap { max-height: 520px; overflow-y: auto; border-radius: var(--radius-md); border: 1px solid var(--card-border); }

.pg-log-table { font-size: 13px; }
.pg-log-table th { position: sticky; top: 0; z-index: 1; }
.pg-log-table td { font-size: 13px; }

.pg-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
}

.pg-mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
}

.pg-mode-stream { background: rgba(255, 125, 0, 0.08); color: var(--warning); }
.pg-mode-nonstream { background: rgba(22, 93, 255, 0.06); color: var(--primary); }

.pg-summary-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Stream Output */
.pg-stream-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--warning);
  background: rgba(255, 125, 0, 0.08);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  margin-left: 6px;
}

.pg-stream-box {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  min-height: 80px;
  max-height: 360px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.7;
  color: var(--body);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-sans);
}

.pg-stream-placeholder { color: var(--muted); }

.pg-stream-cursor {
  display: inline-block;
  width: 2px;
  height: 18px;
  background: var(--primary);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: pgCursorBlink 0.8s steps(1) infinite;
}

@keyframes pgCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.pg-stream-meta {
  margin-top: 10px;
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.pg-stream-meta strong { color: var(--heading); }


/* ── Card Entry Animation ───────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeSlideUp 0.6s var(--spring-default) both;
}

.fade-up-1 { animation-delay: 0s; }
.fade-up-2 { animation-delay: 0.06s; }
.fade-up-3 { animation-delay: 0.12s; }
.fade-up-4 { animation-delay: 0.18s; }


/* ═══════════════════════════════════════════════════════════════════
   Layout Primitives
   ═══════════════════════════════════════════════════════════════════ */

/* ── Two-Column Split ──────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.split-wide {
  grid-template-columns: 1.1fr 0.9fr;
}

.split-code {
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: flex-start;
}

@media (max-width: 768px) {
  .split, .split-wide, .split-code {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}


/* ── Sidebar Layout ────────────────────────────────────────────── */
.layout-sidebar {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}

.layout-sidebar-right {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  align-items: start;
}

/* Let grid children shrink below content size so long code lines (e.g. image
   URLs) scroll inside .code-block instead of blowing out the page width. */
.layout-sidebar > *,
.layout-sidebar-right > * {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-nav {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  transition: background 0.6s var(--spring-light),
              color 0.6s var(--spring-light);
}

.sidebar-nav a + a { border-top: 1px solid var(--card-border); }

.sidebar-nav a:hover { background: var(--primary-light); color: var(--primary); }

.sidebar-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.sidebar-nav a i { font-size: 18px; width: 20px; text-align: center; }

/* Compact stats sidebar card */
.sidebar-card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow-md);
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-card h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .layout-sidebar, .layout-sidebar-right {
    grid-template-columns: 1fr;
  }
  .sidebar { position: static; }
}


/* ── Tab System ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 2px solid var(--card-border);
  margin-bottom: 28px;
}

.tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.6s var(--spring-light),
              border-color 0.6s var(--spring-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab i { font-size: 18px; }

.tab:hover { color: var(--primary); }

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; }


/* ── Bento Grid ────────────────────────────────────────────────── */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 48px 0;
}

.bento-card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow-md);
  padding: 30px 26px;
  transition: transform 0.6s var(--spring-default),
              box-shadow 0.6s var(--spring-default),
              border-color 0.6s var(--spring-default);
}

.bento-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--glass-highlight), var(--shadow-lg);
  border-color: rgba(59, 130, 246, 0.18);
}

.bento-card h3 { color: var(--heading); margin-bottom: 8px; font-size: 18px; font-weight: 600; }
.bento-card p { color: var(--muted); font-size: 15px; line-height: 1.7; }

.bento-card .bento-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--gradient-brand);
  color: #fff;
  margin-bottom: 16px;
  font-size: 22px;
  box-shadow: 0 8px 18px -6px rgba(99, 102, 241, 0.55);
}

/* Bento card sizes */
.bento-card.span-2 { grid-column: span 2; }
.bento-card.span-2r { grid-column: span 2; grid-row: span 2; }
.bento-card.span-4 { grid-column: span 4; }

/* Glass variant */
.bento-card.glass {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
}

/* Code card */
.bento-code {
  background: #1E1E2E;
  color: #CDD6F4;
  border: 1px solid rgba(255,255,255,.05);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
}

.bento-code h3 { color: #CDD6F4; }

@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-card.span-2, .bento-card.span-2r, .bento-card.span-4 { grid-column: span 2; }
}

@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .bento-card.span-2, .bento-card.span-2r, .bento-card.span-4 { grid-column: span 1; }
}


/* ── Hero Visual ────────────────────────────────────────────────── */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.globe-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.globe-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(22, 93, 255, 0.08), transparent 60%);
  pointer-events: none;
}

.globe-card .globe-icon {
  font-size: 80px;
  color: var(--primary);
  margin-bottom: 16px;
  display: block;
}

.globe-stat {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.globe-stat-item {
  text-align: center;
}

.globe-stat-val {
  font-size: 22px;
  font-weight: 600;
  color: var(--heading);
  display: block;
}

.globe-stat-lbl {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}


/* ── Two-Column Main Layout ────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
  margin-top: 28px;
}

.main-col {
  min-width: 0;
}

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


/* ── Compact Stat Strip ────────────────────────────────────────── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

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

@media (max-width: 480px) {
  .stat-strip { grid-template-columns: 1fr; }
}


/* ── Responsive Container ───────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 20px 16px 48px; }
  .page-title { font-size: 24px; }
  .hero h1 { font-size: 28px; }
}


/* ── Drag-and-Drop Model Priority ───────────────────────────────── */
.drag-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drag-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: grab;
  transition: background 0.6s var(--spring-light),
              box-shadow 0.6s var(--spring-light);
  user-select: none;
}

.drag-item:hover { background: var(--primary-light); }

.drag-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
  box-shadow: var(--shadow-md);
}

.drag-handle {
  font-size: 18px;
  color: var(--disabled);
  flex-shrink: 0;
}

.drag-item:hover .drag-handle { color: var(--primary); }

.drag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.drag-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--heading);
}

.drag-item.drag-disabled .drag-label { color: var(--disabled); text-decoration: line-through; }
.drag-item.drag-disabled .drag-dot { opacity: 0.3; }

/* Toggle switch */
.drag-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  margin-left: auto;
  flex-shrink: 0;
  cursor: pointer;
}

.drag-toggle input { display: none; }

.drag-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--disabled);
  border-radius: var(--radius-pill);
  transition: background 0.6s var(--spring-light);
}

.drag-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.6s var(--spring-light);
}

.drag-toggle input:checked + .drag-toggle-slider { background: var(--primary); }
.drag-toggle input:checked + .drag-toggle-slider::after { transform: translateX(16px); }

/* ── Custom Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-dialog {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px 28px 20px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  animation: modalSlideUp 0.2s var(--spring-light);
}
@keyframes modalSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-dialog h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-dialog p {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--body);
  line-height: 1.6;
  white-space: pre-line;
}
.modal-dialog .modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Drag & Drop Priority Lists ─────────────────────────────────── */
.sortable-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.sortable-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  transition: background .15s, box-shadow .15s;
  user-select: none;
}

.sortable-item:last-child {
  border-bottom: none;
}

.sortable-item:hover {
  background: var(--primary-light);
}

.sortable-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.sortable-item.drag-over {
  background: var(--primary-light);
  box-shadow: inset 0 2px 0 var(--primary);
}

.drag-handle {
  font-size: 16px;
  color: var(--disabled);
  letter-spacing: -2px;
  cursor: grab;
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════
   科技光晕 · 玻璃拟态 — Ambient & Motion
   ═══════════════════════════════════════════════════════════════════ */

/* ── 环境光晕背景层 ─────────────────────────────────────────────── */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}
.bg-orb-1 {
  width: 560px; height: 560px;
  top: -160px; left: -120px;
  background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.40), transparent 68%);
  animation: orbFloat 20s ease-in-out infinite;
}
.bg-orb-2 {
  width: 500px; height: 500px;
  top: 4%; right: -160px;
  background: radial-gradient(circle at 50% 50%, rgba(109, 90, 230, 0.36), transparent 68%);
  animation: orbFloat 26s ease-in-out infinite reverse;
}
.bg-orb-3 {
  width: 460px; height: 460px;
  bottom: -180px; left: 30%;
  background: radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.30), transparent 68%);
  animation: orbFloat 30s ease-in-out infinite;
}
.bg-orb-4 {
  width: 380px; height: 380px;
  top: 42%; left: 55%;
  background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.22), transparent 68%);
  animation: orbFloat 34s ease-in-out infinite reverse;
}

/* ── 科技网格背景层（极淡网格 + 顶部极光，营造前沿质感）────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 78%);
}
.bg-grid::before {
  content: '';
  position: absolute;
  inset: -20% -10% 0;
  background:
    radial-gradient(ellipse 60% 42% at 22% 6%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(ellipse 50% 38% at 82% 4%, rgba(109, 90, 230, 0.08), transparent 60%),
    radial-gradient(ellipse 46% 34% at 58% 0%, rgba(6, 182, 212, 0.06), transparent 60%);
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(48px, 36px) scale(1.08); }
  66%      { transform: translate(-36px, 24px) scale(0.94); }
}

/* ── 渐变文字 ──────────────────────────────────────────────────── */
.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.gradient-text-animated {
  background: linear-gradient(135deg, #2563EB, #6D5AE6, #06B6D4, #2563EB);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientShift 8s ease infinite;
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── 滚动渐入（.reveal，由 IntersectionObserver 驱动）────────────── */
.reveal { transition: opacity 0.75s var(--spring-default), transform 0.75s var(--spring-default); }
.reveal.js-reveal { opacity: 0; transform: translateY(22px); }
.reveal.js-reveal.is-visible { opacity: 1; transform: none; }
.reveal-1 { transition-delay: 0.05s; }
.reveal-2 { transition-delay: 0.12s; }
.reveal-3 { transition-delay: 0.19s; }
.reveal-4 { transition-delay: 0.26s; }
.reveal-5 { transition-delay: 0.33s; }
.reveal-6 { transition-delay: 0.40s; }

/* ── Hero（首页）────────────────────────────────────────────────── */
.hero-new {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  min-height: calc(100vh - 104px);
  padding: 0;
}
.hero-copy { min-width: 0; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}
.hero-badge i { font-size: 15px; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.2vw, 58px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--heading);
  margin-bottom: 24px;
}
.hero-desc {
  font-size: 18px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 34px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 0; }

/* 终端 Mock 卡片 */
.hero-visual { position: relative; min-width: 0; }
.terminal-card {
  position: relative;
  background: rgba(17, 24, 39, 0.88);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 70px -18px rgba(15, 23, 42, 0.5), var(--shadow-glow);
  overflow: hidden;
}
.terminal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.28), transparent 55%);
  pointer-events: none;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.terminal-bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red    { background: #FF5F57; }
.dot-yellow { background: #FEBC2E; }
.dot-green  { background: #28C840; }
.terminal-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}
.terminal-code {
  margin: 0;
  padding: 22px 24px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.9;
  color: #E2E8F0;
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal-code .t-cmd { color: #7DD3FC; }
.terminal-code .t-flag { color: #C4B5FD; }
.terminal-code .t-str { color: #A7F3D0; }
.terminal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 12px;
}
.terminal-status { color: #34D399; display: inline-flex; align-items: center; gap: 6px; }
.terminal-time { color: rgba(255, 255, 255, 0.4); }

@media (max-width: 900px) {
  .hero-new { grid-template-columns: 1fr; gap: 44px; padding: 48px 0 64px; min-height: 0; }
  .hero-title { font-size: clamp(32px, 8vw, 44px); }
}

/* ── 减少动效偏好 ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bg-orbs span,
  .gradient-text-animated,
  .btn-primary { animation: none !important; background-position: 0 0 !important; }
  .reveal.js-reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* ── 表单品牌标识（登录/注册/找回）────────────────────────────────── */
.form-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.form-brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.45);
}
.form-brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  color: var(--heading);
  letter-spacing: -0.02em;
}


/* ═══════════════════════════════════════════════════════════════════
   高端浅色 · 前沿科技 (Refined Light v3)
   克制配色 · 冷调中性 · 分层阴影 · 微光强调
   ═══════════════════════════════════════════════════════════════════ */

/* 卡片：实底白 + 极淡冷灰描边 + 柔和分层阴影 */
.card,
.feature-card,
.bento-card,
.balance-item,
.sidebar-card,
.form-container {
  border: 1px solid var(--card-border);
  background: #ffffff;
  box-shadow: var(--glass-highlight), var(--shadow-lg);
}

/* 深色代码卡保持深色（科技暗面，形成对比） */
.bento-code {
  background: #141A2E;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--shadow-lg);
}
.bento-code h3 { color: #E6EAF5; }

/* 展示卡：无顶部强调线 */

/* 展示卡 hover：轻微上浮 + 蓝紫微光 */
.feature-card:hover,
.bento-card:not(.bento-code):hover,
.balance-item:hover {
  transform: translateY(-5px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: var(--glass-highlight), var(--shadow-glow);
}

/* 彩色图标方块（统一蓝→紫→青色系，去除热粉） */
.tile-blue   { background: linear-gradient(135deg, #2563EB, #6D5AE6) !important; }
.tile-violet { background: linear-gradient(135deg, #6D5AE6, #06B6D4) !important; }
.tile-cyan   { background: linear-gradient(135deg, #06B6D4, #2563EB) !important; }
.tile-pink   { background: linear-gradient(135deg, #A855F7, #6D5AE6) !important; }
.tile-green  { background: linear-gradient(135deg, #10B981, #06B6D4) !important; }
.tile-amber  { background: linear-gradient(135deg, #F59E0B, #F97316) !important; }

/* 主按钮：蓝→紫流光，克制发光 */
.btn-primary {
  background: linear-gradient(120deg, #2563EB, #4F46E5, #6D5AE6, #2563EB);
  background-size: 240% 100%;
  box-shadow: 0 10px 26px -10px rgba(37, 99, 235, 0.55);
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 14px 34px -10px rgba(109, 90, 230, 0.6); }

/* 徽章更醒目 */
.badge { font-weight: 600; }

/* Hero 徽章：品牌渐变描边（背景与全局一致，仅强调徽章） */
.hero-badge {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(109, 90, 230, 0.12));
  border-color: rgba(109, 90, 230, 0.24);
  color: var(--primary);
}

/* 终端卡旁漂浮徽章 */
.hero-visual { position: relative; }
.float-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background: #fff;
  border: 1px solid rgba(109, 90, 230, 0.16);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
  animation: floatBadge 6s ease-in-out infinite;
  z-index: 2;
}
.float-badge i { font-size: 18px; }
.float-badge.fb-1 { top: -18px; left: -26px; }
.float-badge.fb-2 { bottom: -16px; right: -18px; animation-delay: 1.5s; }
.float-badge .fb-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}
@media (max-width: 900px) {
  .float-badge.fb-1 { left: -6px; }
  .float-badge.fb-2 { right: -6px; }
}


/* ═══════════════════════════════════════════════════════════════════
   高端浅色 · 骨架层 (Refined Light v3 · Skeleton)
   ═══════════════════════════════════════════════════════════════════ */

/* 侧边栏：品牌渐变 + 细描边 */
.app-sidebar {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, rgba(109, 90, 230, 0.05) 45%, rgba(6, 182, 212, 0.07) 100%),
    rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-right: 1px solid var(--border);
}

/* 表格与输入控件边框统一冷灰 */
.table { background: #fff; border: 1px solid var(--card-border); }
.form-group input,
.input-inline,
.account-input,
.apikey-bar input,
.pg-key-input {
  border-color: var(--border);
}

/* 主按钮与图标磁贴：圆角矩形 */
.btn { border-radius: 10px; }
.bento-icon, .feature-icon { border-radius: 10px; }

/* 环境光晕收敛 */
.bg-orbs span { opacity: 0.32; }

/* 布局：大气留白，层级清晰 */
.features { gap: 20px; }
.section { margin-bottom: 36px; }


/* ═══════════════════════════════════════════════════════════════════
   一体化工作台 (Unified Workspace Surface)
   消灭「离散卡片」——单一连续表面 + 视觉焦点层级
   ═══════════════════════════════════════════════════════════════════ */

/* 页面头：标题 + 副标题 + 右侧元信息，一体化 */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head .page-title { margin-bottom: 2px; }
.page-head .page-subtitle { margin-bottom: 0; }
.page-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}

/* 指标带：单块一体化表面，指标间用细分隔线（取代离散卡片） */
.metric-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 24px;
}
.metric-band.cols-3 { grid-template-columns: repeat(3, 1fr); }
.metric {
  padding: 24px 26px;
  position: relative;
  min-width: 0;
}
.metric + .metric { border-left: 1px solid var(--border); }
.metric-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.metric-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--heading);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.metric-value .metric-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 5px;
  letter-spacing: 0;
}
/* 焦点指标：淡渐变底 + 渐变发光数值 */
.metric-focus {
  background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(109,90,230,0.05));
}
.metric-focus .metric-value {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* 一体化内容面板：单块表面，内部用细分隔线分层 */
.surface {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.surface-section { padding: 24px; }
.surface-section + .surface-section { border-top: 1px solid var(--border); }

/* 分区标题：图标磁贴 + 标题 + 副标题 */
.surface-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.surface-head-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(109,90,230,0.14));
  color: var(--primary);
  font-size: 18px;
}
.surface-head-icon img { width: 20px; height: 20px; display: block; }
.surface-head h3 { font-size: 16px; font-weight: 600; color: var(--heading); margin: 0; line-height: 1.3; }
.surface-head .surface-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 面板内表格去外框，融入同一表面 */
.surface .table {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* 响应式：指标带折行时修正细分隔线 */
@media (max-width: 768px) {
  .metric-band { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: none; border-top: 1px solid var(--border); }
  .metric:nth-child(4) { border-top: 1px solid var(--border); }
}
@media (max-width: 480px) {
  .metric-band { grid-template-columns: 1fr; }
  .metric + .metric { border-left: none; border-top: 1px solid var(--border); }
}

/* ═══════════════════════════════════════════════════════════════════
   Dashboard 单屏工作台（固定视口，无页面滚动条）
   ═══════════════════════════════════════════════════════════════════ */
body.page-dashboard { overflow: hidden; }
body.page-dashboard .app-shell { height: 100vh; min-height: 0; }
body.page-dashboard .app-main { height: 100vh; overflow: hidden; }
body.page-dashboard .container {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 16px;
}
body.page-dashboard .container > .page-head,
body.page-dashboard .container > .metric-band,
body.page-dashboard .container > .alert {
  flex-shrink: 0;
}

.dash-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  margin-top: 4px;
}


/* ═══════════════════════════════════════════════════════════════════
   液态玻璃 · 高透明度 + 明显描边 (Liquid Glass v4)
   ═══════════════════════════════════════════════════════════════════ */

/* 所有卡片/面板：高透明液态玻璃 + 明显白描边 + 内高光 */
.surface,
.metric-band,
.card,
.feature-card,
.bento-card:not(.bento-code),
.balance-item,
.sidebar-card,
.form-container,
.account-menu,
.modal-dialog,
.sidebar-nav,
.pg-config-bar,
.pg-section,
.pg-card,
.pg-model-card,
.pg-log-table-wrap,
.pg-stream-box,
.pg-test-btn,
.pricing-note,
.apikey-bar,
.hero-badge {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow-md);
}

/* 状态卡保留语义色，但改为半透明玻璃 */
.pg-card-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}
.pg-card-fail {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

/* 主测试按钮保留品牌蓝底 */
.pg-test-btn-all {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* 按钮/输入：半透明玻璃 + 明显描边 */
.form-group input,
.input-inline,
.account-input,
.apikey-bar input,
.pg-key-input,
.pg-stress-field input,
.pg-stress-field select {
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
}
.form-group input:focus,
.input-inline:focus,
.account-input:focus,
.pg-key-input:focus,
.pg-stress-field input:focus,
.pg-stress-field select:focus {
  background: rgba(255, 255, 255, 0.60);
  border-color: var(--primary);
}

/* 表格：玻璃融入，去掉实底 */
.table {
  background: rgba(255, 255, 255, 0.26);
  border: 1px solid var(--glass-border);
}
.surface .table {
  background: transparent;
  border: none;
  box-shadow: none;
}
.table th { background: rgba(255, 255, 255, 0.22); }

/* 拖拽列表项：半透明白底（保持列表可读） */
.sortable-item { background: rgba(255, 255, 255, 0.30); }

/* 明显内部分隔线 */
.surface-section + .surface-section,
.metric + .metric,
.account-menu-header,
.account-section + .account-section,
.sidebar-nav a + a {
  border-color: rgba(15, 23, 42, 0.10);
}

/* 终端卡保留深色玻璃，描边更明显 */
.terminal-card {
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 侧边栏：更高透明液态玻璃 + 明显描边 */
.app-sidebar {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.10) 0%, rgba(109, 90, 230, 0.06) 45%, rgba(6, 182, 212, 0.09) 100%),
    rgba(255, 255, 255, 0.5);
  border-right: 1px solid var(--glass-border);
}

/* 所有按钮：明显描边 */
.btn { border: 1px solid var(--border); }
.btn-primary { border-color: rgba(37, 99, 235, 0.55); }
.btn-success { border-color: rgba(5, 150, 105, 0.55); }
.btn-warning { border-color: rgba(217, 119, 6, 0.55); }
.btn-danger { border-color: rgba(220, 38, 38, 0.55); }
.btn-ghost { border: 1px solid var(--border); }

/* 徽章：明显描边 */
.badge { border: 1px solid rgba(148, 163, 184, 0.5); }
.badge-active { border-color: rgba(16, 185, 129, 0.5); }
.badge-inactive { border-color: rgba(239, 68, 68, 0.5); }
.badge-openai { border-color: rgba(37, 99, 235, 0.45); }
.badge-anthropic { border-color: rgba(162, 28, 175, 0.45); }

/* 提示条：明显描边 */
.alert-error { border-color: rgba(239, 68, 68, 0.5); }
.alert-success { border-color: rgba(16, 185, 129, 0.5); }

/* 彩色图标磁贴：亮白描边 */
.bento-icon,
.feature-icon {
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 18px -6px rgba(99, 102, 241, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
/* 浅色图标磁贴：中性描边 */
.surface-head-icon { border: 1px solid rgba(148, 163, 184, 0.5); }

/* 表格单元格分隔更明显 */
.table th, .table td { border-bottom: 1px solid rgba(148, 163, 184, 0.35); }
.table tr:last-child td { border-bottom: none; }

/* 终端卡：描边更明显 */
.terminal-card { border: 1px solid rgba(255, 255, 255, 0.28); }

/* 页面头：玻璃容器包装（标题不再光秃秃） */
.page-head {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow-md);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  align-items: center;
}

/* 页面标题：图标磁贴 + 文字一体化包装 */
.page-title {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.page-title i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 22px;
  font-style: normal;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 18px -6px rgba(99, 102, 241, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ── 左侧边栏元素：无边框，减轻透明度（更实） ── */
.app-nav-item {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.40);
}
.app-nav-item:hover { background: rgba(255, 255, 255, 0.60); }
.app-nav-item.active {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(139, 92, 246, 0.24));
}

.app-account-btn {
  border: 1px solid transparent;
  background: #ffffff;
}
.app-account-btn:hover { background: #f1f5f9; }

.app-avatar { border: 1px solid transparent; }

.sidebar-balance { border-color: transparent; background: rgba(255, 255, 255, 0.40); }

.sidebar-collapse { border-color: transparent; }

/* ── 右侧区域元素：半透明液态玻璃 ── */
.float-badge {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--shadow-lg);
}

.key-display {
  background: rgba(255, 255, 255, 0.30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.alert {
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

/* ── 左侧文字加深 + 品牌名蓝色渐变 ── */
.app-brand-name {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.app-nav-item { color: var(--heading); }
.app-account-phone { color: var(--body); }
.sidebar-balance-label { color: var(--body); }
.nav-group-label { color: #5B6472; }

/* ── 左侧元素拉高 ── */
.app-nav-item { padding: 16px 14px; }
.app-account-btn { padding: 15px 14px; }
.sidebar-balance { padding: 14px 14px; }

/* ── 调用趋势翻转卡片 ── */
.flip-card {
  perspective: 1200px;
  height: 200px;
  cursor: pointer;
  margin-bottom: 16px;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.15, 0.2, 1);
}
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }

.flip-card-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--glass-highlight), var(--shadow-md);
  overflow: hidden;
}

.flip-card-front {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
}
.flip-card-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 22px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 18px -6px rgba(99, 102, 241, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.flip-card-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.flip-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
.flip-card-hint {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.flip-card-hint i { font-size: 13px; }
.flip-card-total {
  margin-left: auto;
  font-size: 22px;
  font-weight: 700;
  color: var(--heading);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.flip-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 16px 18px 12px;
}
.flip-card-back-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.trend-chart-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
}
.trend-chart {
  display: block;
  width: 100%;
  height: 100%;
}
.trend-tooltip {
  position: absolute;
  display: none;
  pointer-events: none;
  transform: translate(-50%, -120%);
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}
.trend-grid {
  stroke: rgba(148, 163, 184, 0.3);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}
.trend-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ── 登录/注册表单优化 ── */
.form-brand span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.form-container h2 { margin-bottom: 4px; }
.form-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 22px;
}

.form-input {
  position: relative;
  display: flex;
  align-items: center;
}
.form-input > i {
  position: absolute;
  left: 14px;
  font-size: 18px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.3s ease;
}
.form-input > input {
  padding-left: 42px;
}
.form-input:focus-within > i { color: var(--primary); }

.form-footer-sep { margin: 0 8px; color: var(--border); }

/* 登录/注册卡片：透明液态玻璃 */
.form-container {
  background:
    radial-gradient(130% 100% at 0% 0%, rgba(37, 99, 235, 0.14) 0%, transparent 48%),
    radial-gradient(130% 100% at 100% 100%, rgba(6, 182, 212, 0.12) 0%, transparent 48%),
    rgba(255, 255, 255, 0.30);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
}

/* 管理后台：API 调用记录总消费额摘要 */
.admin-log-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.30);
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.admin-log-summary strong { font-weight: 600; }
.admin-log-summary-divider {
  width: 1px;
  height: 14px;
  background: rgba(148, 163, 184, 0.55);
}
.admin-log-cost {
  color: var(--primary);
  font-weight: 700;
}
