:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #15181d; --muted: #5b6472; --line: #e4e7ec; --line-strong: #cfd5dd;
  --accent: #0f766e; --accent-ink: #0b5d57; --accent-soft: #e6f2f0;
  --ok: #166534; --ok-bg: #dcfce7; --prev: #1d4ed8; --prev-bg: #dbeafe; --road: #52525b; --road-bg: #e4e4e7;
  --head-bg: #f2f4f6;
  --shadow-sm: 0 1px 2px rgba(21,24,29,.05);
  --shadow-md: 0 4px 16px rgba(21,24,29,.07);
  --sans: -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
}
/* —— ↑ site :root 派生 token（build.mjs 前拼，勿手改） —— */
/* Dicaria Console 样式（全局壳层 2026-11-18 并轨）
   视觉 token（--bg/--panel/--ink/--muted/--line/--accent/…/--sans/--mono）由 console/build.mjs
   构建期从 site/public/style.css :root 前拼派生——本文件禁止自定义共享 token，只留 console 专属变量。
   壳层 = 顶栏（品牌 + 文档 + 用户菜单）+ 左侧栏（产品导航 + 资源），为后续 settings/usage/billing
   页预留可扩展骨架（条目随真实功能逐项点亮，不摆死链）。 */

:root {
  /* console 专属（site :root 未覆盖的补充） */
  --danger: #b91c1c;
  --warn-bg: #fdf3c4; --warn-line: #e5d377;   /* 密钥一次性明文警示（产品内警示语义，保留暖黄） */
}

* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.7 var(--sans); color: var(--ink); background: var(--bg); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(15,118,110,.18); }
h1, h2, h3 { line-height: 1.3; font-weight: 700; margin: 0; }
h2 { font-size: 1.15rem; }
p { margin: .5em 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--accent-soft); padding: .1em .35em; border-radius: 3px; }
.dim { color: var(--muted); font-size: .86em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.eyebrow { color: var(--accent-ink); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
.pill { display: inline-block; padding: 2px 12px; border: 1px solid var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--accent-soft); white-space: nowrap; }

/* ── 顶栏（官网 .nav 同形：白底 + 1px 下边线 + 60px 高 + sticky）── */
.ctop { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.ctop-in { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 18px; height: 60px; }
.cbrand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.1rem; color: var(--ink); letter-spacing: .02em; white-space: nowrap; }
.brand-mark { display: block; width: 24px; height: 24px; }
.cbrand span { color: var(--accent-ink); }
.cbrand:hover { text-decoration: none; color: var(--accent-ink); }
.ctop-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: .9rem; }
.clink { color: var(--muted); white-space: nowrap; }
.clink:hover { color: var(--accent-ink); }

/* 用户菜单：details 原生下拉（官网 .nav-lang 同款形态；console.js 点外部/ESC 收起） */
.cuser { position: relative; }
.cuser summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border: 1px solid var(--line); border-radius: 6px; font-size: .88rem; white-space: nowrap; color: var(--accent-ink); background: var(--panel); cursor: pointer; }
.cuser summary::-webkit-details-marker { display: none; }
.cuser summary:hover { border-color: var(--accent); }
.cuser-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.cuser-caret { font-size: .68rem; color: var(--muted); transition: transform .15s; }
.cuser[open] .cuser-caret { transform: rotate(180deg); }
.cuser-drop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 2px; z-index: 30; }
.cuser-drop a, .cuser-drop button { text-align: left; padding: 7px 10px; border-radius: 6px; font-size: .88rem; background: none; border: 0; font: inherit; color: var(--accent-ink); cursor: pointer; white-space: nowrap; }
.cuser-drop a:hover, .cuser-drop button:hover { background: var(--head-bg); text-decoration: none; }

