/* ==========================================================================
   纷纷布谷 · 未来感设计系统（HUD）
   深空底 + 透视网格 + 极光光晕；玻璃面板、渐变描边、霓虹强调。
   品牌苔绿保留为主色，向电光青、星紫渐变；谷金只做告警。
   组件的未来感覆盖集中在文件末尾「未来感 HUD 层」。
   ========================================================================== */

:root {
  color-scheme: dark;

  /* 表面：深空蓝黑，抬升靠冷色透明度 + 毛玻璃 */
  --paper: #05070b;
  --bg: #0d121a;
  --card: #0a0f16;
  --raised: #111823;
  --glass: rgba(14, 21, 31, 0.62);
  --glass-strong: rgba(16, 24, 36, 0.82);
  --surface-1: rgba(120, 190, 255, 0.025);
  --surface-2: rgba(120, 190, 255, 0.055);
  --surface-hover: rgba(120, 190, 255, 0.045);
  --surface-3: rgba(120, 190, 255, 0.035);
  --topbar-bg: rgba(5, 7, 11, 0.62);
  --input-bg: rgba(8, 13, 20, 0.7);
  --btn-bg: rgba(120, 190, 255, 0.04);
  --btn-bg-hover: rgba(120, 190, 255, 0.09);
  --on-accent: #031015;
  --hero-glow: 0 0 40px rgba(34, 211, 238, 0.35);
  --bg-image: none;

  /* 背景特效 */
  --grid-line: rgba(110, 200, 255, 0.055);
  --aurora-1: rgba(74, 222, 128, 0.13);
  --aurora-2: rgba(34, 211, 238, 0.12);
  --aurora-3: rgba(129, 140, 248, 0.10);

  /* 文字：冷白，不用纯白 */
  --ink: #eaf3ff;
  --ink-2: #b9c7d8;
  --ink-3: #8597ad;
  --ink-4: #5c6d83;

  /* 描边：冷色半透明，悬停时点亮 */
  --line: rgba(140, 200, 255, 0.11);
  --line-soft: rgba(140, 200, 255, 0.07);
  --line-strong: rgba(140, 220, 255, 0.24);
  --line-glow: rgba(34, 211, 238, 0.45);

  /* 品牌：苔绿 → 电光青 → 星紫 */
  --moss: #4ade80;
  --moss-dim: #35b866;
  --moss-soft: rgba(74, 222, 128, 0.12);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.12);
  --violet: #818cf8;
  --grain: #f5b942;
  --grain-soft: rgba(245, 185, 66, 0.12);
  --clay: #f87171;
  --clay-soft: rgba(248, 113, 113, 0.12);
  --grad: linear-gradient(115deg, #4ade80 0%, #22d3ee 52%, #818cf8 100%);
  --glow: 0 0 0 1px rgba(34, 211, 238, 0.18), 0 10px 40px -12px rgba(34, 211, 238, 0.35);
  --glow-sm: 0 0 18px -6px rgba(34, 211, 238, 0.55);

  --serif: "Songti SC", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r: 14px;
  --shadow: 0 1px 0 rgba(180, 230, 255, 0.04) inset, 0 24px 48px -32px rgba(0, 0, 0, 0.95);
}

/* ---------- 浅色主题：冷白实验室，不是简单反色 ---------- */
[data-theme="light"] {
  color-scheme: light;

  --paper: #f2f6fb;
  --bg: #ffffff;
  --card: #ffffff;
  --raised: #f6f9fc;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --surface-1: rgba(255, 255, 255, 0.7);
  --surface-2: #eef3f9;
  --surface-hover: #f1f6fb;
  --surface-3: #f5f8fc;
  --topbar-bg: rgba(242, 246, 251, 0.72);
  --input-bg: #ffffff;
  --btn-bg: rgba(255, 255, 255, 0.85);
  --btn-bg-hover: #ffffff;

  --grid-line: rgba(20, 60, 120, 0.06);
  --aurora-1: rgba(21, 128, 61, 0.08);
  --aurora-2: rgba(8, 145, 178, 0.09);
  --aurora-3: rgba(79, 70, 229, 0.07);

  --ink: #0b1524;
  --ink-2: #33445a;
  --ink-3: #5d6f86;
  --ink-4: #8a99ad;
  --on-accent: #ffffff;

  --line: rgba(20, 50, 90, 0.13);
  --line-soft: rgba(20, 50, 90, 0.08);
  --line-strong: rgba(20, 50, 90, 0.22);
  --line-glow: rgba(8, 145, 178, 0.5);

  --moss: #15803d;
  --moss-dim: #166534;
  --moss-soft: rgba(21, 128, 61, 0.1);
  --cyan: #0891b2;
  --cyan-soft: rgba(8, 145, 178, 0.1);
  --violet: #4f46e5;
  --grain: #b45309;
  --grain-soft: rgba(180, 83, 9, 0.1);
  --clay: #dc2626;
  --clay-soft: rgba(220, 38, 38, 0.08);
  --grad: linear-gradient(115deg, #15803d 0%, #0891b2 52%, #4f46e5 100%);
  --glow: 0 0 0 1px rgba(8, 145, 178, 0.16), 0 14px 36px -18px rgba(8, 145, 178, 0.35);
  --glow-sm: 0 0 16px -6px rgba(8, 145, 178, 0.45);

  --shadow: 0 1px 2px rgba(16, 40, 80, 0.04), 0 14px 36px -28px rgba(16, 40, 80, 0.3);
  --hero-glow: none;
  --bg-image: none;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-image), var(--paper);
  transition: background-color 0.2s ease, color 0.2s ease;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--moss-soft); color: var(--ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 99px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: padding-box; }

a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--moss); }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.022em; margin: 0; color: var(--ink); }

code, pre { font-family: var(--mono); }

/* Agent 接入：只保留提示词预览和密钥管理，创建与复制在弹窗内完成。 */
.agent-install { padding: 0 0 28px; }
.agent-copy-bar { display: flex; align-items: center; gap: 20px; padding: 10px 12px 10px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.agent-prompt-preview { margin: 0; min-width: 0; flex: 1; font-size: 15px; line-height: 1.8; color: var(--ink); user-select: none; -webkit-user-select: none; overflow-wrap: anywhere; }
.agent-copy-bar .btn { flex-shrink: 0; padding: 12px 20px; }
.agent-copy-hint { margin: 12px 0; font-size: 12px; line-height: 1.8; color: var(--ink-3); }
.agent-access table { width: 100%; overflow-wrap: anywhere; }
.agent-prompt { display: block; width: 100%; margin: 14px 0; padding: 14px; font-family: var(--mono); font-size: 12px; line-height: 1.7; resize: vertical; }
.agent-access #keys { scroll-margin-top: 80px; }
.agent-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); }
.agent-dialog::backdrop { background: rgba(0,0,0,.55); }
.agent-dialog .form { margin-top: 24px; }
.agent-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.agent-result-dialog { width: min(660px, calc(100vw - 32px)); }
.agent-form-error { color: #f87171; font-size: 13px; }
@media (max-width: 600px) {
  .agent-copy-bar { align-items: stretch; flex-direction: column; gap: 14px; padding: 18px; }
  .agent-dialog { padding: 22px; }
}
header.topbar { z-index: 40; }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: 8px; cursor: pointer; color: var(--ink-2); list-style: none; max-width: 190px; overflow-wrap: anywhere; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; padding: 6px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.account-dropdown a, .account-dropdown button { display: block; width: 100%; padding: 10px 12px; text-align: left; border: 0; border-radius: 6px; color: var(--ink-2); background: transparent; font: inherit; cursor: pointer; }
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--surface-2); color: var(--ink); }
.account-dropdown form { margin: 0; border-top: 1px solid var(--line-soft); }

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.wrap.wide { width: min(1380px, calc(100% - 48px)); }

main { flex: 1 0 auto; }

.skip {
  position: absolute; left: -999px; top: 8px; background: var(--moss); color: var(--on-accent);
  padding: 8px 14px; border-radius: 6px; z-index: 99; font-weight: 600;
}
.skip:focus { left: 12px; }

/* ---------- 顶栏 ---------- */
.site-header { position: sticky; top: 0; z-index: 40; flex: 0 0 auto; }
.site-header header.topbar { position: relative; top: auto; }
.skill-notice {
  background: var(--bg); color: var(--ink-2);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.skill-notice-content { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; padding: 9px 0; font-size: 12px; line-height: 1.6; }
.skill-notice-content a { flex: 0 0 auto; color: var(--moss); font-weight: 600; }
.skill-notice-content a:hover { text-decoration: underline; }
.skill-notice-content > span { flex: 1 1 460px; min-width: 0; overflow-wrap: anywhere; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .wrap { display: flex; align-items: center; gap: 26px; height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand .mark {
  width: 26px; height: 28px; flex: 0 0 auto; background: var(--moss);
  -webkit-mask: url(/static/logo-linktrees.png) no-repeat center / contain;
          mask: url(/static/logo-linktrees.png) no-repeat center / contain;
}
.brand b { display: block; font-size: 16px; letter-spacing: 0.02em; line-height: 1.2; font-weight: 600; }
.brand i {
  display: block; font-style: normal; font-size: 9.5px; color: var(--ink-4);
  letter-spacing: 0.2em; text-transform: uppercase; margin-top: 2px;
}

.mainnav { display: flex; gap: 2px; flex: 1 1 auto; }
.mainnav a {
  padding: 6px 12px; border-radius: 7px; font-size: 13.5px; color: var(--ink-3);
  transition: background 0.15s ease, color 0.15s ease;
}
.mainnav a:hover { background: var(--surface-2); color: var(--ink); }
.mainnav a.on { color: var(--ink); background: var(--surface-2); }

.account { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); flex: 0 0 auto; }
/* 右上角「看板」入口 */
.board-entry {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--glass);
  font-size: 12.5px; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.board-entry span { font-size: 10px; opacity: .55; }
.board-entry:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-2); }
@media (max-width: 700px) {
  .board-entry { padding: 6px 10px; font-size: 12px; }
  .board-entry span { display: none; }
}
.account .who { padding-right: 2px; color: var(--ink-2); }
.account form.inline { margin: 0; display: inline; }

.ghost {
  border: 1px solid var(--line); background: var(--btn-bg); color: var(--ink-2);
  border-radius: 7px; padding: 5px 11px; font-size: 12.5px; font-family: inherit;
  cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.ghost:hover { border-color: var(--line-strong); color: var(--ink); background: var(--btn-bg-hover); }

/* ---------- hero ---------- */
.hero { padding: 78px 0 50px; display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 60px; align-items: end; }
.eyebrow {
  font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-4);
  margin: 0 0 20px; font-weight: 600;
}
.hero h1 { font-size: clamp(38px, 5.2vw, 64px); line-height: 1.04; letter-spacing: -0.038em; font-weight: 600; }
.hero h1 em {
  font-style: normal; color: var(--moss); padding-left: 0.2em;
  text-shadow: var(--hero-glow);
}
.hero .lede { margin: 24px 0 0; max-width: 44ch; color: var(--ink-3); font-size: 15.5px; line-height: 1.85; }

