/* BasedToken design system — 单文件，无外部字体依赖 */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --bg: #f7f7f8;
  --bg-grad: radial-gradient(1200px 600px at 50% -200px, rgba(64, 99, 255, 0.10), transparent 70%);
  --surface: #ffffff;
  --surface-2: #f3f3f5;
  --surface-3: #ebebef;
  --line: #e6e6ea;
  --line-strong: #d6d6dc;
  --text: #0b0b0f;
  --text-2: #4b4b55;
  --text-3: #8b8b96;
  --accent: #3355ff;
  --accent-2: #2442e0;
  --accent-ink: #ffffff;
  --accent-soft: rgba(51, 85, 255, 0.08);
  --accent-line: rgba(51, 85, 255, 0.28);
  --ok: #0c8a4f;
  --ok-soft: rgba(12, 138, 79, 0.10);
  --warn: #b26b00;
  --warn-soft: rgba(178, 107, 0, 0.10);
  --bad: #d12f2f;
  --bad-soft: rgba(209, 47, 47, 0.09);
  --code-bg: #0e0f13;
  --code-text: #e7e9ee;
  --shadow-sm: 0 1px 2px rgba(16, 16, 24, 0.05);
  --shadow: 0 1px 2px rgba(16, 16, 24, 0.04), 0 4px 16px rgba(16, 16, 24, 0.06);
  --shadow-lg: 0 10px 40px rgba(16, 16, 24, 0.14);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --top-h: 60px;
  --maxw: 1180px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #09090b;
  --bg-grad: radial-gradient(1200px 600px at 50% -200px, rgba(90, 120, 255, 0.16), transparent 70%);
  --surface: #111114;
  --surface-2: #17171b;
  --surface-3: #1f1f24;
  --line: #24242a;
  --line-strong: #32323a;
  --text: #f1f1f4;
  --text-2: #a9a9b4;
  --text-3: #71717c;
  --accent: #6d8bff;
  --accent-2: #8aa2ff;
  --accent-ink: #0a0b10;
  --accent-soft: rgba(109, 139, 255, 0.12);
  --accent-line: rgba(109, 139, 255, 0.35);
  --ok: #3ccf8e;
  --ok-soft: rgba(60, 207, 142, 0.12);
  --warn: #f0b24a;
  --warn-soft: rgba(240, 178, 74, 0.12);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, 0.12);
  --code-bg: #0c0c0f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.page { background-image: var(--bg-grad); background-repeat: no-repeat; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; font-weight: 650; }
