/* 基础与全局 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 15.5px; line-height: 1.75;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: rgba(52, 211, 153, .28); color: #fff; }
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #262833; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #353846; }
* { scrollbar-width: thin; scrollbar-color: #262833 var(--bg); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; color: var(--text); margin: 0 0 .55em; }
.container { width: min(var(--maxw), 90vw); margin-inline: auto; position: relative; z-index: 1; }

code { font-family: var(--mono); font-size: .9em; color: var(--accent-soft); background: var(--surface-2); border: 1px solid var(--border-subtle); padding: 1px 6px; border-radius: 4px; }

.kbd { display: inline-block; padding: 2px 8px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tag { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; border: 1px solid var(--border); color: var(--muted); background: var(--surface-2); font-family: var(--mono); }
.tag.green { color: var(--accent); border-color: rgba(52, 211, 153, .35); }
.tag.pink { color: var(--pink); border-color: rgba(244, 114, 182, .35); }

.bar { height: 6px; background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s var(--ease); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease); }
.btn:hover { border-color: #3E4250; background: var(--surface-hover); }
.btn:active { transform: scale(.98); }
.btn-green { background: var(--accent); border-color: var(--accent); color: #042f1e; font-weight: 600; }
.btn-green:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: #042f1e; }
.btn-pink { background: transparent; border-color: rgba(244, 114, 182, .4); color: var(--pink); }
.btn-pink:hover { background: rgba(244, 114, 182, .1); border-color: var(--pink); }
.btn-ghost { background: transparent; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* 终端（代码块式面板，用于 boot / 对话框 / 演示） */
.term { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.term-head { display: flex; align-items: center; gap: 8px; padding: 10px 15px; background: var(--surface); border-bottom: 1px solid var(--border-subtle); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.term-head .dots { display: flex; gap: 6px; margin-right: 6px; }
.term-head .dots i { width: 11px; height: 11px; border-radius: 50%; background: #2c2c31; }
.term-head .dots i:nth-child(1) { background: #4a4a52; }
.term-body { padding: 18px 20px; }
.prompt { color: var(--accent); font-weight: 600; font-family: var(--mono); }
.prompt::after { content: " "; }
.line { display: flex; gap: 8px; align-items: baseline; margin: 3px 0; font-family: var(--mono); font-size: 14px; }
.line .txt { white-space: pre-wrap; word-break: break-word; }
.cursor { display: inline-block; width: .6em; height: 1.2em; background: var(--accent); margin-left: 2px; vertical-align: text-bottom; animation: blink 1.1s steps(2, start) infinite; border-radius: 2px; }

.ulink { position: relative; }
.ulink::after { content: ""; position: absolute; left: 0; bottom: -3px; height: 1px; width: 0; background: var(--accent); transition: width .2s var(--ease); }
.ulink:hover::after { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 10001; }

/* ===== 视觉层次：极轻光晕 + 颗粒 + 聚光 ===== */
.bg-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-glow span { position: absolute; border-radius: 50%; }
.bg-glow .g1 { width: 62vw; height: 62vw; left: -14vw; top: -22vh; background: radial-gradient(circle, rgba(52,211,153,.10), transparent 62%); animation: drift1 30s ease-in-out infinite alternate; }
.bg-glow .g2 { width: 56vw; height: 56vw; right: -16vw; top: 4vh; background: radial-gradient(circle, rgba(99,102,241,.09), transparent 62%); animation: drift2 36s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(6vw, 5vh) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-5vw, 7vh) scale(1.08); } }

.grain { position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxNjAnIGhlaWdodD0nMTYwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nMC44JyBudW1PY3RhdmVzPScyJyBzdGl0Y2hUaWxlcz0nc3RpdGNoJy8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9JzEwMCUnIGhlaWdodD0nMTAwJScgZmlsdGVyPSd1cmwoI24pJy8+PC9zdmc+"); }

/* 卡片跟随聚光 */
.card { position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease);
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(52,211,153,.10), transparent 62%); }
.card:hover::before { opacity: 1; }

/* 首页星链画布 */
#hero-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* hero 顶部极淡高光 */
.hero { position: relative; }
.hero::before { content: ""; position: absolute; left: -6%; top: -12%; width: 55%; height: 90%; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse at 30% 20%, rgba(52,211,153,.07), transparent 60%); }

/* 标题强调字：极细渐变（绿→青，非霓虹） */
.hero h1 .accent { background: linear-gradient(100deg, #34D399, #2DD4BF 70%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* hero 逐行升起 */
@keyframes heroRise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.hero .eyebrow { animation: heroRise .7s var(--ease) both; }
.hero h1 { animation: heroRise .85s var(--ease) .1s both; }
.hero .hero-actions { animation: heroRise .8s var(--ease) .3s both; }

/* ticker 色带 */
.ticker { overflow: hidden; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); padding: 12px 0; margin-top: 4px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ticker-track { display: inline-block; white-space: nowrap; animation: tickerMove 38s linear infinite; }
.ticker span { font-size: 13px; color: var(--faint); font-family: var(--mono); margin: 0 14px; letter-spacing: .02em; }
.ticker .dot { color: var(--border); }
@keyframes tickerMove { to { transform: translateX(-50%); } }

/* 章节标题揭示：强调条生长 */
.reveal .section-title::before { transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease) .1s; }
.reveal.is-visible .section-title::before { transform: scaleX(1); }

/* ===== ASCII 画布 ===== */
#ascii-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .9; }

/* ===== CRT 叠加（极轻） ===== */
.scan { position: fixed; inset: 0; z-index: 9996; pointer-events: none; opacity: .13; mix-blend-mode: multiply;
  background: repeating-linear-gradient(180deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.5) 2px 3px); }
.vignette { position: fixed; inset: 0; z-index: 9995; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(0,0,0,.55) 100%); }

/* ===== 蒙版揭示 ===== */
.clip-reveal { clip-path: inset(0 0 100% 0); opacity: .001; transition: clip-path .9s var(--ease), opacity .5s var(--ease); }
.clip-reveal.clip-in { clip-path: inset(0 0 0 0); opacity: 1; }

/* ===== 横向滚动区 ===== */
.hscroll { position: relative; height: 240vh; }
.hsticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.hhead { padding: 0 2vw; }
.hlabel { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; color: var(--accent); }
.hhead h2 { font-size: clamp(24px, 3.4vw, 40px); font-weight: 700; letter-spacing: -.03em; margin: 8px 0 0; }
.htrack { display: flex; gap: 18px; padding: 0 2vw; width: max-content; will-change: transform; }
.hcard { flex: 0 0 clamp(220px, 24vw, 290px); display: flex; flex-direction: column; gap: 10px; padding: 26px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text); transition: border-color .2s var(--ease), transform .2s var(--ease); }
.hcard:hover { border-color: var(--accent); transform: translateY(-4px); }
.hnum { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.hname { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.hdesc { color: var(--muted); font-size: 13.5px; }
