/* ===== NES Player · 游戏厅风格 · 共享样式 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&display=swap');

:root {
  --bg: #1b2838;
  --bg2: #2a475e;
  --card: #1e2c3a;
  --text: #c7d5e0;
  --text-bright: #fff;
  --accent: #66c0f4;
  --accent2: #4fc3f7;
  --green: #4caf50;
  --border: #3d5a73;
  --pink: #ff6b9d;
  --purple: #a855f7;
  --yellow: #fbbf24;
  --orange: #fb923c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Noto Sans SC', -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--purple));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent2), var(--accent));
}

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

/* ===== 顶部导航 ===== */
.header {
  background: linear-gradient(180deg, #171a21 0%, #1b2838 100%);
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 64px;
  gap: 40px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-bright);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-bright);
  background: rgba(102, 192, 244, 0.1);
}

.search-box {
  margin-left: auto;
  position: relative;
}

.search-box input {
  width: 280px;
  padding: 10px 16px 10px 36px;
  background: #316282;
  border: 1px solid #4a8ab5;
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.search-box input::placeholder {
  color: #8ba4b8;
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

/* ===== 主容器 ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px;
}

/* ===== 按钮通用 ===== */
.btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  font-family: inherit;
  letter-spacing: 0.5px;
}

.btn-play {
  background: linear-gradient(135deg, var(--green), #388e3c);
  color: #fff;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-play:hover {
  background: linear-gradient(135deg, #66bb6a, var(--green));
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.btn-info {
  background: rgba(102, 192, 244, 0.15);
  color: var(--accent);
  border: 2px solid rgba(102, 192, 244, 0.3);
  backdrop-filter: blur(10px);
}

.btn-info:hover {
  background: rgba(102, 192, 244, 0.25);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 192, 244, 0.2);
}

/* ===== 区域标题 ===== */
.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  margin-bottom: 16px;
}

.section-title h2 {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
  white-space: nowrap;
}

.section-title .line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.4), transparent);
  border-radius: 1px;
}

.section-title a {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 16px;
  border: 1px solid rgba(102, 192, 244, 0.3);
  transition: all 0.3s;
  white-space: nowrap;
}

.section-title a:hover {
  background: rgba(102, 192, 244, 0.15);
  color: var(--accent2);
  box-shadow: 0 0 15px rgba(102, 192, 244, 0.2);
  text-decoration: none;
}

/* ===== 横向游戏列表 ===== */
.game-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin-bottom: 32px;
}

.game-row::-webkit-scrollbar {
  height: 8px;
}

.game-row::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

.game-row::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 4px;
}

.game-row::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, var(--accent2), var(--accent));
}

/* ===== 游戏卡片 ===== */
.game-card {
  flex: 0 0 220px;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: block;
  position: relative;
  border: 2px solid transparent;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--purple), var(--pink));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(102, 192, 244, 0.3);
  border-color: transparent;
}

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

.game-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, rgba(102, 192, 244, 0.1), rgba(168, 85, 247, 0.1));
  display: grid;
  place-items: center;
  font-size: 56px;
  position: relative;
  overflow: hidden;
}

.game-thumb::after {
  content: '▶ 开始游戏';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(102, 192, 244, 0.85), rgba(168, 85, 247, 0.85));
  opacity: 0;
  transition: all 0.3s;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.game-card:hover .game-thumb::after {
  opacity: 1;
}

.game-info {
  padding: 12px;
}

.game-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-info .price {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
}

.game-info .tags {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 10px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(102, 192, 244, 0.15), rgba(168, 85, 247, 0.15));
  color: var(--accent);
  border-radius: 12px;
  border: 1px solid rgba(102, 192, 244, 0.2);
}

.tag.hot {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.15), rgba(251, 191, 36, 0.15));
  color: var(--pink);
  border-color: rgba(255, 107, 157, 0.3);
}

