/* ============================================================
   记忆球 MemoBall 主页样式
   设计 token 与球体渲染参数对齐 docs/design/memoball-v15-visual-spec.md
   ============================================================ */

:root {
  /* 页面色板（冷调近黑，非纯黑） */
  --bg: #0e1116;
  --bg-raise: #161a21;
  --bg-panel: #1b2029;
  --line: #2a303c;
  --text: #e8eaee;
  --text-sub: #9aa3b2;
  --text-faint: #6b7485;

  /* 状态色（视觉规格 §2 状态色表） */
  --c-idle: rgb(107, 120, 242);
  --c-recording: rgb(242, 87, 97);
  --c-drop: rgb(250, 158, 51);
  --c-processing: rgb(115, 102, 242);
  --c-success: rgb(71, 199, 115);
  --c-failure: rgb(184, 56, 66);

  /* 排版 */
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Noto Sans SC", sans-serif;

  /* 形状与动效 */
  --radius: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 280ms;

  /* 容器宽度：显式决策 */
  --container: 1080px;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-idle); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.35; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(30px, 4.5vw, 44px); font-weight: 700; }
h2 { font-size: clamp(24px, 3vw, 31px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  display: inline-block;
  margin-top: 4px;
  word-break: break-all;
}

.ext { font-size: 0.85em; margin-left: 2px; opacity: 0.7; }

::selection { background: rgba(107, 120, 242, 0.35); }

/* ============================================================
   玻璃球（视觉规格 §2 六层结构的 CSS 复刻）
   皮肤参数通过 body[data-skin] 全局注入（规格 §3），全站换肤
   ============================================================ */
.ball {
  /* 状态色，由 data-state 覆写 */
  --sc: var(--c-idle);

  position: relative;
  display: inline-block;
  border-radius: 50%;
  flex: none;
  /* 底色薄染：状态色提亮后铺满球体，深底下接近状态板的透亮观感 */
  background: color-mix(in srgb, color-mix(in srgb, var(--sc), #ffffff 14%) calc(var(--tint-alpha) * 165%), transparent);
}

/* 皮肤参数默认值 = Crystal Memory（规格 §3 批准值） */
body, body[data-skin="crystal"] {
  --tint-alpha: 0.14; --rim-w: 1.25; --rim-bright: 0.85; --rim-dark: 0.35;
  --hl-alpha: 0.55; --glint-alpha: 0.90; --caustic-alpha: 0.30; --shade-alpha: 0.22;
}
body[data-skin="gravitational"] {
  --tint-alpha: 0.18; --rim-w: 1.75; --rim-bright: 0.95; --rim-dark: 0.60;
  --hl-alpha: 0.45; --glint-alpha: 1.00; --caustic-alpha: 0.45; --shade-alpha: 0.38;
}
body[data-skin="liquid"] {
  --tint-alpha: 0.12; --rim-w: 1.00; --rim-bright: 0.55; --rim-dark: 0.22;
  --hl-alpha: 0.40; --glint-alpha: 0.55; --caustic-alpha: 0.18; --shade-alpha: 0.14;
}

.ball[data-state="idle"]       { --sc: var(--c-idle); }
.ball[data-state="recording"]  { --sc: var(--c-recording); }
.ball[data-state="drop"]       { --sc: var(--c-drop); }
.ball[data-state="processing"] { --sc: var(--c-processing); }
.ball[data-state="success"]    { --sc: var(--c-success); }
.ball[data-state="failure"]    { --sc: var(--c-failure); }

.ball > span { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }

/* 1. 径向 tint：中心淡、边缘浓。
   注：网页深底无桌面内容透入，tint 颜色按状态板观感提亮、强度做了放大补偿，
   相对比例保持规格不变。 */
.ball-tint {
  background: radial-gradient(circle at 38% 32%,
    color-mix(in srgb, color-mix(in srgb, var(--sc), #ffffff 10%) calc(var(--tint-alpha) * 70%), transparent) 0%,
    color-mix(in srgb, var(--sc) calc(var(--tint-alpha) * 130%), transparent) 46%,
    color-mix(in srgb, var(--sc) calc(var(--tint-alpha) * 330%), transparent) 94%);
}

/* 2. 底部内阴影 */
.ball-shade {
  background: radial-gradient(circle at 62% 72%,
    transparent 42%,
    rgba(0, 0, 0, calc(var(--shade-alpha) * 0.6)) 74%,
    rgba(0, 0, 0, var(--shade-alpha)) 100%);
}

/* 3. Fresnel 边缘：左上亮弧 + 右下暗弧 */
.ball-rim {
  box-shadow:
    inset calc(var(--rim-w) * 1.6px) calc(var(--rim-w) * 2px) calc(var(--rim-w) * 2.4px)
      rgba(255, 255, 255, calc(var(--rim-bright) * 0.55)),
    inset calc(var(--rim-w) * -1.6px) calc(var(--rim-w) * -2.2px) calc(var(--rim-w) * 3px)
      rgba(0, 0, 0, calc(var(--rim-dark) * 0.9)),
    inset 0 0 0 calc(var(--rim-w) * 0.5px) rgba(255, 255, 255, 0.10);
}

/* 4. 主高光（左上柔光，收敛覆盖范围避免洗白球体） */
.ball-highlight {
  background: radial-gradient(circle at 31% 26%,
    rgba(255, 255, 255, calc(var(--hl-alpha) * 0.62)) 0%,
    rgba(255, 255, 255, calc(var(--hl-alpha) * 0.18)) 15%,
    transparent 34%);
}

/* 5. 锐利小高光（旋转椭圆） */
.ball-glint {
  inset: 14% 58% 68% 16%;
  background: radial-gradient(ellipse at center,
    rgba(255, 255, 255, var(--glint-alpha)) 0%,
    rgba(255, 255, 255, calc(var(--glint-alpha) * 0.4)) 45%,
    transparent 72%);
  transform: rotate(-30deg);
}

/* 6. 焦散弧（底部状态色弧线） */
.ball-caustic {
  inset: 13%;
  border: 2.2px solid transparent;
  border-bottom-color: color-mix(in srgb, var(--sc) calc(var(--caustic-alpha) * 100%), transparent);
  transform: rotate(24deg);
}

/* 麦克风 / 状态符号：直径 0.72R，白色 92% */
.ball-mic {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 36%;
  height: 36%;
  fill: rgba(255, 255, 255, 0.92);
  color: rgba(255, 255, 255, 0.92);
  transition: opacity 220ms var(--ease);
}

/* 尺寸档 */
.ball-dot  { width: 14px;  height: 14px; }
.ball-sm   { width: 36px;  height: 36px; }
.ball-mini { width: 28px;  height: 28px; }
.ball-md   { width: 72px;  height: 72px; }
.ball-lg   { width: 200px; height: 200px; }
.ball-hero { width: 260px; height: 260px; }

.ball-mini .ball-mic, .ball-dot .ball-mic, .ball-sm .ball-mic { display: none; }

/* ---------- 极光画布与成功亮环（共用） ---------- */
.ball-aurora {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 220ms var(--ease);
}
[data-state="processing"] .ball-aurora.is-live { opacity: 1; }
[data-state="processing"] .ball-aurora.is-live ~ .ball-mic,
.ball-hero[data-state="processing"] .ball-mic,
.ball-lg[data-state="processing"] .ball-mic { opacity: 0; }

.ball-success-ring {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  border: 3px solid var(--c-success);
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}
.is-success .ball-success-ring { animation: success-ring 300ms var(--ease) forwards; }
@keyframes success-ring {
  0%   { opacity: 0.95; transform: scale(0.88); }
  100% { opacity: 0;    transform: scale(1.06); }
}

/* ---------- Hero 演示球 ---------- */
.demo-ball-magnet { transition: transform 240ms var(--ease); will-change: transform; }

.ball-hero {
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ball-hero:hover { transform: scale(1.03); }
.ball-hero:focus-visible { outline: 2px solid var(--c-idle); outline-offset: 6px; }
.ball-hero[data-state="recording"] {
  transform: scale(0.96);
  animation: ball-breathe 1.6s var(--ease) infinite;
}
.ball-hero[data-state="processing"] { transform: scale(0.9); }

@keyframes ball-breathe {
  0%, 100% { transform: scale(0.96); }
  50%      { transform: scale(0.92); }
}

/* ============================================================
   滚动轨道球（球贯穿全站的视觉线索）
   ============================================================ */
.orbit-rail {
  position: fixed;
  left: 28px;
  top: 0;
  bottom: 0;
  z-index: 15;
  pointer-events: none;
  display: none;
}
.orbit-track {
  position: absolute;
  left: 50%;
  top: 12vh;
  bottom: 12vh;
  width: 1px;
  background: var(--line);
}
.orbit-rail .ball {
  position: absolute;
  left: 50%;
  margin-left: -18px;
  top: 12vh;
  transition: top 120ms linear;
}
@media (min-width: 1360px) { .orbit-rail { display: block; } }

/* ============================================================
   导航（顶栏 blur 为功能性：提高长滚动页文字可读性）
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 17, 22, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.nav-brand:hover { text-decoration: none; }
.nav-name { font-weight: 600; font-size: 16px; }
.nav-name-en { color: var(--text-sub); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--text-sub); font-size: 15px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.nav-cta {
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 14px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-links a.nav-cta:hover { border-color: var(--c-idle); background: var(--bg-raise); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  background:
    linear-gradient(rgba(14, 17, 22, 0.72), rgba(14, 17, 22, 0.94) 78%),
    var(--hero-bg, none) center / cover no-repeat,
    var(--bg);
}
.hero.has-bg { --hero-bg: url("assets/hero-aurora-bg.png"); }
.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 96px 24px 120px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 64px;
  align-items: center;
}

.eyebrow {
  color: var(--c-idle);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.hero-sub { color: var(--text-sub); margin-top: 20px; max-width: 30em; }
.hero-actions { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.hero-badges { list-style: none; display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.hero-badges li {
  font-size: 12px;
  color: var(--text-sub);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  padding: 12px 24px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--c-idle); color: #f2f4ff; }
.btn-primary:hover { background: rgb(122, 134, 247); }
.btn-ghost {
  color: var(--text);
  border-color: var(--line);
  background: transparent;
  flex-direction: row;
}
.btn-ghost:hover { border-color: var(--text-sub); }
.btn-sub { font-size: 12px; font-weight: 400; opacity: 0.85; }
.btn-lg { padding: 16px 32px; }

/* Hero 演示区 */
.hero-stage { display: flex; justify-content: center; }
.demo-ball-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 32px 0 8px;
}
.demo-hint {
  color: var(--text-faint);
  font-size: 14px;
  min-height: 1.75em;
  transition: opacity var(--dur) var(--ease);
}
.demo-hint.is-dim { opacity: 0.45; }

.demo-card {
  position: absolute;
  top: calc(100% - 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 300px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  opacity: 0;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 5;
}
.demo-card.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.demo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.demo-card-title { font-weight: 600; font-size: 16px; }
.demo-card-fields { display: grid; gap: 6px; }
.demo-card-fields > div { display: flex; gap: 12px; font-size: 14px; }
.demo-card-fields dt { color: var(--text-faint); flex: none; width: 2.5em; }
.demo-card-fields dd { color: var(--text-sub); }
.demo-card-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-faint);
}

/* 徽标：溯源 */
.badge {
  display: inline-block;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 4px;
  padding: 1px 6px;
  vertical-align: baseline;
}
.badge-inferred {
  color: var(--c-drop);
  border: 1px solid color-mix(in srgb, var(--c-drop) 45%, transparent);
}
.badge-default { color: var(--text-sub); border: 1px solid var(--line); }

/* Hero 底部轨道线 */
.orbit-line {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 56px;
  background: linear-gradient(var(--line), transparent);
}

/* ============================================================
   章节通用
   ============================================================ */
.section { max-width: var(--container); margin: 0 auto; padding: 88px 24px 0; }
.section-head { margin-bottom: 40px; max-width: 40em; }
.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.section-sub { color: var(--text-sub); margin-top: 12px; }

/* 滚动 reveal：每屏至多一段 */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 两种输入 ---------- */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.input-card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.input-card-top { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.input-card p { color: var(--text-sub); }
.input-example {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  color: var(--text-faint) ;
}

/* ============================================================
   完整流程自动演示
   ============================================================ */
.flow-lab {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px;
  align-items: start;
}
.flow-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 24px;
  position: sticky;
  top: 96px;
}
.flow-caption {
  color: var(--text-sub);
  font-size: 14px;
  min-height: 1.75em;
  text-align: center;
}
.flow-caption .caret {
  display: inline-block;
  width: 1px;
  height: 1em;
  background: var(--text-sub);
  vertical-align: -0.15em;
  animation: caret-blink 0.9s step-end infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.flow-steps { list-style: none; display: grid; gap: 4px; margin-bottom: 24px; }
.flow-steps li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--text-sub);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.flow-steps li strong { display: block; color: var(--text-sub); font-size: 15px; transition: color var(--dur) var(--ease); }
.flow-steps li span:not(.flow-num) { font-size: 13px; }
.flow-num {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--text-faint);
  flex: none;
}
.flow-steps li.is-active {
  border-color: var(--line);
  background: var(--bg-panel);
  color: var(--text);
}
.flow-steps li.is-active strong { color: var(--text); }
.flow-steps li.is-done .flow-num { color: var(--c-success); }

/* 确认面板模拟 */
.flow-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.flow-panel.is-on { opacity: 1; transform: none; }
.flow-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}
.flow-panel-meta { font-size: 12px; color: var(--text-faint); font-weight: 400; }
.flow-panel-fields { display: grid; gap: 8px; }
.fp-row {
  display: flex;
  gap: 12px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.flow-panel.is-on .fp-row { opacity: 1; transform: none; }
.flow-panel.is-on .fp-row:nth-child(1) { transition-delay: 40ms; }
.flow-panel.is-on .fp-row:nth-child(2) { transition-delay: 90ms; }
.flow-panel.is-on .fp-row:nth-child(3) { transition-delay: 140ms; }
.flow-panel.is-on .fp-row:nth-child(4) { transition-delay: 190ms; }
.flow-panel.is-on .fp-row:nth-child(5) { transition-delay: 240ms; }
.fp-row dt { color: var(--text-faint); flex: none; width: 2.5em; }
.fp-row dd { color: var(--text-sub); }
.flow-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.fp-btn { font-size: 14px; font-weight: 600; border-radius: 6px; padding: 7px 16px; }
.fp-btn-ghost { color: var(--text-sub); border: 1px solid var(--line); }
.fp-btn-primary { color: #f2f4ff; background: var(--c-idle); }
.fp-btn-primary.is-pressing { animation: btn-press 600ms var(--ease); }
@keyframes btn-press {
  0% { transform: scale(1); }
  35% { transform: scale(0.92); filter: brightness(1.25); }
  100% { transform: scale(1); }
}

/* 回执 */
.flow-receipt {
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, var(--c-success) 10%, var(--bg-panel));
  border: 1px solid color-mix(in srgb, var(--c-success) 40%, transparent);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.flow-receipt.is-on { opacity: 1; transform: none; }
.receipt-check { width: 18px; height: 18px; color: var(--c-success); flex: none; }
.receipt-id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text-faint);
}
.receipt-undo {
  margin-left: auto;
  color: var(--c-idle);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--c-idle) 45%, transparent);
  border-radius: 6px;
  padding: 3px 12px;
}

