/* ================================================================
   CoCode 首页 —— 以“向第一次接触 Agent 的人讲清楚”为目标的叙事式版面
   依赖 styles.css 中的设计令牌；只作用于首页新增的类名。
   ================================================================ */

:root {
  --sage: #e3e8d8;
  --sand: #ebdbbc;
  --h-section-y: clamp(88px, 11vw, 152px);
  --h-ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sage: #3a4232;
    --sand: #4a3f2c;
  }
}

/* ---------- 通用版式 ---------- */
.h-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.h-narrow { max-width: 860px; }
.h-section { padding: var(--h-section-y) 0; position: relative; }
.h-section-alt { background: var(--bg-alt); }

.h-head { max-width: 900px; margin: 0 auto clamp(48px, 6vw, 80px); text-align: center; }
.h-head-left { text-align: left; margin-left: 0; }
.h-title {
  font-family: var(--serif); font-weight: 400; color: var(--text-strong);
  font-size: clamp(32px, 4.6vw, 60px); line-height: 1.2; letter-spacing: -0.02em;
}
.h-lead {
  max-width: 660px; margin: 22px auto 0;
  font-size: clamp(17px, 1.5vw, 19px); line-height: 1.8; color: var(--text-2);
}
.h-head-left .h-lead { margin-left: 0; }
.h-subtitle {
  font-family: var(--serif); font-weight: 400; color: var(--text-strong);
  font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; letter-spacing: -0.01em;
}
/* 关键词底部的陶土色“马克笔”涂抹 */
.h-mark { position: relative; z-index: 0; white-space: nowrap; }
.h-mark::before {
  content: ""; position: absolute; z-index: -1; left: -.08em; right: -.08em; bottom: .06em; height: .38em;
  background: var(--accent-soft); border-radius: .2em .5em .3em .4em;
  transform: scaleX(0); transform-origin: left; transition: transform .9s .3s var(--h-ease);
}
.in .h-mark::before, .h-mark.in::before { transform: scaleX(1); }

/* ---------- 导航进度条 ---------- */
.nav-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.nav-progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.nav-links { gap: 24px; }

/* ================================================================
   首屏
   ================================================================ */
