/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --bg-card-hover: #222940;
  --bg-overlay: rgba(0, 0, 0, 0.85);
  --text-primary: #e8eaed;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --brand-gold: #ffd76b;
  --brand-gold-glow: rgba(255, 215, 107, 0.3);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: #2d3548;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: 0.2s ease;
  --nav-height: 64px;
  --sidebar-width: 240px;
  --max-width: 1400px;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans SC", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}
input {
  font: inherit;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.loading-overlay .loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay .loading-text {
  font-size: 16px;
  color: var(--text-secondary);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  white-space: nowrap;
}

.logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.55))
    drop-shadow(0 0 4px rgba(255, 215, 107, 0.25));
}
.logo-text {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.logo-text strong {
  color: var(--brand-gold);
  text-shadow: 0 0 14px var(--brand-gold-glow);
}

.nav-search {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.nav-search input {
  width: 100%;
  padding: 8px 44px 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.nav-search input:focus {
  border-color: var(--accent);
}

.nav-search input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  transition: background var(--transition);
}

.search-btn:hover {
  background: var(--bg-card);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 360px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow);
  z-index: 100;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
}

.search-result-item:hover {
  background: var(--bg-card-hover);
}

.search-result-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
  flex-shrink: 0;
}

.search-result-info h4 {
  font-size: 14px;
  margin-bottom: 2px;
}

.search-result-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.nav-link.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-sidebar-btn {
  display: none;
  padding: 8px;
  font-size: 20px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.nav-sidebar-btn:hover {
  background: var(--bg-card);
}

.nav-menu-btn {
  display: none;
  padding: 8px;
  font-size: 24px;
  color: var(--text-primary);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.mobile-menu.active {
  display: flex;
}

.mobile-link {
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.mobile-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--nav-height));
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 900;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  padding: 16px 0;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  top: var(--nav-height);
  background: rgba(0, 0, 0, 0.5);
  z-index: 899;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
}

.sidebar-close {
  font-size: 18px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.sidebar-close:hover {
  background: var(--bg-card);
}

.sidebar-category {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-category:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.sidebar-category.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  border-right: 3px solid var(--accent);
}
.sidebar-category .cat-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--cat-color, #6366f1) 40%, rgba(255, 255, 255, 0.1)) 0%,
    color-mix(in srgb, var(--cat-color, #6366f1) 14%, rgba(255, 255, 255, 0.04)) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 2px 8px color-mix(in srgb, var(--cat-color, #6366f1) 25%, transparent);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.sidebar-category:hover .cat-icon {
  transform: scale(1.1) rotate(-3deg);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 4px 12px color-mix(in srgb, var(--cat-color, #6366f1) 40%, transparent);
}
.sidebar-category .cat-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-section {
  padding: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.sidebar-section h3 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sidebar-recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.sidebar-recent-item:hover {
  color: var(--text-primary);
}

.empty-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Main Content ===== */
.main-content {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height) - 120px);
  padding: 24px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  transition: margin-left 0.3s ease;
}

.main-content.sidebar-open {
  margin-left: var(--sidebar-width);
}

/* ===== Hero Banner ===== */
.hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
  background: linear-gradient(135deg, #1a1f2e 0%, #0f172a 50%, #1e1b4b 100%);
  padding: 48px;
  min-height: 280px;
  display: flex;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 80% 20%,
    var(--accent-glow),
    transparent 50%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 215, 107, 0.12);
  color: var(--brand-gold);
  border: 1px solid rgba(255, 215, 107, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(
    100deg,
    #fff 0%,
    var(--brand-gold) 55%,
    var(--accent-hover) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 26px;
}

.hero-stat {
  text-align: center;
}
.hero-stat .num {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-hover);
}
.hero-stat .label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Hero 动态光斑 */
.hero-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: orbFloat 12s ease-in-out infinite alternate;
}
.hero-orbs span:nth-child(1) {
  width: 300px;
  height: 300px;
  background: rgba(99, 102, 241, 0.45);
  top: -80px;
  left: -60px;
}
.hero-orbs span:nth-child(2) {
  width: 220px;
  height: 220px;
  background: rgba(255, 215, 107, 0.22);
  bottom: -90px;
  left: 32%;
  animation-delay: -4s;
}
.hero-orbs span:nth-child(3) {
  width: 260px;
  height: 260px;
  background: rgba(139, 92, 246, 0.32);
  top: -60px;
  right: 8%;
  animation-delay: -8s;
}
@keyframes orbFloat {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(34px, 22px) scale(1.15);
  }
}

/* Hero CTA */
.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 26px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition), color var(--transition);
}
.hero-btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}
.hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.55);
}
.hero-btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}
.hero-btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Hero 封面拼贴墙 */
.hero-collage {
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%) rotate(-4deg);
  display: grid;
  grid-template-columns: repeat(3, 108px);
  gap: 12px;
  z-index: 0;
}
.collage-item {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: floatY 5.5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.collage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ===== Section ===== */
.section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding-left: 14px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-hover), var(--brand-gold));
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ===== 首页：贴屏幕左边缘极细条分类抽屉 + 右侧游戏区 ===== */
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