/* ============================================================
   六态状态板
   ============================================================ */
.states-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.state-cell {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: default;
  transition: border-color var(--dur) var(--ease);
}
.state-cell:hover, .state-cell:focus-visible { border-color: var(--text-faint); }
.state-cell:focus-visible { outline: 2px solid var(--c-idle); outline-offset: 3px; }
.state-cell .ball { margin-bottom: 18px; transition: transform var(--dur) var(--ease); }
.state-cell h3 { margin-bottom: 6px; }
.state-cell p { color: var(--text-sub); font-size: 14px; }

/* 各状态悬停动效 */
.state-cell[data-state-demo="idle"]:hover .ball { transform: translateY(-6px); }
.state-cell[data-state-demo="recording"]:hover .ball { animation: ball-breathe 1.6s var(--ease) infinite; }
.state-cell[data-state-demo="drop"]:hover .ball { animation: ball-wobble 700ms var(--ease); }
@keyframes ball-wobble {
  0% { transform: rotate(0); }
  30% { transform: rotate(-7deg) scale(1.04); }
  65% { transform: rotate(5deg) scale(1.02); }
  100% { transform: rotate(0); }
}
.state-cell[data-state-demo="success"]:hover .ball { animation: success-ring-host 300ms var(--ease); }
.state-cell[data-state-demo="success"]:hover .ball-success-ring { animation: success-ring 300ms var(--ease) 120ms forwards; }
@keyframes success-ring-host { 40% { transform: scale(1.06); } }
.state-cell[data-state-demo="failure"]:hover .ball { animation: ball-shake 420ms var(--ease); }
@keyframes ball-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

