/* Pocket Ghost: warm ivory, periwinkle fields, cobalt actions, navy ink, coral details. */
:root {
  color-scheme: light dark;
  --bg: #fbf8f1;
  --bg-card: #fffdf9;
  --fg: #17254b;
  --fg-muted: #58617a;
  --accent: #3453ca;
  --accent-hover: #2943a9;
  --accent-soft: #e5eafd;
  --action: #3453ca;
  --action-hover: #2943a9;
  --border: #d8d9e3;
  --periwinkle: #dce3fa;
  --coral: #ee8b79;
  --nav-bg: rgba(251, 248, 241, .94);
  --shadow: 0 16px 38px rgba(23, 37, 75, .16);
  --desk-bg: linear-gradient(145deg, #c3cff5 0%, #92a9e5 48%, #6482c9 100%);
  --desk-glass: rgba(255, 253, 249, .78);
  --desk-ink: #17254b;
  --desk-muted: #505d7a;
  --desk-line: rgba(23, 37, 75, .16);
  --radius: 14px;
  --radius-sm: 10px;
  --max-w: 1136px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111a30;
    --bg-card: #1a2742;
    --fg: #f4f1e9;
    --fg-muted: #b3bfd6;
    --accent: #afbeff;
    --accent-hover: #d0d9ff;
    --accent-soft: #2b3c66;
    --action: #4864d4;
    --action-hover: #3e57bc;
    --border: #354564;
    --periwinkle: #202f51;
    --coral: #f4a18f;
    --nav-bg: rgba(17, 26, 48, .94);
    --shadow: 0 16px 38px rgba(3, 10, 25, .36);
    --desk-bg: linear-gradient(145deg, #3e568e 0%, #294270 48%, #172b50 100%);
    --desk-glass: rgba(26, 39, 66, .86);
    --desk-ink: #f4f1e9;
    --desk-muted: #bfcae0;
    --desk-line: rgba(200, 215, 246, .22);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-padding-top: 100px; scrollbar-color: var(--fg-muted) var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
input, select { caret-color: var(--accent); accent-color: var(--action); }
input::placeholder { color: var(--fg-muted); opacity: 1; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
a { color: var(--accent); text-underline-offset: .22em; }
::selection { background: var(--accent-soft); color: var(--fg); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1, h2, h3 { text-wrap: balance; }
button:disabled, .btn[aria-disabled="true"] { opacity: .65; cursor: not-allowed; }

/* Navigation shared with the store. */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: calc(var(--max-w) + 64px);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--fg);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand img { display: block; width: 36px; height: 36px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  padding: 6px 0;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s ease;
}
.nav-links a:hover { color: var(--accent); }
/* 当前页：靠 inset 阴影画下划线，不用 border/padding，切换时零布局抖动。 */
.nav-links a.is-active { color: var(--fg); box-shadow: inset 0 -2px 0 var(--action); }

/* Hero: the canonical app icon is the visual, not a substitute mascot. */
.hero { padding: 76px 32px 88px; }
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 64px;
}
.hero-copy { min-width: 0; }
.hero h1 {
  font-size: clamp(72px, 7.5vw, 96px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--fg);
}
.hero-tagline {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.4;
  color: var(--fg);
  margin-top: 20px;
}
.hero-desc {
  max-width: 28em;
  color: var(--fg-muted);
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.9;
}
.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  min-width: 0;
}
.hero-ghost { width: min(100%, 384px); height: auto; display: block; }
.hero-hello {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--fg-muted);
}
.hero-hello::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.download-pick {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}
.download-main { text-align: left; min-width: 268px; }
/* Keep split-button geometry above the shared .btn rules in specificity. */
.btn.download-main {
  align-items: flex-start;
  padding: 16px 26px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.download-main .btn-main { font-weight: 650; }
.download-caret { justify-content: center; transition: background .18s ease; }
.btn.download-caret {
  padding: 0 17px;
  border-left: 1px solid rgba(255, 255, 255, .3);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.download-caret:hover, .download-caret.is-open { background: var(--action-hover); }
.download-caret svg { transition: transform .18s ease; }
.download-caret.is-open svg { transform: rotate(180deg); }
.download-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 300px;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: calc(100vw - 40px);
  text-align: left;
}
.download-menu[hidden] { display: none; }
.download-menu-head, .download-menu-foot {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--fg-muted);
}
.download-menu-foot { border-top: 1px solid var(--border); padding-top: 10px; }
.download-option {
  display: grid;
  grid-template-columns: 1fr auto 18px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
}
.download-option:hover, .download-option:focus-visible { background: var(--accent-soft); }
.download-option:focus-visible { outline-offset: -3px; }
.opt-label { font-weight: 600; }
.opt-meta { font-size: 12px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.opt-check { color: var(--accent); opacity: 0; font-size: 13px; }
.download-option.is-current .opt-check { opacity: 1; }
.hero-meta { display: grid; gap: 8px; margin-top: 16px; }
.hero-details { display: flex; align-items: flex-start; gap: 8px 20px; flex-wrap: wrap; }
.hero-details:has(details[open]) { flex-direction: column; }
.download-fineprint {
  font-size: 12px;
  color: var(--fg-muted);
}
.download-fineprint summary { cursor: pointer; }
.download-fineprint p { margin-top: 6px; }
.download-fineprint code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  word-break: break-all;
}
.changelog {
  max-width: 620px;
  text-align: left;
  color: var(--fg-muted);
  font-size: 13px;
}
.changelog summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
}
.changelog pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 10px 0 0;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--fg);
}
.platform-hint {
  color: var(--fg-muted);
  font-size: 13px;
  margin-top: 4px;
}
.platform-hint a {
  color: var(--accent);
  text-decoration: none;
}
.platform-hint a:hover { text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
  border: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-hover); }
