/* ============================================================
   main.css — 官网（web）样式：共享外壳 + 内页组件（导入 tokens.css 之后加载）
   首页专属组件（hero/trust/bento/proto/flow/faq/cta/grain/aura）见 home.css，仅首页加载。
   规范出处：docs/06-UI设计规范.md §3~§5；禁止裸 hex/rgb()（rgba 特例见 §5.4）
   ============================================================ */
@import url("/css/tokens.css");

/* ---------- web 局部 reset（仅官网加载；不放 tokens 以免影响 console/admin） ---------- */
img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }        /* 反制 svg{display:block}，保证 .i-ok 默认隐藏 */
a { color: inherit; text-decoration: none; }

/* ---------- 布局基元 ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; padding-block: var(--section-gap); }
.section + .section { padding-top: 0; }
.section-head { max-width: 640px; margin-bottom: var(--sp-8); }
.section-head h2 { font-size: var(--fs-2xl); line-height: var(--lh-snug); }
.section-head p { margin-top: var(--sp-4); color: var(--text-2); font-size: var(--fs-md); line-height: var(--lh-base); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 区块之间的渐变发丝分隔线 */
.hr-aurora { position: relative; height: 1px; max-width: var(--container); margin: 0 auto;
  background: var(--grad-edge); opacity: .5;
  -webkit-mask: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
          mask: linear-gradient(90deg, transparent, black 12%, black 88%, transparent); }

/* ---------- 排版原语 ---------- */
h1, h2, h3, h4 { line-height: var(--lh-snug); font-weight: 600; letter-spacing: var(--ls-tight); color: var(--text-1); }
.kicker { display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-kick);
  letter-spacing: var(--ls-kick); text-transform: uppercase; color: var(--accent); margin-bottom: var(--sp-4); padding-left: .14em; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent; }
.link-arrow { color: var(--brand-strong); font-weight: 500; transition: color var(--t-base); }
.link-arrow:hover { color: var(--accent-strong); }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding: 0 var(--sp-5); border-radius: var(--r-full); font-family: var(--font-sans);
  font-weight: 600; font-size: var(--fs-base); letter-spacing: .01em; white-space: nowrap; cursor: pointer;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base), background var(--t-base), border-color var(--t-base); }
.btn svg { display: block; }
.btn-lg { min-height: 54px; padding: 0 var(--sp-7); font-size: var(--fs-md); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { position: relative; color: var(--text-on-accent); background: var(--grad-aurora);
  box-shadow: 0 6px 24px rgba(53,230,219,.22), 0 2px 8px rgba(91,140,255,.24), var(--edge-top); }
.btn-primary::after { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0;
  background: linear-gradient(115deg, var(--accent-strong), var(--brand-strong)); transition: opacity var(--t-base); z-index: -1; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(53,230,219,.34), 0 4px 14px rgba(91,140,255,.3), var(--edge-top); }
.btn-primary:hover::after { opacity: 1; }
.btn-ghost { color: var(--text-1); background: rgba(255,255,255,.02); border: 1px solid var(--line-1); box-shadow: var(--edge-top); }
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--line-glow); transform: translateY(-2px); box-shadow: 0 8px 26px rgba(0,0,0,.4), var(--edge-top); }

/* ---------- 徽章 ---------- */
.badge { display: inline-flex; align-items: center; gap: var(--sp-2); height: 32px; padding: 0 var(--sp-4);
  border-radius: var(--r-full); font-size: var(--fs-sm); font-weight: 500; color: var(--text-2);
  background: rgba(255,255,255,.02); border: 1px solid var(--line-1); backdrop-filter: blur(6px); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim); animation: pulse 2.4s var(--ease-io) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.badge-mod { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--sp-3); border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .02em; color: var(--brand-strong);
  background: var(--brand-dim); border: 1px solid rgba(91,140,255,.2); }