.hero-side { border-left: 1px solid var(--line-soft); padding-left: 30px; }
.hero-side dl { margin: 0; display: grid; gap: 20px; }
.hero-side dt { font-size: 10.5px; letter-spacing: 0.16em; color: var(--ink-4); text-transform: uppercase; }
.hero-side dd {
  margin: 4px 0 0; font-size: 27px; font-weight: 600; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* ---------- section ---------- */
.section { padding: 46px 0; border-top: 1px solid var(--line-soft); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head h2 { font-size: 21px; letter-spacing: -0.025em; }
.section-head .more { font-size: 12.5px; color: var(--ink-4); }
.section-head .more:hover { color: var(--moss); }
.section-note { color: var(--ink-4); font-size: 13px; margin: -12px 0 22px; max-width: 66ch; line-height: 1.75; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.grid.tight { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }

.card {
  position: relative; background: var(--surface-1); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 22px 22px 20px; box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  overflow: hidden;
}
a.card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--surface-hover); }

.toolcard { display: block; }
.toolcard .no { font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); letter-spacing: 0.12em; }
.toolcard h3 { font-size: 19px; margin: 12px 0 7px; letter-spacing: -0.02em; }
.toolcard p { margin: 0; color: var(--ink-3); font-size: 13.5px; line-height: 1.72; min-height: 46px; }
.toolcard .go { margin-top: 18px; font-size: 12.5px; color: var(--moss); display: flex; align-items: center; gap: 6px; }
.toolcard .go::after { content: "→"; transition: transform 0.15s ease; }
.toolcard:hover .go::after { transform: translateX(3px); }

.pcard { display: block; padding-left: 24px; }
.pcard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent, var(--moss)), transparent 88%);
  opacity: 0.95; filter: brightness(1.45) saturate(1.15);
}
[data-theme="light"] .pcard::before { filter: brightness(0.75) saturate(1.1);
}
.pcard .code { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--ink-4); text-transform: uppercase; }
.pcard h3 { font-size: 18.5px; margin: 8px 0 5px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; letter-spacing: -0.02em; }
.pcard .tagline { color: var(--ink-3); font-size: 13px; margin: 0; line-height: 1.68; }
.pcard .meta { margin-top: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-4); }
.pcard .ext { margin-left: auto; font-size: 12px; color: var(--moss); }
.pcard .ext.muted { color: var(--ink-4); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px;
  padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line);
  color: var(--ink-3); background: var(--surface-3); white-space: nowrap;
  font-weight: 500; letter-spacing: 0.01em;
}
.badge.ok { color: var(--moss); border-color: var(--moss); background: var(--moss-soft); }
.badge.warn { color: var(--grain); border-color: var(--grain); background: var(--grain-soft); }
.badge.err { color: var(--clay); border-color: var(--clay); background: var(--clay-soft); }
.badge.plain { color: var(--ink-4); }

/* ---------- page head ---------- */
.pagehead { padding: 56px 0 30px; }
.pagehead h1 { font-size: clamp(29px, 3.4vw, 41px); letter-spacing: -0.032em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagehead p { margin: 14px 0 0; color: var(--ink-3); max-width: 62ch; line-height: 1.8; }
.crumb { font-size: 12px; color: var(--ink-4); margin-bottom: 16px; }
.crumb a:hover { color: var(--moss); }

/* ---------- filters ---------- */
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 24px; }
.chip {
  border: 1px solid var(--line); border-radius: 99px; padding: 4px 13px; font-size: 12.5px;
  color: var(--ink-3); background: transparent; transition: all 0.15s ease;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.on { background: var(--moss); border-color: var(--moss); color: var(--on-accent); font-weight: 600; }

/* ---------- tables ---------- */
.panel {
  background: var(--surface-1); border: 1px solid var(--line-soft);
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
  padding: 15px 20px; border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.panel-head h3 { font-size: 15px; letter-spacing: -0.015em; }
.panel-body { padding: 20px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 600; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-4); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--surface-hover); }
td a { color: var(--ink); }
td a:hover { color: var(--moss); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
td.actions { text-align: right; white-space: nowrap; }
td.actions a, td.actions button { margin-left: 6px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--ink-4); line-height: 1.6; }
input[type=text], input[type=url], input[type=password], input[type=search], select, textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--input-bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--moss); background: var(--input-bg);
  box-shadow: 0 0 0 3px var(--moss-soft);
}
select {
  appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  border-radius: 8px; padding: 9px 17px; border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.btn.primary { background: var(--moss); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); color: var(--on-accent); }
.btn.secondary { background: var(--btn-bg); border-color: var(--line); color: var(--ink-2); }
.btn.secondary:hover { border-color: var(--line-strong); color: var(--ink); background: var(--btn-bg-hover); }
.btn.danger { background: transparent; border-color: var(--clay); color: var(--clay); }
.btn.danger:hover { background: var(--clay-soft); }
.btn.sm { padding: 4px 11px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- flash / empty ---------- */
.flash { border-radius: 8px; padding: 11px 15px; font-size: 13px; margin: 0 0 20px; border: 1px solid var(--line); }
.flash.ok { background: var(--moss-soft); border-color: var(--moss); color: var(--moss); }
.flash.warn { background: var(--grain-soft); border-color: var(--grain); color: var(--grain); }
.flash.err { background: var(--clay-soft); border-color: var(--clay); color: var(--clay); }

.empty { text-align: center; padding: 54px 20px; color: var(--ink-4); }
.empty p { margin: 0; font-size: 15px; color: var(--ink-2); }
.empty .hint { font-size: 12.5px; margin-top: 7px; color: var(--ink-4); }

/* ---------- login ---------- */
.login-wrap { min-height: calc(100vh - 62px - 130px); display: grid; place-items: center; padding: 40px 0; }
.login-card { width: min(430px, 100%); background: var(--card); border-color: var(--line); }
.login-card h1 { font-size: 25px; letter-spacing: -0.03em; margin-bottom: 7px; }
.login-card .sub { color: var(--ink-4); font-size: 13px; margin: 0 0 24px; }
.login-card .btn { width: 100%; margin-top: 4px; }

/* ---------- stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
  background: var(--line-soft); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-soft);
}
.stat { background: var(--card); padding: 18px 20px; }
.stat .k { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4); }
.stat .v {
  font-size: 24px; margin-top: 6px; font-variant-numeric: tabular-nums;
  font-weight: 600; letter-spacing: -0.03em;
}
.stat .v small { font-size: 12.5px; color: var(--ink-4); margin-left: 4px; font-weight: 400; }

/* ---------- meter ---------- */
.meter { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--moss); border-radius: 99px; transition: width 0.4s ease; }
.meter > i.warn { background: var(--grain); }
.meter > i.err { background: var(--clay); }

/* ---------- project detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.detail .prose p { color: var(--ink-3); line-height: 1.9; }
.side-list { display: grid; gap: 1px; background: var(--line-soft); border-radius: var(--r); overflow: hidden; }
.side-list .item { background: var(--card); padding: 13px 16px; }
.side-list .k { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); }
.side-list .v { margin-top: 3px; font-size: 13.5px; word-break: break-all; color: var(--ink-2); }

/* ---------- resource rows ---------- */
.res { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.res:last-child { border-bottom: 0; }
.res .kind {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--ink-4);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; flex: 0 0 auto;
  margin-top: 2px; text-transform: uppercase; background: var(--surface-3);
}
.res .body { flex: 1 1 auto; min-width: 0; }
.res .title { font-size: 13.5px; }
.res .note { font-size: 12px; color: var(--ink-4); margin-top: 3px; line-height: 1.6; }
.res .url { font-family: var(--mono); font-size: 11px; color: var(--moss-dim); word-break: break-all; margin-top: 3px; }

/* ---------- sms 精简页 ---------- */
.sms-list { display: grid; gap: 1px; }

