/* ===== 像素街机 · 全站样式 ===== */
:root {
  --bg: #0b0f1a;
  --bg-2: #111830;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.10);
  --text: #eef2ff;
  --muted: #9aa6c7;
  --accent: #6c8cff;
  --accent-2: #22d3ee;
  --shadow: 0 20px 50px rgba(3, 7, 18, 0.55);
  --radius: 18px;
  --max: 1180px;
}

html[data-theme="light"] {
  --bg: #eef1fb;
  --bg-2: #dfe6ff;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: rgba(255, 255, 255, 0.95);
  --border: rgba(20, 30, 70, 0.12);
  --text: #131a33;
  --muted: #5b678a;
  --shadow: 0 18px 40px rgba(30, 45, 90, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
}

/* 背景装饰 */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
  opacity: .6;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  z-index: -1;
  top: -220px;
  left: 50%;
  width: 900px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(108, 140, 255, .38), rgba(34, 211, 238, .12) 55%, transparent 75%);
  filter: blur(10px);
  pointer-events: none;
}

/* ===== 顶栏 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px;
  backdrop-filter: blur(14px);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .5px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px rgba(108, 140, 255, .35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-size: 17px; }
.brand-text em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; gap: 6px; }

.nav-link {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color .2s, background .2s;
}

.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 2px;
  width: 16px; height: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.theme-toggle {
  width: 38px; height: 38px;
  margin-left: 4px;
  font-size: 17px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .2s, background .2s;
}
.theme-toggle:hover { transform: translateY(-2px) rotate(-12deg); background: var(--surface-2); }

/* ===== Hero ===== */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 24px 40px;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  margin: 0 0 22px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .5px;
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.15;
  letter-spacing: -1px;
  background: linear-gradient(100deg, #ffffff 10%, #a9c2ff 45%, #6ee7f5 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="light"] .hero-title {
  background: linear-gradient(100deg, #16204a 10%, #3b5bdb 50%, #0e7490 90%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-desc {
  max-width: 620px;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: 16px;
}

.hero-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 28px rgba(108, 140, 255, .35);
}
.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 6vw, 70px);
  margin: 52px 0 0;
  padding: 0;
}
.stat dt { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.stat dd { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ===== 通用区块 ===== */
.games, .about {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 24px;
}

.section-head { margin-bottom: 30px; text-align: center; }
.section-head h2 { margin: 0 0 6px; font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.5px; }
.section-head p { margin: 0; color: var(--muted); font-size: 15px; }

/* ===== 游戏卡片 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 22px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .25s ease, border-color .25s ease, background .25s;
}

.game-card:hover {
  transform: translateY(-8px);
  border-color: hsl(var(--hue) 85% 62% / .55);
  background: var(--surface-2);
}

.card-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 132px;
  background: linear-gradient(140deg, hsl(var(--hue) 80% 58% / .35), hsl(var(--hue) 80% 40% / .10));
  border-bottom: 1px solid var(--border);
}
.card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(hsl(var(--hue) 90% 70% / .18) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--hue) 90% 70% / .18) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 72%);
}
.art-emoji { font-size: 52px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .35)); transition: transform .25s; }
.game-card:hover .art-emoji { transform: scale(1.12) rotate(-4deg); }

.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-top h3 { margin: 0; font-size: 19px; }
.badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: hsl(var(--hue) 90% 78%);
  background: hsl(var(--hue) 80% 55% / .16);
  border: 1px solid hsl(var(--hue) 80% 60% / .35);
}
.card-desc { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.best { margin-left: auto; font-size: 12px; color: var(--muted); }
.best b { color: var(--text); font-size: 14px; }

/* 关于卡片 */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.about-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .2s, border-color .2s;
}
.about-card:hover { transform: translateY(-4px); border-color: rgba(108, 140, 255, .45); }
.about-card h3 { margin: 0 0 8px; font-size: 16px; }
.about-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* 页脚 */
.site-footer {
  padding: 40px 24px 46px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.site-footer p { margin: 0; }
.footer-sub { margin-top: 6px !important; font-size: 12px; opacity: .75; }

/* 入场动画 */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}
[data-reveal].revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 620px) {
  .site-header { padding: 14px 16px; }
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .brand-text em { display: none; }
  .hero { padding: 46px 18px 24px; }
  .games, .about { padding: 40px 18px; }
  .hero-stats { gap: 22px; }
  .stat dt { font-size: 24px; }
}