.btn-primary[aria-disabled="true"]:hover { background: var(--action); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
}
.btn-ghost:hover { border-color: var(--fg-muted); }
.btn-lg { padding: 16px 36px; font-size: 16px; }
.btn-sub { font-size: 12px; color: #f0f3ff; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* Editorial content: installation rows and open feature columns, not tiles. */
.features { padding: 88px 32px; }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
/* .agent h1 = /ai 独立页的页面级标题，和首页各 section 的 h2 保持同一字号。 */
.features h2, .preview h2, .agent h2, .agent h1, .agent-cta h2 {
  font-size: clamp(30px, 3.5vw, 44px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.3;
  margin-bottom: 40px;
}
.download h2, .store-hero h1 { text-align: center; font-size: 32px; margin-bottom: 48px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px; }
.feature-card { padding: 24px 0 0; border-top: 1px solid var(--border); min-width: 0; }
.feature-icon { color: var(--accent); margin-bottom: 20px; line-height: 1; }
.feature-icon svg, .dock-i svg {
  display: block;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature-card h3 { font-size: 20px; font-weight: 650; margin-bottom: 10px; }
.feature-card p { color: var(--fg-muted); font-size: 15px; line-height: 1.85; }
.installation { padding-bottom: 24px; }
.installation .section-inner { display: grid; grid-template-columns: 1fr 2fr; gap: 64px; }
.installation h2 { margin: 8px 0 0; }
.installation .feature-grid { display: block; }
.installation .feature-card {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 20px;
  padding: 26px 0;
}
.installation .feature-icon { grid-row: 1 / 3; margin: 4px 0 0; }
.installation .feature-card h3 { margin-bottom: 8px; }
.installation .feature-card p { max-width: 38em; }
.home .version-info { max-width: 34em; }

/* Download */
.download {
  padding: 80px 24px;
  text-align: center;
}
.version-info {
  color: var(--fg-muted);
  font-size: 13px;
}

/* Store */
.store-hero {
  padding: 60px 24px 40px;
  text-align: center;
}
.store-hero p {
  color: var(--fg-muted);
  margin-top: -32px;
}
.store-content { padding: 0 24px 80px; }
.store-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  align-items: center;
}
.store-filters input[type="search"],
.store-filters select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--fg);
  font-size: 14px;
}
.store-filters input[type="search"] { flex: 1; min-width: 200px; }
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--fg-muted);
  cursor: pointer;
}

.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.store-skin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.store-skin-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.skin-preview {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--accent-soft);
}
.skin-preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-size: 14px;
}
.skin-info { padding: 14px; }
.skin-info h3 { font-size: 15px; margin-bottom: 4px; }
.skin-renderer {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--border);
  color: var(--fg-muted);
}
.skin-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.skin-price { color: var(--accent); font-weight: 600; }
.skin-downloads { color: var(--fg-muted); }