/* ---------- 短信子应用 iframe ---------- */
.sms-frame-wrap { overflow: hidden; }
.sms-frame { display: block; width: 100%; border: 0; min-height: 900px; background: var(--card); }
@media (max-width: 820px) {
  /* 窄屏铺满可视区，由子应用内部滚动，不再跟随内容无限拉长 */
  .sms-frame { min-height: 0; height: calc(100vh - 210px); height: calc(100dvh - 210px); }
  .sms-head { padding-bottom: 10px !important; }
}
@media (max-width: 600px) {
  .sms-head p { display: none; }
  .sms-head { padding-bottom: 6px !important; }
  .sms-note { display: none; }
  .sms-frame { height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 420px; border-radius: 12px; }
}
.sms-item { padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.sms-item:last-child { border-bottom: 0; }
.sms-item .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sms-item .sender { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.sms-item .time { margin-left: auto; font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.sms-item .content { margin: 8px 0 0; font-size: 13.5px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.sms-item .otp {
  font-family: var(--mono); font-size: 14px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--moss); background: var(--moss-soft); border-radius: 5px; padding: 1px 7px;
}

/* ---------- dashboard ---------- */
.svc { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.svc:last-child { border-bottom: 0; }
.svc .name { font-size: 13.5px; font-weight: 500; }
.svc .sub { font-size: 11px; color: var(--ink-4); font-family: var(--mono); margin-top: 2px; }
.svc .state { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.dot { width: 6px; height: 6px; border-radius: 99px; background: var(--ink-4); flex: 0 0 auto; }
.dot.ok { background: var(--moss); box-shadow: 0 0 0 3px var(--moss-soft); }
.dot.err { background: var(--clay); box-shadow: 0 0 0 3px var(--clay-soft); }
.dot.warn { background: var(--grain); box-shadow: 0 0 0 3px var(--grain-soft); }

.loading { color: var(--ink-4); font-size: 12.5px; padding: 30px; text-align: center; }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: 190px 1fr; gap: 34px; align-items: start; }
.admin-nav { display: grid; gap: 1px; position: sticky; top: 88px; }
.admin-nav a { padding: 8px 13px; border-radius: 7px; font-size: 13px; color: var(--ink-3); transition: all 0.15s ease; }
.admin-nav a:hover { background: var(--surface-2); color: var(--ink); }
.admin-nav a.on { background: var(--moss-soft); color: var(--moss); font-weight: 600; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.admin-head h1 { font-size: 24px; }
.admin-head .sub { font-size: 12.5px; color: var(--ink-4); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line-soft); margin-top: 60px; padding: 24px 0 38px; flex: 0 0 auto; }
.foot .wrap { display: flex; justify-content: space-between; gap: 20px; font-size: 11.5px; color: var(--ink-4); flex-wrap: wrap; }
/* 备案号：按工信部要求可点击跳转，颜色跟随页脚但保持可读 */
.foot-mid { flex: 1 1 auto; text-align: center; }
.foot-icp { color: var(--ink-3); text-decoration: none; transition: color .16s ease; }
.foot-icp:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 700px) {
  .foot-mid { order: 3; flex-basis: 100%; text-align: left; }
}

form.inline { display: inline; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 48px 0 32px; }
  .hero-side { border-left: 0; border-top: 1px solid var(--line-soft); padding: 22px 0 0; }
  .detail { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; flex-wrap: wrap; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .topbar .wrap { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px 16px; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; }
  .wrap, .wrap.wide { width: calc(100% - 32px); }
}

@media (max-width: 600px) {
  /* 管理台的宽表格在窄屏内部滚动，避免整页被撑宽 */
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-grid, .admin-grid > * { min-width: 0; }
  .panel { overflow-x: auto; min-width: 0; }
  .panel table { min-width: 560px; }
  .quota-meta, .quota-metrics, .quota-foot { padding-left: 16px; padding-right: 16px; }
  .quota-card .panel-head { min-width: 0; }
}

/* ---------- 飞书登录 ---------- */
.btn.feishu { background: #3370ff; color: #fff; width: 100%; padding: 11px 18px; font-size: 14.5px; font-weight: 600; }
.btn.feishu:hover { background: #4a83ff; color: #fff; }
.btn.feishu .feishu-mark { flex: 0 0 auto; }
.login-hint { font-size: 12px; color: var(--ink-4); text-align: center; margin: 12px 0 0; }
.login-local { margin-top: 22px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.login-local summary { cursor: pointer; font-size: 12.5px; color: var(--ink-4); outline: none; }
.login-local summary:hover { color: var(--moss); }
.login-local .form { margin-top: 14px; }
.login-foot { font-size: 11px; color: var(--ink-4); margin: 22px 0 0; text-align: center; line-height: 1.65; }

/* ---------- 主题切换 ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--btn-bg); color: var(--ink-3);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover { color: var(--moss); border-color: var(--line-strong); background: var(--btn-bg-hover); }
.theme-toggle svg { width: 15px; height: 15px; }

/* Codex 多账号额度 */
/* Codex 账号：账号信息集中，额度窗口并排，积分作为次要信息。 */
.codex-page{max-width:1180px;margin-inline:auto}
.codex-page .pagehead{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:38px 0 26px;margin:0}
.codex-page .pagehead h1{font-family:var(--sans);font-size:32px;letter-spacing:-.045em;font-weight:650}
.codex-page .pagehead .eyebrow{font-size:10px;letter-spacing:.2em;margin:0 0 10px;color:var(--ink-4)}
.codex-page .pagehead .lede{font-size:14px;line-height:1.6;margin:10px 0 0}
.codex-auto-sync{display:inline-flex;align-items:center;gap:7px;margin-top:12px;font-size:11px;color:var(--ink-3)}
.codex-auto-sync i,.codex-state i{width:5px;height:5px;flex:none;border-radius:50%;background:currentColor}
.codex-auto-sync i{color:var(--moss)}
.codex-actions,.codex-row-actions,.codex-tabs,.codex-dialog-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.codex-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--line);margin:0 0 24px}
.codex-stat{padding:18px 22px;background:var(--card);display:flex;align-items:center;justify-content:space-between;gap:16px}
.codex-stat>span{font-size:12px;color:var(--ink-3)}
.codex-stat strong{font-size:26px;font-weight:600;letter-spacing:-.05em;font-variant-numeric:tabular-nums;color:var(--ink)}
.codex-stat strong small{font-size:11px;font-weight:400;letter-spacing:0;margin-left:8px;color:var(--ink-4)}
.codex-stat.is-low strong{color:var(--clay)}.codex-stat.is-warning strong{color:var(--grain)}
.codex-filters{display:flex;align-items:flex-end;gap:14px;margin:0 0 16px}
.codex-filters label{display:grid;gap:7px;font-size:11px;color:var(--ink-3)}
.codex-filters .codex-search{flex:1;max-width:360px}
.codex-filters input[type=search]{width:100%;min-width:0}.codex-filters select{min-width:172px}
.codex-filters input[type=search],.codex-filters select{height:38px;padding:8px 12px;font-size:12px;border-radius:8px}
.codex-filters .codex-check{display:flex;align-items:center;gap:8px;min-height:38px;margin-left:auto;white-space:nowrap;font-size:12px;color:var(--ink-2)}
.codex-check input{width:14px;height:14px;accent-color:var(--moss)}
.codex-table-wrap{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--card)}
.codex-table{width:100%;border-collapse:collapse;table-layout:fixed}
.codex-table th,.codex-table td{text-align:left;padding:22px;vertical-align:middle}
.codex-table th{padding-top:13px;padding-bottom:13px;background:var(--surface-2);font-size:10px;font-weight:500;letter-spacing:.04em;color:var(--ink-3);white-space:nowrap;border-bottom:1px solid var(--line)}
.codex-table th:first-child{width:32%}.codex-table th:nth-child(2){width:auto}.codex-table th:nth-child(3){width:130px}.codex-table th:nth-child(4){width:184px}
.codex-table .codex-account-row+.codex-account-row td{border-top:1px solid var(--line-soft)}
.codex-table .codex-account-row{transition:background .15s}.codex-table .codex-account-row:hover{background:var(--surface-hover)}
.codex-identity{display:flex;align-items:flex-start;gap:12px;min-width:0}
.codex-avatar{display:grid;place-items:center;width:36px;height:36px;flex:none;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);color:var(--ink-3);font-size:14px;font-weight:600}
.codex-account-info{min-width:0;padding-top:1px}
.codex-account-info>strong{display:block;font-size:14px;font-weight:550;line-height:1.5;color:var(--ink);overflow-wrap:anywhere}
.codex-email{display:block;font-size:12px;color:var(--ink-3);margin-top:3px;overflow-wrap:anywhere}
.codex-account-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:9px}
.codex-plan{font-size:10px;font-weight:550;letter-spacing:.03em;color:var(--ink-2);border:1px solid var(--line);background:var(--surface-2);border-radius:5px;padding:2px 6px;line-height:1.5;white-space:nowrap}
.codex-state{display:inline-flex;align-items:center;gap:5px;color:var(--moss);font-size:11px;white-space:nowrap}
.codex-state.is-low{color:var(--clay)}.codex-state.is-warning{color:var(--grain)}.codex-state.is-refreshing{color:var(--ink-3)}
.codex-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 22px}
.codex-metric:only-child{grid-column:1/-1}.codex-metric{min-width:0}
.codex-metric>div{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.codex-metric>div>span{font-size:12px;color:var(--ink-3);overflow-wrap:anywhere}
.codex-metric b{font-size:22px;line-height:1.2;font-weight:600;letter-spacing:-.045em;font-variant-numeric:tabular-nums;color:var(--ink);white-space:nowrap}
.codex-metric small{display:block;font-size:11px;line-height:1.5;color:var(--ink-4)}
.codex-metric progress,.codex-unknown-bar{display:block;width:100%;height:4px;margin:9px 0 7px;accent-color:var(--moss);border:0;border-radius:8px;overflow:hidden;background:var(--line)}
.codex-metric progress::-webkit-progress-bar{background:var(--line)}.codex-metric progress::-webkit-progress-value{background:var(--moss);border-radius:8px}.codex-metric progress::-moz-progress-bar{background:var(--moss);border-radius:8px}
.codex-metric.is-low b{color:var(--clay)}.codex-metric.is-low progress{accent-color:var(--clay)}.codex-metric.is-low progress::-webkit-progress-value{background:var(--clay)}.codex-metric.is-low progress::-moz-progress-bar{background:var(--clay)}
.codex-balances{display:flex;gap:8px 18px;flex-wrap:wrap;margin-top:13px;font-size:11px;color:var(--ink-4)}
.codex-balances>span{display:inline-flex;gap:8px;align-items:center}.codex-balances b{font-weight:400;font-variant-numeric:tabular-nums;color:var(--ink-3)}
.codex-time{white-space:nowrap;font-size:12px;color:var(--ink-3);font-variant-numeric:tabular-nums}.codex-time small{display:block;font-size:10px;margin-top:5px;color:var(--grain)}
.codex-row-actions{gap:7px}.codex-row-actions .btn.sm{padding:5px 8px;min-height:28px;font-size:10px}.codex-row-actions .ghost{font-size:10px;padding:3px 2px;color:var(--ink-4)}.codex-row-actions .ghost:hover{color:var(--clay)}
.codex-row-error{font-size:11px;color:var(--grain);line-height:1.6;margin-top:8px;overflow-wrap:anywhere}
.codex-empty{text-align:center!important;padding:56px 20px!important;color:var(--ink-3);font-size:13px}
.codex-table-note{display:flex;justify-content:space-between;gap:16px;padding:12px 22px;border-top:1px solid var(--line);color:var(--ink-4);font-size:11px}
.codex-mobile-label{display:none}
.codex-notice{padding:14px 18px;margin:12px 0;border:1px solid var(--line);border-radius:8px}.codex-notice.error,.codex-form-error{color:#f87171}.codex-page [hidden]{display:none!important}
.codex-dialog{background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:16px;width:min(600px,calc(100vw - 32px));max-height:90vh;padding:28px;margin:auto;overflow-y:auto;box-shadow:0 24px 100px #0005}.codex-dialog::backdrop{background:#0009;backdrop-filter:blur(5px)}.codex-dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px;gap:16px}.codex-dialog h2{font-size:22px;margin:0}.codex-field{display:grid;gap:8px;margin:18px 0;font-size:13px}.codex-field textarea{width:100%;font-family:ui-monospace,monospace;resize:vertical}.codex-dialog .hint{font-size:12px;line-height:1.7;margin:16px 0}.codex-dialog-foot{justify-content:flex-end;margin-top:24px}.codex-login-progress{text-align:center;padding:18px 0}.codex-login-progress strong{display:block;font:600 32px ui-monospace,monospace;letter-spacing:4px;margin:22px 0}.codex-form-error{font-size:13px;margin-top:16px}
@media(max-width:760px){.codex-dialog{padding:20px}}


/* ---------- 首页 Dock ---------- */
.hero-dock { padding: 58px 0 22px; }
.hero-dock h1 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.06; letter-spacing: -0.036em; font-weight: 600; margin: 0; }
.hero-dock h1 em { font-style: normal; color: var(--moss); padding-left: 0.18em; text-shadow: var(--hero-glow); }
.hero-dock .lede { margin: 18px 0 0; max-width: 52ch; color: var(--ink-3); font-size: 15px; line-height: 1.8; }

.dock-wrap { padding: 10px 0 6px; }
@media (min-width: 761px) { .dock { width: max-content; margin: 0 auto; } }
.dock {
  display: flex; gap: 10px; padding: 13px 14px;
  border-radius: 22px; border: 1px solid var(--line-soft);
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 40px rgba(0,0,0,.18);
}
.dock-app { display: grid; justify-items: center; gap: 8px; padding: 4px 6px; border-radius: 14px; transition: transform .18s ease, background .18s ease; }
.dock-app:hover { background: var(--btn-bg); }
.dock-icon {
  position: relative; width: 58px; height: 58px;
  display: grid; place-items: center; color: #fff;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .20)) drop-shadow(0 7px 14px rgba(0, 0, 0, .30));
  transition: transform .22s cubic-bezier(.2, .7, .3, 1);
}
/* 连续圆角底板：clip-path 指向 render.js 里的 #bk-sq-clip（Apple 连续曲率，不是 border-radius 的切线圆弧） */
.dock-bg {
  position: absolute; inset: 0;
  clip-path: url(#bk-sq-clip);
  background: linear-gradient(180deg, var(--ic-1, #6aa87a) 0%, var(--ic-2, #2f6b45) 100%);
}
/* 顶部镜面高光：只在上面 30% 收住，不整片洗白，保住饱和度 */
.dock-bg::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .42) 0%,
    rgba(255, 255, 255, .07) 27%,
    rgba(255, 255, 255, 0) 62%);
}
/* 底部环境暗部：让底板有厚度，不是一张贴纸 */
.dock-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(130% 90% at 50% 118%, rgba(0, 0, 0, .18), rgba(0, 0, 0, 0) 62%);
}
.dock-glyph {
  position: relative; z-index: 1; width: 29px; height: 29px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .20));
}
.dock-app:hover .dock-icon { transform: translateY(-3px) scale(1.04); }
.dock-name { font-size: 11.5px; color: var(--ink-3); letter-spacing: .01em; }
.dock-badge {
  position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px; z-index: 2;
  border-radius: 10px; color: #fff; font-size: 10.5px; font-weight: 600;
  background: linear-gradient(180deg, #ff6b62, #e5342b);
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), 0 3px 8px rgba(0, 0, 0, .4);
}
/* 图标投影只在暗色保留；亮色白底上去掉，避免边缘发脏 */
:root { --ic-shadow: drop-shadow(0 1px 1px rgba(0,0,0,.2)) drop-shadow(0 4px 9px rgba(0,0,0,.22)); --picon-shadow: 0 .5px 1px rgba(0,0,0,.18), 0 6px 14px -6px var(--pglow, rgba(0,0,0,.35)); }
[data-theme="light"] { --ic-shadow: none; --picon-shadow: none; }
/* iOS 系统色底板：每个入口一个色相，避免整排灰掉 */
.tone-moss   { --ic-1: #63E687; --ic-2: #34B85E; --ic-glow: rgba(40, 178, 96, .55); }
.tone-blue   { --ic-1: #7CC2FF; --ic-2: #2B84F0; --ic-glow: rgba(43, 132, 240, .55); }
.tone-amber  { --ic-1: #FFDA80; --ic-2: #F7A21A; --ic-glow: rgba(247, 162, 26, .55); }
.tone-violet { --ic-1: #D3A0FF; --ic-2: #9150EA; --ic-glow: rgba(145, 80, 234, .55); }
.tone-sand   { --ic-1: #FFE7A0; --ic-2: #EDB217; --ic-glow: rgba(237, 178, 23, .50); }
.tone-slate  { --ic-1: #C6D2DF; --ic-2: #68798A; --ic-glow: rgba(104, 121, 138, .50); }
.tone-indigo { --ic-1: #9D9EF9; --ic-2: #5E5BE4; --ic-glow: rgba(94, 91, 228, .55); }
.tone-brown  { --ic-1: #EFCA96; --ic-2: #B97A4A; --ic-glow: rgba(185, 122, 74, .50); }
/* 亮色模式：同一色相再抬高明度、压低饱和度，白底上不发闷 */
[data-theme="light"] .tone-moss   { --ic-1: #9CF3B6; --ic-2: #5FD184; --ic-glow: rgba(95, 209, 132, .30); }
[data-theme="light"] .tone-blue   { --ic-1: #A6D8FF; --ic-2: #66AAF5; --ic-glow: rgba(102, 170, 245, .30); }
[data-theme="light"] .tone-amber  { --ic-1: #FFE9AF; --ic-2: #F8BC57; --ic-glow: rgba(248, 188, 87, .30); }
[data-theme="light"] .tone-violet { --ic-1: #E2C2FF; --ic-2: #B183F1; --ic-glow: rgba(177, 131, 241, .30); }
[data-theme="light"] .tone-sand   { --ic-1: #FFF1C8; --ic-2: #F0C762; --ic-glow: rgba(240, 199, 98, .30); }
[data-theme="light"] .tone-slate  { --ic-1: #DCE4ED; --ic-2: #98A5B2; --ic-glow: rgba(152, 165, 178, .28); }
[data-theme="light"] .tone-indigo { --ic-1: #C0C1FD; --ic-2: #8A88F2; --ic-glow: rgba(138, 136, 242, .30); }
[data-theme="light"] .tone-brown  { --ic-1: #F7E0C2; --ic-2: #D49B70; --ic-glow: rgba(212, 155, 112, .28); }

/* ---------- 首页 / Hub 的图形监测 ---------- */
.pulse-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 6px; }
.pulse {
  display: block; padding: 13px 15px; border-radius: 14px;
  border: 1px solid var(--line-soft); background: var(--card);
  transition: border-color .15s ease, transform .15s ease;
}
.pulse:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.pulse-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 11.5px; color: var(--ink-4); }
.pulse-head b { font-size: 21px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pulse-head b small { font-size: 10.5px; font-weight: 400; color: var(--ink-4); margin-left: 5px; }
.bar-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 11.5px; color: var(--ink-4); margin: 11px 0 5px; }
.bar-line span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-line em { white-space: nowrap; max-width: 62%; overflow: hidden; text-overflow: ellipsis; }
.bar-line em { font-style: normal; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar { display: block; height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--moss); transition: width .3s ease; }
.bar.blue i { background: #6f9fdc; }
.bar.amber i { background: #d3ae4a; }
.bar.violet i { background: #9a8ae2; }
.bar.warn i { background: var(--clay); }

/* ---------- Hub 看板 ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.hub-card {
  display: block; padding: 18px 20px; border-radius: 16px;
  border: 1px solid var(--line-soft); background: var(--card); min-height: 214px;
  transition: border-color .15s ease, transform .15s ease;
}
.hub-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.hub-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hub-name { font-size: 15.5px; font-weight: 600; }
.hub-go { font-size: 11.5px; color: var(--ink-4); }
.hub-card:hover .hub-go { color: var(--moss); }
.hub-sub { margin: 5px 0 14px; font-size: 12px; color: var(--ink-4); }
.stat-row { display: flex; gap: 26px; margin: 2px 0 12px; }
.stat-row b { display: block; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 10.5px; color: var(--ink-4); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.bars small { display: block; margin-top: 5px; font-size: 10.5px; color: var(--ink-4); }
.bars code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed li { display: flex; gap: 10px; align-items: flex-start; }
.feed-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--clay); margin-top: 6px; }
.feed-dot.ok { background: var(--moss); }
.feed b { font-size: 12.5px; font-weight: 600; }
.feed p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }
.feed small { font-size: 10.5px; color: var(--ink-4); }
.hub-empty { margin: 4px 0; font-size: 12.5px; color: var(--ink-4); }
.pulse-note { margin: 10px 0 0; font-size: 11.5px; color: var(--ink-4); }
.pulse-foot { margin: 11px 0 0; font-size: 11.5px; color: var(--ink-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse .bar { margin-top: 10px; }
.doc-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line-soft); border-radius: 12px; overflow: hidden; }
.doc-feed li { display: flex; gap: 10px; align-items: center; padding: 11px 14px; background: var(--card); font-size: 13px; }
.doc-feed .doc-title { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-feed time { margin-left: auto; color: var(--ink-4); font-size: 11.5px; white-space: nowrap; }

/* ---- 移动端体验（≤760 / ≤600） ---- */
@media (max-width: 760px) {
  /* 导航单行横向滚动，不再换行吃掉一行高度 */
  .mainnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -4px;
    padding: 2px 4px;
  }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav a { flex: 0 0 auto; white-space: nowrap; }
}

@media (max-width: 600px) {
  /* iOS 聚焦输入框会放大页面：字号必须 ≥16px。
     登录页的用户名输入框没写 type，必须用 :not([type]) 兜住，否则这条规则不生效。 */
  input[type=text], input[type=email], input[type=tel], input[type=number],
  input[type=url], input[type=password], input[type=search], input:not([type]),
  select, textarea {
    font-size: 16px;
    padding: 11px 12px;
  }
  input[type=checkbox], input[type=radio] { width: 18px; height: 18px; font-size: inherit; }

  /* 触控目标 ≥ 40px */
  .btn { min-height: 42px; padding: 10px 16px; font-size: 14.5px; }
  .btn.sm { min-height: 36px; padding: 8px 12px; font-size: 13px; }
  .mainnav a { padding: 9px 10px; font-size: 13.5px; }
  .theme-toggle { width: 36px; height: 36px; }
  td.actions a, td.actions button { margin-left: 0; padding: 8px 6px; display: inline-block; }

  /* 首屏：标题降一档、统计三列并排，减少大片空白 */
  .hero { padding: 26px 0 24px; gap: 20px; }
  .hero h1 { font-size: clamp(28px, 8.4vw, 34px); line-height: 1.12; letter-spacing: -0.03em; text-wrap: balance; }
  .hero h1 em { padding-left: 0.14em; }
  .hero .lede { margin-top: 14px; font-size: 14.5px; line-height: 1.75; }
  .hero-side { padding-top: 18px; }
  .hero-side dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .hero-side dt { font-size: 9.5px; letter-spacing: 0.1em; }
  .hero-side dd { font-size: 21px; margin-top: 2px; }

  .section { padding: 26px 0; }
  .section-note { font-size: 13px; margin-bottom: 16px; }
  .pagehead { padding-bottom: 18px; }
  .pagehead h1 { font-size: clamp(24px, 7.4vw, 30px); gap: 8px; }
  .pagehead p { font-size: 13.5px; line-height: 1.7; }

  /* 表格：收窄最小宽度，首列吸附，横向滑动时不丢上下文 */
  .panel { position: relative; }
  .panel table { min-width: 460px; font-size: 13px; }
  .panel table th, .panel table td { padding: 10px; }
  .panel table th:first-child, .panel table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--card);
    box-shadow: 1px 0 0 var(--line-soft);
  }

  /* Codex 授权弹窗 */
  .codex-dialog { width: calc(100vw - 24px); padding: 18px; max-height: 92vh; }
  .codex-dialog h2 { font-size: 19px; }
}

/* 刘海屏 / 底部安全区 */
@supports (padding: max(0px)) {
  .topbar .wrap { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
  .foot .wrap { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}

/* ---------- 首页 Dock / Hub 看板的移动端（追加，后写优先） ---------- */
@media (max-width: 600px) {
  .dock {
    gap: 6px; padding: 10px; border-radius: 18px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .dock::-webkit-scrollbar { display: none; }
  .dock-app { flex: 0 0 auto; padding: 2px 4px; }
  .dock-app:hover { transform: none; }
  .dock-icon { width: 50px; height: 50px; }
  .dock-glyph { width: 23px; height: 23px; }
  .dock-name { font-size: 10.5px; }
  .hero-dock { padding: 26px 0 16px; }
  .pulse-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hub-grid { grid-template-columns: minmax(0, 1fr); }
  .hub-card { min-height: 0; padding: 16px; }
  .hub-card:hover { transform: none; }
  .doc-feed li { padding: 10px 12px; font-size: 12.5px; }
  .doc-feed .doc-title { display: none; }
}

/* ================= 视觉升级（字体 / 材质 / 项目应用墙） ================= */

/* 纸张颗粒 + 顶部光晕，替代纯色底 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    radial-gradient(900px 420px at 50% -160px, var(--moss-soft), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}
.topbar, main, .foot { position: relative; z-index: 1; }

/* 标题走衬线，UI 保持无衬线 */
.hero-dock h1, .hero h1, .section-head h2, .app-tile b, .pcard h3, .hub-name, .pagehead h1 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.012em;
}
.hero-dock h1 { font-size: clamp(34px, 4.4vw, 54px); line-height: 1.14; }
.hero-dock h1 em, .hero h1 em {
  font-style: italic;
  color: var(--ink);
  padding-left: .12em;
  text-shadow: none;
}
.section-head h2 { font-size: 22px; }

/* 应用墙 */
.app-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.app-tile {
  position: relative;
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.app-tile:hover {
  border-color: color-mix(in srgb, var(--moss) 55%, var(--line));
  background: var(--card);
  transform: translateY(-2px);
}
.app-tile .picon { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 23.8%;
  box-shadow: var(--picon-shadow); }
.app-tile-body { display: grid; gap: 3px; min-width: 0; }
.app-tile-body b { font-size: 16px; color: var(--ink); font-weight: 600; letter-spacing: .01em; }
.app-tile-body i { font-style: normal; font-size: 11.5px; color: var(--ink-4); }
.app-tile-go { margin-left: auto; color: var(--ink-4); font-size: 13px; opacity: 0; transition: opacity .16s ease, transform .16s ease; }
.app-tile:hover .app-tile-go { opacity: 1; transform: translate(1px, -1px); }

/* 项目详情页也带上图标 */
.pcard .picon { width: 34px; height: 34px; border-radius: 23.8%;
  box-shadow: var(--picon-shadow); }
/* 亮色模式：项目图标底板整体上抬，避免深色块压在白卡上 */
[data-theme="light"] .app-tile .picon,
[data-theme="light"] .pcard .picon { filter: brightness(1.12) saturate(.88); }

/* 入场动效：一次编排，克制 */
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.dock-app, .app-tile, .pulse, .hub-card { animation: riseIn .5s cubic-bezier(.2,.7,.3,1) both; }
.dock-app:nth-child(2) { animation-delay: .04s; }
.dock-app:nth-child(3) { animation-delay: .08s; }
.dock-app:nth-child(4) { animation-delay: .12s; }
.dock-app:nth-child(5) { animation-delay: .16s; }
.dock-app:nth-child(6) { animation-delay: .2s; }
.dock-app:nth-child(7) { animation-delay: .24s; }
.app-tile:nth-child(2n) { animation-delay: .03s; }
.app-tile:nth-child(3n) { animation-delay: .06s; }

@media (prefers-reduced-motion: reduce) {
  .dock-app, .app-tile, .pulse, .hub-card { animation: none; }
  .app-tile:hover, .dock-app:hover, .hub-card:hover { transform: none; }
  .dock-app:hover .dock-icon { transform: none; }
}

@media (max-width: 600px) {
  .app-wall { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .app-tile { padding: 11px 12px; gap: 10px; }
  .app-tile .picon { width: 36px; height: 36px; border-radius: 23.8%; }
  .app-tile-body b { font-size: 14.5px; }
  .app-tile-body i { font-size: 10.5px; }
  .app-tile-go { display: none; }
}

/* ================= 移动端布局重排（Material 3 compact 规范） ================= */
@media (max-width: 600px) {
  /* 页面左右留白统一 16px，触控目标 ≥48px */
  .wrap, .wrap.wide { width: calc(100% - 32px); }

  /* Dock：不再横向滚动，4 列网格两行排完，图标不被裁切 */
  .dock {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 6px;
    padding: 16px 8px;
    overflow: visible;
    width: auto;
    border-radius: 20px;
  }
  .dock-app { padding: 0; min-height: 76px; justify-items: center; gap: 7px; }
  .dock-icon { width: 52px; height: 52px; }
  .dock-glyph { width: 24px; height: 24px; }
  .dock-name { font-size: 11px; line-height: 1.25; text-align: center; }

  /* 监测条：两列等宽，卡片等高 */
  .pulse-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pulse { padding: 12px 13px; min-height: 96px; display: flex; flex-direction: column; }
  .pulse-head b { font-size: 19px; }
  .pulse-foot { margin-top: auto; padding-top: 10px; }

  /* 项目应用墙：两列，图标与文字不再挤在一行 */
  .app-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .app-tile { min-height: 62px; padding: 10px 11px; gap: 10px; border-radius: 12px; }
  .app-tile .picon { width: 34px; height: 34px; border-radius: 10px; }
  .app-tile-body b { font-size: 14.5px; }
  .app-tile-body i { font-size: 10.5px; }

  /* 首屏更紧凑，标题按 8vw 缩放 */
  .hero-dock { padding: 20px 0 14px; }
  .hero-dock h1 { font-size: clamp(27px, 8vw, 34px); line-height: 1.16; }
  .hero-dock .lede { margin-top: 12px; font-size: 14px; line-height: 1.72; }

  /* 区块节奏 */
  .section { padding: 24px 0; }
  .section-head h2 { font-size: 20px; }

  /* 动效更快，避免首帧看起来像"没渲染完" */
  .dock-app, .app-tile, .pulse, .hub-card { animation-duration: .28s; }
}

@media (max-width: 420px) {
  .topbar .wrap { gap: 8px; }
  .account .who { display: none; }
  .brand i { display: none; }
  .brand b { font-size: 15px; }
}

/* ---------- 未登录访客：公开目录 + 登录入口 ---------- */
.guest-note-section { border-top: 0; }
.guest-note {
  display: grid; gap: 7px; justify-items: center; text-align: center;
  padding: 34px 22px; border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--surface-3), var(--card));
}
.guest-note b { font-size: 15.5px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.guest-note span { font-size: 12.5px; color: var(--ink-3); max-width: 48ch; line-height: 1.75; }
.guest-note .btn { margin-top: 10px; }


/* ---------- 首页：林枢 Hub / 运行概览 ---------- */
.hero-dock { padding: 20px 0 16px; max-width: 920px; }
.hero-dock .eyebrow {
  display: flex; align-items: center; gap: 9px; margin: 0;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--moss);
}
.hero-dock .eyebrow .tick { width: 6px; height: 6px; background: var(--moss); box-shadow: 0 0 14px var(--moss); }
.hero-dock h1 {
  margin: 0; font-family: var(--mono);
  font-size: clamp(23px, 2.7vw, 33px); line-height: 1.3; letter-spacing: .005em; font-weight: 600;
}
.hero-dock h1 em { font-style: normal; color: var(--moss); padding-left: .14em; text-shadow: none; }
.hero-dock h1 .h1-slash { color: var(--ink-4); margin-right: .34em; font-weight: 400; }
.hero-dock h1 .h1-cursor {
  display: inline-block; width: .5em; height: 1em; margin-left: .2em; vertical-align: -.12em;
  background: var(--moss); opacity: .85; animation: heroCaret 1.8s steps(1) infinite;
}
@keyframes heroCaret { 0%, 58% { opacity: .85; } 59%, 100% { opacity: .10; } }
.hero-dock .lede { margin: 12px 0 0; max-width: 64ch; font-size: 13.5px; line-height: 1.75; color: var(--ink-4); }

/* ---------- 首页 Codex 额度趋势（首屏可见） ---------- */
.hcx {
  --codex-chart-1: var(--moss); --codex-chart-2: #60a5fa; --codex-chart-3: #c084fc;
  --codex-chart-4: var(--grain); --codex-chart-5: #22d3ee; --codex-chart-6: #fb7185;
  margin: 2px 0 4px; padding: 14px 16px 12px;
  border: 1px solid var(--line-soft); border-radius: 14px; background: var(--card);
}
[data-theme="light"] .hcx {
  --codex-chart-2: #2563eb; --codex-chart-3: #9333ea; --codex-chart-5: #0891b2; --codex-chart-6: #e11d48;
}
.hcx-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.hcx-head h3 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--ink); letter-spacing: .03em; }
.hcx-head h3 .en { margin-left: 8px; font-family: var(--mono); font-size: 9.5px; font-weight: 400; letter-spacing: .18em; color: var(--ink-4); }
.hcx-meta { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--ink-4); }
.hcx-plot { height: 84px; color: var(--ink-3); }
.hcx-plot svg { display: block; width: 100%; height: 100%; }
.hcx-axis { display: flex; justify-content: space-between; margin-top: 5px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: var(--ink-4); }
.hcx-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 9px 0 0; padding: 0; list-style: none; }
.hcx-legend li { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); }
.hcx-legend i { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.hcx-legend b { font-family: var(--mono); font-size: 11px; color: var(--ink); font-weight: 600; }
.hcx-empty { margin: 4px 0; font-size: 12px; color: var(--ink-4); line-height: 1.7; }

.home-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 14px; align-items: stretch; margin: 18px 0 10px;
}
.home-col { display: flex; flex-direction: column; min-width: 0; }
.col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 2px 10px; }
.col-head h2 { margin: 0; font-size: 12.5px; letter-spacing: .04em; color: var(--ink); font-weight: 600; }
.col-head h2 .en { margin-left: 10px; font-family: var(--mono); font-size: 9.5px; font-weight: 400; letter-spacing: .18em; color: var(--ink-4); text-transform: uppercase; vertical-align: 1px; }
.col-head span { font-size: 10px; letter-spacing: .18em; color: var(--ink-4); font-family: var(--mono); text-transform: uppercase; }

.lt-grid { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 9px; }
.lt-card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto;
  gap: 1px 10px; align-content: center; padding: 11px 12px;
  border-radius: 13px; border: 1px solid var(--line-soft); background: var(--card);
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.lt-card:hover { border-color: var(--line-strong); transform: translateY(-1px); background: var(--surface-2); }
.lt-ic {
  position: relative; grid-row: 1 / span 2; align-self: center;
  width: 32px; height: 32px; display: grid; place-items: center; color: #fff;
  filter: var(--ic-shadow);
}
.lt-bg {
  position: absolute; inset: 0; clip-path: url(#bk-sq-clip);
  background: linear-gradient(180deg, var(--ic-1, #6aa87a) 0%, var(--ic-2, #2f6b45) 100%);
}
.lt-bg::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.40) 0%, rgba(255,255,255,.06) 30%, rgba(255,255,255,0) 62%);
}
.lt-glyph { position: relative; z-index: 1; width: 17px; height: 17px; }
.lt-name { font-size: 12.5px; font-weight: 500; color: var(--ink); align-self: end; }
.lt-sub { font-size: 10.5px; color: var(--ink-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-go {
  position: absolute; top: 9px; right: 10px; font-size: 11px; color: var(--ink-4);
  opacity: 0; transition: opacity .15s ease, transform .15s ease;
}
.lt-card:hover .lt-go { opacity: 1; transform: translateX(2px); color: var(--moss); }

.stat-grid { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 9px; }
.stat {
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--card);
  transition: border-color .15s ease, transform .15s ease;
}
.stat:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.stat-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); }
.stat b { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat b small { font-size: 10px; font-weight: 400; color: var(--ink-4); margin-left: 4px; letter-spacing: 0; }
.stat-foot { font-size: 10.5px; color: var(--ink-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.guest-card { display: grid; gap: 8px; justify-items: start; align-content: center; flex: 1 1 auto; padding: 18px; border-radius: 14px; border: 1px dashed var(--line); }
.guest-card b { font-size: 14px; }
.guest-card p { margin: 0; font-size: 12.5px; color: var(--ink-4); line-height: 1.6; }

/* ---------- 项目 ↔ 本地服务映射 ---------- */
.tag-local {
  display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 5px;
  font-size: 9.5px; font-weight: 500; letter-spacing: .04em; line-height: 15px;
  color: var(--moss); background: var(--moss-soft); vertical-align: 1px;
}
.svc-chip {
  display: inline-flex; align-items: center; gap: 5px; margin: 6px 6px 0 0; padding: 2px 7px;
  border-radius: 999px; border: 1px solid var(--line-soft); background: var(--card);
  font-size: 10.5px; color: var(--ink-3); font-family: var(--mono);
}
.svc-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.svc-chip.ok i { background: var(--moss); }
.svc-chip.err i { background: var(--clay); }
.svc-chips { margin-top: 2px; }
a.svc-link { color: var(--moss); }

/* ---------- 林枢 Studio：部署位置 / 新项目向导 ---------- */
.pagehead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.host-chip {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  font-size: 10px; color: var(--ink-3); border: 1px solid var(--line-soft); background: var(--surface-2);
  font-family: var(--mono); letter-spacing: .02em;
}
.wz-targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.wz-target {
  text-align: left; padding: 12px 14px; border-radius: 13px; cursor: pointer;
  border: 1px solid var(--line-soft); background: var(--card); color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.wz-target:hover { border-color: var(--line-strong); }
.wz-target.on { border-color: var(--moss); background: var(--moss-soft); }
.wz-target b { display: block; font-size: 13.5px; }
.wz-target small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--ink-4); font-family: var(--mono); }
.wz-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: start; }
#wz-prompt {
  width: 100%; min-height: 430px; resize: vertical; padding: 14px 16px;
  border-radius: 12px; border: 1px solid var(--line-soft); background: var(--bg); color: var(--ink-2);
  font-family: var(--mono); font-size: 12px; line-height: 1.75; white-space: pre-wrap;
}
.wz-steps { margin: 4px 0 16px; padding-left: 20px; display: grid; gap: 10px; font-size: 12.5px; color: var(--ink-3); }
.wz-steps b { display: block; color: var(--ink); font-size: 12.5px; }
.wz-steps span { display: block; margin-top: 2px; line-height: 1.6; }
@media (max-width: 900px) {
  .wz-grid { grid-template-columns: minmax(0, 1fr); }
  .wz-targets { grid-template-columns: minmax(0, 1fr); }
  #wz-prompt { min-height: 320px; }
}

/* ---------- 项目文档 ---------- */
.doc-body { max-width: 880px; padding: 6px 0 70px; }
.doc-body h1 { font-size: 27px; letter-spacing: -.02em; margin: 8px 0 14px; }
.doc-body h2 {
  margin: 36px 0 12px; padding-top: 20px; font-size: 19px; letter-spacing: -.01em;
  border-top: 1px solid var(--line-soft);
}
.doc-body h3 { margin: 22px 0 8px; font-size: 15px; color: var(--ink); }
.doc-body h4 { margin: 18px 0 6px; font-size: 13.5px; color: var(--ink-2); }
.doc-body p, .doc-body li { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }
.doc-body p { margin: 0 0 12px; }
.doc-body ul, .doc-body ol { padding-left: 22px; margin: 0 0 14px; display: grid; gap: 5px; }
.doc-body li::marker { color: var(--ink-4); }
.doc-body code {
  font-family: var(--mono); font-size: 12.3px; padding: 1px 5px; border-radius: 4px;
  background: var(--surface-2); color: var(--ink);
}
.doc-body pre {
  margin: 0 0 16px; padding: 14px 16px; border-radius: 12px; overflow: auto;
  border: 1px solid var(--line-soft); background: var(--card);
}
.doc-body pre code { background: none; padding: 0; font-size: 12.3px; line-height: 1.7; }
.doc-body blockquote {
  margin: 0 0 14px; padding: 4px 0 4px 14px; border-left: 2px solid var(--moss);
  color: var(--ink-4); font-size: 13px; line-height: 1.75;
}
.doc-body hr { border: 0; border-top: 1px solid var(--line-soft); margin: 30px 0; }
.doc-body a { color: var(--moss); }
.doc-body strong { color: var(--ink); font-weight: 600; }
.doc-head { padding-bottom: 8px; }

/* ---------- 技能库 ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.skill-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 196px;
  padding: 18px 18px 16px; border-radius: 16px; border: 1px solid var(--line-soft); background: var(--card);
  transition: border-color .15s ease, transform .15s ease;
}
.skill-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.skill-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.skill-cat { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--moss); font-family: var(--mono); }
.skill-level { font-size: 10.5px; color: var(--ink-4); }
.skill-card h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.skill-card p { margin: 0; flex: 1 1 auto; font-size: 12.5px; line-height: 1.7; color: var(--ink-4); }
.skill-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.skill-tags span {
  font-size: 10px; padding: 1px 6px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--ink-3);
}
.skill-go { font-size: 11.5px; color: var(--ink-4); }
.skill-card:hover .skill-go { color: var(--moss); }
.skill-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.skill-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--ink-4); font-family: var(--mono); }
.skill-count { font-size: 12px; color: var(--ink-4); font-family: var(--mono); }
@media (max-width: 1000px) { .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .skill-grid { grid-template-columns: minmax(0, 1fr); } }

/* Codex 窄屏：每个账号独立排布，避免横向滚动。 */
@media(max-width:1000px){
  .codex-table th,.codex-table td{padding:18px 16px}
  .codex-table th:first-child{width:30%}.codex-table th:nth-child(3){width:116px}.codex-table th:nth-child(4){width:148px}
  .codex-identity{gap:9px}.codex-avatar{width:30px;height:30px;border-radius:8px}.codex-metrics{gap:16px}
}
@media(max-width:760px){
  .codex-page .pagehead{padding-top:28px;align-items:flex-start;gap:20px;flex-wrap:wrap}
  .codex-page .pagehead h1{font-size:28px}.codex-page .pagehead .lede{font-size:13px}
  .codex-actions .btn{min-height:36px;padding:8px 12px;font-size:12px}
  .codex-stat{display:block;padding:15px}.codex-stat>span{font-size:10px}.codex-stat strong{display:block;font-size:24px;margin-top:8px}
  .codex-summary{margin-bottom:20px}.codex-filters{flex-wrap:wrap;gap:12px}
  .codex-filters .codex-search{flex-basis:100%;max-width:none}.codex-filters select{min-width:170px}
  .codex-filters input[type=search],.codex-filters select{height:42px;font-size:16px}
  .codex-filters .codex-check{min-height:42px;font-size:11px}.codex-check input{width:16px;height:16px}
  .codex-table,.codex-table tbody{display:block}.codex-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .codex-table .codex-account-row{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"account account" "quota quota" "sync actions";gap:16px;padding:20px}
  .codex-table .codex-account-row+.codex-account-row{border-top:1px solid var(--line)}
  .codex-table .codex-account-row>td{padding:0;border:0;min-width:0;background:transparent;position:static}
  .codex-account-cell{grid-area:account}.codex-quota-cell{grid-area:quota}.codex-time{grid-area:sync;align-self:center}.codex-actions-cell{grid-area:actions}
  .codex-avatar{width:34px;height:34px}.codex-account-info>strong{font-size:13px}.codex-account-meta{margin-top:7px}
  .codex-metric b{font-size:24px}.codex-metrics{gap:18px}.codex-mobile-label{display:inline;margin-right:8px;font-size:10px;color:var(--ink-4)}
  .codex-row-actions{justify-content:flex-end;max-width:185px}.codex-row-actions .btn.sm{min-height:36px;font-size:11px}.codex-row-actions .ghost{font-size:11px;min-height:36px}
  .codex-table-note{padding:13px 20px;font-size:10px;gap:8px;flex-wrap:wrap}
}

/* 额度历史：原生 SVG，不引入图表依赖。 */
.codex-history{--codex-chart-1:#56b4e9;--codex-chart-2:#e69f00;--codex-chart-3:#cc79a7;--codex-chart-4:#56c9a5;--codex-chart-5:#f0e442;--codex-chart-6:#f58b68;border:1px solid var(--line);border-radius:12px;background:var(--card);padding:22px;margin:0 0 28px}
[data-theme="light"] .codex-history{--codex-chart-1:#0072b2;--codex-chart-2:#a65e00;--codex-chart-3:#994578;--codex-chart-4:#007b5b;--codex-chart-5:#827300;--codex-chart-6:#b64015}
.codex-history-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.codex-history h2{font-family:var(--sans);font-size:16px;letter-spacing:-.02em;margin:0;font-weight:600}
.codex-history-head p{font-size:12px;line-height:1.6;color:var(--ink-3);margin:7px 0 0}
.codex-history-head .ghost{font-size:12px;white-space:nowrap}
.codex-history-controls,.codex-history-custom{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
.codex-history-controls label,.codex-history-custom label{display:grid;gap:6px;font-size:11px;color:var(--ink-3);min-width:0}
.codex-history-controls select{max-width:240px;min-width:150px;height:36px;padding:6px 10px;font-size:12px;border-radius:7px}
.codex-history-custom{margin-top:14px}.codex-history-custom input{min-width:0;max-width:210px;height:36px;padding:6px 10px;font-size:12px}
.codex-chart-frame{position:relative;margin-top:22px;min-width:0}
.codex-chart{position:relative;min-height:258px;outline-offset:5px;touch-action:pan-y}
.codex-chart svg{display:block;width:100%;height:258px;overflow:visible}
.codex-gridline{stroke:var(--line-soft);stroke-width:1;stroke-dasharray:3 5}
.codex-axis-label{fill:var(--ink-4);font-size:10px;font-family:var(--sans);font-variant-numeric:tabular-nums}
.codex-cursor-line{stroke:var(--ink-4);stroke-dasharray:3 4;stroke-width:1}
.codex-chart-empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:28px 35px;color:var(--ink-3);background:var(--card)}
.codex-chart-empty strong{font-weight:500;font-size:14px}.codex-chart-empty span{font-size:12px;line-height:1.7}
.codex-history-legend{display:flex;flex-wrap:wrap;gap:10px 22px;margin:18px 0 0;min-width:0}
.codex-history-legend>span,.codex-chart-tooltip span{display:inline-flex;align-items:center;gap:7px;font-size:11px;color:var(--ink-2);min-width:0;overflow-wrap:anywhere}
.codex-series-key{display:block;width:36px;height:14px;flex:none}
.codex-history-status{font-size:11px;line-height:1.7;color:var(--ink-4);margin:12px 0 0}
.codex-chart-tooltip{position:absolute;z-index:2;top:16px;pointer-events:none;min-width:190px;max-width:calc(100% - 16px);padding:12px 14px;border:1px solid var(--line-strong);border-radius:9px;background:var(--raised);box-shadow:0 10px 24px #0003}
.codex-chart-tooltip>strong{display:block;font-size:11px;font-weight:500;color:var(--ink-3);margin-bottom:10px;font-variant-numeric:tabular-nums}
.codex-chart-tooltip>div{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:7px}
.codex-chart-tooltip span{max-width:220px;font-size:11px}.codex-chart-tooltip b{font-size:12px;font-weight:500;white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:760px){
 .codex-history{padding:18px 14px;margin-bottom:22px}.codex-history-head{gap:10px;margin-bottom:16px}.codex-history-head p{font-size:11px}.codex-history-head .ghost{font-size:11px}
 .codex-history-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.codex-history-controls label:nth-child(2){grid-column:1/-1;grid-row:2}
 .codex-history-controls select{min-width:0;width:100%;max-width:none;font-size:16px;height:40px}
 .codex-history-custom{display:grid;grid-template-columns:1fr;align-items:stretch}.codex-history-custom input{max-width:none;width:100%;font-size:16px;height:42px}
 .codex-chart-frame{margin-top:18px}.codex-history-legend{gap:9px 16px}.codex-history-status{font-size:10px}.codex-chart-tooltip span{max-width:180px}
}

/* ==========================================================================
   未来感 HUD 层
   放在最后，按层叠覆盖前面的组件；颜色全部走顶部令牌，明暗主题自动跟随。
   ========================================================================== */

/* ---------- 背景：透视网格 + 缓慢漂移的极光 ---------- */
body { background: var(--paper); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center -1px;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 25%, transparent 80%);
          mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 25%, transparent 80%);
}
body::after {
  content: ""; position: fixed; inset: -15%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 32% at 16% 10%, var(--aurora-1), transparent 70%),
    radial-gradient(34% 30% at 84% 4%, var(--aurora-2), transparent 70%),
    radial-gradient(44% 38% at 62% 104%, var(--aurora-3), transparent 70%);
  animation: hudAurora 28s ease-in-out infinite alternate;
}
@keyframes hudAurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(3%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 1%, 0) scale(1.02); }
}
::selection { background: var(--cyan-soft); color: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--line-strong); background-clip: padding-box; }

/* 标题统一回到无衬线，强调靠字重与渐变，不靠衬线 */
.hero-dock h1, .hero h1, .section-head h2, .app-tile b, .pcard h3, .hub-name, .pagehead h1, .app-tile-body b {
  font-family: var(--sans); letter-spacing: -0.02em;
}

/* ---------- 顶栏：玻璃 + 底部渐变光线 ---------- */
header.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
          backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
header.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 4%, var(--moss) 30%, var(--cyan) 55%, var(--violet) 75%, transparent 96%);
  opacity: .5;
}
.brand .mark {
  background: var(--grad);
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, .35));
}
.brand b { letter-spacing: .06em; }
.brand i { font-family: var(--mono); font-size: 9px; letter-spacing: .32em; color: var(--ink-4); }

.mainnav a { position: relative; border-radius: 8px; color: var(--ink-3); }
.mainnav a:hover { background: var(--surface-2); color: var(--ink); }
.mainnav a.on { color: var(--ink); background: var(--surface-2); }
.mainnav a.on::after {
  content: ""; position: absolute; left: 30%; right: 30%; bottom: 2px; height: 2px; border-radius: 2px;
  background: var(--grad); box-shadow: 0 0 10px var(--cyan);
}

.theme-toggle, .account-menu summary, .ghost {
  background: var(--btn-bg); border: 1px solid var(--line); border-radius: 9px;
  transition: border-color .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease;
}
.theme-toggle:hover, .account-menu summary:hover, .ghost:hover {
  border-color: var(--line-glow); color: var(--ink); box-shadow: var(--glow-sm); background: var(--btn-bg-hover);
}
.account-menu summary { padding: 6px 12px; }
.account-dropdown {
  background: var(--glass-strong); border-color: var(--line);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: var(--glow), 0 18px 40px -12px rgba(0, 0, 0, .5);
}

/* ---------- 首页首屏 ---------- */
.hero-dock { padding: 24px 0 18px; max-width: 980px; }
.hero-dock .eyebrow {
  display: inline-flex; padding: 5px 12px 5px 10px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--glass); color: var(--cyan);
  font-size: 10px; letter-spacing: .26em;
}
.hero-dock .eyebrow .tick {
  border-radius: 50%; background: var(--moss); box-shadow: 0 0 0 3px var(--moss-soft), 0 0 12px var(--moss);
  animation: hudPing 2.4s ease-in-out infinite;
}
.hero-dock h1 {
  margin-top: 20px; font-family: var(--sans);
  font-size: clamp(32px, 4.6vw, 58px); line-height: 1.08; letter-spacing: -.035em; font-weight: 700;
}
.hero-dock h1 em {
  font-style: normal; padding-left: .14em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(34, 211, 238, .28));
}
.hero-dock h1 .h1-slash { font-family: var(--mono); font-weight: 300; color: var(--cyan); opacity: .55; }
.hero-dock h1 .h1-cursor { width: .36em; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.hero-dock .lede { margin-top: 16px; font-size: 15px; color: var(--ink-3); }
@keyframes hudPing {
  0%, 100% { box-shadow: 0 0 0 3px var(--moss-soft), 0 0 12px var(--moss); }
  50%      { box-shadow: 0 0 0 6px transparent, 0 0 18px var(--moss); }
}

/* 区块标题：等宽前缀做 HUD 标注 */
.section { border-top: 0; position: relative; }
.section::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, var(--line-strong), var(--line-soft) 40%, transparent);
}
.section-head h2 { font-size: 22px; font-weight: 650; display: flex; align-items: baseline; gap: 10px; }
.section-head h2::before, .col-head h2::before {
  content: "//"; font-family: var(--mono); font-weight: 400; font-size: .72em; color: var(--cyan); opacity: .75;
}
.col-head h2 { font-size: 13px; display: flex; align-items: baseline; gap: 8px; }
.col-head span, .section-head .more { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; }
.section-head .more { color: var(--ink-3); text-transform: uppercase; }
.section-head .more:hover { color: var(--cyan); }

