/* =========================================================
   AIGateway 设计系统
   风格基准：浅色 · 蓝 #3b82f6 · 圆润卡片 · 胶囊按钮
   参考用户站点（pan/id/mbaozi） + AI 网关布局
   ========================================================= */

/* ---------- 设计令牌 ---------- */
:root {
  /* 主色（蓝，参考 pan.mbaozi.cn） */
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #dbeafe;
  --primary-bg: #eff6ff;
  --primary-glow: rgba(59, 130, 246, 0.15);
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);

  /* 语义色 */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #0ea5e9;

  /* 中性色（slate 系） */
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* 阴影阶梯 */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.10);
  --shadow-blue: 0 4px 20px rgba(59, 130, 246, 0.18);

  /* 圆角阶梯 */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* 过渡 */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  /* 字体 */
  --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Noto Sans SC',
               'Microsoft YaHei', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'Fira Mono', 'Consolas', 'JetBrains Mono', monospace;
}

/* ---------- Reset / 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }

a { color: var(--primary); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; color: var(--text); }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

/* 自定义滚动条（圆角，蓝调） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(59, 130, 246, 0.5); }

/* 顶部加载进度条 */
.top-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 9999;
  background: var(--primary-gradient);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s ease;
}
.top-progress.active { transform: scaleX(1); }

/* ---------- 布局容器 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶栏 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex; align-items: center; gap: 24px;
  height: 60px; position: relative;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; color: var(--text);
}
.brand-dot {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: var(--shadow-blue);
}
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link {
  padding: 7px 14px; border-radius: var(--radius-full);
  color: var(--text-secondary); font-weight: 500;
  transition: var(--transition-fast);
}
.nav-link:hover { background: var(--primary-bg); color: var(--primary-dark); }
.nav-link.active { background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 12px; }

/* 汉堡菜单按钮（移动端） */
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 11px;
  border-radius: 8px;
}
.hamburger span {
  display: block; height: 2px; width: 100%;
  background: var(--text-secondary); border-radius: 2px;
  transition: var(--transition-fast);
}
.hamburger:hover { background: var(--surface-2); }

/* 用户区 */
.user-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px; border-radius: var(--radius-full);
  transition: var(--transition-fast);
}
.user-trigger:hover { background: var(--surface-2); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.user-name { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 160px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 200; display: none;
}
.dropdown.open .dropdown-menu { display: block; animation: fadeIn 0.15s ease; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 13px;
  transition: var(--transition-fast);
}
.dropdown-item:hover { background: var(--primary-bg); color: var(--primary-dark); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 20px; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 500;
  transition: var(--transition);
  white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary-gradient); color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(59, 130, 246, 0.25); color: #fff; }
.btn-secondary {
  background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-bg); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-block { width: 100%; }

/* 图标按钮（通用；管理后台 admin.css 的 .row-actions .icon-btn 在此基础上细化） */
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 14px;
  background: var(--surface); border: 1px solid var(--border);
  transition: var(--transition-fast); flex-shrink: 0;
  line-height: 1;
}
.icon-btn:hover { background: var(--primary-bg); color: var(--primary-dark); border-color: var(--primary-light); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bg); }
.icon-btn:disabled,
.icon-btn.disabled { opacity: 0.45; cursor: not-allowed; background: var(--surface-2); }
.icon-btn:disabled:hover,
.icon-btn.disabled:hover { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }

/* 表格操作列按钮组 */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; white-space: nowrap; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.card-pad { padding: 24px; }

/* 统计卡 */
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-card .stat-trend { font-size: 12px; }
.stat-card .stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* 模型卡 */
.model-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.model-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.model-card .model-head { display: flex; align-items: center; gap: 12px; }