.h-hero {
  position: relative; overflow: hidden; text-align: center;
  min-height: calc(100svh - var(--nav-h)); display: flex; align-items: center;
  padding: clamp(56px, 8vh, 96px) 0 clamp(88px, 12vh, 120px);
}
.h-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px;
  padding: 6px 14px; border-radius: 980px; font-size: 14px; color: var(--text-2);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.h-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s var(--h-ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.h-hero-title {
  font-family: var(--serif); font-weight: 400; color: var(--text-strong);
  font-size: clamp(40px, 7vw, 92px); line-height: 1.14; letter-spacing: -0.025em;
}
.h-hero-lead {
  max-width: 640px; margin: 28px auto 0;
  font-size: clamp(17px, 1.6vw, 20px); line-height: 1.8; color: var(--text-2);
}
.h-hero > .h-wrap > * { animation: heroIn .9s var(--h-ease) both; }
.h-hero > .h-wrap > :nth-child(2) { animation-delay: .08s; }
.h-hero > .h-wrap > :nth-child(3) { animation-delay: .16s; }
.h-hero > .h-wrap > :nth-child(4) { animation-delay: .26s; }
.h-hero > .h-wrap > :nth-child(5) { animation-delay: .34s; }
.h-hero > .h-wrap > :nth-child(6) { animation-delay: .4s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 手绘装饰线 */
.h-hero-doodle { position: absolute; width: clamp(110px, 13vw, 180px); height: auto; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.h-hero-doodle path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.2s .6s var(--h-ease) forwards; }
.h-hero-doodle-l { left: max(2vw, 12px); top: 18%; }
.h-hero-doodle-r { right: max(3vw, 12px); bottom: 16%; stroke: var(--text-3); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* 命令输入框演示 */
.h-command { width: min(660px, 100%); margin: 40px auto 0; text-align: left; }
.h-command-bar {
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px;
  border-radius: 20px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 24px 60px -30px rgba(20, 20, 19, .35);
}
.h-command-label { flex: none; font-size: 12px; font-weight: 500; color: var(--accent-text); padding: 4px 9px; border-radius: 980px; background: var(--accent-soft); }
.h-command-text { flex: 1; min-width: 0; font-size: clamp(16px, 1.6vw, 18px); color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -0.18em; background: var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.h-command-send { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--text-strong); color: var(--bg); transition: transform .2s; }
.h-command-send svg { width: 16px; height: 16px; }
.h-command.sending .h-command-send { transform: scale(.88); }
.h-command-result {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 0 18px; min-height: 24px;
  font-size: 14.5px; color: var(--success); opacity: 0; transform: translateY(-4px);
  transition: opacity .35s, transform .35s var(--h-ease);
}
.h-command-result svg { width: 18px; height: 18px; flex: none; }
.h-command-result.show { opacity: 1; transform: none; }
.h-command-result.working { color: var(--text-3); }

.h-hero .dl-primary { margin-top: 36px; }
.h-hero-links { margin-top: 18px; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; color: var(--text-3); }

.h-scroll-cue { position: absolute; left: 50%; bottom: 28px; width: 24px; height: 38px; margin-left: -12px; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.h-scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--text-3); animation: cue 2s var(--h-ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(12px); } }
@media (max-height: 700px), (max-width: 640px) { .h-scroll-cue { display: none; } }

/* ================================================================
   01 · 赛跑对比
   ================================================================ */
.race { padding: clamp(20px, 3vw, 36px); border-radius: var(--radius-xl); background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--line); }
.race-task { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 22px; font-size: 17px; font-weight: 500; color: var(--text-strong); }
.race-task-label { font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--accent-text); }
.race-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lane { padding: 24px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 14px; }
.lane-agent { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.lane-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.lane-head .tag { white-space: nowrap; }
.lane-clock { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 34px); color: var(--text-strong); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.lane-msg { padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: var(--bg-alt); font-size: 15px; line-height: 1.7; color: var(--text-2); }
.lane-msg-user { border-radius: 14px 14px 4px 14px; background: var(--accent-soft); color: var(--text); }
.lane-label { font-size: 14px; color: var(--text-3); }
.lane-files { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.lane-files i { aspect-ratio: 1; border-radius: 5px; background: var(--fill); transition: background-color .25s, transform .25s var(--h-ease); }
.lane-files i.on { background: color-mix(in srgb, var(--text-3) 70%, transparent); transform: scale(.86); }
.lane-status { margin-top: auto; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.lane-status b { color: var(--text-strong); font-weight: 600; }
.lane-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lane-plan li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-3); transition: color .3s; }
.lane-plan li::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: background-color .3s, box-shadow .3s;
}
.lane-plan li.doing { color: var(--text); }
.lane-plan li.doing::before { box-shadow: inset 0 0 0 1.5px var(--accent); border-right: 0; animation: spin 1s linear infinite; background: conic-gradient(var(--accent) 0 25%, transparent 0); -webkit-mask: radial-gradient(circle, transparent 6px, #000 6.5px); mask: radial-gradient(circle, transparent 6px, #000 6.5px); }
.lane-plan li.done { color: var(--text); }
.lane-plan li.done::before {
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
  box-shadow: none;
}
.lane-agent .lane-status.finished { color: var(--success); font-weight: 500; }
.race-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; font-size: 13px; color: var(--text-3); }
.race-ff { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 980px; font-size: 12px; font-family: var(--font); background: var(--fill); color: var(--text-2); vertical-align: middle; }
@media (max-width: 760px) { .race-lanes { grid-template-columns: 1fr; } }

/* ================================================================
   01 · 三样本事（滚动叙事）
   ================================================================ */
.story { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); margin-top: clamp(80px, 10vw, 140px); }
.story-visual { position: sticky; top: calc(var(--nav-h) + 8vh); height: min(72vh, 560px); align-self: start; }
.story-art {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; transform: scale(.96); transition: opacity .6s var(--h-ease), transform .8s var(--h-ease);
}
.story-art.is-active { opacity: 1; transform: none; }
.story-art svg { width: min(100%, 440px); height: auto; overflow: visible; }
.story-art .ink { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--h-ease); }
.story-art .ink.thin { stroke-width: 2; }
.story-art .ink.dash { stroke-dasharray: .012 .02; stroke-dashoffset: 0; opacity: 0; transition: opacity .8s .4s; stroke: var(--text-3); }
.story-art.is-active .ink { stroke-dashoffset: 0; }
.story-art.is-active .ink.dash { opacity: 1; }
.story-art .fill-clay { fill: var(--accent); }
.story-art .fill-paper { fill: var(--surface); }
.story-art .fill-sage { fill: var(--sage); }
.story-art .fill-sand { fill: var(--sand); }
.story-art [class*="fill-"] { transition: opacity .6s .5s; }
.story-art:not(.is-active) [class*="fill-"] { opacity: 0; }
.story-art text { font-family: var(--serif); font-size: 16px; fill: var(--ink); }
.loop-orbit { transform-origin: 160px 160px; animation: orbit 6s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }

.story-steps { display: grid; }
.story-step { min-height: min(72vh, 560px); display: flex; flex-direction: column; justify-content: center; opacity: .42; transition: opacity .5s var(--h-ease); }
.story-step.is-active { opacity: 1; }
.story-num { font-family: var(--serif); font-size: 18px; color: var(--accent-text); margin-bottom: 14px; }
.story-step h3 { font-family: var(--serif); font-weight: 400; color: var(--text-strong); font-size: clamp(28px, 3.2vw, 42px); line-height: 1.25; letter-spacing: -0.015em; }
.story-step p { margin-top: 18px; max-width: 480px; font-size: 18px; line-height: 1.85; color: var(--text-2); }

.formula { margin: clamp(56px, 8vw, 100px) auto 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 14px; font-size: 16px; color: var(--text-2); }
.formula span { padding: 8px 16px; border-radius: 980px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.formula i { font-style: normal; font-family: var(--serif); font-size: 22px; color: var(--text-3); }
.formula b { font-family: var(--serif); font-weight: 400; font-size: 28px; color: var(--accent-text); }

@media (max-width: 860px) {
  .story { grid-template-columns: 1fr; gap: 0; }
  .story-visual {
    top: var(--nav-h); z-index: 2; height: 240px; margin: 0 calc(var(--gutter) * -1);
    background: linear-gradient(var(--bg) 82%, transparent);
  }
  .story-art svg { width: auto; height: 210px; }
  .story-step { min-height: 64vh; justify-content: flex-start; padding-top: 24px; }
  .story-step p { font-size: 17px; }
}

/* ================================================================
   宣言（随滚动逐字点亮）
   ================================================================ */
.h-manifesto { padding: clamp(96px, 14vw, 200px) 0; }
.h-manifesto .kicker { margin-bottom: 28px; }
.manifesto {
  font-family: var(--serif); font-weight: 400; color: var(--text-strong);
  font-size: clamp(24px, 3.3vw, 42px); line-height: 1.65; letter-spacing: -0.005em;
}
.manifesto.is-split { color: var(--text-3); }
.manifesto .w { transition: color .4s; }
.manifesto .w.lit { color: var(--text-strong); }
.manifesto .w.em.lit { color: var(--accent-text); }

/* ================================================================
   02 · 三个关键词
   ================================================================ */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pillar {
  padding: clamp(26px, 3vw, 38px); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 14px;
}
.pillar .pillar-key { font-family: var(--serif); font-size: clamp(40px, 4.4vw, 60px); line-height: 1; color: var(--accent-text); letter-spacing: .02em; }
.pillar h3 { font-size: 21px; font-weight: 600; color: var(--text-strong); margin-top: 6px; }
.pillar p { font-size: 16px; line-height: 1.8; color: var(--text-2); }
.pillar-formats { list-style: none; margin: auto 0 0; padding: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pillar-formats li { padding: 4px 10px; border-radius: 8px; font-size: 13px; background: var(--bg-alt); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.pillar-quote { margin-top: auto; padding: 14px 16px; border-radius: 16px 16px 16px 4px; background: var(--accent-soft); font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--text-strong); }
.pillar-steps { margin-top: auto; display: flex; align-items: center; gap: 5px; padding-top: 8px; }
.pillar-steps i { flex: 1; height: 8px; border-radius: 4px; background: var(--fill); }
.pillar-steps b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--fill); color: var(--text-3); transition: background-color .4s, color .4s; }
.pillar.in .pillar-steps i { animation: stepFill .4s var(--h-ease) forwards; }
.pillar.in .pillar-steps b { background: var(--success); color: #fff; transition-delay: 2.3s; }
.pillar-steps i:nth-child(1) { animation-delay: .4s !important; } .pillar-steps i:nth-child(2) { animation-delay: .58s !important; }
.pillar-steps i:nth-child(3) { animation-delay: .76s !important; } .pillar-steps i:nth-child(4) { animation-delay: .94s !important; }
.pillar-steps i:nth-child(5) { animation-delay: 1.12s !important; } .pillar-steps i:nth-child(6) { animation-delay: 1.3s !important; }
.pillar-steps i:nth-child(7) { animation-delay: 1.48s !important; } .pillar-steps i:nth-child(8) { animation-delay: 1.66s !important; }
.pillar-steps i:nth-child(9) { animation-delay: 1.84s !important; } .pillar-steps i:nth-child(10) { animation-delay: 2.02s !important; }
.pillar-steps i:nth-child(11) { animation-delay: 2.2s !important; }
@keyframes stepFill { to { background: var(--accent); } }
.pillars .pillar:nth-child(2) { transition-delay: .08s; }
.pillars .pillar:nth-child(3) { transition-delay: .16s; }
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }

/* ================================================================
   02 · 演示播放器
   ================================================================ */
.demo { margin-top: clamp(72px, 9vw, 120px); }
.demo-intro { text-align: center; margin-bottom: 28px; }
.demo-intro p { margin-top: 10px; color: var(--text-2); font-size: 17px; }
.demo-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.demo-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 980px; cursor: pointer;
  background: var(--surface); color: var(--text-2); font-size: 15px; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s, color .2s, box-shadow .2s;
}
.demo-tab svg { width: 17px; height: 17px; }
.demo-tab:hover { color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--line-strong); }
.demo-tab[aria-selected="true"] { background: var(--text-strong); color: var(--bg); box-shadow: none; }

.demo-window { border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong), 0 40px 90px -40px rgba(20, 20, 19, .35); }
.demo-window .window-title { transform: translateX(-30px); }
.demo-body { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; min-height: 440px; }
.demo-chat { padding: 26px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; background: var(--surface-2); }
.demo-prompt { align-self: flex-end; max-width: 100%; padding: 12px 16px; border-radius: 18px 18px 4px 18px; background: var(--fill); font-size: 15px; line-height: 1.7; color: var(--text-strong); min-height: 48px; }
.demo-prompt:empty { visibility: hidden; }
.demo-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.demo-plan li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.55; color: var(--text-3); opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s var(--h-ease), color .3s; }
.demo-plan li.show { opacity: 1; transform: none; }
.demo-plan li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.demo-plan li.doing { color: var(--text); }
.demo-plan li.doing::before { background: conic-gradient(var(--accent) 0 25%, transparent 0); box-shadow: inset 0 0 0 1.5px var(--accent); animation: spin 1s linear infinite; }
.demo-plan li.done { color: var(--text); }
.demo-plan li.done::before {
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 10px no-repeat;
  box-shadow: none;
}
.demo-done { margin-top: auto; padding: 12px 14px; border-radius: 12px; background: var(--success-soft); color: var(--success); font-size: 14.5px; line-height: 1.6; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s var(--h-ease); }
.demo-done.show { opacity: 1; transform: none; }
.demo-stage { position: relative; overflow: hidden; background: var(--bg); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 20px 20px; }
.demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.demo-compare { font-size: 14.5px; color: var(--text-2); }
.demo-compare b { font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--text-strong); margin: 0 2px; }
.demo-compare .arrow { margin: 0 8px; color: var(--accent-text); }
.demo-compare small { margin-left: 10px; font-size: 12px; color: var(--text-3); }
@media (max-width: 860px) {
  .demo-body { grid-template-columns: 1fr; }
  .demo-chat { border-right: 0; border-bottom: 1px solid var(--line); }
  .demo-body { min-height: 0; }
  .demo-chat { padding: 20px 18px; }
  .demo-stage { min-height: 340px; }
  .demo-window .window-title { transform: none; }
  .demo-tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1) 18px; padding: 2px var(--gutter); scrollbar-width: none; }
  .demo-tabs::-webkit-scrollbar { display: none; }
  .demo-tab { flex: none; }
}