/* ---------- 玻璃面板：所有卡片类组件 ---------- */
.card, .panel, .lt-card, .stat, .app-tile, .hub-card, .skill-card, .pulse, .guest-note, .guest-card,
.codex-table-wrap, .codex-history, .wz-target, .agent-copy-bar, .dock, .login-card {
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow);
}
.lt-card, .stat, .app-tile, .hub-card, .skill-card, .pulse, .card, .panel { border-radius: var(--r); }
.stat, .hub-card, .pulse { position: relative; }

/* 悬停：渐变描边点亮 + 冷光 */
a.card::after, .lt-card::after, .stat::after, .app-tile::after, .hub-card::after, .skill-card::after, .pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0; transition: opacity .22s ease;
}
a.card:hover::after, .lt-card:hover::after, .stat:hover::after, .app-tile:hover::after,
.hub-card:hover::after, .skill-card:hover::after, .pulse:hover::after { opacity: .9; }
a.card:hover, .lt-card:hover, .stat:hover, .app-tile:hover, .hub-card:hover, .skill-card:hover, .pulse:hover {
  border-color: transparent; background: var(--glass-strong); box-shadow: var(--glow);
}

/* 林枢 Hub 入口 */
.lt-grid, .stat-grid { gap: 10px; }
.lt-card { padding: 13px 14px; }
.lt-ic { transition: filter .2s ease, transform .2s ease; }
.lt-card:hover .lt-ic { filter: drop-shadow(0 0 12px var(--ic-glow, rgba(34, 211, 238, .5))); transform: scale(1.06); }
.lt-name { font-size: 13px; font-weight: 600; }
.lt-sub { font-family: var(--mono); font-size: 10px; letter-spacing: .02em; }
.lt-card:hover .lt-go { color: var(--cyan); }