/* 模型卡提示浮层（data-tip hover 显示，base.html 注入）：品牌蓝渐变 + 指向卡片的箭头 */
.model-tip {
  --tip-border: var(--primary-dark);
  --tip-edge-top: var(--primary);      /* 渐变顶部色（tip-down 箭头朝上用）*/
  --tip-edge-bottom: #6366f1;          /* 渐变底部色（tip-up 箭头朝下用）*/
  position: fixed;
  z-index: 1000;
  max-width: 320px;
  min-width: 180px;
  padding: 10px 14px;
  background: var(--primary-gradient); /* 与登录按钮同款品牌蓝渐变 */
  border: 1px solid var(--tip-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.35);
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
  display: none;
}
.model-tip.show { opacity: 1; transform: scale(1); }

/* 模型名标题行 */
.model-tip-head {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 14px; color: #fff;
  margin-bottom: 4px;
}
.model-tip-icon { font-size: 13px; }
.model-tip-body { white-space: pre-line; color: #f0f7ff; }

/* 指向卡片的箭头（tip-up=在卡片上方箭头朝下；tip-down=在下方箭头朝上） */
.model-tip::before,
.model-tip::after {
  content: '';
  position: absolute;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border: 8px solid transparent;
}
.model-tip.tip-up::before { border-top-color: var(--tip-border); top: 100%; }
.model-tip.tip-up::after  { border-top-color: var(--tip-edge-bottom); top: 100%; margin-top: -1px; }
.model-tip.tip-down::before { border-bottom-color: var(--tip-border); bottom: 100%; }
.model-tip.tip-down::after  { border-bottom-color: var(--tip-edge-top); bottom: 100%; margin-bottom: -1px; }
.model-avatar {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700; flex-shrink: 0;
  overflow: hidden; background: var(--surface-2);
}
.model-avatar-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.model-name { font-weight: 600; font-size: 15px; }
.model-tag {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  display: inline-block;
  font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: var(--radius-full);
}
.model-protocols { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.protocol-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600; padding: 1px 8px;
  border-radius: var(--radius-full);
}
.proto-openai { background: var(--primary-bg); color: var(--primary-dark); }
.proto-anthropic { background: #fef3c7; color: #b45309; }
.tag-red { background: var(--danger-bg); color: var(--danger); }
.tag-yellow { background: var(--warning-bg); color: #b45309; }
.tag-green { background: var(--success-bg); color: var(--success); }
.model-provider { font-size: 12px; color: var(--text-muted); }
.model-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.pricing-tag {
  flex-shrink: 0; align-self: flex-end;
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 2px 10px; border-radius: var(--radius-full);
  background: var(--primary-bg); color: var(--primary-dark);
}
.pricing-tag.free { background: var(--success-bg); color: var(--success); }
.pricing-tag.per-call { background: var(--warning-bg); color: #b45309; }
.model-price { margin-top: auto; display: flex; align-items: flex-end; justify-content: flex-end; }
.model-price .price { font-weight: 700; color: var(--primary-dark); font-size: 13px; }
.model-price .price em { font-style: normal; font-weight: 500; font-size: 11px; color: var(--text-muted); }
.model-price .price-free { color: var(--success); }
.model-price .price-block { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.model-price .price-sub { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.model-price .free-badge, .free-badge {
  position: absolute; top: 12px; right: 12px; z-index: 1;
}
.model-price .price-rows { display: flex; flex-direction: column; gap: 0; align-items: flex-end; }
.model-price .price-row {
  display: flex; align-items: baseline; gap: 4px;
  font-size: 11px; color: var(--text-secondary); line-height: 1.25;
}
.model-price .price-row span { width: 26px; flex-shrink: 0; color: var(--text-muted); }
.model-price .price-row b { font-weight: 700; color: var(--text); font-size: 12px; }
.model-price .price-row em { font-style: normal; font-size: 10px; color: var(--text-muted); }
/* 价格对齐列（类型名 / 数值 纵向对齐） */
.model-price .price-cols { display: flex; gap: 10px; justify-content: flex-end; }
.model-price .price-col { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.model-price .pc-label { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.model-price .pc-val { font-weight: 600; color: var(--text-secondary); font-size: 11px; line-height: 1.3; white-space: nowrap; }
.model-price .price-cols-3 .price-col { flex: 1; }
.model-price .price-cols-2 .price-col { flex: 1; }
.model-price .price-cols-1 .price-col { flex: none; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500;
}
.badge-blue { background: var(--primary-bg); color: var(--primary-dark); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-amber { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-gray { background: var(--surface-2); color: var(--text-muted); }

/* Chips 标签 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px;
  transition: var(--transition-fast); cursor: pointer;
}
.chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 表单 ---------- */
.input {
  width: 100%; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  transition: var(--transition);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.input::placeholder { color: var(--text-muted); }

.search-box {
  position: relative;
}
.search-box .search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 16px;
}
.search-box .input { padding-left: 44px; }

/* ---------- 表格 ---------- */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; padding: 13px 18px;
  background: var(--surface-2); color: var(--text-secondary);
  font-weight: 600; font-size: 13px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 13px 18px; border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: var(--transition-fast); }
.data-table tbody tr:hover { background: var(--primary-bg); }
.data-table .mono { font-family: var(--font-mono); font-size: 13px; }

/* 空状态 */
.empty-state {
  padding: 48px 24px; text-align: center; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.4; }

/* ---------- 侧边栏（管理后台） ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.admin-sidebar .brand { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.sidebar-nav .nav-group { margin-bottom: 18px; }
.sidebar-nav .nav-group-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); padding: 6px 12px; font-weight: 600;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  margin-bottom: 2px; transition: var(--transition-fast);
}
.sidebar-link:hover { background: var(--surface-2); color: var(--text); }
.sidebar-link.active { background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }
.sidebar-link .badge-count {
  margin-left: auto; background: var(--primary); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: var(--radius-full); font-weight: 600;
}
.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 28px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.admin-topbar .page-title { font-size: 16px; font-weight: 700; flex: 1; }
.admin-content { padding: 28px; flex: 1; }

/* ---------- 面板 ---------- */
.panel { margin-bottom: 24px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 12px;
}
.panel-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-tools { display: flex; align-items: center; gap: 10px; }

/* ---------- Hero ---------- */
.hero {
  text-align: center; padding: 64px 0 40px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-bg); color: var(--primary-dark);
  padding: 5px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; margin-bottom: 20px;
}
.hero h1 { font-size: 40px; margin-bottom: 14px; letter-spacing: -0.02em; }
.hero .hero-lead { font-size: 16px; color: var(--text-secondary); max-width: 560px; margin: 0 auto 28px; }
.hero .search-box { max-width: 520px; margin: 0 auto; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0; margin-top: auto;
  color: var(--text-muted); font-size: 13px;
  text-align: center;
}
.footer p { margin: 0; }
.footer .author-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.footer .author-link:hover { color: var(--primary-dark); text-decoration: underline; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; pointer-events: none; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 480px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  transform: translateY(12px); transition: var(--transition);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: var(--transition-fast);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; min-height: 0; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  padding: 12px 16px; min-width: 280px; max-width: 380px;
  animation: slideIn 0.25s ease;
  font-size: 14px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast .toast-icon { font-size: 16px; }

/* Token 用量条 */
.usage-bar {
  height: 6px; background: var(--surface-2); border-radius: var(--radius-full);
  overflow: hidden;
}
.usage-bar .usage-fill {
  height: 100%; background: var(--primary-gradient);
  border-radius: var(--radius-full); transition: width 0.5s ease;
}

/* 动画 */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--border-strong);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .container, .container-wide { padding: 0 16px; }

  /* 导航折叠为汉堡 */
  .navbar-inner { height: 56px; gap: 12px; }
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute; top: 56px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md); padding: 8px 14px;
    flex-direction: column; align-items: stretch; gap: 2px;
    z-index: 90;
  }
  .nav-links.open { display: flex; animation: fadeIn 0.2s ease; }
  .nav-link { border-radius: 8px; padding: 12px 14px; }
  .nav-actions { gap: 8px; }
  .user-name { display: none; }

  /* 表格横向滚动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 640px; }

  /* 尺寸收紧 */
  .hero h1 { font-size: 30px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .btn-lg { padding: 12px 24px; }
  .modal { width: calc(100vw - 24px); }
  .toast { min-width: 0; max-width: calc(100vw - 40px); }
}