.badge-mod.ok { color: var(--ok); background: var(--ok-dim); border-color: rgba(52,224,160,.25); }
.badge-mod.accent { color: var(--accent-strong); background: var(--accent-dim); border-color: rgba(53,230,219,.25); }

/* ---------- 可复制药丸 / 复制按钮 ---------- */
.copy-pill { display: inline-flex; align-items: center; gap: var(--sp-2); height: 44px; padding: 0 var(--sp-4);
  border-radius: var(--r-full); font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-2);
  background: var(--bg-2); border: 1px solid var(--line-1); cursor: pointer;
  transition: border-color var(--t-base), color var(--t-base); }
.copy-pill:hover { border-color: var(--line-glow); color: var(--text-1); }
.copy-pill svg { display: block; }
.copy-pill .i-ok { color: var(--ok); }
.copy-pill.copied { border-color: rgba(52,224,160,.4); color: var(--ok); }
.copy-btn { display: inline-flex; align-items: center; gap: var(--sp-1); height: 28px; padding: 0 var(--sp-3);
  border-radius: var(--r-sm); font-size: var(--fs-xs); color: var(--text-2); background: rgba(255,255,255,.03);
  border: 1px solid var(--line-1); cursor: pointer; transition: color var(--t-base), border-color var(--t-base); }
.copy-btn:hover { color: var(--text-1); border-color: var(--line-glow); }
.copy-btn svg { display: block; }
.copy-btn.copied { color: var(--ok); border-color: rgba(52,224,160,.4); }
.copy-btn .i-ok { color: var(--ok); }

/* ---------- 顶部公告条 ---------- */
.notice { position: relative; z-index: 20; text-align: center; font-size: var(--fs-sm); color: var(--text-2);
  padding: var(--sp-2) var(--gutter); background: linear-gradient(90deg, var(--accent-dim), var(--brand-dim));
  border-bottom: 1px solid var(--line-2); }
.notice a { color: var(--accent-strong); font-weight: 600; }
.notice b { color: var(--text-1); }

/* ---------- 玻璃导航（无 JS 时基础玻璃底保证可读；.scrolled 由 JS 加强边线/阴影） ---------- */
.nav { position: sticky; top: 0; z-index: 30; background: var(--bg-glass);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line-2);
  transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base); }
.nav.scrolled { border-bottom-color: var(--line-1); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.nav-inner { display: flex; align-items: center; gap: var(--sp-5); height: 64px; }
.logo { display: inline-flex; align-items: center; gap: var(--sp-3); font-family: var(--font-display);
  font-weight: 600; font-size: var(--fs-md); letter-spacing: -.01em; color: var(--text-1); }
.logo svg { display: block; filter: drop-shadow(0 0 8px rgba(53,230,219,.4)); }
.nav-links { display: flex; align-items: center; gap: var(--sp-2); margin-left: var(--sp-4); }
.nav-links a { position: relative; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-base); color: var(--text-2);
  border-radius: var(--r-sm); min-height: 40px; display: inline-flex; align-items: center; transition: color var(--t-base); }
.nav-links a::after { content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 4px; height: 1.5px;
  background: var(--grad-aurora); transform: scaleX(0); transform-origin: left; transition: transform var(--t-base) var(--ease-out); }
.nav-links a:hover { color: var(--text-1); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta { display: flex; align-items: center; gap: var(--sp-3); margin-left: auto; }
.nav-cta .link { font-size: var(--fs-base); color: var(--text-2); padding: var(--sp-2); min-height: 40px;
  display: inline-flex; align-items: center; transition: color var(--t-base); }
.nav-cta .link:hover { color: var(--text-1); }
.nav-cta .nav-balance b { font-family: var(--font-mono); color: var(--text-1); }
.nav-burger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  border-radius: var(--r-md); color: var(--text-1); border: 1px solid var(--line-1); cursor: pointer; }
.nav-burger svg { display: block; }
#nav-toggle { display: none; }