/* 运行概览：每张数据卡顶部一道色相光条，数字走等宽 */
.stat { padding: 12px 14px; }
.stat::before {
  content: ""; position: absolute; left: 14px; top: 0; width: 26px; height: 2px; border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, var(--ic-1, var(--moss)), var(--ic-2, var(--cyan)));
  box-shadow: 0 0 12px var(--ic-glow, var(--cyan));
}
.stat-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; color: var(--ink-4); }
.stat b { font-family: var(--mono); font-size: 22px; letter-spacing: -.03em; }
.stat-foot { font-size: 10.5px; }

/* 林枢 Studio 应用墙 */
.app-wall { gap: 10px; }
.app-tile { padding: 14px 16px; }
.app-tile .picon { transition: transform .2s ease, box-shadow .2s ease; }
.app-tile:hover .picon { transform: scale(1.06); box-shadow: 0 0 22px -4px var(--pglow, rgba(34, 211, 238, .5)); }
.app-tile-body i { font-family: var(--mono); font-size: 10.5px; }
.app-tile-go { color: var(--cyan); }

/* 项目卡 */
.pcard::before { width: 2px; box-shadow: 0 0 14px var(--accent, var(--moss)); }
.pcard .code { color: var(--cyan); opacity: .8; }

/* 资料动态 */
.doc-feed { background: transparent; gap: 6px; border-radius: 0; overflow: visible; }
.doc-feed li {
  background: var(--glass); border: 1px solid var(--line-soft); border-radius: 11px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .18s ease, background .18s ease;
}
.doc-feed li:hover { border-color: var(--line-strong); background: var(--glass-strong); }
.doc-feed time { font-family: var(--mono); font-size: 11px; }

