:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #f97316;
  --accent-soft: #fff7ed;
  --primary-soft: #eff6ff;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -6px rgba(15, 23, 42, 0.04);
  --radius: 16px;
}

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

html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 顶部导航栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: #f1f5f9;
  color: var(--text);
}

.nav-link.active {
  background: var(--primary);
  color: #ffffff;
}

/* 页面主视觉区 */
.hero {
  padding: 36px 0 24px;
}

.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 640px;
}

/* 分类与游戏卡片区 */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 12px 0 16px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.section-count {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-bottom: 48px;
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.game-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bg);
  font-size: 1.75rem;
  flex-shrink: 0;
}

.game-category-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.game-category-pill.puzzle {
  background: var(--accent-soft);
  color: #ea580c;
}

.game-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.game-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  flex: 1;
}

.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.game-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.game-tag {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
}

.best-score {
  font-weight: 600;
  color: var(--accent);
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.play-btn:hover {
  background: var(--primary-hover);
}

/* 游戏内页通用顶部栏 */
.game-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.game-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--bg);
  transition: color 0.15s ease, background 0.15s ease;
}

.back-link:hover {
  color: var(--text);
  background: #e2e8f0;
}

.game-topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.game-topbar-cat {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* 响应式适配 */
@media (max-width: 900px) {
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 20px 0 16px;
  }

  .hero-card {
    padding: 20px;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 0.86rem;
  }
}
