:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eaeef6;
  --ink: #161a24;
  --ink-2: #4b5368;
  --muted: #7c8499;
  --line: #d8deea;
  --accent: #5b5bf0;
  --accent-2: #ff6b8b;
  --ok: #22a06b;
  --bad: #e5484d;
  --stage: #10131c;
  --shadow: 0 1px 2px rgba(20, 25, 45, 0.06), 0 6px 20px rgba(20, 25, 45, 0.07);
  --shadow-lg: 0 2px 4px rgba(20, 25, 45, 0.06), 0 18px 44px rgba(20, 25, 45, 0.14);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e1016; --surface: #181b24; --surface-2: #232734; --ink: #eef0f6; --ink-2: #b8bdcc; --muted: #8a90a2; --line: #2e3342;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3); --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 20px 44px rgba(0,0,0,.4);
    --stage: #07080c;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0e1016; --surface: #181b24; --surface-2: #232734; --ink: #eef0f6; --ink-2: #b8bdcc; --muted: #8a90a2; --line: #2e3342;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3); --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 20px 44px rgba(0,0,0,.4);
  --stage: #07080c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; }
.link { color: var(--accent); font-weight: 600; }

/* ---------- 顶栏 ---------- */
.site-top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.site-top-in { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; white-space: nowrap; min-width: 0; }
@media (max-width: 400px) { .brand { font-size: 16px; } .top-link { padding: 0 7px; } }
.brand-mark {
  width: 30px; height: 30px; border-radius: 10px; flex: none; position: relative;
  background: linear-gradient(135deg, #6a6af5, #ff6b8b); box-shadow: 0 4px 12px rgba(91, 91, 240, .35);
}
.brand-mark::after { content: ''; position: absolute; left: 11px; top: 8px; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.top-actions { display: flex; align-items: center; gap: 2px; }
.top-link {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 10px; border: 0; background: none;
  font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.top-link:hover { background: var(--surface-2); color: var(--ink); }
.top-link .ico { width: 18px; height: 18px; }
.top-link.lang { border: 1px solid var(--line); height: 30px; margin-left: 4px; }

/* ---------- 页面 ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 0 20px 40px; }
.hero { padding: 40px 0 18px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 900; letter-spacing: -.01em;
  background: linear-gradient(90deg, var(--ink), color-mix(in srgb, var(--accent) 80%, var(--ink))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--ink-2); max-width: 680px; margin: 12px 0 20px; font-size: 17px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search {
  flex: 1 1 220px; max-width: 360px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; outline: none;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid transparent; font-weight: 700; font-size: 15px; transition: transform .12s, filter .12s, background .12s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: color-mix(in srgb, var(--surface-2) 80%, var(--ink)); }
.btn-lg { height: 52px; padding: 0 26px; font-size: 17px; }
.btn.danger { color: var(--bad); margin-top: 18px; }

.sec { margin-top: 30px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head h2 { font-size: 22px; font-weight: 800; }
.sec-head p { margin: 0; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-art { width: 78px; height: 78px; flex: none; border-radius: 16px; overflow: hidden; background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.card-art svg { width: 100%; height: 100%; display: block; }
.card-body { min-width: 0; }
.card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-title b { font-size: 17px; }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 15%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--ink)); font-weight: 600; }
.card-tag { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-best { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.card-best .ico { width: 15px; height: 15px; }
.empty { padding: 30px 0; text-align: center; }

.site-foot { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; font-size: 14px; color: var(--ink-2); }
.site-foot nav a:hover { color: var(--accent); }

/* ---------- 游戏页 ---------- */
body.in-game { overflow-x: hidden; }
.play { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.g-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); }
.g-btn {
  width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px;
  background: var(--surface-2); color: var(--ink);
}
.g-btn:disabled { opacity: .4; cursor: default; }
.g-btn .ico { width: 20px; height: 20px; }
.g-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
.g-title b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
.g-score { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 2px 10px; border-radius: 10px; background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); line-height: 1.15; }
.g-score span { font-size: 11px; color: var(--muted); font-weight: 600; }
.g-score b { font-size: 17px; font-variant-numeric: tabular-nums; }
.g-score.best { background: var(--surface-2); }
.stage-wrap { position: relative; flex: 1; min-height: 0; background: var(--stage); }
.stage { position: absolute; inset: 10px; display: flex; align-items: center; justify-content: center; }
.game-canvas { display: block; border-radius: 14px; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(8, 10, 16, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 5; }
.panel { width: min(380px, 100%); background: var(--surface); border-radius: 22px; padding: 26px 24px 22px; text-align: center; box-shadow: var(--shadow-lg); animation: pop .22s ease-out; }
.panel h2 { font-size: 24px; font-weight: 900; }
.panel-body p { margin: 10px 0 0; }
.panel-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.final { margin-top: 12px; display: flex; flex-direction: column; align-items: center; }
.final span { color: var(--muted); font-size: 14px; }
.final b { font-size: 52px; line-height: 1.1; font-weight: 900; color: var(--c); font-variant-numeric: tabular-nums; }
.final small { color: var(--muted); }
.record { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-weight: 800; color: #b7791f; background: #fff3d6; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

.below { padding-top: 10px; }
.about-game { margin-top: 18px; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.about-game h2 { font-size: 20px; }
.about-game ul { padding-left: 20px; margin: 10px 0; color: var(--ink-2); }
.about-game li { margin: 4px 0; }

/* ---------- 战绩 ---------- */
.page-title { font-size: 30px; font-weight: 900; padding: 30px 0 16px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpis div { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kpis b { font-size: 28px; font-weight: 900; }
.kpis span { color: var(--muted); font-size: 13px; }
.stat-list { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.stat-row { display: grid; grid-template-columns: 44px 1.4fr 1.4fr .8fr .8fr; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.stat-art { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; }
.stat-art svg { width: 100%; height: 100%; display: block; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(8, 10, 16, .5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { position: relative; width: min(520px, 100%); max-height: 86vh; overflow: auto; background: var(--surface); border-radius: 22px; padding: 26px 24px; box-shadow: var(--shadow-lg); animation: pop .2s ease-out; }
.modal-x { position: absolute; right: 12px; top: 10px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; font-size: 24px; color: var(--muted); }
.rules h2 { font-size: 22px; margin-bottom: 8px; }
.rules ul { padding-left: 20px; color: var(--ink-2); }
.rules li { margin: 6px 0; }
#toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 静态页（构建生成的落地页 / 无 JS 目录） ---------- */
.seo-static, .doc { max-width: 860px; margin: 0 auto; padding: 24px 20px 40px; }
.doc h1 { font-size: clamp(26px, 4.5vw, 38px); font-weight: 900; margin: 18px 0 10px; }
.doc h2 { font-size: 21px; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--ink-2); }
.doc .lead { font-size: 17px; }
.doc ul { padding-left: 22px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.land-hero { display: flex; gap: 22px; align-items: center; margin-top: 10px; }
.land-hero .card-art { width: 120px; height: 120px; border-radius: 26px; }
.land-cta { margin: 18px 0 6px; }
.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--ink-2); }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.mini-grid a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.mini-grid .card-art { width: 46px; height: 46px; border-radius: 12px; }

@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .page { padding: 0 16px 32px; }
  .hero { padding-top: 26px; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .card-art { width: 64px; height: 64px; }
  .g-bar { gap: 6px; padding: 6px 8px; }
  .g-btn { width: 36px; height: 36px; }
  .g-score { min-width: 50px; padding: 2px 6px; }
  .g-score b { font-size: 15px; }
  .stage { inset: 6px; }
  .stat-row { grid-template-columns: 40px 1fr 1fr .6fr; }
  .kpis b { font-size: 22px; }
  .land-hero { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