/* ---------- 页头 ---------- */
.pagehead { padding: 60px 0 30px; }
.pagehead h1 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; letter-spacing: -.03em; }
.crumb { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-4); }
.crumb a:hover { color: var(--cyan); }
.eyebrow { font-family: var(--mono); color: var(--cyan); }

/* ---------- 按钮 / 标签 / 筛选 ---------- */
.btn { border-radius: 10px; transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, filter .18s ease, transform .18s ease; }
.btn.primary {
  background: var(--grad); color: var(--on-accent); border: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 26px -10px var(--cyan);
}
.btn.primary:hover { color: var(--on-accent); filter: brightness(1.08) saturate(1.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 28px -4px var(--cyan); transform: translateY(-1px); }
.btn.secondary { background: var(--btn-bg); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--line-glow); box-shadow: var(--glow-sm); }
.btn.danger:hover { box-shadow: 0 0 18px -6px var(--clay); }

.chip { border-color: var(--line); background: var(--btn-bg); }
.chip:hover { border-color: var(--line-glow); color: var(--ink); }
.chip.on { background: var(--grad); border-color: transparent; color: var(--on-accent); box-shadow: 0 0 18px -6px var(--cyan); }

.badge { font-family: var(--mono); font-size: 10.5px; letter-spacing: .02em; }
.badge.ok { border-color: color-mix(in srgb, var(--moss) 55%, transparent); box-shadow: 0 0 10px -4px var(--moss); }
.badge.warn { border-color: color-mix(in srgb, var(--grain) 55%, transparent); }
.badge.err { border-color: color-mix(in srgb, var(--clay) 55%, transparent); }
.tag-local { font-family: var(--mono); color: var(--cyan); background: var(--cyan-soft); }