/* ===== 游戏网格 ===== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.game-grid .game-card {
  flex: none;
}

/* ===== 特色卡片 ===== */
.featured-row {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.featured-card {
  flex: 1;
  background: linear-gradient(135deg, var(--card), var(--bg2));
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid rgba(102, 192, 244, 0.2);
  position: relative;
}

.featured-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--purple), var(--pink));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.featured-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px rgba(102, 192, 244, 0.3);
  border-color: transparent;
}

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

.featured-thumb {
  width: 220px;
  aspect-ratio: 4/3;
  display: grid;
  place-items: center;
  font-size: 64px;
  background: linear-gradient(135deg, rgba(102, 192, 244, 0.1), rgba(168, 85, 247, 0.1));
  position: relative;
  overflow: hidden;
}

.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-fallback-icon {
  position: relative;
  z-index: 0;
}

.featured-info {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-info h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: 10px;
}

.featured-info .desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 16px;
}

.featured-info .play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--green), #388e3c);
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  width: fit-content;
}

.featured-info .play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

/* ===== 分类网格 ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.category-card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid rgba(102, 192, 244, 0.15);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(102, 192, 244, 0.1), rgba(168, 85, 247, 0.1));
  opacity: 0;
  transition: opacity 0.3s;
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(102, 192, 244, 0.2);
}

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

.category-card .emoji {
  font-size: 36px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.category-card .name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
  position: relative;
  z-index: 1;
}

.category-card .count {
  font-size: 11px;
  color: var(--text);
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

/* ===== 面板通用 ===== */
.panel {
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
}

.panel-body {
  padding: 20px;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 32px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  background: rgba(0,0,0,0.2);
  border-radius: 24px 24px 0 0;
}

.footer p {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .featured-row {
    flex-direction: column;
  }

  .featured-thumb {
    width: 100%;
    aspect-ratio: 16/9;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0 16px;
    background: rgba(23, 26, 33, 0.98);
    backdrop-filter: blur(20px);
  }

  .header-inner {
    height: 60px;
    gap: 12px;
  }

  .logo {
    flex: 0 0 auto;
    font-size: 18px;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .nav-links {
    margin-left: auto;
    gap: 4px;
  }

  .nav-links a {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.3s;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(102, 192, 244, 0.15);
    color: var(--accent);
  }

  .search-box {
    display: none;
  }

  .container {
    padding: 16px;
  }

  .section-title {
    padding: 8px 0;
    margin-bottom: 12px;
  }

  .section-title h2 {
    font-size: 18px;
    font-weight: 800;
  }

  .game-row {
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .game-row::-webkit-scrollbar {
    display: none;
  }

  .game-card {
    flex: 0 0 165px;
    scroll-snap-align: start;
    border-radius: 12px;
  }

  .game-thumb {
    aspect-ratio: 1;
    border-radius: 12px 12px 0 0;
  }

  .game-info {
    padding: 14px;
  }

  .game-info h4 {
    font-size: 14px;
    font-weight: 700;
  }

  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .featured-card {
    flex-direction: column;
    border-radius: 12px;
    transition: all 0.3s;
  }

  .featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  }

  .featured-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px 12px 0 0;
  }

  .featured-info {
    padding: 16px;
  }

  .featured-info h3 {
    font-size: 17px;
    font-weight: 700;
  }

  .category-grid {
    gap: 10px;
    margin-bottom: 24px;
    grid-template-columns: repeat(4, 1fr);
  }

  .category-card {
    min-height: 90px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s;
  }

  .category-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(102, 192, 244, 0.2);
  }

  .category-card .emoji {
    font-size: 28px;
    margin-bottom: 6px;
  }

  .category-card .name {
    font-size: 12px;
    font-weight: 600;
  }

  .category-card .count {
    font-size: 10px;
  }

  .panel-header {
    padding: 14px 16px;
  }

  .panel-body {
    padding: 16px;
  }

  .footer {
    margin-top: 24px;
    padding: 24px 16px;
  }

  .btn {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 15px;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-card {
    flex: 0 0 155px;
  }

  .hero-carousel {
    margin: 12px auto 16px;
    border-radius: 12px;
  }
}