/* ---------- 卡片（通用，§4.5） ---------- */
.card { position: relative; display: flex; flex-direction: column; padding: var(--sp-5); border-radius: var(--r-lg);
  background: var(--bg-1); border: 1px solid var(--line-1); box-shadow: var(--edge-top); overflow: hidden;
  transition: transform var(--t-slow) var(--ease-out), border-color var(--t-base), box-shadow var(--t-base); }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(120% 100% at 90% 0%, rgba(53,230,219,.1), transparent 60%); transition: opacity var(--t-base); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px); border-color: var(--line-glow); box-shadow: var(--shadow-2), var(--edge-top); }
  .card:hover::before { opacity: 1; }
}
a.card:focus-visible { border-color: var(--accent); }

/* ---------- 价格卡（首页预览 + /pricing 页共享） ---------- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); align-items: stretch; }
.price-card { padding: var(--sp-6); }
.price-card h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-3); }
.price-line { font-size: var(--fs-md); color: var(--text-2); margin-bottom: var(--sp-5); }
.price-line b { font-family: var(--font-mono); font-size: var(--fs-xl); color: var(--text-1); font-weight: 600; }
.price-feats { list-style: none; display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-6); flex: 1; }
.price-feats li { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }
.price-feats svg { display: block; flex: none; margin-top: 3px; color: var(--accent); }
.price-card .btn { width: 100%; margin-top: auto; }
.price-card.featured { border-color: var(--line-glow); box-shadow: var(--shadow-3), var(--edge-glow);
  background: radial-gradient(130% 100% at 50% -10%, rgba(53,230,219,.1), transparent 55%), var(--bg-1); }
.price-tag { position: absolute; top: var(--sp-5); right: var(--sp-5); font-size: var(--fs-xs); font-weight: 600;
  color: var(--accent-strong); background: var(--accent-dim); border: 1px solid rgba(53,230,219,.3);
  padding: 2px var(--sp-3); border-radius: var(--r-full); }
@media (min-width: 820px) {
  /* 用独立 translate 属性做抬升：不被 .reveal.in{transform:none} 覆盖，二者可共存 */
  .price-card.featured { translate: 0 -14px; }
  .price-card.featured:hover { translate: 0 -18px; }
}
.price-note { margin-top: var(--sp-6); text-align: center; color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- 页脚 ---------- */
.footer { position: relative; background: var(--bg-void); border-top: 1px solid var(--line-1); padding-block: var(--sp-8) var(--sp-6); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--sp-6); margin-bottom: var(--sp-7); }
.f-brand { max-width: 30em; }
.f-brand .logo { margin-bottom: var(--sp-4); }
.f-brand p { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-base); margin-bottom: var(--sp-2); }
.footer h4 { font-size: var(--fs-sm); letter-spacing: .02em; color: var(--text-1); margin-bottom: var(--sp-4); text-transform: uppercase; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: var(--sp-3); }
.footer ul a { color: var(--text-2); font-size: var(--fs-sm); transition: color var(--t-base); }
.footer ul a:hover { color: var(--accent-strong); }
.footer-bar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between;
  padding-top: var(--sp-5); border-top: 1px solid var(--line-2); font-size: var(--fs-sm); color: var(--text-3); }
.footer-bar a { color: var(--text-3); }
.footer-bar .icp:hover { color: var(--text-2); }
.f-status { display: inline-flex; align-items: center; gap: var(--sp-2); }
.f-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-dim); }

/* ============================================================
   内页组件（06 §3.2 模型广场 / §3.3 价格 / §3.5 登录注册 / §3.8 状态 / 模型文档）
   ============================================================ */

/* ---------- 页头 ---------- */
.page-head { padding-top: var(--sp-7); }
.page-head h1 { font-size: var(--fs-2xl); line-height: var(--lh-snug); font-weight: 700; letter-spacing: -0.01em; }
.page-head .sub { margin-top: var(--sp-3); color: var(--text-2); max-width: 640px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap; }