/* ---------- 可信 ---------- */
.trust-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: start;
}
.trust-figure {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.trust-figure img {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius);
  display: block;
  margin: 0 auto;
}
.trust-figure figcaption { margin-top: 14px; font-size: 12px; color: var(--text-faint); }
.trust-points { display: grid; gap: 28px; }
.trust-point h3 { margin-bottom: 8px; }
.trust-point p { color: var(--text-sub); }

/* ============================================================
   模型自由
   ============================================================ */
.model-lab {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.model-routes { display: grid; gap: 12px; }
.model-route {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.model-route:hover { border-color: var(--text-sub); }
.model-route.is-active { border-color: var(--c-idle); background: var(--bg-panel); }
.model-route-name { font-size: 16px; font-weight: 600; }
.model-route-tag { font-size: 13px; color: var(--text-sub); }

.provider-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  border-radius: 999px;
  padding: 6px 16px;
}
.model-facts {
  list-style: none;
  display: grid;
  gap: 10px;
  color: var(--text-sub);
}
.model-facts li { padding-left: 18px; position: relative; }
.model-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-idle);
}
.model-facts strong { color: var(--text); font-weight: 600; }

/* ---------- 皮肤实验室 ---------- */
.skin-lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px;
}
.skin-stage { display: flex; justify-content: center; padding: 16px 0; }
.skin-stage .ball { transition: transform var(--dur) var(--ease); }
.skin-controls { display: grid; gap: 12px; }
.skin-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.skin-btn:hover { border-color: var(--text-sub); }
.skin-btn.is-active { border-color: var(--c-idle); background: var(--bg-panel); }
.skin-name { font-size: 16px; font-weight: 600; }
.skin-desc { font-size: 13px; color: var(--text-sub); }