.dot.ok { animation: hudPing 2.4s ease-in-out infinite; }

/* ---------- 表格 / 表单 ---------- */
th, th.num { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--ink-4); font-weight: 600; }
tbody tr:hover { background: var(--surface-hover); }
td a:hover { color: var(--cyan); }
input[type=text], input[type=url], input[type=password], input[type=search], input:not([type]), select, textarea {
  background-color: var(--input-bg); border-color: var(--line); border-radius: 10px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft), 0 0 20px -6px var(--cyan);
}
.admin-nav a.on { background: var(--cyan-soft); color: var(--cyan); box-shadow: inset 2px 0 0 var(--cyan); }
.flash { border-radius: 10px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ---------- 登录卡：顶部扫描光 ---------- */
.login-card { position: relative; overflow: hidden; box-shadow: var(--glow), var(--shadow); }
.login-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--grad); box-shadow: 0 0 16px var(--cyan);
}

/* ---------- 文档 / 技能 ---------- */
.skill-cat, .pcard .code { font-family: var(--mono); }
.skill-cat { color: var(--cyan); }
.doc-body a, a.svc-link { color: var(--cyan); }
.doc-body blockquote { border-left-color: var(--cyan); }
.doc-body pre, #wz-prompt { background: var(--input-bg); border-color: var(--line); }