/* ---------- 模型广场：搜索 + 模态 chips ---------- */
.search { display: flex; gap: var(--sp-2); }
.search input { min-height: 44px; width: 220px; padding: 0 var(--sp-4);
  border: 1px solid var(--line-1); border-radius: var(--r-md);
  background: var(--bg-2); color: var(--text-1); font-size: var(--fs-base); font-family: inherit;
  transition: border-color var(--t-base); }
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--brand); outline: none; }
.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-5); }
.chips a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 var(--sp-4);
  border: 1px solid var(--line-1); border-radius: var(--r-full);
  color: var(--text-2); font-size: var(--fs-sm);
  transition: color var(--t-base), border-color var(--t-base), background var(--t-base); }
.chips a:hover { border-color: var(--brand); color: var(--text-1); }
.chips a.on { background: var(--brand-dim); border-color: var(--brand); color: var(--brand-strong); font-weight: 600; }

/* ---------- 模型广场：卡片网格 ---------- */
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin-top: var(--sp-6); }
.model-card { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-5); color: var(--text-1); }
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.mc-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ok); }
.mc-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.mc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 2px 8px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg-2); font-size: var(--fs-xs); color: var(--text-2); }
.mc-foot { margin-top: auto; font-size: var(--fs-sm); color: var(--brand); }
.icon-vendor { display: inline-block; vertical-align: -4px; margin-right: 8px; border-radius: 4px;
  background: rgba(255,255,255,.92); padding: 2px; }
.models-empty { text-align: center; padding: var(--sp-8) 0; color: var(--text-2); }

/* ---------- 模型名 / 描述 / 价格（模型广场卡 + 状态页 + 首页 bento 共用基样） ---------- */
.model-name { font-family: var(--font-mono); font-size: var(--fs-md); font-weight: 600; word-break: break-all; }
.model-desc { font-size: var(--fs-sm); color: var(--text-2); line-height: var(--lh-base); }
.model-price { margin-top: auto; font-size: var(--fs-sm); color: var(--text-2); }
.model-price b { font-family: var(--font-mono); font-weight: 600; color: var(--text-1); }
.model-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }

/* ---------- 数据表格（价格页 / 文档页；手机端卡片化见 §5.3 媒体查询） ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line-1); border-radius: var(--r-md);
  background: var(--bg-1); box-shadow: var(--edge-top); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.data th { text-align: left; height: 40px; padding: 0 var(--sp-4); white-space: nowrap;
  color: var(--text-2); font-weight: 500; font-size: var(--fs-xs);
  background: var(--bg-2); border-bottom: 1px solid var(--line-1); }
.data td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line-2); color: var(--text-1); }
.data tbody tr:last-child td { border-bottom: 0; }
.data td.amount { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.row-link { color: var(--brand); }
.row-link:hover { color: var(--brand-strong); }
.group-title { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-6) 0 var(--sp-4); }
.group-title h3 { font-size: var(--fs-lg); font-weight: 600; }

/* ---------- 价格页：计费规则卡 ---------- */
.rule-card { padding: var(--sp-6); gap: var(--sp-4); }
.rule-formula { align-self: flex-start; font-family: var(--font-mono); font-size: var(--fs-md);
  color: var(--brand-strong); background: var(--brand-dim);
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }
.rule-notes { display: flex; flex-direction: column; gap: var(--sp-2); color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- 状态页（06 §3.8） ---------- */
.status-pill { display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 6px 14px; border-radius: var(--r-full); font-size: var(--fs-sm); font-weight: 600; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.ok { background: var(--ok-dim); color: var(--ok); }
.status-pill.warn { background: var(--warn-dim); color: var(--warn); }
.status-pill.err { background: var(--err-dim); color: var(--err); }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.status-card { padding: var(--sp-5); gap: var(--sp-3); }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.health-bdg { flex: none; padding: 3px 10px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600; }
.health-bdg.ok { background: var(--ok-dim); color: var(--ok); }
.health-bdg.warn { background: var(--warn-dim); color: var(--warn); }
.health-bdg.err { background: var(--err-dim); color: var(--err); }
.sc-nums { display: flex; align-items: baseline; gap: var(--sp-4); }
.sc-avail { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-xl); font-weight: 600; }
.sc-lat { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-sm); color: var(--text-3); }
.mini-curve svg { display: block; width: 100%; height: 40px; }
.mini-curve .curve { fill: none; stroke: var(--brand); stroke-width: 1.5; }
.mini-curve .base { stroke: var(--line-1); stroke-width: 1; }
.status-note { margin-top: var(--sp-7); color: var(--text-3); font-size: var(--fs-sm); max-width: 760px; }