/* 左缘抽屉容器（fixed 脱离布局流） */
.home-cats {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: max-content;
  z-index: 950;
}

/* 贴边缘极细条把手（收起态） */
.home-cats-rail {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 44px;
  padding: 13px 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 14px 14px 0;
  cursor: pointer;
  box-shadow: 4px 6px 18px rgba(0, 0, 0, 0.35);
  transition: border-color var(--transition), transform var(--transition),
    box-shadow var(--transition);
}
.home-cats-rail:hover {
  border-color: var(--accent, #6366f1);
  transform: translateX(2px);
  box-shadow: 4px 8px 24px rgba(0, 0, 0, 0.45), 6px 0 18px rgba(99, 102, 241, 0.2);
}
.home-cats-rail:hover .rail-logo {
  transform: scale(1.12) rotate(-4deg);
}
.home-cats-rail:hover .rail-text {
  color: var(--text-primary);
}
.rail-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.45);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rail-text {
  writing-mode: vertical-rl;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.home-layout.cats-collapsed .home-cats-rail {
  display: flex;
}

/* 滑出浮层面板（展开态，贴左边缘） */
.home-cats-inner {
  width: 248px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 16px 16px 0;
  padding: 12px 10px;
  box-shadow: 12px 12px 36px rgba(0, 0, 0, 0.45);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease,
    visibility 0.3s;
}
.home-layout.cats-collapsed .home-cats-inner {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
  visibility: hidden;
}

/* 遮罩层 */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 17, 0.5);
  z-index: 940;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-mask.active {
  opacity: 1;
  pointer-events: auto;
}