/* —— 演示舞台里的元素 —— */
.st-label { position: absolute; font-size: 12px; color: var(--text-3); }
.st-photo {
  position: absolute; width: 58px; height: 46px; border-radius: 7px; background: var(--c, var(--sand));
  box-shadow: 0 0 0 3px var(--surface), 0 6px 14px -6px rgba(20, 20, 19, .35);
  transition: transform .9s var(--h-ease), opacity .5s;
}
.st-photo::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 7px; height: 14px; background: color-mix(in srgb, var(--ink) 22%, transparent); clip-path: polygon(0 100%, 30% 25%, 50% 65%, 72% 10%, 100% 100%); }
.st-folder {
  position: absolute; width: 104px; height: 80px; border-radius: 6px 12px 12px 12px; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line-strong); display: grid; place-items: center; padding-top: 12px;
  font-size: 13px; color: var(--text-strong); opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .6s var(--h-ease), box-shadow .3s;
}
.st-folder::before { content: ""; position: absolute; left: 0; top: -8px; width: 42px; height: 12px; border-radius: 6px 6px 0 0; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); clip-path: inset(0 0 4px 0); }
.st-folder.show { opacity: 1; transform: none; }
.st-folder.hit { box-shadow: inset 0 0 0 2px var(--accent); }
.st-folder em { font-style: normal; font-size: 11px; color: var(--text-3); display: block; text-align: center; }

.st-sheet { position: absolute; width: 62px; height: 74px; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong), 0 6px 14px -8px rgba(20, 20, 19, .3); transition: transform .9s var(--h-ease), opacity .5s; overflow: hidden; }
.st-sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: var(--sage); }
.st-sheet::after { content: ""; position: absolute; inset: 22px 8px 8px; background: repeating-linear-gradient(var(--fill-strong) 0 3px, transparent 3px 9px); }
.st-table { position: absolute; left: 50%; top: 50%; width: min(78%, 420px); transform: translate(-50%, -46%); border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); padding: 14px; opacity: 0; transition: opacity .5s, transform .6s var(--h-ease); font-size: 12.5px; }
.st-table.show { opacity: 1; transform: translate(-50%, -50%); }
.st-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--text-2); transition: background-color .3s, opacity .4s, max-height .4s, padding .4s; max-height: 40px; overflow: hidden; font-variant-numeric: tabular-nums; }
.st-row.head { color: var(--text-strong); font-weight: 600; background: var(--sage); }
.st-row.dup { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; }
.st-row.gone { opacity: 0; max-height: 0; padding-block: 0; }
.st-bars { display: flex; align-items: flex-end; gap: 10px; height: 70px; margin-top: 12px; padding: 0 8px; }
.st-bars i { flex: 1; height: 0; border-radius: 4px 4px 0 0; background: var(--accent); transition: height .8s var(--h-ease); }

.st-doc { position: absolute; width: 54px; height: 68px; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: transform .8s var(--h-ease), opacity .5s; }
.st-doc::after { content: ""; position: absolute; inset: 12px 9px; background: repeating-linear-gradient(var(--fill-strong) 0 2.5px, transparent 2.5px 8px); }
.st-page { position: absolute; right: 8%; top: 50%; width: min(56%, 320px); transform: translateY(-50%); padding: 22px 22px 18px; border-radius: 10px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong), 0 20px 40px -24px rgba(20, 20, 19, .35); opacity: 0; transition: opacity .5s; }
.st-page.show { opacity: 1; }
.st-page h6 { margin: 0 0 12px; font-family: var(--serif); font-weight: 500; font-size: 15px; color: var(--text-strong); }
.st-line { height: 7px; border-radius: 4px; background: var(--fill-strong); margin: 0 0 9px; width: 0; transition: width .5s var(--h-ease); }
.st-line.sub { background: var(--accent); opacity: .7; height: 8px; margin-top: 14px; }
.st-todo { margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: var(--warning-soft); color: var(--warning); font-size: 12px; opacity: 0; transition: opacity .4s; }
.st-todo.show { opacity: 1; }