/* ---------- 登录 / 注册（06 §3.5） ---------- */
.auth-main { position: relative; overflow: hidden; isolation: isolate;
  min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center;
  padding: var(--sp-7) var(--gutter); }
.auth-orb { position: absolute; z-index: -1; width: 640px; height: 640px; border-radius: 50%;
  filter: blur(90px); pointer-events: none; right: -160px; top: -160px;
  background: radial-gradient(circle, var(--brand-dim), transparent 65%); }
.auth-card { width: 100%; max-width: 400px; padding: var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-4);
  background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-xl);
  box-shadow: var(--edge-top), var(--shadow-2); }
.auth-card h1 { font-size: var(--fs-xl); font-weight: 700; }
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field label { font-size: var(--fs-sm); color: var(--text-2); }
.field input { width: 100%; min-height: 44px; padding: 0 var(--sp-4);
  border: 1px solid var(--line-1); border-radius: var(--r-md);
  background: var(--bg-2); color: var(--text-1); font-size: var(--fs-base); font-family: inherit;
  transition: border-color var(--t-base); }
.field input::placeholder { color: var(--text-3); }
.field input:focus { border-color: var(--brand); outline: none; }
.err-msg { color: var(--err); font-size: var(--fs-xs); }
.form-alert { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  background: var(--err-dim); color: var(--err); font-size: var(--fs-sm); }
.form-alert.ok { background: var(--ok-dim); color: var(--ok); }
.code-row { display: flex; gap: var(--sp-2); }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { flex: none; }
.auth-foot { display: flex; justify-content: space-between; gap: var(--sp-4); font-size: var(--fs-sm); }
.auth-foot a { color: var(--text-2); transition: color var(--t-base); }
.auth-foot a:hover { color: var(--brand-strong); }

/* ---------- 模型文档基础版 /docs/models/:id ---------- */
.container.doc-main { max-width: 860px; padding-top: var(--sp-7); }
.breadcrumb { font-size: var(--fs-sm); color: var(--text-3); margin-bottom: var(--sp-4); }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--brand-strong); }
.doc-main h1 { font-size: var(--fs-2xl); line-height: var(--lh-snug); font-weight: 700;
  letter-spacing: -0.01em; display: flex; align-items: center; gap: var(--sp-3); }
.doc-badges { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.doc-main h2 { font-size: var(--fs-lg); font-weight: 600; margin: var(--sp-7) 0 var(--sp-3); }
.doc-main h3 { font-size: var(--fs-base); font-weight: 600; margin: var(--sp-5) 0 var(--sp-2); }
.lead { color: var(--text-2); margin: var(--sp-2) 0 var(--sp-3); }
.doc-main code.mono { background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); padding: 2px 6px; font-size: 0.9em; }
.codeblock { position: relative; margin: var(--sp-3) 0; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-md); }
.codeblock pre { padding: var(--sp-4); padding-right: 96px; overflow-x: auto;
  font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.8; color: var(--text-2); }
.codeblock .copy-btn { position: absolute; top: var(--sp-2); right: var(--sp-2); background: var(--bg-1); }

/* ---------- 文档中心 /docs、/docs/{slug}（06 §3.4 三栏） ---------- */
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px;
  gap: var(--sp-7); align-items: start; padding-top: var(--sp-7); }
