:root {
  --bg: #0a0e17;
  --bg-alt: #0d1322;
  --panel: #111a2c;
  --panel-2: #141d33;
  --line: #22304d;
  --text: #e5e9f0;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --violet: #a855f7;
  --green: #34d399;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #22d3ee, #a855f7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { width: min(1140px, 92%); margin: 0 auto; }
.container.narrow { width: min(820px, 92%); }

section { scroll-margin-top: 84px; }
.section { padding: 84px 0; }
.section.alt { background: var(--bg-alt); }

/* ===== header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.logo-badge {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 1.1rem;
  box-shadow: 0 4px 18px rgba(34, 211, 238, 0.35);
}
.logo-badge.sm { width: 34px; height: 34px; font-size: 0.95rem; border-radius: 9px; }
.logo-text em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.main-nav { display: flex; gap: 22px; margin-left: auto; }
.main-nav a { color: var(--muted); font-size: 0.95rem; transition: color 0.2s; }
.main-nav a:hover { color: #fff; }
.nav-cta { padding: 0.5rem 1.1rem; font-size: 0.9rem; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; margin-left: auto; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: 0.3s; }

/* ===== buttons ===== */
.btn {
  display: inline-block; padding: 0.72rem 1.5rem; border-radius: 10px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer; text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn-sm { padding: 0.42rem 1rem; font-size: 0.85rem; }
.btn-primary {
  background: var(--grad); color: #06121f; border: 0;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(168, 85, 247, 0.35); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-ghost.active { border-color: var(--amber); color: var(--amber); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== hero ===== */
.hero {
  position: relative; padding: 90px 0 70px;
  background-image: radial-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 30px 30px;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(500px 320px at 18% 25%, rgba(34, 211, 238, 0.14), transparent 70%),
    radial-gradient(520px 340px at 82% 30%, rgba(168, 85, 247, 0.14), transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-badge {
  display: inline-block; padding: 0.3rem 0.9rem; border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.4); color: var(--cyan);
  font-size: 0.85rem; margin-bottom: 18px; background: rgba(34, 211, 238, 0.07);
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.3rem); line-height: 1.22; margin-bottom: 18px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--muted); font-size: 1.05rem; margin-bottom: 28px; }
.hero-chips { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-chips span {
  padding: 0.32rem 0.9rem; border-radius: 999px; font-size: 0.85rem;
  color: var(--muted); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02);
}
.hero-visual { position: relative; display: grid; place-items: center; min-height: 320px; }
.orb {
  width: min(300px, 70%); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgba(34, 211, 238, 0.32), transparent 55%),
    radial-gradient(circle at 70% 68%, rgba(168, 85, 247, 0.32), transparent 55%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(34, 211, 238, 0.28);
  display: grid; place-items: center;
  box-shadow: 0 0 90px rgba(34, 211, 238, 0.22), inset 0 0 60px rgba(168, 85, 247, 0.14);
}
.pad { width: 62%; }
.float-chip {
  position: absolute; padding: 0.45rem 1rem; border-radius: 12px; font-size: 0.88rem;
  background: rgba(17, 26, 44, 0.9); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px);
  animation: floaty 4.5s ease-in-out infinite;
}
.chip-a { top: 8%; left: 4%; border-color: rgba(34, 211, 238, 0.45); }
.chip-b { bottom: 14%; right: 2%; border-color: rgba(168, 85, 247, 0.45); animation-delay: 1.2s; }
.chip-c { top: 46%; right: 10%; animation-delay: 2.2s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ===== notice bar ===== */
.notice-bar {
  background: rgba(251, 191, 36, 0.07);
  border-top: 1px solid rgba(251, 191, 36, 0.2);
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
  overflow: hidden; white-space: nowrap;
}
.notice-track { display: inline-flex; gap: 56px; padding: 10px 0; animation: marquee 24s linear infinite; }
.notice-track span { color: var(--amber); font-size: 0.9rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== section head ===== */
.section-head { text-align: center; margin-bottom: 44px; }
.kicker {
  display: inline-block; font-size: 0.78rem; letter-spacing: 0.28em;
  text-transform: uppercase; margin-bottom: 10px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 700;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 10px; }
.section-head p { color: var(--muted); max-width: 560px; margin: 0 auto; }

/* ===== tabs ===== */
.tabs { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }
.tab-btn {
  padding: 0.55rem 1.4rem; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02); color: var(--muted);
  font-size: 0.95rem; cursor: pointer; transition: 0.2s;
}
.tab-btn:hover { color: #fff; border-color: var(--cyan); }
.tab-btn.active { background: var(--grad); color: #06121f; border-color: transparent; font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== cards ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-4px); border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.12);
}
.card-grid.wide { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card-top { display: flex; align-items: center; gap: 10px; }
.chip-icon {
  width: 36px; height: 36px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.95rem;
}
.gi-2048 { background: linear-gradient(135deg, #22d3ee, #2563eb); }
.gi-snake { background: linear-gradient(135deg, #34d399, #0ea5e9); }
.gi-brick { background: linear-gradient(135deg, #a855f7, #6366f1); }
.gi-mem { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.gi-mine { background: linear-gradient(135deg, #ef4444, #a855f7); }
.gi-gomoku { background: linear-gradient(135deg, #94a3b8, #475569); }
.card-name { font-weight: 600; font-size: 0.98rem; }
.tag {
  margin-left: auto; font-size: 0.75rem; padding: 0.14rem 0.55rem; border-radius: 999px;
  color: var(--green); border: 1px solid rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08);
  flex: none;
}
.desc { color: var(--muted); font-size: 0.88rem; flex: 1; }
.btn-card {
  border: 1px solid rgba(34, 211, 238, 0.45); color: var(--cyan); background: transparent;
  padding: 0.5rem 1rem; font-size: 0.9rem; border-radius: 9px; text-align: center;
  transition: 0.2s; cursor: pointer; font-weight: 600;
}
.btn-card:hover { background: var(--grad); color: #06121f; border-color: transparent; }
.note { color: var(--muted); font-size: 0.85rem; margin-top: 18px; text-align: center; }

/* ===== flow ===== */
.flow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 22px; transition: transform 0.25s, border-color 0.25s;
}
.step:hover { transform: translateY(-4px); border-color: rgba(168, 85, 247, 0.5); }
.step-num { font-size: 2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.step h3 { margin: 8px 0 6px; font-size: 1.08rem; }
.step p { color: var(--muted); font-size: 0.9rem; }

/* ===== why ===== */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.why-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px 22px; text-align: center; transition: transform 0.25s, border-color 0.25s;
}
.why-card:hover { transform: translateY(-4px); border-color: rgba(34, 211, 238, 0.5); }
.why-card .chip-icon { margin: 0 auto 14px; width: 46px; height: 46px; font-size: 1.15rem; border-radius: 12px; }
.why-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.why-card p { color: var(--muted); font-size: 0.88rem; }

/* ===== faq ===== */
.faq-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 12px; overflow: hidden;
}
.faq-item summary {
  list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600;
  position: relative; padding-right: 48px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  color: var(--cyan); font-size: 1.3rem; transition: transform 0.25s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { padding: 0 20px 18px; color: var(--muted); font-size: 0.93rem; }

/* ===== contact ===== */
.contact-panel {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 30px;
  border-radius: 18px; padding: 2px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.5), rgba(168, 85, 247, 0.5));
}
.contact-main { background: var(--panel); border-radius: 16px 0 0 16px; padding: 40px 36px; }
.contact-main h2 { margin: 6px 0 12px; font-size: 1.7rem; }
.contact-main p { color: var(--muted); margin-bottom: 20px; }
.email-line { font-size: 1.02rem; margin-bottom: 24px; color: var(--muted); }
.email-line strong { color: var(--cyan); font-size: 1.18rem; font-family: Consolas, Menlo, monospace; }
.contact-tips { background: var(--panel-2); border-radius: 0 16px 16px 0; padding: 40px 32px; }
.contact-tips h3 { margin-bottom: 14px; font-size: 1.05rem; }
.contact-tips li {
  color: var(--muted); font-size: 0.9rem; padding: 7px 0 7px 20px; position: relative;
}
.contact-tips li::before {
  content: ""; position: absolute; left: 0; top: 15px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--grad);
}

/* ===== footer ===== */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 50px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; padding-bottom: 34px; }
.footer-logo { margin-bottom: 12px; }
.footer-desc { color: var(--muted); font-size: 0.9rem; max-width: 320px; }
.site-footer h4 { margin-bottom: 12px; font-size: 0.98rem; }
.site-footer .footer-grid a { display: block; color: var(--muted); font-size: 0.9rem; padding: 4px 0; }
.site-footer .footer-grid a:hover { color: var(--cyan); }
.site-footer .footer-grid p { color: var(--muted); font-size: 0.9rem; padding: 4px 0; }
.copyright {
  border-top: 1px solid var(--line); text-align: center; padding: 18px 0;
  color: #64748b; font-size: 0.82rem;
}

/* ===== reveal animation ===== */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== 游戏弹窗 ===== */
.game-modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(4, 8, 16, 0.82); backdrop-filter: blur(8px);
  padding: 16px;
}
.game-modal.show { display: flex; }
.game-panel {
  width: min(560px, 100%); max-height: 94vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.game-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.game-title-wrap { display: flex; align-items: center; gap: 12px; }
.game-title-wrap h3 { font-size: 1.15rem; line-height: 1.3; }
.game-title-wrap p { color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.game-actions { display: flex; gap: 8px; flex: none; }
.game-status { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 14px 0; }
.stat-chip {
  padding: 0.3rem 0.95rem; border-radius: 999px; background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line); font-size: 0.88rem; color: var(--muted);
}
.stat-chip strong { color: var(--cyan); font-weight: 700; }
.stat-chip.win { border-color: rgba(52, 211, 153, 0.5); color: var(--green); }
.stat-chip.warn { border-color: rgba(251, 191, 36, 0.5); color: var(--amber); }
.game-body { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* 画布通用 */
.gcanvas-wrap { position: relative; width: fit-content; margin: 0 auto; }
.gcanvas { display: block; border-radius: 12px; background: #0d1524; touch-action: none; }
.gmsg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: rgba(6, 10, 20, 0.72); border-radius: 12px;
  font-weight: 800; font-size: 1.3rem; color: #fff; line-height: 1.6; padding: 10px;
}
.gmsg small { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); }

/* ===== 2048 ===== */
.g2048-board {
  position: relative; width: min(88vw, 380px); aspect-ratio: 1;
  background: #0d1524; border: 1px solid var(--line); border-radius: 14px;
  touch-action: none; user-select: none;
}
.g2048-tile {
  position: absolute; display: grid; place-items: center;
  border-radius: 10px; font-weight: 800; font-family: "Segoe UI", "PingFang SC", sans-serif;
}
.g2048-tile.new { animation: tile-in 0.18s ease; }
.g2048-tile.merged { animation: tile-pop 0.22s ease; }
@keyframes tile-in { from { transform: scale(0.4); opacity: 0; } }
@keyframes tile-pop { 50% { transform: scale(1.12); } }
.g2048-tile[data-v="2"] { background: #243447; color: #cbd5e1; }
.g2048-tile[data-v="4"] { background: #2b4060; color: #e2e8f0; }
.g2048-tile[data-v="8"] { background: #0e7490; color: #fff; }
.g2048-tile[data-v="16"] { background: #0891b2; color: #fff; }
.g2048-tile[data-v="32"] { background: #7c3aed; color: #fff; }
.g2048-tile[data-v="64"] { background: #9333ea; color: #fff; }
.g2048-tile[data-v="128"] { background: #a855f7; color: #fff; box-shadow: 0 0 18px rgba(168, 85, 247, 0.45); }
.g2048-tile[data-v="256"] { background: #d946ef; color: #fff; box-shadow: 0 0 18px rgba(217, 70, 239, 0.45); }
.g2048-tile[data-v="512"] { background: #ec4899; color: #fff; box-shadow: 0 0 20px rgba(236, 72, 153, 0.5); }
.g2048-tile[data-v="1024"] { background: #f59e0b; color: #1a1206; box-shadow: 0 0 22px rgba(245, 158, 11, 0.55); }
.g2048-tile[data-v="2048"] { background: #fbbf24; color: #1a1206; box-shadow: 0 0 30px rgba(251, 191, 36, 0.7); }
.g2048-tile.super { background: linear-gradient(135deg, #fbbf24, #ef4444); color: #1a1206; box-shadow: 0 0 30px rgba(239, 68, 68, 0.6); }

/* ===== 贪吃蛇方向键 ===== */
.dpad { display: grid; grid-template-columns: repeat(3, 58px); gap: 8px; justify-content: center; margin-top: 12px; }
.dpad button {
  height: 46px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03); color: var(--text); font-size: 1.1rem; cursor: pointer;
  transition: 0.15s; touch-action: manipulation;
}
.dpad button:hover { border-color: var(--cyan); color: var(--cyan); }
.dpad button:active { background: var(--grad); color: #06121f; }

/* ===== 记忆翻牌 ===== */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(88vw, 380px); }
.mem-card {
  aspect-ratio: 1; position: relative; cursor: pointer;
  transform-style: preserve-3d; transition: transform 0.35s;
}
.mem-card.flipped { transform: rotateY(180deg); }
.mem-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line);
}
.mem-back {
  background: linear-gradient(135deg, #16233c, #1b2c4e);
  color: rgba(148, 163, 184, 0.5); font-size: 1.5rem; font-weight: 800;
}
.mem-card:not(.flipped):hover .mem-back { border-color: rgba(34, 211, 238, 0.5); }
.mem-front {
  background: #1c2a47; transform: rotateY(180deg); font-size: 1.75rem;
}
.mem-card.done .mem-front { border-color: rgba(52, 211, 153, 0.55); background: #12301f; }

/* ===== 扫雷 ===== */
.mine-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; width: min(88vw, 380px); }
.mine-cell {
  aspect-ratio: 1; border-radius: 7px; border: 1px solid #263654;
  background: #1a2740; cursor: pointer; display: grid; place-items: center;
  font-weight: 700; font-size: 0.92rem; padding: 0; line-height: 1;
  color: var(--text); transition: background 0.12s;
}
.mine-cell:not(.open):hover { background: #22335a; }
.mine-cell.open { background: #0e1626; border-color: #17233c; cursor: default; }
.mine-cell.flag { background: #3b2a12; border-color: rgba(251, 191, 36, 0.45); }
.mine-cell.boom { background: #7f1d1d; border-color: #b91c1c; }
.mine-cell.n1 { color: #67e8f9; } .mine-cell.n2 { color: #86efac; }
.mine-cell.n3 { color: #fcd34d; } .mine-cell.n4 { color: #f0abfc; }
.mine-cell.n5 { color: #f87171; } .mine-cell.n6 { color: #5eead4; }
.mine-cell.n7 { color: #e2e8f0; } .mine-cell.n8 { color: #94a3b8; }
.mine-toolbar { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }

/* ===== 五子棋 / 通用提示 ===== */
.gomoku-canvas { cursor: pointer; }
.gtip { color: var(--muted); font-size: 0.83rem; text-align: center; margin-top: 8px; }

/* ===== responsive ===== */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 240px; }
  .flow-grid, .why-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-panel { grid-template-columns: 1fr; }
  .contact-main { border-radius: 16px 16px 0 0; }
  .contact-tips { border-radius: 0 0 16px 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .main-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 0; padding: 8px 0;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 13px 6%; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .flow-grid, .why-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .hero { padding: 60px 0 50px; }
  .game-head { flex-direction: column; }
  .game-actions { align-self: flex-end; }
}