.st-procs { position: absolute; inset: 24px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.st-meter { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-strong); font-weight: 500; }
.st-meter .bar { flex: 1; height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.st-meter .bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--danger); transition: width 1s var(--h-ease), background-color .6s; }
.st-meter.ok .bar i { background: var(--success); }
.st-meter b { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.st-proc { display: grid; grid-template-columns: 1fr 90px 70px; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--surface); color: var(--text-2); transition: background-color .3s, opacity .5s, transform .5s var(--h-ease), max-height .5s, padding .5s; max-height: 44px; overflow: hidden; }
.st-proc .cpu { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.st-proc .cpu i { display: block; height: 100%; background: var(--text-3); }
.st-proc span:last-child { font-size: 11px; text-align: right; }
.st-proc.flag { background: var(--warning-soft); color: var(--warning); }
.st-proc.flag .cpu i { background: var(--warning); }
.st-proc.scan { box-shadow: inset 0 0 0 1.5px var(--accent); }
.st-proc.closed { opacity: 0; transform: translateX(20px); max-height: 0; padding-block: 0; }
.st-ask { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text-strong); opacity: 0; transition: opacity .4s; }
.st-ask.show { opacity: 1; }
.st-ask span { flex: 1; }
.st-ask .btn { min-height: 26px; padding: 3px 12px; font-size: 12px; }
.st-ask .btn.press { transform: scale(.92); }

