:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel2: #1c232c;
  --line: #2a323d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #22c55e;
  --accent2: #38bdf8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 首页 ---------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 48px 20px 64px; }
.hero h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: .5px; }
.hero p { color: var(--muted); margin: 0 0 28px; line-height: 1.7; }
.badge {
  display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: rgba(34,197,94,.14); color: var(--accent); border: 1px solid rgba(34,197,94,.3);
  margin-right: 6px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; display: block; color: var(--text); transition: .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card .ico { font-size: 26px; margin-bottom: 8px; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.card .tag { font-size: 11px; color: var(--accent); margin-top: 10px; display: block; }
.foot { margin-top: 40px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- 通用全屏游戏 ---------- */
.game-shell { position: fixed; inset: 0; overflow: hidden; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.hud {
  position: fixed; top: 14px; left: 14px; z-index: 5;
  background: rgba(22,27,34,.82); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; min-width: 168px;
  backdrop-filter: blur(6px);
}
.hud .big { font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.hud .row { color: var(--muted); margin-top: 4px; }
.hud .lb { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 12px; }
.hud .lb div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.hud .lb div:first-child { color: var(--text); }

.overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(8,10,14,.82); backdrop-filter: blur(3px);
}
.overlay.hidden { display: none; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px 30px; width: 340px; max-width: 90vw; text-align: center;
}
.panel h2 { margin: 0 0 6px; font-size: 22px; }
.panel .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; line-height: 1.6; }
.panel input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 14px; margin-bottom: 12px; outline: none;
}
.panel input:focus { border-color: var(--accent); }
.panel button {
  width: 100%; padding: 11px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--accent); color: #06210f; font-size: 15px; font-weight: 700;
}
.panel button:hover { filter: brightness(1.08); }
.panel button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); margin-top: 8px; font-weight: 500; }
.colors { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.swatch.on { border-color: #fff; transform: scale(1.12); }
.stat { display: flex; justify-content: space-around; margin: 14px 0 18px; }
.stat div { font-size: 12px; color: var(--muted); }
.stat b { display: block; font-size: 24px; color: var(--text); }
.tips { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.7; text-align: left; }
kbd {
  background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 6px; font-size: 11px; font-family: inherit;
}