.empty { color: var(--fg-muted); text-align: center; grid-column: 1/-1; padding: 40px; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}
.footer p { color: var(--fg-muted); font-size: 13px; }

/* Agent installation keeps the real host commands and registry as the content. */
.agent { padding: 88px 32px; background: var(--periwinkle); }
.agent h2 { margin-bottom: 22px; }
.agent-lead { max-width: 52em; margin: 0 0 32px; color: var(--fg-muted); font-size: 16px; line-height: 1.9; }
.agent-lead strong { color: var(--fg); font-weight: 650; }
.agent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.agent-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  border-radius: 8px;
  padding: 10px 18px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.agent-tab:hover { border-color: var(--accent); color: var(--fg); }
.agent-tab.is-active { border-color: var(--fg); color: var(--bg); background: var(--fg); }
.agent-mode { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.agent-mode .mode-btn {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.agent-mode .mode-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--fg); }
.agent-mode .mode-btn.is-active { border-style: solid; border-color: var(--accent); color: var(--fg); background: var(--accent-soft); }
.agent-mode .mode-btn:disabled { opacity: .4; cursor: not-allowed; }
.agent-plugin-note { margin-top: 12px; }
.agent-cmd { display: flex; align-items: stretch; gap: 12px; max-width: 100%; margin: 0; }
.agent-cmd code {
  flex: 1;
  min-width: 0;
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 14px;
  color: var(--fg);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.8;
  text-align: left;
}
.btn-sm {
  padding: 0 20px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  cursor: pointer;
}
.btn-sm:hover { border-color: var(--accent); background: var(--accent-soft); }
.agent-note { max-width: 60em; margin: 14px 0 48px; font-size: 13px; color: var(--fg-muted); line-height: 1.9; }
.agent-note a { color: var(--accent); }
.agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
  margin-bottom: 40px;
}
.agent-card { border-top: 1px solid var(--border); padding: 28px 0; min-width: 0; }
.agent-card .feature-icon { float: left; margin: 2px 14px 0 0; }
.agent-card h3 { font-size: 20px; font-weight: 650; margin-bottom: 14px; }
.agent-card p { color: var(--fg-muted); font-size: 15px; line-height: 1.85; }
.agent-mono {
  display: block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--accent);
  overflow-wrap: anywhere;
  text-align: left;
}
.agent-connect { white-space: pre-wrap; color: var(--fg); background: var(--bg-card); border-radius: var(--radius-sm); padding: 14px; }
.agent-sub { font-size: 15px; color: var(--fg-muted); font-weight: 550; margin-bottom: 16px; }
.agent-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.agent-chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--bg-card);
  cursor: default;
}
.agent-chips code { font-size: 12px; color: var(--fg); overflow-wrap: anywhere; }
.agent-chips .dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- AI 接入（/ai）：首页入口带 + 独立页 ----------
   2026-10-16 顶部导航新增「AI 接入」菜单项：正文从首页搬到 /ai（partial 共用），
   首页这里换成一条轻入口带 —— 数字来自能力注册表，不写死。 */
.agent-cta { padding: 72px 32px; background: var(--periwinkle); }
.agent-cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.agent-cta h2 { font-size: clamp(26px, 3vw, 38px); margin-bottom: 18px; }
.agent-cta-eyebrow,
.agent-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.agent-cta-lead { color: var(--fg-muted); font-size: 15px; line-height: 1.95; max-width: 46em; }
.agent-cta-lead strong { color: var(--fg); font-weight: 650; }
.agent-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.agent-cta-stats {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.agent-cta-stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.agent-cta-stats dt { color: var(--fg-muted); font-size: 13px; }
.agent-cta-stats dd { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--fg); font-variant-numeric: tabular-nums; }

