/* Chora 官网。深色，紫 粉 蓝 绿四色渐变。 */
@font-face { font-family: "Inter"; src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #08080a;
  --surface: #0f0f13;
  --text: #f1f0f5;
  --sub: #a3a1ae;
  --faint: #6e6c79;
  --line: #ffffff17;
  --line-strong: #ffffff36;
  --purple: #a855ff;
  --pink: #ff3db4;
  --blue: #4da3ff;
  --green: #34e0a1;
  --grad: linear-gradient(100deg, var(--purple), var(--pink) 34%, var(--blue) 68%, var(--green));
  --sans: "Inter", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, "Noto Sans SC", monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ok: #4ade80;
  --pink-wash: linear-gradient(135deg, #ff9be3 0%, #ff00af 25%, #c400ff 50%, #ff00af 75%, #ff9be3 100%);
  --shell: 1440px;
  --pad: clamp(24px, 5.4vw, 88px);
  --bar: 72px;
  --intro: 132px;
}
/* 子弹行情面板（Shadow DOM）用的自定义属性：@property 只在文档层生效 */
@property --ga { syntax: "<color>"; inherits: true; initial-value: #ff00af; }
@property --gb { syntax: "<color>"; inherits: true; initial-value: #8f01fb; }
@property --p { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; }
section[id] { scroll-margin-top: calc(var(--bar) + 20px); }
body { font: 400 16px/1.7 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: clip; }
/* Avoid a full-viewport SVG filter layer above every scrolling surface. */
::selection { background: var(--pink); color: #fff; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 5px; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 90; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; transition: top .2s; }
.skip:focus { top: 12px; }

/* 背景：WebGL 光带，失败时用 CSS 渐变 */
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0; transition: opacity 1.6s ease; pointer-events: none; }
#field.ready { opacity: 1; }
.field-fallback { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 78% 30%, #a855ff2e, transparent 70%), radial-gradient(50% 45% at 90% 75%, #ff3db424, transparent 70%), radial-gradient(45% 40% at 62% 88%, #4da3ff22, transparent 70%); }
#field.ready ~ .field-fallback { opacity: 0; transition: opacity 1.6s ease; }

.bar { position: fixed; z-index: 50; inset: 0 0 auto 0; height: var(--bar); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--pad); transition: background .4s; }
.bar.solid { background: #08080af5; border-bottom: 1px solid var(--line); }
.mark { display: inline-flex; align-items: center; gap: 12px; font-weight: 560; letter-spacing: -.02em; font-size: 19px; }
.mark i { width: 20px; height: 20px; border-radius: 50%; background: var(--grad); -webkit-mask: radial-gradient(circle, transparent 5px, #000 5.5px); mask: radial-gradient(circle, transparent 5px, #000 5.5px); }

.btn { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 26px; border-radius: 999px; font-weight: 520; letter-spacing: -.01em; color: #0a0a0c; background: var(--text); position: relative; isolation: isolate; will-change: transform; }
.btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--grad); opacity: 0; transition: opacity .45s var(--ease); z-index: -1; }
.btn:hover::before { opacity: 1; }
.btn span { display: inline-block; transition: transform .45s var(--ease); }
.btn:hover span { transform: translate(3px, -3px); }
.btn-sm { height: 40px; padding: 0 20px; font-size: 14px; }

/* 主体：左介绍 右助手面板 */
.split { position: relative; z-index: 1; max-width: var(--shell); margin: 0 auto; padding: 0 var(--pad); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); --gap: clamp(32px, 5vw, 96px); gap: var(--gap); }
.chapter { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--bar) + 40px) 0 80px; }
.chapter + .chapter { border-top: 1px solid var(--line); }
.display { width: max-content; max-width: 100%; font-weight: 480; font-size: clamp(76px, 12.5vw, 220px); line-height: .92; letter-spacing: -.03em; margin-left: -.04em; }
/* 字距收得很紧，字形会伸出 span 的盒子；背景只铺在盒子里，伸出去的部分就像被截断。
   右侧补一段内边距让渐变盖住字形，再用负外边距抵消，排版位置不变。
   标题改为淡入上浮，不再需要遮罩，所以这一行不裁切。 */
.display .ln { overflow: visible; }
.display .ln > span { padding-right: .12em; margin-right: -.12em; }
.js .display .ln > span { opacity: 0; }
.display .ln > span, .grad-text { background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: drift 9s linear infinite alternate; }
@keyframes drift { to { background-position: 100% 0; } }
.title { font-weight: 480; font-size: clamp(36px, 4.6vw, 76px); line-height: 1.12; letter-spacing: -.055em; }
/* 介绍文案：英文走 JetBrains Mono（只含拉丁字形），中文逐字回落到 Noto Sans SC */
.lead { margin-top: 36px; max-width: 460px; color: var(--sub); font-family: "JetBrains Mono", "Noto Sans SC", sans-serif; font-weight: 400; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.8; }
/* 「为您呈现」悬在 Chora 上方，绝对定位，不占标题的排版高度 */
.hero-title { position: relative; }
.present { position: absolute; left: 0; bottom: 100%; margin-bottom: .5em; font-size: clamp(18px, 1.7vw, 24px); font-weight: 500; letter-spacing: .3em; white-space: nowrap; background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: drift 9s linear infinite alternate; }
.js .present { opacity: 0; }
.ln { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.ln > span { display: inline-block; }

/* 滚动提示：向下箭头 + "下滑了解"，入场后显示，滚动时淡出 */
.scroll-hint { position: fixed; z-index: 2; left: 0; right: 0; bottom: max(36px, 9svh); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.js .scroll-hint { opacity: 0; }
.hint-arrow { width: 24px; height: 24px; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; animation: bounce 2s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
.hint-text { font-size: 14px; color: var(--faint); letter-spacing: .05em; }

.figures { margin-top: 56px; display: flex; align-items: center; gap: 28px; font-family: var(--mono); }
.fig { font-weight: 450; font-size: clamp(44px, 6vw, 96px); line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.fig.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.figures svg { width: 56px; height: 14px; fill: none; stroke: var(--faint); stroke-width: 1.5; flex: none; }

/* 助手窗口 */
.stage { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; padding: calc(var(--bar) + 12px) 0 40px; pointer-events: none; }
/* 外层负责倾斜和光边变量；辉光层放在窗口后面，因为窗口自己 overflow:hidden 会把辉光裁掉 */
/* The sticky stage retains its original grid width when the chat is resized.
   Only the visible window should intercept input; its empty margins pass through. */
.win-wrap { --mx: 50%; --my: 50%; position: relative; width: 100%; height: min(100%, 780px); will-change: transform; pointer-events: auto; }
/* 窗口还没亮相（首屏停留、勾线中）时不接收鼠标：否则看不见的窗口也会冒出悬停辉光，按钮也能点到 */
.js .win-wrap:not(.ready) { pointer-events: none; }
.win { width: 100%; height: 100%; display: flex; flex-direction: column; border-radius: 14px; background: #0b0b0ff2; position: relative; transform-style: preserve-3d; will-change: transform;
  box-shadow: 0 0 0 1px var(--line); }
/* 窗口的底板和投影单独一层：勾线时先慢慢显出来，窗口本体最后才淡入 */
.win-shade { position: absolute; inset: 0; border-radius: 14px; pointer-events: none; background: #0b0b0fd9;
  box-shadow: 0 40px 120px -30px #000, 0 24px 60px -24px #000c; transition: box-shadow .6s; }
.js .win-shade { opacity: 0; }
.win::before { content: ""; position: absolute; inset: -1px; border-radius: 15px; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg) at var(--mx) var(--my), var(--purple), var(--pink), var(--blue), var(--green), var(--purple));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .85; transition: opacity .5s, filter .5s; }
/* 入场勾线层，描完淡出并移除 */
.sketch { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 3; pointer-events: none; fill: none; stroke: url(#skGrad); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px #ff3db466); }
.sketch-m { stroke: url(#mkGrad); }
/* 边框 bloom：同一圈渐变放大模糊，垫在窗口背后，只从边缘透出来 */
.win-glow { position: absolute; inset: 0; border-radius: 14px; pointer-events: none; opacity: 0; transform: scaleY(.98); filter: blur(26px);
  background: conic-gradient(from var(--ang, 0deg) at var(--mx) var(--my), var(--purple), var(--pink), var(--blue), var(--green), var(--purple));
  transition: opacity .6s ease, transform .8s var(--spring); }
@media (hover: hover) {
  /* .lit 由 main.js 加：第 4 章行情和对话拼成一块，指到哪边两边一起亮 */
  .win-wrap.lit .win-glow, .market.lit .mk-glow { opacity: .55; transform: scaleY(1.03); }
  .win-wrap.lit .win::before, .market.lit::before { opacity: 1; filter: brightness(1.35) saturate(1.2); }
  .win-wrap.lit .win-shade { box-shadow: 0 30px 90px -50px #000, 0 16px 40px -24px #000a; }
}
.win { overflow: hidden; }
.win.busy::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; z-index: 2; background: linear-gradient(90deg, transparent, var(--pink), var(--purple), transparent); background-size: 35% 100%; background-repeat: no-repeat; animation: sweep 1.6s linear infinite; }
.win-head { flex: none; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.orb { flex: none; display: block; width: 30px; height: 30px; margin: -4px; border-radius: 50%; }
.win.fresh .orb { opacity: 0; }
.win:not(.fresh) .orb { animation: orbIn .6s var(--spring) both; }
@keyframes orbIn { from { opacity: 0; transform: scale(.4); } }
.no-orb .orb { transform: scale(.72); background: radial-gradient(circle at 34% 30%, #fff6e8, var(--green) 34%, var(--pink) 62%, var(--purple) 88%); }
.conv-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; letter-spacing: -.01em; transition: color .3s; }
.win.fresh .conv-title { font-weight: 500; color: var(--faint); }
/* 会话切换：三个点，当前会话拉长成渐变胶囊。按钮本身 20px 高，方便点中 */
.tabs { flex: none; display: flex; align-items: center; }
.tabs button { display: grid; place-items: center; height: 20px; padding: 0 4px; background: none; border: 0; cursor: pointer; }
.tabs button::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: var(--faint); transition: width .45s cubic-bezier(.2,.8,.2,1), background-color .25s; }
.tabs button:hover::before { background: var(--sub); }
.tabs button[aria-selected="true"]::before { width: 18px; background: var(--grad); background-size: 200% 100%; animation: drift 9s linear infinite alternate; }
.tabs button:focus-visible { outline: 2px solid var(--sub); outline-offset: 1px; border-radius: 6px; }
.icon-btn { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--sub); cursor: pointer; transition: background .2s, color .2s; }
.icon-btn:hover { background: #ffffff0f; color: var(--text); }
.icon-btn .ic { width: 16px; height: 16px; }
#soundBtn.muted { color: var(--faint); }
.transcript { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 20px; font: 400 13.5px/1.6 var(--sans); scrollbar-width: none; overscroll-behavior: contain; }
.transcript::-webkit-scrollbar { display: none; }

/* 用户气泡：从右下角弹入 */
.msg { align-self: flex-end; max-width: 88%; padding: 9px 13px 8px; border-radius: 14px 14px 3px 14px; background: linear-gradient(135deg, #a855ff26, #ff3db41f), #181820; border: 1px solid #ff3db42b; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.in { animation: msgIn .6s var(--spring) both; transform-origin: 100% 100%; }

/* 工具卡：竖线加节点，可展开 */
.step { position: relative; margin-left: 3px; padding: 3px 0 3px 14px; border-left: 1px solid var(--line); color: var(--sub); }
.step.in, .turn-meta.in { animation: stepIn .5s var(--ease) both; }
.step::before { content: ""; position: absolute; left: -4px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 1px solid var(--faint); transition: background .3s, border-color .3s; }
.step.ok::before { background: var(--sub); border-color: var(--sub); }
.step.err::before { background: #ff6b5e; border-color: #ff6b5e; }
.step.run::before { background: var(--pink); border-color: var(--pink); animation: nodePulse 1.2s ease-out infinite; }
.step.landed::before { animation: ripple .8s ease-out; }
.step + .step { margin-top: -9px; }
.step summary { display: flex; align-items: center; gap: 8px; min-height: 32px; min-width: 0; padding: 4px 10px 4px 8px; list-style: none; cursor: pointer; user-select: none; border: 1px solid var(--line); border-radius: 10px; background: #101014; transition: border-color .25s, background .25s; }
.step summary::-webkit-details-marker { display: none; }
.step summary::after { content: ""; flex: none; width: 5px; height: 5px; margin: 0 3px 0 4px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(-45deg); transition: transform .2s var(--ease); }
.step[open] > summary::after { transform: rotate(45deg); }
.step summary:hover { border-color: #ffffff2e; background: #14141a; }
.step[open] > summary { border-radius: 10px 10px 0 0; }
.step.run > summary { border-color: #ff3db44d; background: linear-gradient(90deg, #ff3db414, #a855ff0d), #101014; }
.t-ic { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: #1a1a22; color: var(--sub); transition: color .25s, transform .35s var(--spring); }
.t-ic svg { width: 13px; height: 13px; }
.step summary:hover .t-ic { color: var(--text); transform: scale(1.1) rotate(-6deg); }
.step.landed .t-ic { animation: icPop .6s var(--spring); }
.t-label { flex: none; font-size: 12.5px; font-weight: 500; color: var(--text); white-space: nowrap; }
.step.run .t-label, .think.live .think-title { background: linear-gradient(90deg, var(--sub) 25%, #fff 45%, var(--pink) 55%, var(--sub) 75%) 0 0 / 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.5s linear infinite; }
.ic { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.t-chips { flex: 1; min-width: 0; display: flex; gap: 5px; overflow: hidden; }
.t-chip { flex: 0 1 auto; min-width: 0; display: inline-flex; gap: 5px; align-items: baseline; padding: 0 7px; border-radius: 6px; background: #ffffff0f; font: 11px/20px var(--mono); color: #b9b7c4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-chip i { font-style: normal; color: var(--faint); }
.t-chip.more { color: var(--faint); }
.t-state { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--faint); }
.step.run .t-state { color: var(--pink); }
.step.ok .t-state { color: var(--ok); }
.t-state svg { width: 13px; height: 13px; stroke-width: 2; }
.step.landed.ok .t-state svg { stroke-dasharray: 24; animation: draw .5s .12s ease-out both; }
.t-body { padding: 8px 10px 10px; border: 1px solid #ffffff2e; border-top: 0; border-radius: 0 0 10px 10px; background: #0b0b0e; }
.t-code { margin-bottom: 6px; font: 10.5px var(--mono); color: var(--faint); }
.t-body .k { margin: 10px 0 4px; font-size: 11px; color: var(--faint); }
.t-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 12px; font: 11.5px/1.5 var(--mono); }
.t-kv dt { color: var(--faint); }
.t-kv dd { margin: 0; color: #d9d7e2; overflow-wrap: anywhere; }
.t-body pre { padding: 8px 10px; border-radius: 8px; background: #070709; font: 11px/1.55 var(--mono); color: #c6c4d0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 200px; overflow-y: auto; scrollbar-width: thin; }

/* 助手回答：markdown 正文 */
.md { font-size: 13.5px; line-height: 1.78; color: #dedce8; overflow-wrap: anywhere; }
.md p { margin: .5em 0; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md strong { color: #fff; font-weight: 640; }
.md ul { margin: .45em 0; padding-left: 1.3em; }
.md li { margin: .18em 0; }
.md li::marker { color: var(--faint); }
.md .gap { height: .5em; }
.tk { animation: tk .7s var(--ease) both; }
.caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 3px; vertical-align: -.2em; border-radius: 3px; background: var(--grad); box-shadow: 0 0 10px var(--pink); animation: caretIn .3s var(--spring), caret 1s .3s ease-in-out infinite; }
.turn-meta { display: flex; align-items: center; gap: 6px; margin-top: -6px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.turn-meta .ic { width: 13px; height: 13px; stroke-width: 2; color: var(--ok); }
.turn-meta.in .ic { stroke-dasharray: 24; animation: draw .6s .25s ease-out both; }
.turn-meta.in span { animation: turnGlow 1.6s .25s ease-out; }

/* 思考块 */
.think summary { min-height: 26px; padding: 2px 10px 2px 6px; border: 0; background: none; }
.think summary:hover { background: none; border-color: transparent; }
.think[open] > summary { border-radius: 0; }
.think .think-ic { width: 14px; height: 14px; color: var(--faint); transition: color .25s; }
.think.live .think-ic { color: #ffd54f; animation: glow 1.6s ease-in-out infinite; }
.think .think-title { font-size: 12px; color: var(--sub); transition: color .2s; }
.think summary:hover .think-title { color: var(--text); }
.think .think-body { margin: 4px 0 6px; font-size: 12px; line-height: 1.7; color: var(--sub); white-space: pre-wrap; }

/* 活动提示与输入框 */
.activity { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 20px; font-size: 12px; color: var(--sub); }
.activity[hidden] { display: none; }
.live-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px #ff3db41a; animation: pulse 2s infinite; }
.composer { flex: none; display: flex; flex-direction: column; gap: 4px; margin: 6px 16px 0; padding: 11px 8px 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: #08080b; transition: border-color .3s, box-shadow .3s; }
.composer.on { border-color: #ff3db455; box-shadow: 0 0 0 3px #ff3db412; }
.composer textarea { display: block; width: 100%; min-height: 24px; max-height: 96px; resize: none; border: 0; outline: 0; background: none; color: var(--text); font: 400 13.5px/1.6 var(--sans); overflow: hidden; cursor: default; }
.composer textarea::placeholder { color: var(--faint); }
.composer-bar { display: flex; justify-content: flex-end; }
.primary-btn { position: relative; isolation: isolate; overflow: hidden; flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--purple); color: #fff; box-shadow: 0 0 0 0 #ff3db400; transition: transform .25s var(--spring), box-shadow .3s, filter .2s; }
.primary-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pink-wash); background-size: 200% 200%; opacity: 0; transition: opacity .5s; }
.primary-btn .ic { grid-area: 1 / 1; width: 16px; height: 16px; stroke-width: 1.8; transition: transform .5s var(--spring), opacity .25s; }
.primary-btn .ic-send { margin: 3px 0 0; }
.primary-btn .ic-stop { fill: currentColor; stroke: none; opacity: 0; transform: scale(.2) rotate(-120deg); }
.primary-btn:hover { transform: translateY(-1px) scale(1.07); box-shadow: 0 6px 16px -4px #a855ffaa; filter: brightness(1.12); }
.primary-btn:active { transform: scale(.9); }
.composer.on .primary-btn:not(.stop):not(.launch) .ic-send { animation: planeIdle 2.8s ease-in-out infinite; }
.primary-btn.launch::before { opacity: 1; animation: wash .75s var(--ease) both, pinkflow 2.4s linear infinite alternate; }
.primary-btn.launch .ic-send { animation: planeAway .6s cubic-bezier(.5, 0, 1, .6) both; }
.primary-btn.stop::before { opacity: 1; animation: pinkflow 2.4s ease-in-out infinite alternate; }
.primary-btn.stop { animation: breathe 2.2s ease-in-out infinite; }
.primary-btn.stop .ic-send { opacity: 0; transform: translate(22px, -22px) scale(.4); }
.primary-btn.stop .ic-stop { opacity: 1; transform: none; }
.composer-hint { flex: none; padding: 7px 18px 12px; font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; }
.composer-hint kbd { font: 10.5px var(--mono); padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; color: var(--sub); }
.hint-in { display: inline-flex; align-items: center; gap: 6px; animation: hintIn .5s var(--ease) both; }

/* 第 4 章：灰字居中在上，左行情右对话。窗口是右侧吸顶的那一个，这一章只给它让出右半边 */
.showcase { position: relative; padding: calc(var(--bar) + var(--intro)) 0 40px; justify-content: flex-start; pointer-events: none; }
.showcase .lead { position: absolute; top: calc(var(--bar) + 20px); left: 0; right: 0; max-width: none; margin: 0; text-align: center; }
.market { --mx: 50%; --my: 50%; position: relative; width: 100%; height: min(calc(100svh - var(--bar) - var(--intro) - 40px), 780px); min-height: 360px; pointer-events: auto; }
/* 和对话窗口同一套做法：本体裁剪、辉光垫在后面、渐变光边盖在外圈 */
.mk-body { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; background: #0b0b0f; box-shadow: 0 0 0 1px var(--line), 0 40px 120px -30px #000; }
.mk-glow { position: absolute; inset: 0; border-radius: 14px; pointer-events: none; opacity: 0; transform: scaleY(.98); filter: blur(26px);
  background: conic-gradient(from var(--ang, 0deg) at var(--mx) var(--my), var(--purple), var(--pink), var(--blue), var(--green), var(--purple));
  transition: opacity .6s ease, transform .8s var(--spring); }
.market::before { content: ""; position: absolute; inset: -1px; border-radius: 15px; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg) at var(--mx) var(--my), var(--purple), var(--pink), var(--blue), var(--green), var(--purple));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .5s, filter .5s; }
#marketHost { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.panel-divider { display: none; }
@media (min-width: 1001px) {
  /* Remember the divider only in the joined showcase; the page grid stays 5:6. */
  .win-wrap { flex: none; margin-left: 0; transition: width .65s var(--ease), margin-left .65s var(--ease); }
  .split:has(.stage.dock) .market { width: var(--showcase-left, calc(100% + var(--gap))); }
  .stage.dock .win-wrap { flex: none; width: var(--showcase-chat, 100%); margin-left: var(--showcase-offset, 0px); }
  .stage.dock { z-index: 2; }
  .win { transition: border-radius .65s var(--ease); }
  .stage.dock .panel-divider { display: flex; position: absolute; z-index: 5; left: -9px; top: 0; bottom: 0; width: 18px; align-items: center; justify-content: center; cursor: col-resize; touch-action: none; }
  /* Keep the hit area generous, but highlight only the small central grip. */
  .panel-divider:focus-visible { outline: none; }
  .panel-divider::before { content: ""; position: absolute; left: 2px; top: 50%; width: 14px; height: 52px; transform: translateY(-50%); border-radius: 8px; background: #1e1d26; opacity: 0; transition: opacity .2s; }
  .panel-divider span { position: relative; width: 3px; height: 28px; border-radius: 3px; background: #777380; opacity: .65; transition: background-color .2s, opacity .2s, box-shadow .2s; }
  .panel-divider:hover::before, .panel-divider:focus-visible::before, .resizing .panel-divider::before { opacity: 1; }
  .panel-divider:hover span, .panel-divider:focus-visible span, .resizing .panel-divider span { background: #c3b6d6; opacity: 1; }
  .panel-divider:focus-visible span { box-shadow: 0 0 0 4px #c3b6d626; }
  .resizing .panel-divider span { box-shadow: none; }
  html.resizing-panels, html.resizing-panels * { cursor: col-resize !important; user-select: none !important; }
  .resizing .win-wrap, .resizing .market { transform: none !important; transition: none; }
  /* Large blurred surfaces should not be rerasterized throughout a resize. */
  .panel-motion .win-glow, .panel-motion .mk-glow, .panel-motion .showcase::before { visibility: hidden; opacity: 0 !important; transition: none; }
  .copy { grid-column: 1; grid-row: 1; }
  .stage { grid-column: 2; grid-row: 1 / span 2; transition: padding-top .9s var(--ease); }
  .stage.dock { padding-top: calc(var(--bar) + var(--intro)); align-items: flex-start; }
  .showcase { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: subgrid; align-content: start; }
  /* 行情面板越过列间距，右边缘贴住对话窗口：两块连成一个整体，只在中间留一道分隔线 */
  .market { width: calc(100% + var(--gap)); margin-right: calc(-1 * var(--gap)); transition: width .65s var(--ease); }
  .mk-body, .mk-glow { border-radius: 14px 0 0 14px; }
  .mk-body { box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line), 0 1px 0 var(--line), 0 40px 120px -30px #000; }
  .market::before { border-radius: 15px 0 0 15px; padding: 1px 0 1px 1px; } /* 右边贴着对话窗口，不画光边 */
  .stage.dock .win, .stage.dock .win-shade, .stage.dock .win-glow { border-radius: 0 14px 14px 0; }
  /* The market owns the seam. Do not draw the chat panel's left edge again. */
  .stage.dock .win { box-shadow: 0 -1px 0 var(--line), 0 1px 0 var(--line), 1px 0 0 var(--line); }
  .stage.dock .win::before { border-radius: 0 15px 15px 0; padding: 1px 1px 1px 0; } /* 左边是接缝，不画光边 */
  /* 辉光在接缝处各自裁掉朝向对方的一侧：行情面板的光在 DOM 里排在对话窗口之后，不裁会压到窗口左缘上漏光。
     裁剪发生在缩放之前，所以这里只做纵向缩放，横向不动，裁剪边才会正好落在接缝上，不会重叠出一条亮带 */
  .mk-glow { clip-path: inset(-120px 0 -120px -120px); }
  .stage.dock .win-glow { clip-path: inset(-120px -120px -120px 0); }
  /* 拼合后，两侧都先画完整矩形再裁切。渐变中心与模糊采样相同，接缝不会出现色块断层。 */
  .joined-glow:has(.stage.dock) .mk-glow {
    right: calc(-1 * var(--joined-right));
    border-radius: 14px;
    clip-path: inset(-120px var(--joined-right) -120px -120px);
  }
  .joined-glow .stage.dock .win-glow {
    left: calc(-1 * var(--joined-left));
    border-radius: 14px;
    clip-path: inset(-120px -120px -120px var(--joined-left));
  }
  .joined-glow:has(.stage.dock) .market::before,
  .joined-glow .stage.dock .win::before { background-size: var(--joined-width) 100%; background-repeat: no-repeat; }
  .joined-glow:has(.stage.dock) .market::before { background-position: left center; }
  .joined-glow .stage.dock .win::before { background-position: right center; }
  /* One continuous glow behind the joined surface; no clipping boundary at the divider. */
  .showcase::before {
    content: ""; position: absolute; top: calc(var(--bar) + var(--intro)); left: 0; right: 0;
    height: min(calc(100svh - var(--bar) - var(--intro) - 40px), 780px); min-height: 360px;
    border-radius: 14px; pointer-events: none; filter: blur(26px); transform: scaleY(1.03);
    background: conic-gradient(var(--purple), var(--pink), var(--blue), var(--green), var(--purple));
    opacity: 0; transition: opacity .4s ease;
  }
  .split:has(.stage.dock):has(.win-wrap.lit, .market.lit) .showcase::before { opacity: .55; }
  .split:has(.stage.dock) .mk-glow, .split .stage.dock .win-glow { display: none; }
  .split:has(.stage.dock) .market, .split .stage.dock .win-wrap { transform: none !important; }
  .split .stage.dock .win-shade { box-shadow: none; }
  .split:has(.stage.dock) .mk-body { box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line), 0 1px 0 var(--line); }
}

/* 底层能力：三张卡。和章节一样整屏一屏，标题居中，卡片只留一层极淡的本色光 */
.stack { position: relative; z-index: 1; min-height: 100svh; display: grid; align-content: center; padding: calc(var(--bar) + 72px) 0 96px; border-top: 1px solid var(--line); }
.stack-in { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 var(--pad); }
.stack-title { text-align: center; font-weight: 480; font-size: clamp(36px, 4.6vw, 76px); line-height: 1.1; letter-spacing: -.055em; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 1.6vw, 24px); margin-top: clamp(40px, 5vw, 64px); }
.card { --accent: var(--pink); display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; background: #0b0b0f;
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px -40px #000; transition: translate .5s var(--ease), box-shadow .4s var(--ease); }
.cards > :nth-child(2) { --accent: var(--purple); }
.cards > :nth-child(3) { --accent: var(--green); }
/* 空封面改成轻量技术图：网格、扫描框、读数比孤零零的大字更像“稳定性”证据。 */
.card-cover { position: relative; height: clamp(174px, 17vw, 224px); overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line);
  background: radial-gradient(120% 140% at 88% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 66%), #0b0b0f; }
.card-cover::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .7;
  background: linear-gradient(90deg, #ffffff0a 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(#ffffff0a 1px, transparent 1px) 0 0 / 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, #000 10%, transparent 92%); mask-image: linear-gradient(to bottom, #000 10%, transparent 92%); }
.card-cover::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 17px; height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 65%, transparent), transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 42%, transparent); }
.card-index { position: absolute; z-index: 2; top: 18px; left: 22px; font: 500 11px var(--mono); letter-spacing: .08em; color: var(--faint); }
.card-visual { position: absolute; z-index: 1; top: 50%; left: 12%; width: 76%; height: auto; transform: translateY(-44%); fill: none;
  stroke: color-mix(in srgb, var(--accent) 68%, var(--text)); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .9; transition: transform .5s var(--spring), opacity .3s; }
/* 三层：主轮廓 > 暗线（辅助结构）> 实心高亮（唯一的焦点），线宽统一，不再靠细线撑场面 */
.card-visual .dim { stroke: color-mix(in srgb, var(--accent) 38%, transparent); }
.card-visual .hot { fill: color-mix(in srgb, var(--accent) 24%, transparent); stroke: var(--accent); }
.card-visual .hot-line { stroke: var(--accent); stroke-width: 2.4; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent)); }
.card-visual .dot { fill: var(--accent); stroke: none; }
.card-readout { position: absolute; z-index: 2; right: 22px; bottom: 24px; font: 520 11px var(--mono); letter-spacing: .07em; color: var(--accent); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 26px; }
.card h3 { font-size: clamp(18px, 1.45vw, 21px); font-weight: 560; line-height: 1.45; letter-spacing: -.015em; }
.card p { font-size: clamp(13.5px, 1.02vw, 15px); line-height: 1.8; color: var(--sub); }
@media (hover: hover) {
  /* GSAP 会写内联 translate: none，抬升要 !important 才盖得住；旋转走 transform，不冲突 */
  .card:hover { translate: 0 -4px !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, var(--line)), 0 34px 90px -40px #000; }
  .card:hover .card-visual { opacity: 1; transform: translateY(-44%) scale(1.03); }
}

/* 结尾 */
.close { position: relative; z-index: 1; min-height: 100svh; display: grid; place-items: center; text-align: center; gap: 36px; padding: 140px var(--pad) 100px; overflow: hidden; border-top: 1px solid var(--line); align-content: center; }
/* 结尾收益：有真实数据才变成老虎机；没有数据时只保留诚实的空状态 */
.earn { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.earn-label { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; letter-spacing: .04em; color: var(--sub); }
.earn-empty { font: 520 clamp(24px, 4vw, 64px)/1 var(--mono); letter-spacing: -.055em; color: var(--faint); }
.earn-num { display: flex; align-items: flex-start; justify-content: center; max-width: 100%; font: 520 clamp(44px, 8vw, 220px)/1 var(--mono); letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
/* 滚的时候糊一点，每格上下再淡掉，半截数字才不会显得像排版坏了 */
.earn-num.spinning { filter: blur(3px); }
.earn-num.spinning .reel {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
}
.reel { display: inline-block; height: 1em; overflow: hidden; }
.reel-track { display: block; }
.reel-track b { display: block; height: 1em; font-weight: inherit; line-height: 1; }
.comma { display: inline-block; height: 1em; line-height: 1; color: var(--sub); }
.earn-sub { font: 500 12px var(--mono); letter-spacing: .05em; color: var(--faint); }
.close .claim { font-size: clamp(17px, 1.5vw, 22px); font-weight: 480; letter-spacing: -.01em; line-height: 1.4; max-width: 18em; color: var(--sub); }
.claim .w { opacity: .12; display: inline-block; white-space: pre; }
.word { position: absolute; inset: auto 0 -.17em; font-size: clamp(120px, 28vw, 440px); font-weight: 520; letter-spacing: -.09em; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .12; pointer-events: none; user-select: none; }
.foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px var(--pad); border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.foot-end { display: flex; align-items: center; gap: 16px; }
.social { display: flex; align-items: center; gap: 4px; }
.social-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--sub); box-shadow: inset 0 0 0 1px var(--line); transition: color .25s, box-shadow .3s, transform .4s var(--spring); }
.social-btn svg { width: 16px; height: 16px; fill: currentColor; }
@media (hover: hover) {
  .social-btn:hover { color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pink) 45%, var(--line)); transform: translateY(-2px); }
}
.social-btn:active { transform: scale(.92); }

/* 初始状态：JS 在才隐藏，防止内容丢失 */
.js .ln > span { transform: translateY(110%); }
.js .hero-in, .js .win, .js .bar { opacity: 0; }
.js [data-reveal] { opacity: 0; }

@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .copy { display: contents; }
  .split > * { min-width: 0; }
  .stage { grid-row: 2; position: relative; top: auto; height: clamp(380px, 68svh, 640px); padding: 0 0 24px; align-items: stretch; }
  .win-wrap { height: 100%; }
  .chapter { min-width: 0; min-height: 64svh; padding: 64px 0; }
  .chapter:first-child { min-height: 100svh; padding: calc(var(--bar) + 72px) 0 80px; }
  .showcase { min-height: 0; padding: 48px 0; }
  .stack { min-height: 0; padding: 96px 0 80px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .showcase .lead { position: static; margin: 0 0 28px; }
  .market { height: clamp(520px, 80svh, 760px); }
  .figures { margin-top: 36px; }
}
@media (max-width: 600px) {
  :root { --pad: 20px; --bar: 64px; }
  .lead { font-size: 16px; overflow-wrap: anywhere; }
  .title { font-size: 36px; }
  .figures { gap: 20px; }
  .fig { font-size: 52px; }
  .figures svg { width: 40px; }
  .win-head { gap: 8px; padding: 0 12px; }
  .transcript { padding: 14px 12px 16px; }
  .composer-hint { display: none; }
  .tabs button { min-width: 32px; height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .close { min-height: 80svh; padding: 112px var(--pad) 100px; }
  .foot { padding: 14px var(--pad); }
  .social { gap: 6px; }
  .social-btn { width: 44px; height: 44px; border-radius: 10px; }
  .social-btn svg { width: 18px; height: 18px; }
  .stack { padding: 88px 0 64px; }
  .card-body { padding: 20px; }
  .claim { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .ln > span, .js .hero-in, .js .win, .js .win-shade, .js .bar, .js [data-reveal] { transform: none; opacity: 1; }
  #field { display: none; }
}

/* harnn WebUI 的动效 */
@keyframes sweep { from { background-position: -60% 0; } to { background-position: 160% 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; opacity: .6; } }
@keyframes msgIn { from { opacity: 0; transform: translate(12px, 26px) scale(.8); } }
@keyframes stepIn { from { opacity: 0; transform: translateX(-10px); } }
@keyframes shimmer { to { background-position: -260% 0; } }
@keyframes nodePulse { 0% { box-shadow: 0 0 0 0 #ff3db4aa; } 100% { box-shadow: 0 0 0 9px #ff3db400; } }
@keyframes ripple { 0% { box-shadow: 0 0 0 0 #4ade80aa; } 100% { box-shadow: 0 0 0 10px #4ade8000; } }
@keyframes draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@keyframes icPop { 0% { transform: scale(.4); } 100% { transform: none; } }
@keyframes glow { 50% { filter: drop-shadow(0 0 5px #ffd54f); transform: scale(1.15); } }
@keyframes tk { from { opacity: 0; } to { opacity: 1; } }
@keyframes caretIn { from { transform: scaleY(0); } }
@keyframes caret { 50% { opacity: .25; transform: scaleY(.78); } }
@keyframes turnGlow { 0% { color: var(--faint); } 25% { color: #fff; text-shadow: 0 0 12px var(--pink); } 100% { color: var(--faint); text-shadow: none; } }
@keyframes planeIdle { 50% { transform: translate(1.5px, -2.5px) rotate(-6deg); } }
@keyframes planeAway { 0% { transform: none; opacity: 1; } 35% { transform: translate(-3px, 3px) scale(.9) rotate(8deg); opacity: 1; } 100% { transform: translate(26px, -26px) scale(.4) rotate(-12deg); opacity: 0; } }
@keyframes wash { from { clip-path: circle(0% at 25% 75%); } to { clip-path: circle(150% at 25% 75%); } }
@keyframes pinkflow { 0% { background-position: 0% 0%; } 100% { background-position: 100% 100%; } }
@keyframes breathe { 50% { box-shadow: 0 0 0 5px #ff3db422, 0 4px 18px -2px #ff3db488; } }
@keyframes hintIn { from { opacity: 0; transform: translateY(5px); } }
.motion-paused, .motion-paused *, .motion-paused *::before, .motion-paused *::after { animation-play-state: paused !important; }