/* ---------- 页脚 ---------- */
.foot { border-top: 0; position: relative; }
.foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 30%, var(--line-strong) 70%, transparent);
}
.foot .wrap { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; }

/* ---------- 首页布局：写在 HUD 层之后，同名规则以这里为准 ---------- */
.account { margin-left: auto; }

/* 收紧首屏，让入口、数据和产品墙尽量落在第一屏 */
.hero-dock { padding: 22px 0 14px; }
.hero-dock h1 { margin-top: 0; font-size: clamp(28px, 3.1vw, 40px); line-height: 1.16; letter-spacing: -.025em; text-wrap: balance; }
.hero-dock .lede { margin-top: 10px; font-size: 14px; line-height: 1.7; }

/* 入口 3 行、数据 3 行，两栏高度接近，卡片不再被拉伸出大片空白 */
.home-split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; margin: 16px 0 8px; }
.stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 入口数为奇数时，末张铺满整行，不留空格 */
.lt-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* 小字统一提到 11px 以上并用 ink-3，保证深色底上可读 */
.col-head h2 { font-size: 14px; }
.lt-ic { width: 36px; height: 36px; }
.lt-glyph { width: 19px; height: 19px; }
.lt-name { font-size: 14px; }
.lt-sub { font-size: 11.5px; color: var(--ink-3); }
.stat-label { font-size: 11px; letter-spacing: .1em; color: var(--ink-3); }
.stat b small { font-size: 11px; color: var(--ink-3); }
/* 窄卡里的数据不截断，最多折成两行 */
.stat-foot {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  white-space: normal; font-size: 11.5px; line-height: 1.4; color: var(--ink-3);
}
.hcx-head h3 { font-size: 13.5px; }
.hcx-head h3 .en, .hcx-meta, .hcx-axis { font-size: 11px; letter-spacing: .04em; color: var(--ink-3); }
.hcx-legend li { font-size: 12px; }
.hcx-empty { font-size: 12.5px; color: var(--ink-3); }
.app-tile-body i { font-size: 11px; color: var(--ink-3); }
/* 限定列宽，否则不换行的长标题会把整列撑出屏幕 */
.doc-feed { grid-template-columns: minmax(0, 1fr); }
.doc-feed .doc-title { min-width: 0; }

/* 宽度放不下左右两栏时上下堆叠，横向空间用来多排几列 */
@media (max-width: 1099px) {
  .home-split { grid-template-columns: minmax(0, 1fr); }
  .lt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lt-card:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
}

/* ---------- 窄屏与动效偏好 ---------- */
@media (max-width: 600px) {
  /* 顶栏：品牌行随页面滚走，只吸附导航行。top 等于品牌行总高（4 + 40 + 2） */
  header.topbar { top: -46px; }
  .topbar .wrap { padding: 4px 0 2px; gap: 2px 8px; }
  .brand { min-height: 40px; }
  .theme-toggle { width: 40px; height: 40px; }
  .account-menu summary { min-height: 40px; max-width: 112px; white-space: nowrap; overflow: hidden; }
  .account .ghost { display: inline-flex; align-items: center; min-height: 40px; }
  .mainnav a { padding: 10px 12px; }

  /* 首屏 */
  .hero-dock { padding: 14px 0 10px; }
  .hero-dock h1 { font-size: clamp(22px, 6.4vw, 28px); }
  .hero-dock .eyebrow { font-size: 9px; letter-spacing: .18em; }
  .hero-dock .lede { margin-top: 8px; font-size: 13.5px; line-height: 1.65; }
  .pagehead { padding-top: 34px; }
  body::before { background-size: 40px 40px; }

  /* Codex 趋势 */
  .hcx { padding: 12px 13px; }
  .hcx-head { flex-wrap: wrap; gap: 2px 12px; }

  /* 入口与数据在小屏也保持两列，避免单列把页面拉长 */
  .home-split { gap: 16px; margin: 14px 0 6px; }
  .col-head { margin-bottom: 8px; }
  .lt-grid, .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lt-card { padding: 10px; column-gap: 8px; }
  .lt-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .lt-ic { width: 30px; height: 30px; }
  .lt-glyph { width: 16px; height: 16px; }
  .lt-name { font-size: 13.5px; }
  .lt-sub { white-space: normal; line-height: 1.35; }
  .stat { padding: 10px 11px; }
  .stat::before { left: 11px; }
  .stat b { font-size: 20px; }

  /* 产品墙 */
  .section { padding: 20px 0; }
  .section-head .more { padding: 10px 0; margin: -10px 0; }
  .app-tile { min-height: 58px; padding: 10px 11px; gap: 10px; }

  /* 资料动态：资料标题是主要信息，单独占一行，不再隐藏 */
  .doc-feed li { flex-wrap: wrap; gap: 4px 8px; }
  .doc-feed li > a { min-width: 0; overflow-wrap: anywhere; }
  .doc-feed .doc-title { display: block; order: 3; flex: 1 1 100%; font-size: 13px; color: var(--ink-2); }
  .doc-feed time { color: var(--ink-3); }

  /* 卡片很多时毛玻璃和极光动画会拖慢滚动，手机上换成不透明度更高的底色 */
  .lt-card, .stat, .app-tile, .doc-feed li {
    -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-strong);
  }
  body::after { animation: none; }
}
/* 触屏没有悬停，避免点按后卡片停留在抬升和发光状态 */
@media (hover: none) {
  .lt-card:hover, .stat:hover, .app-tile:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow); }
  .lt-card:hover::after, .stat:hover::after, .app-tile:hover::after { opacity: 0; }
  .lt-card:hover .lt-ic, .app-tile:hover .picon { transform: none; filter: var(--ic-shadow); }
  .lt-go, .app-tile-go { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  body::after, .hero-dock .eyebrow .tick, .dot.ok, .hero-dock h1 .h1-cursor { animation: none; }
  .btn.primary:hover { transform: none; }
}

/* ---------- Claude 额度页：沿用额度页版式，只换强调色（Claude 橙） ---------- */
.claude-page .codex-metric progress { accent-color: #d97757; }
.claude-page .codex-metric progress::-webkit-progress-value { background: #d97757; }
.claude-page .codex-metric progress::-moz-progress-bar { background: #d97757; }
.claude-page .codex-avatar { color: #d97757; border-color: rgba(217, 119, 87, .35); background: rgba(217, 119, 87, .1); }
[data-theme="light"] .claude-page .codex-avatar { color: #b45309; border-color: rgba(180, 83, 9, .3); background: rgba(180, 83, 9, .08); }

/* ---------- 短信接收 ---------- */
.sms-pagehead-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.sms-pagehead-actions { display: flex; gap: 8px; flex-shrink: 0; }
.sms-tabs { display: flex; gap: 4px; margin: 18px 0 16px; border-bottom: 1px solid var(--line-soft); }
.sms-tab { background: none; border: 0; padding: 10px 14px; font-size: 13.5px; color: var(--ink-4); cursor: pointer; border-bottom: 2px solid transparent; }
.sms-tab:hover { color: var(--ink); }
.sms-tab.active { color: var(--ink); border-bottom-color: var(--moss); font-weight: 500; }
.sms-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sms-stat { border: 1px solid var(--line-soft); border-radius: 14px; background: var(--card); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.sms-stat span { font-size: 11.5px; color: var(--ink-4); letter-spacing: .04em; }
.sms-stat strong { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sms-stat strong.sm { font-size: 17px; }
.sms-stat em { font-size: 11.5px; color: var(--ink-4); font-style: normal; }
.sms-chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sms-chip { display: inline-flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--card); text-decoration: none; color: inherit; font-size: 12.5px; }
.sms-chip.active { border-color: var(--moss); }
.sms-chip span { font-size: 11px; color: var(--ink-4); }
.sms-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); display: inline-block; margin-right: 5px; opacity: .5; }
.sms-chip .dot.on { background: #6fbf73; opacity: 1; }
.sms-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sms-toolbar input[type=search] { flex: 1 1 auto; max-width: 360px; }
.sms-check { font-size: 12.5px; color: var(--ink-4); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sms-list { display: flex; flex-direction: column; }
.sms-msg { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line-soft); }
.sms-msg:last-child { border-bottom: 0; }
.sms-msg.unread .sms-body { color: var(--ink); font-weight: 500; }
.sms-avatar { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line-soft); flex-shrink: 0; }
.sms-avatar.num { color: #9bb8d4; }
.sms-msg-main { flex: 1 1 auto; min-width: 0; }
.sms-msg-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.sms-msg-head strong { font-weight: 500; }
.sms-msg-head time { color: var(--ink-4); font-size: 11.5px; white-space: nowrap; }
.sms-body { margin: 6px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-3); word-break: break-word; white-space: pre-wrap; }
.sms-msg-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 11.5px; color: var(--ink-4); }
.sms-msg-foot .link { background: none; border: 0; padding: 0; color: var(--moss); cursor: pointer; font-size: 11.5px; }
.sms-form { display: grid; gap: 12px; max-width: 560px; }
.sms-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-4); }
.sms-form label.inline { flex-direction: row; align-items: center; gap: 8px; }
.sms-form-foot { display: flex; gap: 10px; }
.sms-hook-list { display: flex; flex-direction: column; gap: 10px; }
.sms-hook { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; }
.sms-hook code { font-size: 12px; word-break: break-all; color: var(--ink-3); }
@media (max-width: 720px) {
  .sms-pagehead-row { flex-direction: column; }
  .sms-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sms-toolbar { flex-wrap: wrap; }
}
.sms-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.sms-channels .panel { margin: 0; }