/* /ai：正文就是那段 agent 区，顶部留一点呼吸，底部接一枚下载引导。 */
.agent-page { padding-top: 64px; }
.agent-page h1 { margin-bottom: 22px; }
.ai-handoff { padding: 56px 32px 72px; border-top: 1px solid var(--border); }
.ai-handoff-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 32px;
  align-items: center;
}
.ai-handoff h2 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 700; letter-spacing: -.02em; margin-bottom: 10px; }
.ai-handoff p { color: var(--fg-muted); font-size: 15px; line-height: 1.9; }
.ai-handoff p code { background: var(--accent-soft); border-radius: 6px; padding: 2px 6px; font-size: 13px; }
.ai-handoff-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

/* ---------- Behavior illustration: macOS desktop with the Pocket Ghost ---------- */
.preview { padding: 64px 32px 72px; border-top: 1px solid var(--border); }
.section-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 64px;
  margin-bottom: 36px;
}
.preview h2 { margin: 0; }
.preview-lead { max-width: 38em; margin: 0; color: var(--fg-muted); font-size: 15px; line-height: 1.9; }
.stage {
  max-width: 1000px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  overflow: hidden;
}

/* 系统状态栏：半透明 + 背景模糊，和真 macOS 一样压在壁纸上 */
.menubar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 15px;
  height: 26px;
  padding: 0 12px;
  font-size: 12.5px;
  color: var(--desk-ink);
  background: var(--desk-glass);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
}
.mb-logo { display: inline-flex; align-items: center; opacity: .95; }
.mb-bold { font-weight: 700; }
.mb-item { opacity: .82; }
.mb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  opacity: .92;
}
.mb-clock { font-size: 12.5px; }

/* Periwinkle wallpaper stays independent from the readable UI surfaces. */
.desk { position: relative; height: 430px; overflow: hidden; background: var(--desk-bg); }