.docs-side { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow-y: auto; }
.docs-side-m { display: none; }
.ds-group { margin-bottom: var(--sp-5); }
.ds-title { font-size: var(--fs-xs); font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--sp-2); }
.docs-side a, .docs-side-m a { display: block; padding: 6px var(--sp-3); font-size: var(--fs-sm);
  color: var(--text-2); border-left: 2px solid transparent;
  transition: color var(--t-base), border-color var(--t-base), background var(--t-base); }
.docs-side a:hover, .docs-side-m a:hover { color: var(--text-1); }
.docs-side a.on, .docs-side-m a.on { border-left-color: var(--brand); color: var(--brand-strong);
  background: var(--brand-dim); font-weight: 600; }
.docs-article { max-width: 760px; min-width: 0; }
.docs-article h1 { font-size: var(--fs-2xl); line-height: var(--lh-snug); font-weight: 700; letter-spacing: -0.01em; }
.docs-meta { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); }
.docs-toc { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow-y: auto; }
.docs-toc a { display: block; padding: 4px 0; font-size: var(--fs-xs); color: var(--text-3); transition: color var(--t-base); }
.docs-toc a:hover { color: var(--text-1); }
.docs-toc a.toc-l3 { padding-left: var(--sp-4); }

/* Markdown 正文（lib/markdown.ts 输出；06 §3.4 排版合同） */
.md { margin-top: var(--sp-5); }
.md h2 { font-size: var(--fs-lg); font-weight: 600; margin: 48px 0 var(--sp-3);
  padding-bottom: var(--sp-2); border-bottom: 1px solid var(--line-2); }
.md h3 { font-size: var(--fs-md); font-weight: 600; margin: var(--sp-6) 0 var(--sp-2); }
.md h4 { font-size: var(--fs-base); font-weight: 600; margin: var(--sp-5) 0 var(--sp-2); }
.md h2[id], .md h3[id] { scroll-margin-top: 88px; }
.md p { margin: var(--sp-3) 0; color: var(--text-2); }
.md strong { color: var(--text-1); }
.md ul, .md ol { margin: var(--sp-3) 0; padding-left: 1.4em; color: var(--text-2);
  display: flex; flex-direction: column; gap: var(--sp-2); }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md ul ul, .md ol ol, .md ul ol, .md ol ul { margin: var(--sp-2) 0 0; }
.md a { color: var(--brand); }
.md a:hover { color: var(--brand-strong); text-decoration: underline; }
.md code { font-family: var(--font-mono); font-size: 0.88em; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 2px 6px; color: var(--text-1); }
.md pre code { background: transparent; border: 0; padding: 0; font-size: inherit; color: inherit; }
.md .codeblock { margin: var(--sp-4) 0; }
.md .table-scroll { margin: var(--sp-4) 0; }
.md blockquote { margin: var(--sp-4) 0; padding: var(--sp-2) var(--sp-4);
  border-left: 3px solid var(--line-1); color: var(--text-3); }
.md blockquote p { margin: var(--sp-2) 0; color: inherit; }
.md hr { border: 0; border-top: 1px solid var(--line-2); margin: var(--sp-6) 0; }
.callout { margin: var(--sp-4) 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); border-left: 3px solid; }
.callout p { margin: var(--sp-2) 0; }
.callout .callout-title { font-weight: 600; color: var(--text-1); }
.callout-info { background: var(--info-dim); border-left-color: var(--info); }
.callout-warn { background: var(--warn-dim); border-left-color: var(--warn); }
.callout-err { background: var(--err-dim); border-left-color: var(--err); }

/* 上一篇 / 下一篇 */
.docs-pn { display: flex; justify-content: space-between; gap: var(--sp-4);
  margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--line-2); }
.docs-pn a { display: flex; flex-direction: column; gap: 2px; max-width: 48%;
  color: var(--text-1); font-weight: 500; transition: color var(--t-base); }