/* ============================================================
   细节见功力
   ============================================================ */
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.detail-card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.detail-card h3 { margin-bottom: 8px; font-size: 17px; }
.detail-card p { color: var(--text-sub); font-size: 14px; }

/* 贴边吸附微演示 */
.edge-demo {
  position: relative;
  height: 84px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--bg-panel);
}
.edge-demo::after {
  content: "屏幕右缘";
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 11px;
  color: var(--text-faint);
}
.edge-demo-ball {
  position: absolute;
  top: 24px;
  left: 24px;
  animation: edge-park 4.5s var(--ease) infinite;
}
@keyframes edge-park {
  0%, 18%  { transform: translateX(0); }
  46%, 78% { transform: translateX(182px); }  /* 贴边，只露出约 1/3 */
  100%     { transform: translateX(0); }
}

/* 空格键微演示 */
.keycap-demo { height: 84px; display: flex; align-items: center; margin-bottom: 16px; }
.keycap {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--bg-panel);
  padding: 8px 18px;
  animation: keycap-tap 2.4s var(--ease) infinite;
}
@keyframes keycap-tap {
  0%, 70%, 100% { transform: translateY(0); border-bottom-width: 3px; }
  78%, 88% { transform: translateY(2px); border-bottom-width: 1px; }
}

