/* ================================================================
   星链 StarLink · 模型中转站 — 首页样式
   深色霓虹 / 玻璃拟态 / 街机厅
   ================================================================ */
:root {
  --bg0: #05070f;
  --bg1: #0a0f1e;
  --panel: rgba(148, 180, 255, .06);
  --panel-strong: rgba(148, 180, 255, .10);
  --line: rgba(148, 180, 255, .16);
  --txt: #dbe6ff;
  --txt-dim: #8fa3c8;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --glow-cyan: 0 0 18px rgba(34, 211, 238, .35);
  --font-mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* 防止类选择器的 display 压过 hidden 属性（曾导致透明弹层吞掉全页点击） */
html { scroll-behavior: smooth; }
body {
  background: radial-gradient(1200px 700px at 70% -10%, #12203c 0%, var(--bg1) 45%, var(--bg0) 100%);
  color: var(--txt);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
::selection { background: rgba(34, 211, 238, .3); }

#bgfx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.scanlines {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
}
main, .nav, .foot { position: relative; z-index: 2; }

/* ---------- 顶部导航 ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 5vw, 64px);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 700; letter-spacing: .06em; color: var(--txt);
}
.nav-brand svg { color: var(--cyan); filter: drop-shadow(0 0 6px rgba(34,211,238,.6)); }
.nav-brand em { font-style: normal; color: var(--cyan); font-family: var(--font-mono); font-weight: 600; }

.health-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--txt-dim); font-size: 13px; font-family: var(--font-mono);
  transition: box-shadow .2s, border-color .2s, color .2s;
}
.health-pill:hover { border-color: rgba(34,211,238,.5); color: var(--txt); box-shadow: var(--glow-cyan); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-green { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.dot-red { background: var(--red); box-shadow: 0 0 8px var(--red); }
.dot-gray { background: #5b6b8c; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- HERO ---------- */
.hero {
  padding: clamp(40px, 9vh, 90px) clamp(18px, 5vw, 64px) 70px;
  max-width: 1200px; margin: 0 auto;
}
.hero-kicker { font-family: var(--font-mono); color: var(--green); font-size: 14px; letter-spacing: .12em; margin-bottom: 18px; }
.hero-title {
  font-size: clamp(30px, 5.4vw, 64px); line-height: 1.18; font-weight: 800; letter-spacing: .01em;
  text-shadow: 0 0 30px rgba(167,139,250,.25);
  min-height: 1.3em;
}
.hero-title .hl-cyan { color: var(--cyan); }
.hero-title .hl-violet { color: var(--violet); }
.cursor { color: var(--cyan); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { margin-top: 22px; color: var(--txt-dim); font-size: clamp(15px, 1.6vw, 18px); line-height: 1.9; max-width: 640px; }
.hero-sub b { color: var(--txt); }
.only-desktop { display: block; }

.hero-cta { margin-top: 34px; display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; border-radius: 12px; text-decoration: none;
  font-size: 16px; font-weight: 600; letter-spacing: .04em;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-neon { color: #04121a; background: linear-gradient(100deg, var(--cyan), #6ee7ff); box-shadow: var(--glow-cyan); }
.btn-neon:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(34,211,238,.55); }
.btn-ghost { color: var(--txt); border: 1px solid var(--line); background: var(--panel); }
.btn-ghost:hover { border-color: rgba(167,139,250,.6); box-shadow: 0 0 18px rgba(167,139,250,.3); }

.hero-stats { margin-top: 54px; display: flex; gap: clamp(24px, 5vw, 70px); flex-wrap: wrap; }
.stat b { font-size: clamp(26px, 3vw, 38px); font-family: var(--font-mono); color: var(--cyan); text-shadow: var(--glow-cyan); font-weight: 700; }
.stat i { display: block; font-style: normal; color: var(--txt-dim); font-size: 13px; margin-top: 6px; letter-spacing: .08em; }

/* ---------- 通用区块 ---------- */
section { max-width: 1200px; margin: 0 auto; padding: 70px clamp(18px, 5vw, 64px); }
.sec-title { font-size: clamp(24px, 3.2vw, 38px); font-weight: 800; margin-bottom: 10px; }
.sec-title span { color: var(--violet); }
.sec-sub { color: var(--txt-dim); font-size: 15.5px; line-height: 1.8; max-width: 660px; margin-bottom: 34px; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.shown { opacity: 1; transform: none; }

/* ---------- 能力四宫格 ---------- */
.cap-grid { margin-top: 34px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.cap-card {
  border: 1px solid var(--line); background: var(--panel); border-radius: 18px;
  padding: 26px 24px; backdrop-filter: blur(8px);
  transition: border-color .25s, box-shadow .25s, transform .1s ease-out;
  will-change: transform;
}
.cap-card:hover { border-color: rgba(34,211,238,.45); box-shadow: 0 10px 40px rgba(6,20,40,.6), var(--glow-cyan); }
.cap-glyph { font-size: 30px; margin-bottom: 14px; filter: drop-shadow(0 0 10px rgba(167,139,250,.5)); }
.cap-card h3 { font-size: 19px; margin-bottom: 10px; }
.cap-card p { color: var(--txt-dim); font-size: 14.5px; line-height: 1.8; }
.cap-card code {
  display: inline-block; margin-top: 16px; font-family: var(--font-mono); font-size: 12px;
  color: var(--green); background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.25);
  padding: 4px 10px; border-radius: 7px; letter-spacing: .05em;
}

/* ---------- 街机厅 ---------- */
.cab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.cab {
  display: block; width: 100%; text-align: left; cursor: pointer; color: var(--txt);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, rgba(20,30,55,.85), rgba(10,15,30,.9));
  transition: transform .18s, border-color .2s, box-shadow .25s;
  font: inherit;
}
.cab:hover { transform: translateY(-4px); border-color: rgba(167,139,250,.6); box-shadow: 0 14px 44px rgba(6,15,35,.75), 0 0 22px rgba(167,139,250,.35); }
.cab-screen { position: relative; aspect-ratio: 16/9; background: #020409; overflow: hidden; }
.cab-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cab-screen::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 2px, transparent 2px 4px);
  pointer-events: none;
}
.cab-info { padding: 18px 20px 20px; }
.cab-info h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.tag { font-size: 11.5px; font-family: var(--font-mono); padding: 3px 9px; border-radius: 6px; letter-spacing: .06em; }
.tag-cyan { color: var(--cyan); background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.35); }
.tag-red { color: var(--red); background: rgba(251,113,133,.1); border: 1px solid rgba(251,113,133,.35); }
.tag-violet { color: var(--violet); background: rgba(167,139,250,.1); border: 1px solid rgba(167,139,250,.35); }
.tag-amber { color: var(--amber); background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.35); }
.cab-info p { color: var(--txt-dim); font-size: 13.5px; line-height: 1.7; margin-top: 8px; }
.cab-play { display: inline-block; margin-top: 14px; font-family: var(--font-mono); font-size: 12.5px; color: var(--amber); animation: blink 1.6s steps(1) infinite; }
.arcade-note { margin-top: 26px; color: var(--txt-dim); font-size: 13px; font-family: var(--font-mono); }
.arcade-note code { color: var(--cyan); }

/* ---------- 页脚 ---------- */
.foot { text-align: center; padding: 60px 20px 46px; color: var(--txt-dim); font-size: 14px; line-height: 2; }
.foot-status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; margin-bottom: 10px; color: var(--txt); padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.foot-legal { font-size: 12.5px; color: #5b6b8c; }
.foot-legal a { color: #5b6b8c; text-decoration: none; transition: color .2s; }
.foot-legal a:hover { color: var(--cyan); }
.foot-sep { margin: 0 8px; }

/* ---------- 游戏弹层 ---------- */
/* 注意：.shell/.dpad 的 display 会压过 hidden 属性默认的 display:none，必须显式兜底，
   否则全屏透明弹层会盖住整页吞掉所有点击 */
.shell[hidden], .dpad[hidden] { display: none !important; }
.shell {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(3,6,14,.82); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .22s;
}
.shell.open { opacity: 1; }
.shell.no-anim { transition: none; }
.shell-card {
  width: min(94vw, 620px); max-height: 96dvh; display: flex; flex-direction: column;
  background: linear-gradient(165deg, #101a33, #070c1a);
  border: 1px solid rgba(167,139,250,.4); border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0,0,0,.7), 0 0 40px rgba(167,139,250,.18);
  overflow: hidden;
}
.shell-bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.shell-title { font-weight: 700; font-size: 16px; }
.shell-hud { margin-left: auto; font-family: var(--font-mono); font-size: 13px; color: var(--txt-dim); }
.shell-hud b { color: var(--cyan); }
.shell-x {
  border: 1px solid var(--line); background: var(--panel); color: var(--txt-dim);
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 14px;
}
.shell-x:hover { color: var(--red); border-color: rgba(251,113,133,.5); }
.shell-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 14px; overflow: auto; touch-action: none; }
.shell-stage canvas { display: block; border-radius: 10px; background: #020409; box-shadow: inset 0 0 60px rgba(20,40,90,.35); touch-action: none; }
.shell-hint { padding: 0 18px 16px; text-align: center; color: var(--txt-dim); font-size: 12.5px; font-family: var(--font-mono); line-height: 1.7; }

.dpad { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0 16px; }
.dpad > div { display: flex; gap: 8px; }
.dpad button {
  width: 56px; height: 56px; border-radius: 14px; font-size: 20px;
  border: 1px solid rgba(34,211,238,.4); background: rgba(34,211,238,.08); color: var(--cyan);
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.dpad button:active { background: rgba(34,211,238,.3); }

/* ---------- Konami 故障滤镜 ---------- */
body.glitch #bgfx, body.glitch .nav, body.glitch main, body.glitch .foot {
  animation: glitchy .18s steps(2) infinite;
  filter: hue-rotate(140deg) saturate(1.8) contrast(1.15);
}
@keyframes glitchy {
  0% { transform: translate(0); } 25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, -1px); } 100% { transform: translate(0); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .only-desktop { display: none; }
  .hero { padding-top: 30px; }
  .nav { padding: 14px 16px; }
  .health-pill { font-size: 11.5px; padding: 6px 10px; }
  section { padding: 46px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .cursor, .cab-play, .dot-green { animation: none; }
}