/* 桌面上的窗口 */
.desk-win {
  position: absolute;
  overflow: hidden;
  border-radius: 10px;
  background: var(--desk-glass);
  color: var(--desk-ink);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.desk-win.win-term { top: 44px; left: 34px; width: min(430px, 58%); background: #17233c; }
.desk-win-bar {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border-bottom: 1px solid var(--desk-line);
  background: var(--desk-glass);
}
.win-term .desk-win-bar { background: #22314d; border-bottom-color: #344560; }
.lights { display: flex; gap: 7px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #555; }
.lights i:nth-child(1) { background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.dw-title { font-size: 11.5px; color: var(--desk-muted); }
.win-term .dw-title { color: #c0cce1; }
.desk-code {
  margin: 0;
  padding: 12px 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.8;
  color: #a6f0b8;
}
.desk-code .desk-dim { color: #aebbd1; }
.desk-code .desk-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  vertical-align: -2px;
  background: #a6f0b8;
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* 第二扇窗（备忘录），叠在后面给桌面一点纵深 */
.win-note { top: 58px; right: 40px; width: 230px; }
.note-list {
  list-style: none;
  margin: 0;
  padding: 12px 14px 14px;
  font-size: 12px;
  line-height: 2;
  color: var(--desk-ink);
}
.note-list li::before { content: "· "; color: var(--desk-muted); }

/* Dock：毛玻璃 + 圆角图标 + 运行指示点 + 悬停放大 */
.dock {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 16px;
  background: var(--desk-glass);
  color: var(--desk-ink);
  backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  box-shadow: var(--shadow);
}
.dock-i {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  line-height: 1;
  border-radius: 10px;
  background: var(--bg-card);
  transition: transform .18s ease;
}
.dock-i svg { width: 23px; height: 23px; }
.dock-i.dock-brand { background: transparent; }
.dock-brand img { display: block; width: 100%; height: 100%; }
.dock-i:hover { transform: translateY(-7px) scale(1.22); }
.dock-i.is-run::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 3.5px;
  height: 3.5px;
  margin-left: -1.75px;
  border-radius: 50%;
  background: var(--desk-ink);
}
.dock-sep { width: 1px; align-self: stretch; margin: 2px 3px; background: var(--desk-line); }
.dock-trash { border-radius: 10px; }

/* 桌宠：站在 Dock 右上方的空桌面上 */
.pet {
  position: absolute;
  right: 62px;
  bottom: 66px;
  width: 124px;
  z-index: 3;
  transition: opacity .5s ease, transform .5s ease;
}
.pet-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pet-shad { fill: rgba(23, 37, 75, .2); }
.pet-breathe { transform-origin: 60px 100px; animation: pet-breathe 3.4s ease-in-out infinite; }
@keyframes pet-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.028, .975); } }
.pet-eyes { animation: blink 5.2s infinite; transform-origin: 60px 57px; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
.pet-eyes-happy path { stroke: #17254b; stroke-width: 3.6; fill: none; stroke-linecap: round; }
.pet-eyes-happy, .pet-eyes-alert, .mouth-open, .mouth-o, .sweat { display: none; }
.mouth { stroke: #17254b; stroke-width: 2.8; fill: none; stroke-linecap: round; }
.mouth-open, .mouth-o { fill: #17254b; stroke: none; }
.sweat { fill: #9bb9ed; opacity: .95; }

/* 表情：由 data-face 切换，和客户端的 reaction 一一对应 */
.stage[data-face="happy"] .pet-eyes { display: none; }
.stage[data-face="happy"] .pet-eyes-happy { display: block; }
.stage[data-face="happy"] .mouth-neutral { display: none; }
.stage[data-face="happy"] .mouth-open { display: block; }
.stage[data-face="alert"] .pet-eyes { display: none; }
.stage[data-face="alert"] .pet-eyes-alert { display: block; }
.stage[data-face="alert"] .mouth-neutral { display: none; }
.stage[data-face="alert"] .mouth-o { display: block; }
.stage[data-face="alert"] .sweat { display: block; }
.stage[data-face="alert"] .cheek { opacity: .8; }

/* 气泡 */
.bubble {
  position: absolute;
  right: 40px;
  bottom: 196px;
  z-index: 4;
  max-width: 300px;
  min-height: 22px;
  padding: 12px 16px;
  border-radius: 15px;
  background: var(--bg-card);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.6;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transform-origin: bottom right;
  transition: opacity .35s ease, transform .35s ease;
}
.bubble::after {
  content: "";
  position: absolute;
  right: 44px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  transform: rotate(45deg);
}
.stage[data-scene="bubble"] .bubble,
.stage[data-scene="alert"] .bubble,
.stage[data-scene="sound"] .bubble { opacity: 1; transform: none; }
/* 飘红场景里气泡也变红：它是在喊，不是在聊天 */
.stage[data-scene="alert"] .bubble { background: #b53638; color: #fff; font-weight: 600; }
.stage[data-scene="alert"] .bubble::after { background: #b53638; }

/* 弹幕层 */
.danmaku { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity .4s ease; }
.stage[data-scene="danmaku"] .danmaku { opacity: 1; }
.dm {
  position: absolute;
  left: 100%;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: #fff;
  background: #2943a9;
  animation: dm-float 9s linear infinite;
}
.dm-a { top: 60px; animation-duration: 8.5s; }
.dm-b { top: 118px; animation-duration: 10.5s; animation-delay: 1.6s; background: #304668; }
.dm-c { top: 176px; animation-duration: 9.5s; animation-delay: 3.1s; background: #a33838; }
.dm-d { top: 238px; animation-duration: 11.5s; animation-delay: 4.6s; }
@keyframes dm-float { from { left: 100%; } to { left: -55%; } }

/* 通知卡（弱打扰 / 告警共用一套外观，差别在强调色） */
.quiet-card, .alert-card {
  position: absolute;
  top: 44px;
  right: 26px;
  z-index: 4;
  width: 262px;
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--bg-card);
  color: var(--fg);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity .45s ease, transform .45s ease;
}
.quiet-card strong, .alert-card strong { display: block; margin: 8px 0 4px; font-size: 14px; color: var(--fg); }
.qc-tag, .ac-tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.qc-verdict { font-size: 12px; color: var(--fg-muted); }
.stage[data-scene="quiet"] .quiet-card { opacity: 1; transform: none; }
.stage[data-scene="quiet"] .pet { opacity: 0; transform: translateY(16px) scale(.94); }
/* 隐身不等于空场：原位那枚角标交代"消息在它手里存着" */
.quiet-hint {
  position: absolute;
  right: 66px;
  bottom: 76px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--desk-ink);
  background: var(--desk-glass);
  border: 1px dashed var(--desk-muted);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s ease .35s, transform .4s ease .35s;
}
.stage[data-scene="quiet"] .quiet-hint { opacity: 1; transform: none; }

.alert-card { display: flex; gap: 12px; align-items: flex-start; background: #fff1ea; }
.alert-card strong { color: #71272c; }
.alert-card .qc-verdict { color: #7b4548; }
.ac-tag { background: #f8d7cf; color: #872d32; }
.ac-pulse {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 0 0 rgba(255, 77, 77, .7);
  animation: ac-pulse 1.4s ease-out infinite;
}
@keyframes ac-pulse {
  70% { box-shadow: 0 0 0 12px rgba(255, 77, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}
.stage[data-scene="alert"] .alert-card { opacity: 1; transform: none; }

/* 全屏飘红：抄 screen-alert 的 inset 红边脉冲，节奏一模一样 */
.redline {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 60px 18px rgba(255, 30, 30, 1);
}
.stage[data-scene="alert"] .redline { animation: pulse-glow 3s ease-in-out infinite; }
@keyframes pulse-glow {
  0%   { opacity: 0; }
  8%   { opacity: .70; }
  25%  { opacity: .25; }
  33%  { opacity: .70; }
  50%  { opacity: .25; }
  58%  { opacity: .70; }
  75%  { opacity: .25; }
  83%  { opacity: .70; }
  92%  { opacity: .15; }
  100% { opacity: 0; }
}
/* 飘红时整块壁纸也压暗一点，红边才显得是"打光"而不是贴纸 */
.stage[data-scene="alert"] .desk { filter: saturate(1.15); }
.stage[data-scene="alert"] .pet { animation: pet-shake .42s ease-in-out 2; }
@keyframes pet-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px) rotate(-1.5deg); }
  75% { transform: translateX(3px) rotate(1.5deg); }
}

/* 音效场景：原地蹦跶 + 三圈扩散 */
.pet-sfx { position: absolute; inset: 0; opacity: 0; }
.pet-sfx i {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 104px;
  height: 104px;
  margin: -52px 0 0 -52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .75);
}
.stage[data-scene="sound"] .pet-sfx { opacity: 1; }
.stage[data-scene="sound"] .pet-sfx i { animation: sfx-ring 1.8s ease-out infinite; }
.stage[data-scene="sound"] .pet-sfx i:nth-child(2) { animation-delay: .6s; }
.stage[data-scene="sound"] .pet-sfx i:nth-child(3) { animation-delay: 1.2s; }
@keyframes sfx-ring {
  0% { transform: scale(.3); opacity: .85; }
  100% { transform: scale(1.55); opacity: 0; }
}
.pet-hop { transform-origin: 60px 116px; }
.stage[data-scene="sound"] .pet-hop { animation: pet-hop 1.1s ease-in-out infinite; }
@keyframes pet-hop {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  35% { transform: translateY(-14px) rotate(-3deg); }
  65% { transform: translateY(-6px) rotate(2deg); }
}

.stage-caption {
  margin: 0;
  padding: 17px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg-muted);
  font-size: 13.5px;
  text-align: center;
  min-height: 58px;
}
.scene-tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.scene-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  border-radius: 999px;
  padding: 10px 20px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.scene-tab:hover { border-color: var(--accent); color: var(--fg); }
.scene-tab.is-active { border-color: var(--action); color: #fff; background: var(--action); }

@media (max-width: 900px) {
  .hero-inner { gap: 32px; }
  .hero-tagline { font-size: 28px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .installation .section-inner { grid-template-columns: 1fr 2fr; gap: 32px; }
  .section-heading { gap: 32px; }
  .agent-grid { column-gap: 32px; }
}

@media (max-width: 640px) {
  html { scroll-padding-top: 90px; }
  .nav-inner { padding: 12px 16px; gap: 16px; flex-wrap: wrap; row-gap: 2px; }
  /* 五个菜单项在小屏挤不下，宁可换一行也不要横向溢出。 */
  .nav-links { width: 100%; justify-content: space-between; gap: 2px; }
  .nav-brand { gap: 7px; font-size: 21px; }
  .nav-brand img { width: 32px; height: 32px; }
  .nav-links { gap: 10px; }
  .nav-links a { font-size: 12px; padding: 10px 0; white-space: nowrap; }
  .hero { padding: 36px 20px 56px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero-visual { gap: 12px; }
  .hero-ghost { width: 160px; }
  .hero-hello { font-size: 13px; }
  .hero-copy { text-align: center; }
  .hero h1 { font-size: 64px; }
  .hero-tagline { font-size: 28px; margin-top: 14px; }
  .hero-desc { font-size: 15px; margin: 16px auto 0; }
  .hero-actions { align-items: center; margin-top: 24px; }
  .download-pick { width: 100%; max-width: 340px; }
  .download-main { min-width: 0; flex: 1; }
  .btn.download-main { padding: 15px 20px; }
  .download-menu { min-width: 0; width: 100%; }
  .download-option { grid-template-columns: minmax(0, 1fr) auto 18px; gap: 6px; padding: 10px; }
  .opt-label { overflow-wrap: anywhere; }
  .opt-meta { font-size: 11px; }
  .hero-meta { justify-items: center; }
  .hero-details { justify-content: center; }
  .hero-details:has(details[open]) { align-items: center; }
  .home .version-info { font-size: 12px; }
  .changelog { text-align: center; }
  .changelog pre { text-align: left; }
  .download-fineprint { max-width: 100%; }
  .download-fineprint p { overflow-wrap: anywhere; }
  .preview, .features, .agent, .agent-cta, .ai-handoff { padding: 56px 20px; }
  .features h2, .agent h2, .agent h1, .agent-cta h2 { margin-bottom: 28px; }
  .agent-cta-inner, .ai-handoff-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .agent-cta-actions .btn, .ai-handoff-actions .btn { flex: 1 1 168px; }
  .agent-cta-stats dd { font-size: 22px; }
  .section-heading { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-bottom: 28px; }
  .preview h2 br { display: none; }
  .preview-lead { font-size: 14px; }
  .installation { padding-bottom: 0; }
  .installation .section-inner { display: block; }
  .installation h2 { margin: 0 0 24px; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .feature-card { padding-top: 22px; }
  .feature-icon { margin-bottom: 14px; }
  .agent-lead { font-size: 15px; }
  .agent-tabs { gap: 6px; }
  .agent-tab { padding: 10px 12px; font-size: 13px; }
  .agent-cmd { flex-direction: column; gap: 8px; }
  .agent-cmd code { padding: 16px; font-size: 12px; }
  .agent-cmd .btn { align-self: flex-end; min-width: 88px; }
  .agent-note { margin-bottom: 32px; }
  .agent-grid { grid-template-columns: minmax(0, 1fr); margin-bottom: 28px; }
  .agent-chips { gap: 6px; }
  .agent-chips li { padding: 6px 8px; }
  .desk { height: 360px; }
  .desk-win.win-term { width: 84%; left: 12px; top: 32px; }
  .desk-code { font-size: 10px; padding: 10px 11px 12px; line-height: 1.9; }
  .win-note { display: none; }
  .menubar { gap: 9px; font-size: 11px; }
  .mb-item { display: none; }
  .mb-right { gap: 8px; }
  .mb-clock { font-size: 10px; }
  .dock { gap: 5px; padding: 7px 8px; border-radius: 13px; }
  .dock-i { width: 28px; height: 28px; border-radius: 7px; }
  .dock-i svg { width: 19px; height: 19px; }
  .dock-sep { margin: 2px 1px; }
  .pet { right: 18px; bottom: 60px; width: 100px; }
  .quiet-hint { right: 18px; bottom: 66px; font-size: 11px; }
  .bubble { right: 12px; bottom: 163px; max-width: 72%; font-size: 13px; }
  .quiet-card, .alert-card { width: 214px; right: 12px; top: 32px; padding: 12px; }
  .stage-caption { padding: 14px 16px; min-height: 76px; text-align: left; font-size: 12px; }
  .scene-tabs { gap: 8px; margin-top: 20px; }
  .scene-tab { padding: 10px 14px; font-size: 13px; }
}

/* Preserve scene states without motion; no hover effects or transitions when reduced. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .stage[data-scene="alert"] .redline { opacity: .5; }
  .dm-a { left: 8%; }
  .dm-b { left: 18%; }
  .dm-c { left: 5%; }
  .dm-d { left: 12%; }
  .dock-i:hover, .btn:active { transform: none; }
}