/* 回执微演示 */
.receipt-demo { height: 84px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.receipt-chip {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text-sub);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 12px;
  background: var(--bg-panel);
}
.receipt-chip-undo {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-idle);
  border: 1px solid color-mix(in srgb, var(--c-idle) 45%, transparent);
  border-radius: 6px;
  padding: 5px 12px;
  animation: undo-hint 2.4s var(--ease) infinite;
}
@keyframes undo-hint {
  0%, 60%, 100% { background: transparent; }
  70%, 85% { background: color-mix(in srgb, var(--c-idle) 18%, transparent); }
}

/* ============================================================
   无障碍
   ============================================================ */
.a11y-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: start;
}
.a11y-figure {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.a11y-figure img {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius);
  display: block;
  margin: 0 auto;
}
.a11y-figure figcaption { margin-top: 14px; font-size: 12px; color: var(--text-faint); }
.a11y-points { display: grid; gap: 28px; }
.a11y-item h3 { margin-bottom: 8px; }
.a11y-item p { color: var(--text-sub); }

/* ---------- 隐私 ---------- */
.privacy-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.privacy-item { border-left: 2px solid var(--c-success); padding: 4px 0 4px 20px; }
.privacy-item h3 { margin-bottom: 8px; }
.privacy-item p { color: var(--text-sub); font-size: 15px; }