/* ── 壳层：左侧栏 + 主区（幅宽对齐官网 1200）── */
.cshell { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 0 40px; }
.cside { padding: 28px 0 40px; }
.cside-nav { display: flex; flex-direction: column; gap: 2px; }
.cside-nav a { padding: 7px 12px; border-left: 2px solid var(--line); border-radius: 0 6px 6px 0; color: var(--muted); font-size: .95rem; }
.cside-nav a:hover { color: var(--accent-ink); background: var(--head-bg); text-decoration: none; }
.cside-nav a[aria-current="page"] { border-left-color: var(--accent); color: var(--accent-ink); font-weight: 600; background: var(--accent-soft); }
.cside-sec { margin: 24px 0 6px; padding-left: 14px; font-size: .78rem; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.cmain { padding: 28px 0 64px; min-width: 0; }

/* ── 概览三卡 + 密钥表 ── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; box-shadow: var(--shadow-sm); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cpage-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 28px 0 12px; }
.kpi { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: .95rem; color: var(--muted); font-weight: 600; }
.kpi--txt { font-size: 1.25rem; }
.plan-foot { margin-top: 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 按钮 */
.btn { display: inline-block; padding: 8px 18px; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 600; border: 1px solid var(--accent); font: inherit; font-size: .92rem; cursor: pointer; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--accent-ink); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--accent-ink); border: 1px solid var(--line-strong); box-shadow: none; }
.btn--ghost:hover { border-color: var(--accent); background: transparent; }
.btn--sm { padding: 5px 12px; font-size: .85rem; }
.btn--full { width: 100%; text-align: center; cursor: pointer; }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); box-shadow: none; }

/* 徽章 */
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge--ok { color: var(--ok); background: var(--ok-bg); }
.badge--road { color: var(--road); background: var(--road-bg); }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--head-bg); font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl code { white-space: nowrap; }
.is-revoked td { color: var(--muted); }
.th-op { text-align: right; }
.th-op .btn { white-space: nowrap; }

/* 对话框 */
.dlg { border: 1px solid var(--line); border-radius: 12px; padding: 0; max-width: 460px; width: calc(100vw - 40px); background: var(--panel); color: var(--ink); }
.dlg::backdrop { background: rgba(21, 24, 29, .4); }
.dlg-form, .dlg-result { padding: 22px 24px; }
.dlg-form h2, .dlg-result h2 { font-size: 1.1rem; margin-bottom: 10px; }
.dlg-label { display: block; font-size: .88rem; font-weight: 600; margin: 12px 0 4px; }
.dlg-label input { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; background: #fff; margin-top: 6px; }
.dlg-label input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.dlg-warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 10px 12px; font-size: .88rem; }
.key-once { position: relative; background: #1c2127; border-radius: 8px; padding: 14px 16px; margin-top: 12px; }
.key-once code { background: none; color: #e8eaed; font-size: .95rem; word-break: break-all; }
.copy-btn { position: absolute; top: 8px; right: 8px; padding: 2px 10px; font-size: .78rem; border: 1px solid #4a5058; border-radius: 4px; background: #2b3138; color: #c8cdd3; cursor: pointer; }
.copy-btn:hover { background: #383f47; }

/* ── 登录（bare 外壳）：居中单卡——行业惯例（Stripe / Clerk / Vercel 同款）── */
.auth-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 30px 24px; box-shadow: var(--shadow-md); }
.auth-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.auth-brand span { color: var(--accent-ink); }
.auth-brand:hover { text-decoration: none; color: var(--accent-ink); }
.auth-card h1 { font-size: 1.35rem; margin: 20px 0 6px; }
.auth-sub { color: var(--muted); font-size: .9rem; margin: 0 0 22px; }
.auth-card label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.auth-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; background: #fff; font-size: 16px; }
.auth-card input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.auth-card input::placeholder { color: #a8adb4; }
.auth-card .btn--full { margin-top: 14px; padding: 11px 18px; border-radius: 8px; font-size: .95rem; }
.auth-sent { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; margin: 0 0 16px; font-size: .84rem; color: var(--accent-ink); }
.auth-card .otp-input { letter-spacing: .38em; text-align: center; font-family: var(--mono); font-size: 20px; padding: 12px 8px; }
.auth-aux { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: .86rem; }
.err { color: var(--danger); font-size: .86rem; min-height: 1.2em; margin: 14px 0 0; }
.auth-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.auth-links { display: flex; justify-content: center; gap: 8px; align-items: center; margin: 12px 0 0; font-size: .85rem; color: var(--muted); }
.link { color: var(--accent-ink); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }
.link[disabled] { color: var(--muted); cursor: default; text-decoration: none; }

/* ── 响应式 ── */
@media (max-width: 860px) {
  .cshell { grid-template-columns: 1fr; gap: 0; }
  .cside { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
  .cside-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .cside-nav a { border-left: 0; border-radius: 6px; padding: 5px 10px; }
  .cside-sec { display: none; }   /* 资源组移动端收起：文档在顶栏、回官网在用户菜单，均有常驻位 */
  .cmain { padding-top: 20px; }
  .cuser-name { max-width: 130px; }
}
@media (max-width: 720px) {
  .trio { grid-template-columns: 1fr; }
  .tbl { display: block; overflow-x: auto; }
}
