:root {
  --bg: #06060f;
  --bg2: #0b0a1c;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --ink: #f4f1ff;
  --ink-2: #a79fce;
  --ink-3: #6f6891;
  --cyan: #22d3ee;
  --purple: #a855f7;
  --pink: #ec4899;
  --green: #4ade80;
  --yellow: #fbbf24;
  --grad: linear-gradient(135deg, #a855f7 0%, #22d3ee 100%);
  --grad2: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  --radius: 18px;
  --radius-sm: 13px;
  --maxw: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------- 背景层 ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.18), rgba(34, 211, 238, 0.07) 42%, transparent 66%);
  mix-blend-mode: screen;
  filter: blur(12px);
  transform: translate(-50%, -50%);
  will-change: transform;
}

/* ---------- 通用 ---------- */
.nav, .hero, .section, .footer, .dev { position: relative; z-index: 2; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
  background-size: 160% 160%;
  transition: transform .15s ease, box-shadow .2s ease, background-position .4s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(168, 85, 247, 0.5); background-position: 100% 0; }
.btn-light { background: #fff; color: #1a1030; padding: 13px 26px; }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 255, 255, 0.25); }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 7, 18, 0.72);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(168, 85, 247, 0.18);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 20px; letter-spacing: .04em; }
.brand-mark {
  font-size: 23px;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.6));
  animation: spin 9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.brand-name b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 28px; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.nav-links a { transition: color .15s; }
.nav-links a:hover { color: var(--cyan); text-shadow: 0 0 12px rgba(34, 211, 238, 0.6); }
.nav-actions { display: flex; align-items: center; gap: 14px; }

/* ---------- 语言切换 ---------- */
.lang-switch {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 999px;
  background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.12);
}
.lang-switch button {
  border: 0; background: transparent; color: var(--ink-2);
  font-family: inherit; font-size: 12px; font-weight: 800;
  padding: 4px 11px; border-radius: 999px; cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
  letter-spacing: .02em;
}
.lang-switch button:hover { color: #fff; }
.lang-switch button.active {
  background: var(--grad); color: #fff;
  box-shadow: 0 3px 12px rgba(168, 85, 247, 0.45);
}
.lang-sep { color: var(--ink-3); font-size: 11px; }

.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 12px; border-radius: 999px;
}
.live i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }
.nav-count {
  background: rgba(168, 85, 247, 0.18);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.4);
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 800;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 24px 110px;
  text-align: center;
  background:
    radial-gradient(60% 70% at 18% 0%, rgba(168, 85, 247, 0.18), transparent 60%),
    radial-gradient(55% 65% at 85% 12%, rgba(34, 211, 238, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}
.hero-float { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.hf {
  position: absolute;
  font-size: 40px;
  opacity: .5;
  filter: drop-shadow(0 0 14px rgba(168, 85, 247, 0.5));
  animation: drift 11s ease-in-out infinite;
  animation-delay: calc(var(--i) * -1.1s);
}
.hf:nth-child(1) { top: 16%; left: 9%; font-size: 46px; }
.hf:nth-child(2) { top: 64%; left: 14%; font-size: 34px; }
.hf:nth-child(3) { top: 24%; right: 12%; font-size: 52px; }
.hf:nth-child(4) { top: 70%; right: 10%; font-size: 38px; }
.hf:nth-child(5) { top: 12%; right: 36%; font-size: 30px; opacity: .35; }
.hf:nth-child(6) { top: 50%; left: 44%; font-size: 44px; opacity: .3; }
.hf:nth-child(7) { top: 8%; left: 40%; font-size: 32px; }
.hf:nth-child(8) { top: 78%; left: 48%; font-size: 28px; opacity: .35; }
.hf:nth-child(9) { top: 38%; right: 30%; font-size: 30px; opacity: .3; }
.hf:nth-child(10) { top: 58%; right: 38%; font-size: 26px; opacity: .35; }
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-26px) rotate(12deg); }
}
.hero-inner { position: relative; z-index: 2; max-width: 880px; margin: 0 auto; }
.hero-kicker {
  display: inline-block;
  color: var(--cyan);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .22em;
  margin-bottom: 20px;
  padding: 6px 16px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.06);
}
.hero-title {
  font-size: clamp(44px, 9vw, 92px);
  line-height: 1.02;
  margin: 0 0 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.hero-title .line { display: block; }
.hero-title .grad {
  background: linear-gradient(90deg, #22d3ee, #a855f7, #ec4899, #22d3ee);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(168, 85, 247, 0.45));
  animation: flow 6s linear infinite;
}
@keyframes flow { to { background-position: 300% 0; } }
.hero-sub {
  max-width: 600px;
  margin: 0 auto 32px;
  color: var(--ink-2);
  font-size: 18px;
}
.hero-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  background: rgba(10, 9, 23, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 999px;
  padding: 8px 8px 8px 20px;
  backdrop-filter: blur(8px);
  transition: border-color .2s, box-shadow .2s;
}
.hero-search:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.16), 0 0 30px rgba(168, 85, 247, 0.25);
}
.hs-icon { font-size: 18px; }
.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  font-family: inherit;
  color: var(--ink);
}
.hero-search input::placeholder { color: var(--ink-3); }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.hstat {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  min-width: 112px;
  backdrop-filter: blur(6px);
}
.hstat b {
  display: block;
  font-size: 27px;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.hstat span { font-size: 13px; color: var(--ink-2); }
.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 700;
  letter-spacing: .1em;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- section ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 64px 24px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { font-size: 30px; font-weight: 900; margin: 0; letter-spacing: -0.01em; }
.hg { filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.6)); }
.see-all { color: var(--cyan); font-weight: 800; font-size: 14px; transition: text-shadow .15s; }
.see-all:hover { text-shadow: 0 0 14px rgba(34, 211, 238, 0.7); }

