/* ============================================================
   VibeSpin · 共享设计系统
   单一权威来源（single source of truth），所有交付件均引用本文件。
   Token 依据项目文档 docs/09 §10（色彩 Token 起点表）。
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

/* ---------- 1. Token ---------- */
:root {
  /* 表面层级：Blueprint Cyan 深色 */
  --bg-base:      #07131F;   /* 页面底色 */
  --bg-card:      #0E2434;   /* 卡片 / 弹层 */
  --bg-elevated:  #143247;   /* 浮层 / 边栏 */
  --bg-terminal:  #081A26;   /* 终端区底色 */
  --bg-recessed:  #050E16;   /* 设备框 / 更深层次 */
  --bg-input:     #0B1E2D;

  /* 前景 */
  --fg:           #E8F1F4;
  --fg-secondary: #A9C0CB;
  --muted:        #7E99A6;   /* 卡片上 5.3:1 */
  --faint:        #4E6773;   /* 仅用于装饰 */

  /* 描边 */
  --border:        rgba(232, 241, 244, 0.10);
  --border-strong: rgba(232, 241, 244, 0.20);
  --border-faint:  rgba(232, 241, 244, 0.06);

  /* 强调 */
  --accent:       #38D6FF;
  --accent-fill:  #38D6FF;
  --accent-fill-hover: #6BE4FF;
  --accent-fg:    #07131F;
  --on-accent:    #07131F;
  --danger-fg:    #07131F;
  --accent-soft:  rgba(56, 214, 255, 0.14);
  --accent-line:  rgba(56, 214, 255, 0.42);

  /* 连接状态 */
  --direct:       #34C759;
  --relay:        #38D6FF;
  --reconnecting: #FFD60A;
  --offline:      #FF453A;

  /* Agent 状态 */
  --agent-running: #38D6FF;
  --agent-blocked: #FF9F0A;
  --agent-done:    #30D158;
  --agent-error:   #FF453A;
  --agent-idle:    #8E8E93;

  /* 风险等级 */
  --risk-low:    #30D158;
  --risk-medium: #FFD60A;
  --risk-high:   #FF453A;

  /* 字体 */
  --font-display: "IBM Plex Sans", "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", system-ui, sans-serif;
  --font-ui: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --font-wordmark: "IBM Plex Mono", ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* 圆角 */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* 8px 基线网格 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  /* 阴影 */
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 8px 24px rgba(0,0,0,.36);
  --shadow-3: 0 24px 64px rgba(0,0,0,.52);
  --shadow-pop: 0 12px 32px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.4);

  --ease: cubic-bezier(.22,.61,.36,1);
  --dur-1: 140ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
}

/* 浅色主题：冰白表面 + 海军蓝文字；主按钮为海军蓝底 + 青色字 */
[data-theme="light"] {
  --bg-base:      #E8F1F4;
  --bg-card:      #FFFFFF;
  --bg-elevated:  #FFFFFF;
  --bg-terminal:  #FFFFFF;
  --bg-recessed:  #D9E7ED;
  --bg-input:     #FFFFFF;

  --fg:           #0A1B2A;
  --fg-secondary: #2E4A58;
  --muted:        #4F6B77;
  --faint:        #7A919C;

  --border:        rgba(10, 27, 42, 0.14);
  --border-strong: rgba(10, 27, 42, 0.24);
  --border-faint:  rgba(10, 27, 42, 0.07);

  --accent:       #0E7490;
  --accent-fill:  #0A1B2A;
  --accent-fill-hover: #143247;
  --accent-fg:    #38D6FF;
  --on-accent:    #FFFFFF;
  --danger-fg:    #FFFFFF;
  --accent-soft:  rgba(14, 116, 144, 0.10);
  --accent-line:  rgba(14, 116, 144, 0.36);

  --direct:       #1F7A44;
  --relay:        #0E7490;
  --reconnecting: #A35A00;
  --offline:      #B3261E;

  --agent-running: #0E7490;
  --agent-blocked: #A35A00;
  --agent-done:    #1F7A44;
  --agent-error:   #B3261E;
  --agent-idle:    #5C6B73;

  --risk-low:    #1F7A44;
  --risk-medium: #A35A00;
  --risk-high:   #B3261E;

  --shadow-2: 0 8px 24px rgba(10,27,42,.10);
  --shadow-3: 0 24px 64px rgba(10,27,42,.16);
  --shadow-pop: 0 12px 32px rgba(10,27,42,.16), 0 2px 8px rgba(10,27,42,.10);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
code, kbd, samp, pre { font-family: var(--font-mono); }

::selection { background: var(--accent-line); color: #fff; }

/* ---------- 3. 排版 ---------- */
.display, .h1, .h2, .h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.12; font-weight: 600; }
.display { font-size: clamp(40px, 6vw, 68px); line-height: 1.06; letter-spacing: -0.03em; }
.h1 { font-size: clamp(30px, 3.6vw, 44px); }
.h2 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3; }
.h3 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }

/* 中文展示标题：CJK 行高下限 1.3，禁止负字距 */
.cjk-display { font-family: var(--font-display); font-weight: 600; line-height: 1.34; letter-spacing: 0; }

.body { font-size: 16px; line-height: 1.6; color: var(--fg-secondary); }
.lead { font-size: 19px; line-height: 1.6; color: var(--fg-secondary); }
.small { font-size: 13px; line-height: 1.5; letter-spacing: 0.01em; color: var(--muted); }
.caption { font-size: 12px; line-height: 1.5; letter-spacing: 0.01em; color: var(--muted); }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.fg-2 { color: var(--fg-secondary); }
.accent-text { color: var(--accent); }

/* ---------- 4. 布局工具 ---------- */
.wrap { width: min(1180px, 92vw); margin-inline: auto; }
.wrap-wide { width: min(1440px, 95vw); margin-inline: auto; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); } .gap-5 { gap: var(--s-5); } .gap-6 { gap: var(--s-6); } .gap-8 { gap: var(--s-8); }
.grid { display: grid; gap: var(--s-6); }
.center { text-align: center; }
.hairline { height: 1px; background: var(--border); border: 0; }
/* 滚动容器（ios / web 共用） */
.scroll { flex: 1; min-height: 0; overflow-y: auto; }

/* ---------- 5. 标志 ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo__mark { flex: none; }
.logo__word {
  font-family: var(--font-wordmark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 17px;
  line-height: 1;
  color: var(--fg);
  white-space: nowrap;
}
.logo__word::after {
  content: "";
  display: inline-block;
  width: .14em;
  height: .14em;
  margin-left: .12em;
  background: var(--accent);
  vertical-align: .08em;
}
.logo__word--caps { letter-spacing: 0.14em; font-size: 15px; font-weight: 600; }

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--r-sm);
  font-family: var(--font-ui); font-size: 15px; font-weight: 550;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent-fill); color: var(--accent-fg); }
.btn--primary:hover { background: var(--accent-fill-hover); }
.btn--secondary { background: var(--bg-elevated); color: var(--fg); border-color: var(--border); }
.btn--secondary:hover { background: color-mix(in oklch, var(--bg-elevated) 88%, white); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn--ghost:hover { background: rgba(255,255,255,.06); }
[data-theme="light"] .btn--ghost:hover { background: rgba(0,0,0,.05); }
.btn--danger { background: var(--offline); color: var(--danger-fg); }
.btn--danger:hover { background: color-mix(in oklch, var(--offline) 88%, white); }
.btn--quiet { background: transparent; color: var(--accent); min-height: 36px; padding: 0 8px; }
.btn--quiet:hover { background: var(--accent-soft); }
.btn--block { width: 100%; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-xs); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, .focusable:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs);
}

/* 图标按钮 */
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-secondary); border: 1px solid transparent;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: var(--fg); }
[data-theme="light"] .icon-btn:hover { background: rgba(0,0,0,.06); }

/* ---------- 7. 连接状态胶囊 ---------- */
.capsule {
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 11px 0 9px;
  border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 550; letter-spacing: 0.01em;
  font-family: var(--font-ui);
  border: 1px solid;
  white-space: nowrap;
}
.capsule__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.capsule--direct  { color: var(--direct);  border-color: color-mix(in oklch, var(--direct) 42%, transparent); background: color-mix(in oklch, var(--direct) 12%, transparent); }
.capsule--direct  .capsule__dot { background: var(--direct); }
.capsule--relay   { color: var(--relay);   border-color: color-mix(in oklch, var(--relay) 42%, transparent); background: color-mix(in oklch, var(--relay) 12%, transparent); }
.capsule--relay   .capsule__dot { background: var(--relay); }
.capsule--reconnect { color: var(--reconnecting); border-color: color-mix(in oklch, var(--reconnecting) 46%, transparent); background: color-mix(in oklch, var(--reconnecting) 12%, transparent); }
.capsule--reconnect .capsule__dot { background: var(--reconnecting); animation: spin 900ms linear infinite; }
.capsule--offline { color: var(--offline); border-color: color-mix(in oklch, var(--offline) 42%, transparent); background: color-mix(in oklch, var(--offline) 12%, transparent); }
.capsule--offline .capsule__dot { background: var(--offline); }
.capsule--neutral { color: var(--muted); border-color: var(--border); background: rgba(255,255,255,.05); }
.capsule--neutral .capsule__dot { background: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }

/* ---------- 8. Agent 状态点 ---------- */
.agent-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; position: relative; }
.agent-dot--idle    { background: var(--agent-idle); }
.agent-dot--running { background: var(--agent-running); animation: pulse 1.8s var(--ease) infinite; }
.agent-dot--blocked { background: var(--agent-blocked); animation: pulse 1.2s var(--ease) infinite; }
.agent-dot--done    { background: var(--agent-done); }
.agent-dot--error   { background: var(--agent-error); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70% { box-shadow: 0 0 0 6px transparent; opacity: .75; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}
.agent-dot--running { color: color-mix(in oklch, var(--agent-running) 60%, transparent); background: var(--agent-running); }
.agent-dot--blocked { color: color-mix(in oklch, var(--agent-blocked) 60%, transparent); background: var(--agent-blocked); }

/* ---------- 9. 卡片 ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--r-lg);
  padding: var(--s-4);
}
.card--flush { padding: 0; overflow: hidden; }
.card--elev { background: var(--bg-elevated); }
.card--tight { padding: var(--s-3); }

/* ---------- 10. 列表行 ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 13px var(--s-4);
  position: relative;
  transition: background var(--dur-1) var(--ease);
}
.list-row + .list-row { box-shadow: inset 0 1px 0 var(--border-faint); }
.list-row:hover { background: rgba(255,255,255,.03); }
[data-theme="light"] .list-row:hover { background: rgba(0,0,0,.03); }
.list-row__main { flex: 1; min-width: 0; }
.list-row__title { font-size: 15px; font-weight: 500; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.list-row__sub { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row--unread::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent); border-radius: 0 2px 2px 0;
}
.list-row--handled { opacity: .5; }
.list-row--todo { }

/* ---------- 11. 徽章 / 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: var(--r-xs);
  font-size: 11.5px; font-weight: 550; letter-spacing: 0.02em;
  font-family: var(--font-mono);
  background: rgba(255,255,255,.07); color: var(--fg-secondary);
  border: 1px solid var(--border-faint);
}
.badge--accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge--amber  { background: rgba(255,159,10,.14); color: var(--agent-blocked); border-color: rgba(255,159,10,.36); }
.badge--green  { background: rgba(48,209,88,.14); color: var(--agent-done); border-color: rgba(48,209,88,.34); }
.badge--solid  { background: var(--accent-fill); color: var(--accent-fg); border-color: transparent; }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: var(--r-xs); font-size: 11px; letter-spacing: 0.02em;
  font-family: var(--font-mono); background: rgba(255,255,255,.06); color: var(--muted);
}
/* 图标方块（ios / web 共用） */
.hero-card__ico {
  width: 42px; height: 42px; border-radius: var(--r-sm);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex: none;
}

/* ---------- 12. 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 550; color: var(--fg-secondary); }
.input {
  height: 46px; padding: 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg); font-size: 16px; font-family: var(--font-ui);
  width: 100%;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input--mono { font-family: var(--font-mono); letter-spacing: 0.14em; }
.input--code { text-align: center; font-family: var(--font-mono); font-size: 24px; letter-spacing: 0.3em; height: 58px; }
.input--err { border-color: var(--offline); }

.segment {
  display: inline-flex; padding: 3px; gap: 3px;
  background: var(--bg-input); border: 1px solid var(--border-faint);
  border-radius: var(--r-sm);
}
.segment__opt {
  padding: 7px 14px; border-radius: var(--r-xs);
  font-size: 13.5px; font-weight: 550; color: var(--fg-secondary);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.segment__opt[aria-selected="true"] { background: var(--bg-elevated); color: var(--fg); box-shadow: var(--shadow-1); }
.segment__opt:hover:not([aria-selected="true"]) { color: var(--fg); }

.switch {
  --w: 51px; --h: 31px;
  width: var(--w); height: var(--h); border-radius: var(--r-pill);
  background: var(--bg-elevated); border: 1px solid var(--border-faint);
  position: relative; flex: none; transition: background var(--dur-2) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: calc(var(--h) - 6px); height: calc(var(--h) - 6px);
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease);
}
.switch[aria-checked="true"] { background: var(--direct); border-color: transparent; }
.switch[aria-checked="true"]::after { transform: translateX(calc(var(--w) - var(--h))); }

/* ---------- 13. 进度 / 风险 ---------- */
.progress { height: 5px; border-radius: var(--r-pill); background: rgba(255,255,255,.10); overflow: hidden; }
.progress__fill { height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width var(--dur-3) var(--ease); }
.riskbar { height: 4px; border-radius: var(--r-pill); overflow: hidden; }
.riskbar--low { background: var(--risk-low); }
.riskbar--medium { background: var(--risk-medium); }
.riskbar--high { background: var(--risk-high); }

/* ---------- 14. 终端 ---------- */
.term {
  background: var(--bg-terminal);
  color: #E6E6E6;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 12px 14px;
  overflow: hidden;
}
.term--flush { border-radius: 0; }
.term--box { border-radius: var(--r-md); border: 1px solid var(--border-faint); }
.term__line { white-space: pre-wrap; word-break: break-word; }
.term .prompt, .prompt { color: #4EC9A0; font-weight: 600; }
.term .t-green { color: #4EC9A0; }
.term .t-blue  { color: #56A8FF; }
.term .t-amber { color: #FFCC66; }
.term .t-red   { color: #FF7A6E; }
.term .t-dim   { color: #8A8A8E; }
.term .t-mag   { color: #C792EA; }
.term .cursor {
  display: inline-block; width: 8px; height: 15px; background: #E6E6E6;
  vertical-align: -2px; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* diff */
.diff { font-family: var(--font-mono); font-size: 12px; line-height: 1.55; }
.diff__line { display: flex; gap: 10px; padding: 0 10px; white-space: pre; }
.diff__ln { color: var(--faint); width: 26px; text-align: right; flex: none; user-select: none; }
.diff__add { background: rgba(48,209,88,.10); }
.diff__add .diff__code { color: #8BE0A6; }
.diff__del { background: rgba(255,69,58,.10); }
.diff__del .diff__code { color: #FF8A80; }
.diff__code { white-space: pre; }

/* ---------- 15. 设备框 ---------- */
/* 手机 */
.phone {
  width: 390px; flex: none;
  background: #000; border-radius: 54px; padding: 11px;
  box-shadow: var(--shadow-3), inset 0 0 0 1px rgba(255,255,255,.08);
  position: relative;
}
.phone__screen {
  background: var(--bg-base); border-radius: 44px; overflow: hidden;
  height: 812px; position: relative; display: flex; flex-direction: column;
}
.phone__island {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 118px; height: 33px; background: #000; border-radius: var(--r-pill); z-index: 40;
}
.statusbar {
  height: 54px; flex: none; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 26px 6px; font-size: 14px; font-weight: 600; color: var(--fg);
  font-family: var(--font-ui);
}
.statusbar__icons { display: flex; align-items: center; gap: 6px; }
.home-ind { height: 26px; flex: none; display: flex; align-items: center; justify-content: center; }
.home-ind::after { content: ""; width: 134px; height: 5px; border-radius: var(--r-pill); background: rgba(255,255,255,.5); }
[data-theme="light"] .home-ind::after { background: rgba(0,0,0,.28); }

/* 浏览器窗口 */
.browser {
  border-radius: var(--r-md); overflow: hidden; background: var(--bg-recessed);
  border: 1px solid var(--border); box-shadow: var(--shadow-3);
}
.browser__bar {
  height: 44px; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--bg-card); border-bottom: 1px solid var(--border-faint);
}
.dots { display: flex; gap: 7px; }
.dots span { width: 11px; height: 11px; border-radius: 50%; }
.dots span:nth-child(1) { background: #FF5F57; } .dots span:nth-child(2) { background: #FEBC2E; } .dots span:nth-child(3) { background: #28C840; }
.urlbar {
  flex: 1; max-width: 420px; margin-inline: auto; height: 28px;
  background: var(--bg-input); border-radius: var(--r-pill);
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  font-size: 12.5px; color: var(--muted); font-family: var(--font-mono);
}

/* macOS 窗口 */
.macwin {
  border-radius: 12px; overflow: hidden; background: var(--bg-base);
  border: 1px solid var(--border); box-shadow: var(--shadow-3);
}
.macwin__bar {
  height: 40px; display: flex; align-items: center; padding: 0 16px; gap: 10px;
  background: var(--bg-card); border-bottom: 1px solid var(--border-faint);
}
.macwin__title { font-size: 13px; font-weight: 600; color: var(--fg-secondary); margin-inline: auto; }

/* 弹出面板 */
.popover {
  width: 320px; background: color-mix(in oklch, var(--bg-card) 92%, transparent);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); overflow: hidden;
}

.hero-cta { margin-top: var(--s-8); display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* ---------- 16. 展示页版式 ---------- */
.page-head {
  padding: var(--s-12) 0 var(--s-8);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-10);
}
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-3); }
.eyebrow__chip {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 3px 9px; border-radius: var(--r-xs);
}
.section { padding: var(--s-10) 0; }
.section + .section { border-top: 1px solid var(--border-faint); }
.section__head { margin-bottom: var(--s-6); }
.section__index { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; margin-bottom: 8px; display: block; }

/* 屏幕展示网格 */
.screens {
  display: flex; flex-wrap: wrap; gap: var(--s-8) var(--s-6);
  align-items: flex-start; justify-content: center;
}
.screen-item { display: flex; flex-direction: column; gap: var(--s-3); align-items: center; }
.screen-item__cap { text-align: center; max-width: 320px; }
.screen-item__cap .label { color: var(--accent); }
.screen-item__cap p { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* 规格卡 */
.spec { background: var(--bg-card); border: 1px solid var(--border-faint); border-radius: var(--r-md); padding: var(--s-4); }
.spec__row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13.5px; }
.spec__row + .spec__row { border-top: 1px solid var(--border-faint); }
.spec__k { color: var(--muted); }
.spec__v { color: var(--fg); text-align: right; font-family: var(--font-mono); font-size: 12.5px; }

/* 色卡 */
.swatch { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border-faint); }
.swatch__chip { height: 88px; }
.swatch__meta { padding: 12px 14px; background: var(--bg-card); }
.swatch__name { font-size: 13.5px; font-weight: 550; }
.swatch__hex { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 2px; letter-spacing: 0.04em; }

/* 顶栏（展示件） */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--bg-base) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.topbar__in { height: 62px; display: flex; align-items: center; justify-content: space-between; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  padding: 8px 13px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
  color: var(--fg-secondary); transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.nav-links a:hover { background: rgba(255,255,255,.06); color: var(--fg); }
.nav-links a[aria-current="page"] { color: var(--fg); background: var(--accent-soft); }

/* 提示条 */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.5;
  border: 1px solid;
}
.notice--warn { background: rgba(255,214,10,.10); border-color: rgba(255,214,10,.34); color: #FFE08A; }
.notice--danger { background: rgba(255,69,58,.10); border-color: rgba(255,69,58,.34); color: #FFA79E; }
.notice--info { background: var(--accent-soft); border-color: var(--accent-line); color: #9CD0FF; }
.notice--neutral { background: rgba(255,255,255,.05); border-color: var(--border); color: var(--fg-secondary); }
.notice__ico { flex: none; margin-top: 1px; }

.pill-sm { display:inline-flex; align-items:center; gap:5px; height:24px; padding:0 9px; border-radius:var(--r-pill); font-size:11.5px; font-weight:550; background:rgba(255,255,255,.07); color:var(--fg-secondary); font-family: var(--font-mono); }

/* 滚动条（暗色） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: var(--r-pill); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 尊重系统的减弱动效设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 860px) {
  .phone { width: 340px; }
  .phone__screen { height: 716px; }
  .screens { gap: var(--s-8) var(--s-4); }

  /* 交付导航改为可横向滚动的第二行，避免窄屏溢出 */
  .topbar__in { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
  .nav-links { width: 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }
  .logo__word { font-size: 18px; }
}

/* ============================================================
   17. 应用内构件（iOS / Android 控制端多页共用 · 单一权威来源）
   原散落于各页 <style>，已收敛至此，页面不得再重复定义。
   ============================================================ */
.ios-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.ios-header { display: flex; align-items: center; gap: 8px; padding: 4px 12px 12px; }
.ios-header__t { flex: 1; }
.ios-header__t .l1 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.ios-header__t .l2 { font-size: 12px; color: var(--muted); margin-top: 1px; }
.ios-title-lg { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; padding: 0 18px 10px; }
.pad { padding: 0 16px; }

.tabbar { height: 58px; flex: none; display: flex; border-top: 1px solid var(--border-faint); background: color-mix(in oklch, var(--bg-card) 70%, transparent); backdrop-filter: blur(18px); }
.tabbar__item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: var(--muted); }
.tabbar__item svg { color: var(--muted); }
.tabbar__item--on { color: var(--accent); }
.tabbar__item--on svg { color: var(--accent); }

.hero-card { background: linear-gradient(180deg, color-mix(in oklch,var(--accent) 16%, var(--bg-card)), var(--bg-card)); border: 1px solid var(--accent-line); border-radius: var(--r-lg); padding: 14px 15px; display: flex; align-items: center; gap: 12px; }

.comp-card { background: var(--bg-card); border: 1px solid var(--border-faint); border-radius: var(--r-lg); padding: 14px 15px; }
.comp-card__top { display: flex; align-items: flex-start; gap: 12px; }
.comp-card__ico { width: 40px; height: 40px; border-radius: 11px; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; color: var(--fg-secondary); flex: none; }
.comp-card__meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* 工作台 */
.wb-top { height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 4px; }
.sess-tabs { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; }
.sess-tab { display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--r-pill); background: var(--bg-card); border: 1px solid var(--border-faint); font-size: 12.5px; color: var(--fg-secondary); white-space: nowrap; flex: none; }
.sess-tab--on { background: var(--bg-elevated); color: var(--fg); border-color: var(--border); }
.term-wrap { flex: 1; min-height: 0; position: relative; background: var(--bg-terminal); margin: 0 10px; border-radius: 12px; overflow: hidden; }
.handle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 46px; background: var(--accent); border-radius: 3px 0 0 3px; opacity: .8; }
.agent-panel { margin: 10px 10px 0; border: 1px solid var(--border-faint); border-radius: 12px; padding: 12px; display: flex; gap: 12px; align-items: center; background: var(--bg-card); }
.kb-toolbar { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; }
.kb-key { flex: none; min-width: 44px; height: 38px; padding: 0 12px; border-radius: 9px; background: var(--bg-elevated); border: 1px solid var(--border-faint); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 13px; color: var(--fg-secondary); }
.kb-key--mod { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* 抽屉 / 弹层 */
.sheet { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet__dim { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(1.5px); }
.sheet__panel { position: relative; background: var(--bg-elevated); border-radius: 22px 22px 0 0; padding: 8px 16px 20px; box-shadow: 0 -8px 40px rgba(0,0,0,.5); }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 4px auto 14px; }

/* 长按批准（P-C04）：填充动画 + 震动，防误触 */
.sample-press {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); background: var(--agent-blocked); color: #241500;
  font-size: 15px; font-weight: 600; letter-spacing: 0.01em; user-select: none; cursor: pointer;
}
.sample-press .fill { position: absolute; inset: 0; width: 0; background: rgba(0,0,0,.22); }
.sample-press.holding .fill { animation: holdfill .8s linear forwards; }
@keyframes holdfill { to { width: 100%; } }

.dialog { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 24px; }
.dialog__panel { position: relative; width: 100%; background: var(--bg-elevated); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-pop); }

.grid-2s { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sess-card { background: var(--bg-card); border: 1px solid var(--border-faint); border-radius: var(--r-md); padding: 12px; }
.sess-card__t { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 550; }
.sess-card__c { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.file-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.file-row + .file-row { border-top: 1px solid var(--border-faint); }
.pill-mini { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; }
.add { color: var(--direct); background: rgba(48,209,88,.12); }
.del { color: var(--offline); background: rgba(255,69,58,.12); }

.settings-group { background: var(--bg-card); border: 1px solid var(--border-faint); border-radius: var(--r-md); overflow: hidden; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; }
.settings-row + .settings-row { border-top: 1px solid var(--border-faint); }

.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: var(--r-pill); font-size: 12.5px; background: var(--bg-card); border: 1px solid var(--border-faint); color: var(--fg-secondary); }
.chip--on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

.swatch-mini { height: 62px; border-radius: 10px; border: 1px solid var(--border); display:flex; align-items:flex-end; justify-content:space-between; padding: 6px 8px; font-size: 9.5px; font-family: var(--font-mono); }

/* 单选行（macOS 被控端 / 设置页共用） */
.radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; position: relative; }
.radio--on { border-color: var(--accent); }
.radio--on::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.radio-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; cursor: pointer; }
.radio-row + .radio-row { border-top: 1px solid var(--border-faint); }

/* iOS 子页导航（由 assets/vibespin.js 注入，避免各页重复定义链接表） */
.pv-ios-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.pv-ios-nav a {
  padding: 7px 13px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
  color: var(--fg-secondary); background: var(--bg-card); border: 1px solid var(--border-faint);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.pv-ios-nav a:hover { color: var(--fg); background: var(--bg-elevated); }
.pv-ios-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }

/* 用法条 / 配额条（订阅页、团队页共用） */
.quota { display: flex; align-items: center; gap: 10px; }
.quota__bar { flex: 1; height: 6px; border-radius: var(--r-pill); background: rgba(255,255,255,.10); overflow: hidden; }
.quota__fill { height: 100%; border-radius: var(--r-pill); background: var(--accent); }
.quota__fill--warn { background: var(--agent-blocked); }
.quota__num { font-family: var(--font-mono); font-size: 12px; color: var(--fg-secondary); white-space: nowrap; }

/* 统计小格（审计/用量等） */
.tile { background: var(--bg-card); border: 1px solid var(--border-faint); border-radius: var(--r-md); padding: 12px 14px; }
.tile__n { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.tile__k { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* 时间线（审计日志 / 安全事件） */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl__item { position: relative; padding: 9px 0; }
.tl__dot { position: absolute; left: -21px; top: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); border: 2px solid var(--bg-base); }
.tl__dot--on { background: var(--accent); }

/* 步骤条（推送自检 / 权限引导共用） */
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 12px; padding: 12px 0; }
.step + .step { border-top: 1px solid var(--border-faint); }
.step__no { width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; background: var(--bg-elevated); color: var(--fg-secondary); border: 1px solid var(--border-faint); }
.step__no--ok { background: rgba(48,209,88,.16); color: var(--direct); border-color: rgba(48,209,88,.4); }
.step__no--err { background: rgba(255,69,58,.14); color: var(--offline); border-color: rgba(255,69,58,.4); }
.step__no--wait { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* 头像圆（账号卡 / 成员列表共用） */
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); font-weight: 600; font-size: 17px; }

/* 内凹卡片变体（预览区 / 日志区） */
.card--recessed { background: var(--bg-recessed); }

/* 复选（闲置设备清理等） */
.checkbox { width: 22px; height: 22px; border-radius: 7px; flex: none; border: 1.5px solid var(--border-strong); position: relative; }
.checkbox--on { background: var(--accent); border-color: var(--accent); }
.checkbox--on::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* 滑块（外观 / 终端偏好设置） */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.16); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(0,0,0,.15); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid rgba(0,0,0,.15); cursor: pointer; }

/* ============================================================
   18. 展示页窄屏适配
   固定 390px 的手机框在手机上会撑出横向滚动；用 zoom 整体缩放，
   保持内部 390×844 设计稿比例，而不是压扁内部布局。
   ============================================================ */
@media (max-width: 520px) {
  .screens { gap: var(--s-6); }
  .screen-item { width: 100%; }
  .screens .phone { zoom: 0.92; }
}
@media (max-width: 440px) {
  .screens .phone { zoom: 0.88; }
}
@media (max-width: 390px) {
  .screens .phone { zoom: 0.82; }
}
@media (max-width: 340px) {
  .screens .phone { zoom: 0.76; }
}

/* 浏览器窗口地址栏在窄屏下必须省略，而不是撑破工具栏 */
.urlbar { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

@media (max-width: 640px) {
  .page-head { padding: var(--s-8) 0 var(--s-6); margin-bottom: var(--s-8); }
  .section { padding: var(--s-8) 0; }
  .page-head .lead { font-size: 17px; line-height: 1.65; }
}