p { margin: 0; }
code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.85em;
  white-space: nowrap;
}
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 0.92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: var(--text); color: var(--bg); }
.skip-link:focus { left: 12px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 550; white-space: nowrap;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.primary:hover { background: var(--text-2); border-color: var(--text-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm, .btn.compact { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn svg { width: 16px; height: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- header */
.site-top {
  position: sticky; top: 0; z-index: 40; height: var(--top-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.site-top.is-scrolled { border-bottom-color: var(--line); }
.site-top .inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--text); color: var(--bg);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-tag { font-size: 11px; font-weight: 600; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.is-on { color: var(--text); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
#auth-slot { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 6px 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px;
}
.user-chip:hover { border-color: var(--line-strong); }
.user-chip .user-bal { font-family: var(--mono); font-size: 12px; color: var(--text-2); background: var(--surface-2); border-radius: 999px; padding: 2px 8px; }
.user-chip .user-email { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle { display: none; }
.nav-overlay { position: fixed; inset: var(--top-h) 0 0; background: rgba(0, 0, 0, 0.3); z-index: 30; }
.announce {
  border-bottom: 1px solid var(--line); background: var(--accent-soft); color: var(--text);
  font-size: 13px; text-align: center; padding: 8px 16px;
}

/* ---------------------------------------------------------------- footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 96px; padding: 40px 0 48px; color: var(--text-3); font-size: 13px; }
.site-foot .inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; justify-content: space-between; }
.site-foot .foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.site-foot a:hover { color: var(--text); }

/* ---------------------------------------------------------------- sections */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; font-weight: 550; color: var(--text-2);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.section { padding: 88px 0 0; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); }
.section-head p { margin-top: 10px; color: var(--text-2); font-size: 16px; }
.kicker { font-size: 12.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }

/* hero */
.hero { padding: 72px 0 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.08; letter-spacing: -0.035em; margin-top: 20px; font-weight: 700; }
.hero h1 .grad { background: linear-gradient(92deg, var(--accent), #8b5cf6 60%, #d946ef); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { margin-top: 18px; font-size: 17px; color: var(--text-2); max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; color: var(--text-3); font-size: 13px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 15px; height: 15px; color: var(--ok); }

.term {
  border-radius: var(--r-lg); background: var(--code-bg); color: var(--code-text);
  border: 1px solid color-mix(in srgb, var(--line) 30%, #000); box-shadow: var(--shadow-lg); overflow: hidden;
}
.term-bar { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.term-dots { display: flex; gap: 6px; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.term-tabs { display: flex; gap: 2px; margin-left: 6px; }
.term-tabs button { border: 0; background: transparent; color: rgba(255, 255, 255, 0.5); font: 500 12.5px var(--font); padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.term-tabs button.is-on { color: #fff; background: rgba(255, 255, 255, 0.09); }
.term pre { margin: 0; padding: 18px 20px 22px; font-size: 13px; line-height: 1.7; overflow-x: auto; white-space: pre; }
.term .c { color: #7d8597; }
.term .s { color: #a5d6a7; }
.term .k { color: #9cb4ff; }
.term .n { color: #f3c77a; }

.strip { margin-top: 72px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.strip > div { padding: 22px 24px; border-left: 1px solid var(--line); }
.strip > div:first-child { border-left: 0; }
.strip strong { display: block; font-size: 22px; letter-spacing: -0.02em; font-weight: 650; }
.strip span { color: var(--text-3); font-size: 13px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { padding: 24px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.feature .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.feature .ico svg { width: 20px; height: 20px; }
.feature h3 { font-size: 16px; }
.feature p { margin-top: 8px; color: var(--text-2); font-size: 14px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 24px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); font: 600 12px var(--mono); color: var(--accent); }
.step h3 { margin-top: 10px; font-size: 16px; }
.step p { margin-top: 6px; color: var(--text-2); font-size: 14px; }

.cta-band {
  margin-top: 88px; padding: 44px; border-radius: 20px; border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { font-size: 26px; }
.cta-band p { color: var(--text-2); margin-top: 6px; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.field small { color: var(--text-3); font-size: 12px; }
.input, .field input, .field select, .field textarea, .wt-form input, .wt-form select, .wt-form textarea, .wt-page-actions input, .toolbar input, .toolbar select {
  width: 100%; height: 38px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea, .wt-form textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .wt-form input:focus, .wt-page-actions input:focus, .toolbar input:focus, .toolbar select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input[readonly] { background: var(--surface-2); color: var(--text-2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background 0.15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.alert { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); }
.alert.is-error { border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: var(--bad-soft); color: var(--bad); }
.alert.is-ok { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-soft); color: var(--ok); }
.alert.is-warn { border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-soft); color: var(--warn); }

/* ---------------------------------------------------------------- tags / pills */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.wt-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.wt-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.wt-pill-ok { background: var(--ok-soft); color: var(--ok); }
.wt-pill-bad { background: var(--bad-soft); color: var(--bad); }
.wt-pill-wait { background: var(--warn-soft); color: var(--warn); }
.wt-pill-neutral { background: var(--surface-2); color: var(--text-2); }

/* ---------------------------------------------------------------- model plaza */
.page-head { padding: 56px 0 28px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; font-weight: 700; }
.page-head p { color: var(--text-2); margin-top: 10px; max-width: 640px; font-size: 16px; }
.toolbar { position: sticky; top: var(--top-h); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.toolbar .search { position: relative; flex: 1 1 260px; max-width: 360px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.toolbar .search input { padding-left: 34px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--text-2); font: 500 13px var(--font); height: 30px; padding: 0 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.toolbar .count { margin-left: auto; color: var(--text-3); font-size: 13px; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-top: 8px; }
.model-card {
  display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.model-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.mc-head { display: flex; align-items: flex-start; gap: 12px; }
.mc-logo { flex: none; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; font-weight: 700; font-size: 15px; color: var(--text-2); }
.mc-logo img { width: 24px; height: 24px; }
.mc-title { min-width: 0; flex: 1; }
.mc-title h3 { font-size: 15.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-title .mc-id { display: block; margin-top: 2px; font: 12px var(--mono); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-status { flex: none; }
.mc-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px; }
.mc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-price { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.mc-price .from { font-size: 12px; color: var(--text-3); }
.mc-price .val { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mc-price .unit { font-size: 12.5px; color: var(--text-3); margin-left: 4px; font-weight: 500; }
.mc-price .more { font-size: 13px; color: var(--accent); font-weight: 550; white-space: nowrap; }
.empty { padding: 64px 24px; text-align: center; color: var(--text-3); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-lg); min-height: 210px; }
@keyframes sk { to { background-position: -200% 0; } }

/* drawer */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(8, 8, 12, 0.45); opacity: 0; transition: opacity 0.2s; }
.drawer-backdrop.is-on { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(560px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer.is-on { transform: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 19px; }
.drawer-head .close { margin-left: auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px 32px; display: grid; gap: 24px; align-content: start; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.drawer h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 650; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.idline { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font: 13px var(--mono); }
.idline span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table th, .price-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.price-table th { font-weight: 550; color: var(--text-3); font-size: 12.5px; background: var(--surface-2); }
.price-table tr:last-child td { border-bottom: 0; }
.price-table-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.feature-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); }
.feature-list li { display: flex; gap: 10px; }
.feature-list li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2 7 10.5l4.5-5' fill='none' stroke='%230c8a4f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }

/* ---------------------------------------------------------------- code snippets */
pre.snippet, .wt-code {
  margin: 0; padding: 16px 18px; border-radius: var(--r); background: var(--code-bg); color: var(--code-text);
  font-size: 13px; line-height: 1.65; overflow-x: auto; white-space: pre; border: 1px solid color-mix(in srgb, var(--line) 30%, #000);
}
.snippet-wrap { position: relative; }
.snippet-copy {
  position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 10px; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.75);
  font: 500 12px var(--font); cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.snippet-wrap:hover .snippet-copy, .snippet-copy:focus-visible, .snippet-copy.is-done { opacity: 1; }

/* ---------------------------------------------------------------- docs */
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding-top: 40px; }
.docs-nav { position: sticky; top: calc(var(--top-h) + 24px); align-self: start; display: grid; gap: 2px; font-size: 14px; }
.docs-nav p { font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin: 14px 10px 6px; }
.docs-nav p:first-child { margin-top: 0; }
.docs-nav a { padding: 6px 10px; border-radius: 8px; color: var(--text-2); }
.docs-nav a:hover { background: var(--surface-2); color: var(--text); }
.docs-nav a.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.docs-main { min-width: 0; max-width: 780px; }
.docs-main h1 { font-size: 34px; letter-spacing: -0.03em; }
.docs-main > p.lead { margin-top: 10px; color: var(--text-2); font-size: 16px; }
.doc-section { padding-top: 44px; }
.doc-section h2 { font-size: 22px; margin-bottom: 12px; }
.doc-section h3 { font-size: 16px; margin: 22px 0 10px; }
.doc-section p, .doc-section li { color: var(--text-2); font-size: 15px; }
.doc-section p + p { margin-top: 10px; }
.doc-section ul, .doc-section ol { padding-left: 20px; margin: 10px 0; display: grid; gap: 6px; }
.doc-section .snippet-wrap, .doc-section pre.snippet { margin-top: 14px; }
.callout { margin-top: 16px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--accent-line); background: var(--accent-soft); font-size: 14px; color: var(--text); }
.callout.warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.param-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.param-table th, .param-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.param-table th { font-size: 12.5px; color: var(--text-3); font-weight: 550; }
.param-table td:first-child { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.param-table td { color: var(--text-2); }
.method { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; font: 650 11.5px var(--mono); margin-right: 8px; }
.method.get { background: var(--ok-soft); color: var(--ok); }
.method.post { background: var(--accent-soft); color: var(--accent); }
.endpoint { display: flex; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font: 13.5px var(--mono); margin-top: 12px; }

/* ---------------------------------------------------------------- auth */
.auth-wrap { min-height: calc(100vh - var(--top-h)); display: grid; place-items: center; padding: 40px 20px 80px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand-mark { width: 44px; height: 44px; border-radius: 13px; margin: 0 auto 20px; }
.auth-card .brand-mark svg { width: 26px; height: 26px; }
.auth-card h1 { text-align: center; font-size: 24px; letter-spacing: -0.02em; }
.auth-card .sub { text-align: center; color: var(--text-2); margin-top: 8px; font-size: 14.5px; }
.auth-panel { margin-top: 28px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 16px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; }
.auth-tabs button { height: 34px; }
.auth-panel .btn { width: 100%; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-foot { margin-top: 20px; text-align: center; font-size: 13px; color: var(--text-3); }
.auth-foot a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- toast */
.tj-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--shadow-lg);
  transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px);
}
.tj-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.tj-toast.is-error { background: var(--bad); color: #fff; }
.tj-top { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); display: grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.tj-top.is-on { opacity: 1; pointer-events: auto; }
.tj-top svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- console / admin shell */
.console-body { background: var(--bg); }
.console-app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.console-rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px;
  padding: 16px 12px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto;
}
.console-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-weight: 700; }
.console-brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.console-brand-sub { font-size: 11px; font-weight: 600; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 2px; }
.console-nav { display: grid; gap: 2px; }
.console-nav-label { margin: 14px 10px 6px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.console-nav-label:first-child { margin-top: 0; }
.console-nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  font: 500 14px var(--font); text-align: left; cursor: pointer;
}
.console-nav-btn svg { width: 17px; height: 17px; flex: none; }
.console-nav-btn:hover { background: var(--surface-2); color: var(--text); }
.console-nav-btn.is-on { background: var(--surface-3); color: var(--text); font-weight: 600; }
.console-nav-btn .badge { margin-left: auto; font: 600 11px var(--mono); color: var(--text-3); }
.console-rail-bottom { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; color: var(--text-3); }
.console-rail-bottom a:hover { color: var(--text); }
.console-workspace { min-width: 0; display: flex; flex-direction: column; }
.console-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 12px 28px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.console-topbar h1 { font-size: 17px; font-weight: 650; }
.console-topbar p { font-size: 13px; color: var(--text-3); margin-top: 1px; }
.console-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.console-balance-chip { font: 600 13px var(--mono); padding: 5px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.console-user-chip { font-size: 13px; color: var(--text-2); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-ghost-btn { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 500 13px var(--font); cursor: pointer; display: inline-flex; align-items: center; }
.console-ghost-btn:hover { color: var(--text); border-color: var(--line-strong); }
.console-rail-toggle { display: none; }
.console-main { padding: 28px; display: grid; gap: 20px; align-content: start; max-width: 1280px; width: 100%; }
.console-status { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 14px; }
.console-status.is-error { background: var(--bad-soft); color: var(--bad); }
.console-panel { display: grid; gap: 20px; }

.wt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.wt-stat { padding: 18px 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.wt-stat span { display: block; font-size: 13px; color: var(--text-3); }
.wt-stat strong { display: block; margin-top: 6px; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wt-stat small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.wt-stat.is-warn strong { color: var(--warn); }
.wt-stat.is-bad strong { color: var(--bad); }
.wt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wt-card { padding: 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.wt-card-flush { padding: 0; overflow: hidden; }
.wt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.wt-card-flush > .wt-card-head { padding: 16px 20px 0; }
.wt-card-head h2 { font-size: 15px; font-weight: 650; }
.wt-muted { color: var(--text-3); font-size: 13.5px; }
.wt-link { border: 0; background: none; padding: 0; color: var(--accent); font: 550 13px var(--font); cursor: pointer; }
.wt-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.wt-btn-soft, .wt-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 9px; font: 550 13.5px var(--font); cursor: pointer; white-space: nowrap; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
}
.wt-btn-soft:hover { background: var(--surface-2); }
.wt-btn-soft:disabled, .wt-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.wt-btn-primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.wt-btn-primary:hover { background: var(--text-2); border-color: var(--text-2); }
.wt-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; counter-reset: s; }
.wt-steps li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wt-steps li:last-child { border-bottom: 0; }
.wt-steps li::before { counter-increment: s; content: counter(s); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font: 600 12px var(--mono); color: var(--text-2); }
.wt-steps strong { font-size: 14px; font-weight: 600; }
.wt-steps span { grid-column: 2; font-size: 13px; color: var(--text-3); }
.wt-steps .wt-link { grid-column: 3; grid-row: 1 / span 2; }
.wt-api-row { display: grid; gap: 6px; }
.wt-api-row label { font-size: 12px; color: var(--text-3); font-weight: 550; text-transform: uppercase; letter-spacing: 0.05em; }
.wt-api-row code { display: block; padding: 10px 12px !important; border-radius: 10px; font-size: 13.5px !important; white-space: normal !important; word-break: break-all; margin-bottom: 10px; }
.wt-table-wrap { overflow-x: auto; }
.wt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wt-table th { text-align: left; font-weight: 550; font-size: 12.5px; color: var(--text-3); padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.wt-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.wt-table tbody tr:last-child td { border-bottom: 0; }
.wt-table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.wt-table td.num, .wt-table th.num { text-align: right; }
.wt-table td.pos { color: var(--ok); }
.wt-table td.neg { color: var(--text); }
.wt-table td.dim { text-align: center; padding: 36px 16px; color: var(--text-3); }
.wt-table code { font-size: 12px; }
.wt-table .cell-main { font-weight: 550; }
.wt-table .cell-sub { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.wt-table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.wt-page-tools { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wt-page-title { font-size: 18px; font-weight: 650; }
.wt-page-tools .wt-muted { margin-top: 4px; }
.wt-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wt-page-actions input, .wt-page-actions select { height: 34px; width: 220px; }
.wt-pager { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-3); }
.wt-secret { padding: 16px 18px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); display: grid; gap: 10px; }
.wt-secret-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wt-secret-head strong { font-size: 14px; color: var(--ok); }
.wt-secret code { display: block; white-space: normal !important; word-break: break-all; padding: 10px 12px !important; font-size: 13px !important; background: var(--surface) !important; }
.wt-canvas-hero { background: linear-gradient(135deg, var(--surface), var(--accent-soft)); }
.wt-tips { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); }
.wt-creator-links { display: grid; gap: 6px; }
.wt-creator-links a, .wt-creator-links button { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 14px var(--font); cursor: pointer; text-align: left; }
.wt-creator-links a:hover, .wt-creator-links button:hover { border-color: var(--line-strong); background: var(--surface-2); }
.wt-form { display: grid; gap: 14px; }
.wt-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.wt-form .wt-btn-primary { justify-self: start; }
.wt-mini { font-size: 12px; color: var(--text-3); }

/* modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(8, 8, 12, 0.5); display: grid; place-items: center; padding: 20px; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 20px 22px; overflow-y: auto; display: grid; gap: 16px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal-foot .left { margin-right: auto; }
.fieldset-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 650; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 14px; }
.res-rows { display: grid; gap: 8px; }
.res-row { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 8px; }
.key-hint { font: 12.5px var(--mono); color: var(--text-2); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.wt-btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.wt-btn-danger { color: var(--bad); }
.wt-btn-danger:hover { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.wt-pill-warn { background: var(--warn-soft); color: var(--warn); }
.issue { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; background: var(--surface-2); color: var(--text-2); }
.issue::before { content: ""; flex: none; width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--text-3); }
.issue.is-warn::before { background: var(--warn); }
.issue.is-bad::before { background: var(--bad); }
.issue.is-ok::before { background: var(--ok); }
.issue .wt-link { margin-left: auto; white-space: nowrap; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; word-break: break-all; }
.err-text { display: block; max-width: 360px; font-size: 12px; color: var(--bad); white-space: normal; word-break: break-word; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .feature-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .wt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .site-top .nav { position: fixed; top: var(--top-h); left: 0; right: 0; z-index: 35; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; background: var(--surface); border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: 0.18s; }
  .site-top .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .site-top .nav a { padding: 12px; font-size: 15px; }
  .user-chip .user-email { display: none; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip > div:nth-child(3) { border-left: 0; }
  .strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .docs-nav p { display: none; }
  .wt-grid, .form-grid { grid-template-columns: 1fr; }
  .console-app { grid-template-columns: 1fr; }
  .console-rail { position: fixed; z-index: 50; left: 0; width: 260px; transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-lg); }
  .console-app.rail-open .console-rail { transform: none; }
  .console-rail-toggle { display: inline-grid; }
  .console-topbar { padding: 10px 16px; }
  .console-main { padding: 18px 16px; }
  .console-user-chip { display: none; }
}
@media (max-width: 600px) {
  .container { padding: 0 18px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .model-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 28px; }
  .wt-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .wt-stat strong { font-size: 20px; }
  .hero h1 { font-size: 34px; }
  .toolbar .count { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.lang-btn { font-size: 12px; font-weight: 600; letter-spacing: .02em; width: auto; min-width: 34px; padding: 0 8px; }