.home-cats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 8px 10px;
  margin-bottom: 8px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  color: var(--text-primary);
  transition: background var(--transition);
}
.home-cats-header:hover {
  background: none;
}
.home-cats-header:hover .home-cats-arrow {
  background: var(--accent, #6366f1);
  color: #fff;
  transform: translateX(-2px);
}
.home-cats-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.home-cats-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  transition: background var(--transition), color var(--transition),
    transform var(--transition);
}
.home-cats-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* 分类列表项：玻璃小图标 + 名称 + 数量徽章 */
.home-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition),
    transform var(--transition);
}
.home-cat-item:hover {
  background: color-mix(in srgb, var(--cat-color, #6366f1) 12%, transparent);
  border-color: color-mix(in srgb, var(--cat-color, #6366f1) 30%, transparent);
  transform: translateX(3px);
}
.home-cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  font-size: 15px;
  border-radius: 9px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--cat-color, #6366f1) 40%, rgba(255, 255, 255, 0.1)) 0%,
    color-mix(in srgb, var(--cat-color, #6366f1) 14%, rgba(255, 255, 255, 0.04)) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 2px 8px color-mix(in srgb, var(--cat-color, #6366f1) 25%, transparent);
}
.home-cat-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-cat-count {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
  .home-cats {
    display: none;
  }
}

/* ===== 精选区：本周主打大卡 ===== */
.featured-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 8px;
}

.featured-hero-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 320px;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.featured-hero-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--cat-color, #6366f1) 55%, var(--border));
  box-shadow: 0 12px 40px color-mix(in srgb, var(--cat-color, #6366f1) 30%, transparent);
}

.fhc-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fhc-img.loaded {
  opacity: 1;
}

.featured-hero-card:hover .fhc-img {
  transform: scale(1.06);
}

.fhc-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
  padding: 22px;
  background: linear-gradient(180deg, transparent 30%, rgba(5, 8, 17, 0.85) 100%);
}

.fhc-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #1a1205;
  background: linear-gradient(135deg, #ffd76b, #f59e0b);
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.fhc-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.fhc-desc {
  font-size: 13px;
  color: rgba(232, 234, 237, 0.85);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fhc-play {
  margin-top: 4px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 24px;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fhc-play:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.featured-side {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  align-content: start;
}

@media (max-width: 1024px) {
  .featured-layout {
    grid-template-columns: 1fr;
  }
  .featured-hero-card {
    min-height: 240px;
  }
}

/* ===== 角标（HOT / NEW）===== */
.corner-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 3px 9px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.corner-badge.hot {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.corner-badge.new {
  background: linear-gradient(135deg, #10b981, #6366f1);
}

/* ===== 封面渐显 + shimmer 骨架 ===== */
.card-thumb-img {
  opacity: 0;
}

.card-thumb-img.loaded {
  opacity: 1;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.game-card-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.08) 55%,
    transparent 80%
  );
  animation: shimmer 1.6s ease-in-out infinite;
}

.game-card:has(.card-thumb-img.loaded) .game-card-thumb::before {
  animation: none;
  opacity: 0;
}

/* ===== 分类页横幅 ===== */
.cat-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 32px;
  margin-bottom: 20px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--cat-color, #6366f1) 35%, transparent), transparent 60%),
    linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
  border: 1px solid color-mix(in srgb, var(--cat-color, #6366f1) 30%, var(--border));
}

.cat-banner-icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--cat-color, #6366f1) 45%, rgba(255, 255, 255, 0.08)) 0%,
    color-mix(in srgb, var(--cat-color, #6366f1) 18%, rgba(255, 255, 255, 0.03)) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 4px 16px color-mix(in srgb, var(--cat-color, #6366f1) 35%, transparent);
}

.cat-banner-info {
  flex: 1;
  min-width: 0;
}

.cat-banner-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cat-banner-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
}

.cat-banner-count {
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cat-color, #6366f1);
  background: color-mix(in srgb, var(--cat-color, #6366f1) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-color, #6366f1) 40%, transparent);
}

.cat-banner-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

@media (max-width: 640px) {
  .cat-banner {
    padding: 20px;
    gap: 14px;
  }
  .cat-banner-icon {
    width: 52px;
    height: 52px;
    font-size: 26px;
  }
  .cat-banner-title {
    font-size: 20px;
  }
}

/* ===== 相关推荐横滑区 ===== */
.related-section {
  margin-bottom: 8px;
}

.related-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.related-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.related-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 4px 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.related-scroll::-webkit-scrollbar {
  height: 6px;
}

.related-card {
  flex: 0 0 180px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.related-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.related-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.related-card-thumb .card-icon {
  position: relative;
  z-index: 1;
}

.related-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.45s ease;
}

.related-card-img.loaded {
  opacity: 1;
}

.related-card:hover .related-card-img {
  transform: scale(1.06);
}

.related-card-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.related-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .related-card {
    flex-basis: 150px;
  }
}

.section-more {
  font-size: 14px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}

.section-more:hover {
  color: var(--accent-hover);
}

/* ===== Game Card ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.game-card-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}

.game-card-thumb .card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.15;
}

.game-card-thumb .card-icon {
  position: relative;
  z-index: 1;
}

.game-card-thumb .card-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  border-radius: inherit;
  transition: transform 0.45s ease, opacity 0.4s ease;
}

.game-card:hover .card-thumb-img {
  transform: scale(1.08);
}

/* hover 高光扫过 */
.game-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 60%
  );
  transform: translateX(-130%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.game-card:hover .game-card-thumb::after {
  transform: translateX(130%);
}

/* 卡片入场动画 */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.games-grid .game-card {
  animation: fadeUp 0.45s ease backwards;
}
.games-grid .game-card:nth-child(2) { animation-delay: 0.05s; }
.games-grid .game-card:nth-child(3) { animation-delay: 0.1s; }
.games-grid .game-card:nth-child(4) { animation-delay: 0.15s; }
.games-grid .game-card:nth-child(5) { animation-delay: 0.2s; }
.games-grid .game-card:nth-child(6) { animation-delay: 0.25s; }
.games-grid .game-card:nth-child(7) { animation-delay: 0.3s; }
.games-grid .game-card:nth-child(8) { animation-delay: 0.35s; }

.search-result-thumb .search-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.game-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--transition);
}

.game-card:hover .game-card-play {
  opacity: 1;
}

.play-circle {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-mobile {
  background: var(--success);
  color: #fff;
}
.badge-multi {
  background: var(--danger);
  color: #fff;
}
.badge-new {
  background: var(--warning);
  color: #000;
}
.badge-external {
  background: #3b82f6;
  color: #fff;
}

.game-card-info {
  padding: 12px 14px;
}

.game-card-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.game-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.game-card-rating {
  color: var(--warning);
}
.game-card-cat {
  color: var(--accent);
}

/* ===== Categories Grid ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px 16px;
  background: var(--bg-card);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  isolation: isolate;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--cat-color, #6366f1) 25%, transparent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
  pointer-events: none;
}

.category-card:hover {
  border-color: var(--cat-color, #6366f1);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px color-mix(in srgb, var(--cat-color, #6366f1) 15%, transparent);
}

.category-card:hover::before {
  opacity: 1;
}

.category-card:active {
  transform: translateY(-1px);
}

.category-card.active {
  border-color: var(--cat-color, #6366f1);
  background: color-mix(in srgb, var(--cat-color, #6366f1) 12%, var(--bg-card));
}

/* 图标容器 —— 彩色玻璃拟态 */
.cat-card-icon-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--cat-color, #6366f1) 42%, rgba(255, 255, 255, 0.1)) 0%,
    color-mix(in srgb, var(--cat-color, #6366f1) 20%, rgba(255, 255, 255, 0.05)) 55%,
    color-mix(in srgb, var(--cat-color, #6366f1) 12%, rgba(255, 255, 255, 0.03)) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -2px 5px rgba(0, 0, 0, 0.18),
    0 6px 18px color-mix(in srgb, var(--cat-color, #6366f1) 30%, transparent);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.3s ease,
    border-color 0.3s ease;
  z-index: 1;
}

/* 玻璃后的彩色光斑 */
.cat-card-icon-wrap::before {
  content: "";
  position: absolute;
  inset: -35%;
  background:
    radial-gradient(circle at 25% 25%, color-mix(in srgb, var(--cat-color, #6366f1) 80%, transparent) 0%, transparent 55%),
    radial-gradient(circle at 78% 80%, color-mix(in srgb, var(--cat-color, #6366f1) 50%, rgba(255, 255, 255, 0.3)) 0%, transparent 50%);
  filter: blur(9px);
  opacity: 0.8;
  z-index: -1;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

/* 玻璃顶部斜向高光 */
.cat-card-icon-wrap::after {
  content: "";
  position: absolute;
  top: -55%;
  left: -30%;
  width: 160%;
  height: 130%;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.08) 45%,
    transparent 62%
  );
  border-radius: inherit;
  pointer-events: none;
}

.category-card:hover .cat-card-icon-wrap {
  transform: scale(1.06) translateY(-2px);
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    inset 0 -2px 5px rgba(0, 0, 0, 0.12),
    0 10px 28px color-mix(in srgb, var(--cat-color, #6366f1) 48%, transparent);
}

.category-card:hover .cat-card-icon-wrap::before {
  transform: scale(1.15) rotate(8deg);
  opacity: 1;
}

.cat-card-emoji {
  position: relative;
  z-index: 1;
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-card:hover .cat-card-emoji {
  transform: scale(1.12) rotate(-4deg);
}

.cat-card-name {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
  transition: color 0.2s;
}

.category-card:hover .cat-card-name {
  color: var(--cat-color, #6366f1);
}

.cat-card-count {
  position: relative;
  z-index: 1;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s;
}

.category-card:hover .cat-card-count {
  background: color-mix(in srgb, var(--cat-color, #6366f1) 12%, transparent);
  border-color: color-mix(in srgb, var(--cat-color, #6366f1) 25%, transparent);
  color: var(--text-secondary);
}

/* ===== Game Detail Page ===== */
.game-detail {
  max-width: 960px;
  margin: 0 auto;
}

.game-player-wrapper {
  position: relative;
  width: 100%;
  min-height: 500px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.game-player-wrapper iframe {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
  display: block;
}

.game-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  gap: 12px;
  transition: background var(--transition);
}

.game-play-overlay:hover {
  background: rgba(0, 0, 0, 0.5);
}

.play-btn-big {
  width: 72px;
  height: 72px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 24px var(--accent-glow);
  transition: transform var(--transition);
}

.game-play-overlay:hover .play-btn-big {
  transform: scale(1.1);
}

.play-text {
  font-size: 16px;
  font-weight: 600;
}

.game-info-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.game-detail-title {
  font-size: 28px;
  font-weight: 800;
}

.game-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.meta-rating {
  color: var(--warning);
}
.meta-plays {
  color: var(--text-muted);
}

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

.tag {
  padding: 4px 12px;
  background: var(--bg-card);
  border-radius: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.tag:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.game-description {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.game-description h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.game-description p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.game-controls-info {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.game-controls-info h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.game-controls-info p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 16px;
  background: var(--bg-card);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.filter-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Back Button ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  transition: all var(--transition);
}

.back-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ===== Page Title ===== */
.page-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 24px;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  margin-top: 60px;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
}
.footer-brand-row .logo-icon {
  width: 26px;
  height: 26px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 3000;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.active {
  transform: translateX(-50%) translateY(0);
}

/* ===== Ad Containers ===== */
.ad-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder {
    border: 2px dashed var(--border);
    opacity: 0.5;
}

.ad-label {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.ad-feed {
    aspect-ratio: 16/9;
}

.ad-sidebar {
    width: 300px;
    min-height: 250px;
    position: fixed;
    top: calc(var(--nav-height) + 24px);
    right: 24px;
    z-index: 100;
}

.ad-game-loading {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 2000;
}

.ad-game-loading .ad-skip-btn {
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}

.ad-game-loading .ad-skip-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 1200px) {
    .ad-sidebar { display: none; }
}

@media (max-width: 768px) {
    .ad-container { min-height: 80px; }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .nav-sidebar-btn {
    display: block;
  }
  .hero {
    padding: 32px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero-btn {
    padding: 10px 22px;
    font-size: 14px;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* 中等桌面：缩小拼贴墙 */
@media (max-width: 1101px) and (min-width: 962px) {
  .hero-collage {
    grid-template-columns: repeat(3, 82px);
    gap: 10px;
    right: 40px;
  }
}

/* 窄屏隐藏拼贴墙 */
@media (max-width: 961.5px) {
  .hero-collage {
    display: none;
  }
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition),
    background var(--transition), border-color var(--transition);
  box-shadow: var(--shadow);
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  .nav-search {
    display: none;
  }
  .nav-links {
    display: none;
  }
  .nav-sidebar-btn {
    display: block;
  }
  .nav-menu-btn {
    display: block;
  }
  .hero {
    padding: 24px;
    min-height: 200px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .hero p {
    font-size: 14px;
  }
  .hero-stats {
    gap: 20px;
  }
  .hero-stat .num {
    font-size: 20px;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
  }
  .category-card {
    padding: 16px 8px 12px;
  }
  .cat-card-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 13px;
  }
  .cat-card-name {
    font-size: 12px;
  }
  .cat-card-count {
    font-size: 10px;
    padding: 1px 8px;
  }
  .section-title {
    font-size: 18px;
  }
  .game-detail-title {
    font-size: 22px;
  }
  .game-info-bar {
    flex-direction: column;
  }
  .main-content {
    padding: 16px;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  .sidebar {
    width: 260px;
  }
  .main-content.sidebar-open {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .category-card {
    padding: 14px 6px 10px;
  }
  .cat-card-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 11px;
  }
  .cat-card-name {
    font-size: 11px;
    letter-spacing: 0.5px;
  }
  .cat-card-count {
    font-size: 9px;
    padding: 1px 6px;
  }
  .filter-chip {
    font-size: 12px;
    padding: 5px 12px;
  }
}
