/* TokenAI Relay — 统一样式 */
:root {
  --brand: #f59e0b;
  --brand-dark: #d97706;
  --brand-light: #fef3c7;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --ok: #16a34a;
  --warn: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 15px;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 导航 */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; flex-shrink: 0;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--ink-2); font-size: 14.5px; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 9px; padding: 8px 18px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-danger { background: #fef2f2; color: var(--warn); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 7px; }

/* 主容器 */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { padding: 72px 0 56px; text-align: center; background: linear-gradient(180deg, #fffbeb 0%, #fff 100%); }
.hero h1 { font-size: 38px; font-weight: 800; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--brand-dark); }
.hero .sub { margin: 16px auto 0; max-width: 640px; color: var(--ink-2); font-size: 16.5px; }
.hero .cta { margin-top: 30px; display: flex; gap: 12px; justify-content: center; }
.hero .badge {
  display: inline-block; margin-bottom: 18px; padding: 5px 14px; border-radius: 999px;
  background: var(--brand-light); color: var(--brand-dark); font-size: 13px; font-weight: 600;
}

/* 区块 */
.section { padding: 56px 0; }
.section h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.section .lead { color: var(--ink-2); margin-bottom: 32px; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* 特性卡片 */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature .ic { width: 28px; height: 28px; margin-bottom: 12px; color: var(--brand-dark); }
.feature .ic svg { width: 100%; height: 100%; }
.feature h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: 13.5px; }

/* SVG 图标通用 */
.ic { width: 1em; height: 1em; vertical-align: -0.125em; display: inline-block; flex-shrink: 0; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }

/* 价格表 */
.price-table { width: 100%; border-collapse: collapse; background: var(--bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.price-table th { text-align: left; padding: 12px 16px; background: var(--bg-2); font-size: 13px; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--line); }
.price-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.price-table tr:last-child td { border-bottom: none; }
.price-table .model-id { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; color: var(--ink); }
.price-table .tag { display: inline-block; padding: 2px 8px; border-radius: 5px; background: var(--brand-light); color: var(--brand-dark); font-size: 12px; font-weight: 600; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }

/* 步骤 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 18px; right: 20px; font-size: 34px; font-weight: 800; color: var(--brand-light);
}
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step p, .step code { font-size: 13.5px; color: var(--ink-2); }

/* 代码块 */
pre.code {
  background: #0f172a; color: #e2e8f0; border-radius: var(--radius); padding: 18px 20px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 1.7;
  overflow-x: auto; margin: 12px 0;
}
pre.code .c { color: #64748b; }
pre.code .k { color: #fbbf24; }
pre.code .s { color: #86efac; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin-bottom: 10px; background: var(--bg); }
.faq summary { font-weight: 600; cursor: pointer; font-size: 15px; }
.faq details p { margin-top: 10px; color: var(--ink-2); font-size: 14px; }

/* 兼容工具 */
.tools { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.tool-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-weight: 600; font-size: 14px;
}

/* 页脚 */
.footer { border-top: 1px solid var(--line); padding: 30px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.footer b { color: var(--ink-2); }

/* 表格容器 */
.table-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-card table { width: 100%; border-collapse: collapse; }
.table-card th { text-align: left; padding: 11px 16px; background: var(--bg-2); font-size: 12.5px; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-card td { padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.table-card tr:last-child td { border-bottom: none; }
.table-card .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }

/* 徽章 */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-on { background: #dcfce7; color: var(--ok); }
.pill-off { background: #fee2e2; color: var(--warn); }

/* 表单 */
.input, .select {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 14px; font-size: 14px;
  color: var(--ink); background: var(--bg); outline: none; transition: border-color .15s;
}
.input:focus, .select:focus { border-color: var(--brand); }
label { font-size: 13px; color: var(--ink-2); font-weight: 600; display: block; margin-bottom: 5px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-card .num small { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.stat-card .lbl { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* 工具条 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

/* 条形图（无依赖） */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 10px 4px 0; }
.bar { flex: 1; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; transition: opacity .2s; }
.bar:hover { opacity: .75; }
.bar-lbl { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.bar-val { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink-2); font-weight: 600; white-space: nowrap; display: none; }
.bar:hover .bar-val { display: block; }

/* 标签页 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { padding: 10px 18px; font-size: 14.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.tab:hover { color: var(--ink); }

/* 提示 */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: var(--ink); color: #fff; padding: 11px 22px; border-radius: 10px; font-size: 14px;
  opacity: 0; transition: all .25s ease; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.empty { text-align: center; padding: 40px 0; color: var(--ink-3); font-size: 14px; }
.muted { color: var(--ink-3); font-size: 13px; }
.nowrap { white-space: nowrap; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-2); }
.login-card { width: 380px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 36px; box-shadow: var(--shadow); }
.login-card .logo { justify-content: center; margin-bottom: 8px; font-size: 20px; }
.login-card .sub { text-align: center; color: var(--ink-3); font-size: 13.5px; margin-bottom: 26px; }
.login-card .input { width: 100%; margin-bottom: 14px; }
.login-card .btn-primary { width: 100%; padding: 11px; }

/* 响应式 */
@media (max-width: 860px) {
  .features, .steps { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 28px; }
  .nav-links a:not(.btn) { display: none; }
}