.st-term { position: absolute; inset: 20px; padding: 18px 20px; border-radius: 12px; background: var(--code-bg); color: var(--code-text); font-family: var(--mono); font-size: 12.5px; line-height: 1.8; overflow: hidden; letter-spacing: 0; }
.st-term div { opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.st-term div.show { opacity: 1; transform: none; }
.st-term .c { color: #8a877f; }
.st-term .r { color: #e08a76; }
.st-term .g { color: #a3b58a; }
.st-term .y { color: #d9a94e; }

/* ================================================================
   02 · 身份任务库
   ================================================================ */
.library { margin-top: clamp(88px, 10vw, 140px); }
.library-head { text-align: center; max-width: 640px; margin: 0 auto 28px; }
.library-head p { margin-top: 12px; color: var(--text-2); font-size: 16px; line-height: 1.75; }
.home .task-tabs { margin-bottom: 32px; }
.home .task-tabs .segmented { flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; background: none; overflow: visible; }
.home .task-tabs .seg-tab {
  padding: 8px 16px; border-radius: 980px; font-size: 14.5px; background: var(--surface); color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.home .task-tabs .seg-tab:hover { color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--line-strong); }
.home .task-tabs .seg-tab[aria-selected="true"] { background: var(--accent); color: #fff; box-shadow: none; }
@media (max-width: 640px) {
  .home .task-tabs .segmented { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); }
}

.home .tasks { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.home .task {
  padding: 24px; border-radius: var(--radius-lg); background: var(--surface); gap: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.home .task:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line-strong), 0 18px 36px -22px rgba(20, 20, 19, .3); }
.task-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.task-ico svg { width: 17px; height: 17px; }
.task-cat { font-size: 13px; color: var(--text-3); }
.home .task h3 { font-size: 19px; font-weight: 600; color: var(--text-strong); }
.home .prompt { padding: 0; background: none; box-shadow: none; border-radius: 0; font-family: var(--serif); font-size: 16px; line-height: 1.8; color: var(--text); }
.home .task .btn { margin-top: 4px; padding-inline: 0; color: var(--accent-text); }
.home .task .btn:hover { background: none; text-decoration: underline !important; }
.home .tasks .task:nth-child(3n+2) { transition-delay: .06s; }
.home .tasks .task:nth-child(3n+3) { transition-delay: .12s; }
@media (max-width: 1000px) { .home .tasks { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .home .tasks { grid-template-columns: 1fr; } }

/* ================================================================
   03 · 工作方式
   ================================================================ */
.how { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: how; }
.how-steps button {
  counter-increment: how; position: relative; display: grid; gap: 4px; width: 100%; text-align: left; cursor: pointer;
  padding: 16px 18px 16px 58px; border: 0; border-radius: 16px; background: transparent; color: var(--text-2);
  transition: background-color .25s, box-shadow .25s;
}
.how-steps button::before {
  content: counter(how); position: absolute; left: 16px; top: 15px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif); font-size: 15px; color: var(--accent-text);
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: background-color .25s, color .25s;
}
.how-steps b { font-size: 17px; font-weight: 600; color: var(--text-strong); }
.how-steps span { font-size: 14.5px; line-height: 1.65; }
.how-steps button:hover { background: var(--fill); }
.how-steps button[aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong), 0 12px 30px -20px rgba(20, 20, 19, .3); }
.how-steps button[aria-pressed="true"]::before { background: var(--accent); color: #fff; box-shadow: none; }

.how-window { border-radius: 14px; }
.how-window .window-body { min-height: 500px; }
.how-window [data-how-part] { transition: opacity .35s, box-shadow .35s, transform .35s var(--h-ease); }
.how[data-focus] .how-window [data-how-part] { opacity: .28; }
.how[data-focus="1"] .how-window [data-how-part="1"],
.how[data-focus="2"] .how-window [data-how-part="2"],
.how[data-focus="3"] .how-window [data-how-part="3"],
.how[data-focus="4"] .how-window [data-how-part="4"] { opacity: 1; box-shadow: 0 0 0 2px var(--accent), 0 12px 28px -16px rgba(20, 20, 19, .3); border-radius: 12px; }
.how[data-focus="2"] .how-window .step[data-how-part="2"] { padding: 6px 8px; margin: -6px -8px; }
.how[data-focus="3"] .how-window .step[data-how-part="3"] { padding: 6px 8px; margin: -6px -8px; }
.how-window .seq > * { opacity: 0; transform: translateY(6px); }
.how.play .how-window .seq > * { animation: seqIn .6s var(--h-ease) forwards; }
.how.play .how-window .seq > *:nth-child(2) { animation-delay: .5s; }
.how.play .how-window .seq > *:nth-child(3) { animation-delay: 1s; }
.how.play .how-window .seq > *:nth-child(4) { animation-delay: 1.5s; }
.how.play .how-window .seq > *:nth-child(5) { animation-delay: 2s; }
.how.play .how-window .seq > *:nth-child(6) { animation-delay: 2.5s; }
@media (max-width: 960px) {
  .how { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) { .how-steps { grid-template-columns: 1fr; } }

/* ================================================================
   04 · 安全护栏
   ================================================================ */
.guard { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.guard-art { display: grid; place-items: center; }
.guard-ring {
  position: relative; display: grid; place-items: center; border-radius: 36px; padding: clamp(30px, 4vw, 44px);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  opacity: 0; transform: scale(.94); transition: opacity .7s var(--h-ease), transform .9s var(--h-ease);
}
.guard-ring > span {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 3px 12px; border-radius: 980px; font-size: 13px; font-weight: 500; background: var(--bg-alt); color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.guard-ring-3 { width: min(100%, 440px); aspect-ratio: 1.08; background: var(--surface); border-radius: 44px; box-shadow: inset 0 0 0 1.5px var(--line-strong), 0 30px 60px -40px rgba(20, 20, 19, .3); }
.guard-ring-2 { width: 100%; height: 100%; background: var(--sage); border-radius: 32px; box-shadow: none; transition-delay: .2s; }
.guard-ring-1 { width: 100%; height: 100%; background: var(--accent-soft); border-radius: 24px; box-shadow: none; transition-delay: .4s; }
.guard-ring-2 > span { background: var(--surface); }
.guard-ring-1 > span { background: var(--sage); color: var(--text-strong); }
.guard-core { width: 64px; height: 64px; color: var(--text-strong); opacity: 0; transform: scale(.6); transition: opacity .5s .7s, transform .7s .7s var(--h-ease); }
.guard-core svg { width: 100%; height: 100%; }
.guard.in .guard-ring, .guard.in .guard-core { opacity: 1; transform: none; }
.guard.in .guard-ring > span { transform: translateX(-50%); }
.guard-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.guard-list li { display: flex; gap: 18px; }
.guard-no { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 18px; color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface); }
.guard-list h3 { font-size: 20px; font-weight: 600; color: var(--text-strong); margin-bottom: 6px; }
.guard-list p { font-size: 16px; line-height: 1.8; color: var(--text-2); }

.safety-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: clamp(48px, 6vw, 80px); }
.safety-mini article { display: flex; gap: 14px; padding: 22px; border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.safety-mini .safety-ico { flex: none; width: 40px; height: 40px; margin: 0; border-radius: 50%; }
.safety-mini h3 { font-size: 16.5px; font-weight: 600; color: var(--text-strong); margin-bottom: 4px; }
.safety-mini p { font-size: 15px; line-height: 1.7; color: var(--text-2); }
.home .note-box { margin-top: 16px; }
@media (max-width: 900px) {
  .guard { grid-template-columns: 1fr; }
  .safety-mini { grid-template-columns: 1fr; }
}

/* ================================================================
   05 · 新手时间线
   ================================================================ */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 22px; right: 22px; top: 22px; height: 1.5px; background: var(--line-strong); transform: scaleX(0); transform-origin: left; transition: transform 1.4s .2s var(--h-ease); }
.timeline.in::before { transform: scaleX(1); }
.timeline li { position: relative; }
.timeline-no { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; margin-bottom: 20px; font-family: var(--serif); font-size: 19px; background: var(--bg); color: var(--accent-text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.timeline h3 { font-size: 19px; font-weight: 600; color: var(--text-strong); margin-bottom: 8px; }
.timeline p { font-size: 15.5px; line-height: 1.8; color: var(--text-2); }
.home .release { margin-top: clamp(48px, 6vw, 72px); }
@media (max-width: 900px) {
  .timeline { grid-template-columns: 1fr; gap: 28px; }
  .timeline::before { left: 21px; right: auto; top: 22px; bottom: 22px; width: 1.5px; height: auto; transform: scaleY(0); transform-origin: top; }
  .timeline.in::before { transform: scaleY(1); }
  .timeline li { padding-left: 64px; }
  .timeline-no { position: absolute; left: 0; top: -6px; margin: 0; }
}

/* ================================================================
   06 · 常见问题 & 下载
   ================================================================ */
.home .faq { max-width: none; }
.home .faq summary { font-size: clamp(17px, 1.6vw, 19px); }
.h-final { text-align: center; }
.h-final-mark { width: 60px; height: 60px; margin: 0 auto 26px; color: var(--text-strong); }
.h-final .dl-primary { margin-top: 0; }
.h-final .platforms-compact { margin-top: 48px; }
.h-final .platforms-compact .platform { background: var(--bg-alt); }
.h-final .dl-account { margin-top: 28px; }

/* ================================================================
   移动端与减弱动效
   ================================================================ */
@media (max-width: 640px) {
  .h-hero { min-height: 0; }
  .h-hero-title { font-size: clamp(32px, 9.4vw, 40px); }
  .h-hero-title .scribble { white-space: nowrap; }
  .lane-clock { font-size: 24px; }
  .guard-ring { padding: 36px 18px 18px; }
  .h-command-bar { padding: 8px 8px 8px 12px; gap: 10px; }
  .h-command-label { display: none; }
  .h-hero-doodle { display: none; }
  .race { padding: 16px; border-radius: var(--radius-lg); }
  .lane { padding: 18px; }
  .how-window .window-body { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .h-hero > .h-wrap > *, .h-dot, .h-caret, .loop-orbit, .h-scroll-cue span { animation: none !important; }
  .h-hero-doodle path { stroke-dashoffset: 0; animation: none; }
  .story-art .ink { stroke-dashoffset: 0; transition: none; }
  .manifesto .w { color: var(--text-strong); }
  .how-window .seq > * { opacity: 1; transform: none; }
  .guard-ring, .guard-core { opacity: 1; transform: none; }
  .pillar .pillar-steps i { background: var(--accent); }
  .timeline::before { transform: none !important; }
  .h-mark::before { transform: scaleX(1); }
}