.docs-pn a small { color: var(--text-3); font-size: var(--fs-xs); font-weight: 400; }
.docs-pn a:hover { color: var(--brand-strong); }
.docs-pn .pn-next { text-align: right; margin-left: auto; }

/* /docs 首页分组目录 */
.docs-idx-group { margin-top: var(--sp-7); }
.docs-idx-group h2 { font-size: var(--fs-lg); font-weight: 600; margin-bottom: var(--sp-4); }
.docs-idx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.docs-idx-card { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); color: var(--text-1); }
.docs-idx-card h3 { font-size: var(--fs-md); font-weight: 600; }
.docs-idx-card p { font-size: var(--fs-sm); color: var(--text-2); flex: 1; }

/* ---------- 动效：滚动进入（§4.2；隐藏态只在 html.js 下生效，禁用 JS 完整可读） ---------- */
.js .reveal { opacity: 0; transform: translateY(26px);
  transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- 页面切换过渡（§4.7） ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: 150ms; }
::view-transition-new(root) { animation-duration: 200ms; }

/* ---------- 响应式（§5.3） ---------- */
@media (max-width: 1023px) {
  .proto { grid-template-columns: 1fr; gap: var(--sp-6); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .model-grid { grid-template-columns: 1fr 1fr; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .docs-idx-grid { grid-template-columns: 1fr 1fr; }
}

/* 文档中心 ≤1024px：单栏，左侧栏折叠为 <details>，右目录隐藏（06 §3.4） */
@media (max-width: 1024px) {
  .docs-layout { grid-template-columns: 1fr; gap: var(--sp-5); }
  .docs-side { display: none; }
  .docs-toc { display: none; }
  .docs-side-m { display: block; border: 1px solid var(--line-1); border-radius: var(--r-md); background: var(--bg-1); }
  .docs-side-m summary { list-style: none; cursor: pointer; min-height: 44px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--sp-4); font-weight: 600; color: var(--text-1); }
  .docs-side-m summary::-webkit-details-marker { display: none; }
  .docs-side-m summary::after { content: "▾"; color: var(--text-3); }
  .docs-side-m[open] summary::after { content: "▴"; }
  .docs-side-m nav { padding: var(--sp-2) var(--sp-3) var(--sp-4); border-top: 1px solid var(--line-2); }
}

@media (max-width: 900px) {
  .pricing { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; }
  .price-card.featured { translate: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .f-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav-links { position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: var(--sp-3) var(--gutter) var(--sp-5); background: var(--bg-glass);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line-1); transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity var(--t-base), transform var(--t-base); margin-left: 0; z-index: 40; }
  #nav-toggle:checked ~ .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: var(--sp-4) var(--sp-2); min-height: 52px; border-bottom: 1px solid var(--line-2); }
  .nav-links a::after { display: none; }
  .nav-burger { display: inline-flex; order: 9; }
  .nav-cta .link { display: none; }
}

@media (max-width: 767px) {
  .footer-bar { flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
  .model-grid { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr; }
  .docs-idx-grid { grid-template-columns: 1fr; }
  .page-head-row { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .search input { flex: 1; width: auto; }
  /* 表格卡片化（06 §5.3：thead 视觉隐藏，td 前置 data-label 小标签） */
  .table-cards { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .table-cards table, .table-cards tbody { display: block; }
  .table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; }
  .table-cards tr { display: block; margin-bottom: var(--sp-3); padding: var(--sp-3) var(--sp-4);
    background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-md); box-shadow: var(--edge-top); }
  .table-cards td { display: flex; gap: var(--sp-3); padding: 6px 0; border-bottom: 0; }
  .table-cards td::before { content: attr(data-label); flex: none; width: 72px;
    color: var(--text-3); font-size: var(--fs-xs); line-height: inherit; }
  .table-cards td:not([data-label])::before { content: none; }
}

/* ---------- prefers-reduced-motion 完整降级（§4.8，必须最后） ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  @view-transition { navigation: none; }
}