/* ---------- 分类 chips ---------- */
.cat-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s ease;
  font-family: inherit;
}
.chip:hover { color: #fff; border-color: rgba(34, 211, 238, 0.5); transform: translateY(-2px); }
.chip.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(168, 85, 247, 0.4);
}

/* ---------- 精选 ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  transition: opacity .55s ease, transform .1s ease, box-shadow .25s ease;
}
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.7), rgba(34, 211, 238, 0.2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
  transition: background .25s;
}
.feature-card:hover { box-shadow: 0 22px 60px rgba(168, 85, 247, 0.35); }
.feature-card:hover::before { background: linear-gradient(135deg, #a855f7, #22d3ee); }
.feature-thumb {
  height: 196px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.thumb-emo { font-size: 92px; transition: transform .3s ease; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4)); }
.feature-card:hover .thumb-emo, .game-card:hover .thumb-emo { transform: scale(1.16) rotate(-4deg); }
.feature-body { padding: 18px 20px 22px; }
.feature-body h3 { margin: 0 0 6px; font-size: 22px; font-weight: 900; }
.feature-body p { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.feature-play {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--grad); color: #fff;
  padding: 10px 20px; border-radius: 999px; font-weight: 800; font-size: 14px;
  box-shadow: 0 8px 22px rgba(168, 85, 247, 0.35);
}

/* ---------- 游戏库搜索 ---------- */
.lib-search {
  display: flex; align-items: center; gap: 8px;
  max-width: 440px; margin-bottom: 22px;
  background: rgba(10, 9, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px; padding: 10px 18px;
  transition: border-color .18s, box-shadow .18s;
}
.lib-search:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14); }
.ls-icon { font-size: 16px; }
.lib-search input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; font-family: inherit; color: var(--ink); }
.lib-search input::placeholder { color: var(--ink-3); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); font-weight: 700; }
.sort select {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 9, 23, 0.8);
  color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; font-family: inherit; cursor: pointer;
}
.sort select option { background: #0b0a1c; }

/* ---------- 游戏网格 + 街机柜卡片 ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
  perspective: 1100px;
}
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: opacity .55s ease, transform .55s ease, box-shadow .25s ease;
  transform-style: preserve-3d;
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.5), rgba(34, 211, 238, 0.15));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
  transition: background .25s;
}
.game-card:hover {
  transition: transform .1s ease, box-shadow .25s ease;
  box-shadow: 0 22px 60px rgba(168, 85, 247, 0.28), 0 0 34px rgba(34, 211, 238, 0.14);
}
.game-card:hover::before { background: linear-gradient(135deg, #a855f7, #22d3ee); }
.card-badges { position: absolute; top: 12px; left: 12px; z-index: 4; display: flex; gap: 6px; }
.card-badge {
  font-size: 11px; font-weight: 900; padding: 4px 10px; border-radius: 999px;
  color: #fff; letter-spacing: .04em; backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.badge-featured { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.badge-new { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.badge-hot { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.card-thumb {
  height: 136px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.card-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.22), transparent 55%);
}
.card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-title { font-size: 18px; font-weight: 900; margin: 0; }
.card-desc { color: var(--ink-2); font-size: 13.5px; margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.card-tag {
  background: rgba(168, 85, 247, 0.14); color: #d8b4fe;
  border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 700;
}
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.card-meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.card-play {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--grad); color: #fff;
  padding: 7px 15px; border-radius: 999px; font-weight: 800; font-size: 13px;
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.3);
  transition: transform .15s ease;
}
.game-card:hover .card-play { transform: scale(1.06); }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal.in { opacity: 1; transform: translateY(0); }
.feature-card.reveal { opacity: 0; transform: translateY(24px); }
.feature-card.reveal.in { opacity: 1; transform: translateY(0); }

.empty { text-align: center; color: var(--ink-2); padding: 48px 0; font-size: 15px; }
.hidden { display: none; }

/* ---------- 开发者 CTA ---------- */
.dev-card {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.16), rgba(34, 211, 238, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 26px; padding: 44px;
  position: relative; overflow: hidden;
}
.dev-card::before {
  content: ""; position: absolute; width: 300px; height: 300px; right: -80px; top: -80px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.3), transparent 70%);
  filter: blur(20px);
}
.dev-copy { position: relative; z-index: 1; }
.dev-tag {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .2em;
  color: var(--cyan); margin-bottom: 12px;
}
.dev-copy h2 { color: #fff; margin: 0 0 12px; font-size: 26px; }
.dev-copy p { color: var(--ink-2); margin: 0 0 22px; font-size: 15px; }
.dev-steps { position: relative; z-index: 1; margin: 0; padding: 0; list-style: none; }
.dev-steps li {
  display: flex; gap: 12px; align-items: flex-start;
  color: var(--ink-2); font-size: 14.5px; margin-bottom: 16px;
}
.step-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 900; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}
.dev-steps code {
  background: rgba(0, 0, 0, 0.4); padding: 2px 7px; border-radius: 6px;
  font-size: 13px; color: #fde68a; border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid rgba(255, 255, 255, 0.08); background: rgba(6, 6, 15, 0.6); margin-top: 24px; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 48px 24px 32px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px;
}
.footer-brand p { color: var(--ink-2); font-size: 14px; margin: 12px 0 0; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.footer-col h4 { margin: 0 0 14px; font-size: 14px; font-weight: 800; color: var(--ink); }
.footer-col a { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 9px; transition: color .15s; }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom {
  max-width: var(--maxw); margin: 0 auto; padding: 18px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--ink-3); font-size: 13px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .dev-card { grid-template-columns: 1fr; gap: 24px; padding: 32px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .live { display: none; }
  .nav-count { display: none; }
  .nav-actions { gap: 8px; }
  .lang-switch button { padding: 4px 8px; }
  .btn-sm { padding: 8px 13px; font-size: 13px; }
  .section { padding: 44px 18px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding: 70px 18px 90px; }
  .hero-stats { gap: 10px; }
  .hstat { padding: 10px 18px; min-width: 84px; }
  .hstat b { font-size: 22px; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .card-thumb { height: 108px; }
  .thumb-emo { font-size: 60px; }
  .dev-card { padding: 26px 22px; }
  .footer-bottom { flex-direction: column; }
}