/* ---------- 下载 ---------- */
.download-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
}
.download-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  justify-content: center;
}
.download-note { font-size: 14px; color: var(--text-sub); }
.download-steps h3 { margin-bottom: 14px; }
.download-steps ol { padding-left: 1.4em; color: var(--text-sub); display: grid; gap: 8px; }
.download-warning { margin-top: 14px; font-size: 14px; color: var(--text-faint); }

.limits {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 24px;
  color: var(--text-sub);
}
.limits summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}
.limits ul { margin-top: 12px; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14px; }

/* ---------- 反馈 ---------- */
.feedback-grid { display: grid; gap: 24px; }
.feedback-channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.channel-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  color: var(--text);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.channel-card:hover { text-decoration: none; border-color: var(--c-idle); transform: translateY(-2px); }
.channel-label { font-size: 13px; color: var(--text-faint); }
.channel-value { font-size: 17px; font-weight: 600; }
.feedback-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.feedback-col h3 { margin-bottom: 10px; }
.feedback-col ul { padding-left: 1.3em; color: var(--text-sub); display: grid; gap: 6px; }
.feedback-note { margin-top: 10px; font-size: 14px; color: var(--text-faint); }

/* ============================================================
   页脚
   ============================================================ */
.footer { margin-top: 104px; border-top: 1px solid var(--line); background: var(--bg-raise); }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 56px 24px 32px; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 48px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-name { font-weight: 600; }
.footer-about p { color: var(--text-sub); font-size: 14px; max-width: 26em; }
.footer-col h4 { color: var(--text-faint); margin-bottom: 12px; }
.footer-links { list-style: none; display: grid; gap: 8px; }
.footer-links a { color: var(--text-sub); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-faint);
}

/* ============================================================
   响应式（断点基于内容，px 单位）
   ============================================================ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; padding: 64px 24px 96px; }
  .hero-stage { order: -1; }
  .trust-grid, .skin-lab, .download-panel, .a11y-grid, .flow-lab { grid-template-columns: 1fr; }
  .flow-stage { position: static; }
  .skin-lab, .download-panel, .flow-lab, .model-lab { padding: 28px; }
  .model-lab { grid-template-columns: 1fr; }
  .model-routes { grid-template-columns: 1fr 1fr; }
  .states-grid, .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .nav-links { gap: 14px; font-size: 14px; }
  .nav-links a:not(.nav-cta):nth-child(2),
  .nav-links a:not(.nav-cta):nth-child(3),
  .nav-links a:not(.nav-cta):nth-child(4) { display: none; }
  .split, .privacy-list, .feedback-channels, .feedback-guide,
  .states-grid, .details-grid { grid-template-columns: 1fr; }
  .ball-hero { width: 220px; height: 220px; }
  .demo-card { width: min(300px, 86vw); }
  .section { padding-top: 64px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Reduced Motion：与产品自身的无障碍设计对齐 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ball-hero[data-state="recording"],
  .edge-demo-ball, .keycap, .receipt-chip-undo,
  .flow-caption .caret { animation: none; }
  .state-cell:hover .ball { animation: none; }
  .orbit-rail { display: none; }
  .demo-ball-magnet { transition: none; }
  .ball-hero, .btn, .channel-card, .skin-btn, .model-route, .demo-card { transition: none; }
}
