/* ============================================
   欢乐游戏平台 - 禅意·极简大气 (Zen-Minimalism)
   设计理念：去掉所有不必要的装饰，用光影代替线条，用间距代替分隔
   Version: 4.0
   ============================================ */

/* 字体导入 - SF Pro风格 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ==================== CSS 变量 ==================== */
:root {
  /* 极简背景层次 */
  --bg-page: #FBFBFB;
  --bg-card: #FFFFFF;
  --bg-elevated: #F5F5F7;
  --bg-hover: rgba(0, 0, 0, 0.02);
  
  /* 文字色 - 高对比度 */
  --text-primary: #1D1D1F;
  --text-secondary: #424245;
  --text-muted: #86868B;
  --text-dim: #AEAEB2;
  
  /* 主色 - 纯黑为主 */
  --primary: #1D1D1F;
  --primary-light: #424245;
  --primary-dark: #000000;
  --primary-glow: rgba(0, 0, 0, 0.08);
  
  /* 强调色 - 保持克制 */
  --accent: #0071E3;
  --accent-glow: rgba(0, 113, 227, 0.1);
  
  /* 功能色 */
  --hot: #FF6B35;
  --hot-glow: rgba(255, 107, 53, 0.1);
  --success: #34C759;
  --warning: #FF9500;
  --danger: #FF3B30;
  
  /* 边框 - 极淡 */
  --border: rgba(0, 0, 0, 0.06);
  --border-light: rgba(0, 0, 0, 0.03);
  --border-focus: rgba(0, 113, 227, 0.3);
  
  /* 阴影 - 微弱弥散 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
  
  /* 尺寸 - 增加呼吸感 */
  --nav-height: 56px;
  --sidebar-w: 240px;
  --aside-w: 280px;
  --gap: 20px;
  --gap-sm: 14px;
  --gap-lg: 32px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

/* ==================== 夜间模式 ==================== */
[data-theme="dark"] {
  --bg-primary: #0F0F12;
  --bg-secondary: #1A1A22;
  --bg-card: #1E1E28;
  --bg-elevated: #252530;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-input: #252530;
  --text-primary: #EEEEF0;
  --text-secondary: #A0A0AB;
  --text-muted: #6B6B76;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body {
  background: #0F0F12;
  color: #EEEEF0;
}

[data-theme="dark"] .navbar {
  background: rgba(15, 15, 18, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .sidebar {
  background: #1A1A22;
  border-right-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .sidebar-section {
  background: #1E1E28;
}

[data-theme="dark"] .game-card {
  background: #1E1E28;
}

[data-theme="dark"] .game-card-title {
  color: #EEEEF0;
}

[data-theme="dark"] .ranking-sidebar {
  background: transparent;
}

[data-theme="dark"] .ranking-section {
  background: #1E1E28;
}

[data-theme="dark"] .search-box {
  background: #252530;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .search-box input {
  color: #EEEEF0;
}

[data-theme="dark"] .top-banner.placeholder {
  background: #1E1E28;
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .footer-section {
  background: #0F0F12;
  border-top-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .contact-popup {
  background: #1E1E28;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .game-modal-content {
  background: #1A1A22;
}

[data-theme="dark"] .game-modal-header {
  background: #1E1E28;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .prompt-content {
  background: #1E1E28;
  color: #EEEEF0;
}

[data-theme="dark"] .notice-banner {
  background: rgba(255, 107, 53, 0.1);
  border-color: rgba(255, 107, 53, 0.2);
}

/* 分页深色 */
[data-theme="dark"] .page-btn {
  background: #252530;
  color: #A0A0AB;
  border: none;
}

[data-theme="dark"] .page-btn.active {
  background: #1B1B1F;
  color: white;
}

[data-theme="dark"] .page-btn:hover:not(:disabled) {
  background: #FF6B35;
  color: white;
}

[data-theme="dark"] .page-info {
  color: #6B6B76;
}

/* 联系客服深色 */
[data-theme="dark"] .contact-fab {
  background: #252530;
  border-color: rgba(255,255,255,0.08);
  color: #A0A0AB;
}

[data-theme="dark"] .contact-popup {
  background: #1E1E28;
  border-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .contact-popup h4 {
  color: #EEEEF0;
}

[data-theme="dark"] .contact-item .label {
  color: #A0A0AB;
}

[data-theme="dark"] .contact-item .value {
  color: #EEEEF0;
}

/* 返回顶部深色 */
[data-theme="dark"] .back-to-top {
  background: #252530;
  border-color: rgba(255,255,255,0.08);
  color: #A0A0AB;
}

/* 空状态深色 */
[data-theme="dark"] .empty-state {
  color: #6B6B76;
}

/* 分类侧边栏深色 */
[data-theme="dark"] .category-item {
  color: #A0A0AB;
}

[data-theme="dark"] .category-item:hover {
  background: #252530;
  color: #EEEEF0;
}

[data-theme="dark"] .category-item.active {
  background: #EEEEF0;
  color: #1B1B1F;
}

[data-theme="dark"] .sidebar-title {
  color: #A0A0AB;
}

[data-theme="dark"] .stat-row .label {
  color: #6B6B76;
}

[data-theme="dark"] .stat-row .value {
  color: #EEEEF0;
}

/* 游戏卡片meta深色 */
[data-theme="dark"] .game-card-plays {
  color: #6B6B76;
}

/* 广告位深色 */
[data-theme="dark"] .side-ad {
  background: #1E1E28;
  border-color: rgba(255,255,255,0.06);
  color: #A0A0AB;
}

[data-theme="dark"] .side-ad h4 {
  color: #A0A0AB;
}

/* 排行榜深色 */
[data-theme="dark"] .ranking-item {
  color: #A0A0AB;
}

[data-theme="dark"] .ranking-item:hover {
  background: #252530;
}

[data-theme="dark"] .ranking-name {
  color: #EEEEF0;
}

/* 搜索框深色 */
[data-theme="dark"] .m-search {
  background: #0F0F12;
}

[data-theme="dark"] .m-search input {
  background: #1E1E28;
  color: #EEEEF0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
}

/* 手机统计深色 */
[data-theme="dark"] .m-stats {
  color: #A0A0AB;
}

[data-theme="dark"] .m-stats strong {
  color: #EEEEF0;
}

/* 游戏详情弹窗深色 */
[data-theme="dark"] .game-detail-content {
  background: #1E1E28;
}

[data-theme="dark"] .game-detail-title {
  color: #EEEEF0;
}

[data-theme="dark"] .game-detail-action-btn {
  background: #252530;
  color: #A0A0AB;
}

/* 搜索历史深色 */
[data-theme="dark"] .search-history-popup {
  background: #1E1E28;
  border-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .sh-item {
  color: #A0A0AB;
}

[data-theme="dark"] .sh-item:hover {
  background: #252530;
}

/* 公告深色 */
[data-theme="dark"] .notice-banner {
  background: rgba(255,107,53,0.08);
  border-color: rgba(255,107,53,0.15);
}

[data-theme="dark"] .notice-content strong {
  color: #EEEEF0;
}

[data-theme="dark"] .notice-content span {
  color: #A0A0AB;
}

/* 畅玩横幅深色 */
[data-theme="dark"] .freeplay-banner {
  background: linear-gradient(135deg, #1a5c2e 0%, #1e6b35 100%);
}

/* 底部footer深色 */
[data-theme="dark"] .footer-copyright {
  color: #6B6B76;
}

[data-theme="dark"] .footer-links a {
  color: #6B6B76;
}

/* 手机底栏深色补充 */
[data-theme="dark"] .m-tab-item {
  color: #6B6B76;
}

[data-theme="dark"] .m-tab-item.active {
  color: #EEEEF0;
}

/* 手机分类/Tab深色 */
[data-theme="dark"] .m-cat-item {
  background: #252530;
  color: #A0A0AB;
  border-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .m-cat-item.active {
  background: #EEEEF0;
  color: #1B1B1F;
}

[data-theme="dark"] .m-tab-btn {
  background: #252530;
  color: #A0A0AB;
}

[data-theme="dark"] .m-tab-btn.active {
  background: #EEEEF0;
  color: #1B1B1F;
}

/* 手机游戏名深色 */
[data-theme="dark"] .m-game-name {
  color: #EEEEF0;
}

/* 加载更多按钮深色 */
[data-theme="dark"] .m-load-more button {
  background: #252530;
  color: #A0A0AB;
  border-color: rgba(255,255,255,0.08);
}

/* 手机footer深色 */
[data-theme="dark"] .m-footer {
  color: #6B6B76;
}

[data-theme="dark"] .m-footer a {
  color: #6B6B76;
}

/* Mobile dark mode */
@media (max-width: 900px) {
  [data-theme="dark"] .m-navbar {
    background: rgba(15, 15, 18, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }
  
  [data-theme="dark"] .m-search input {
    background: #1E1E28;
    color: #EEEEF0;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
  }
  
  [data-theme="dark"] .m-banner {
    background: #1E1E28;
    border-color: rgba(255, 255, 255, 0.06);
  }
  
  [data-theme="dark"] .m-tab-bar {
    background: rgba(15, 15, 18, 0.95);
    border-top-color: rgba(255, 255, 255, 0.06);
  }
  
  [data-theme="dark"] .m-game-card {
    background: #1E1E28;
  }
  
  [data-theme="dark"] .m-game-name {
    color: #EEEEF0;
  }
  
  [data-theme="dark"] .m-cat-item {
    background: #252530;
    color: #A0A0AB;
    border-color: rgba(255, 255, 255, 0.08);
  }
  
  [data-theme="dark"] .m-tab-btn {
    background: #252530;
    color: #A0A0AB;
  }
}

/* ==================== 深色模式：游戏弹窗评论区 ==================== */
[data-theme="dark"] .reviews-panel { background: #1A1A22; color: #EEEEF0; }
[data-theme="dark"] .reviews-header { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .reviews-title h3 { color: #EEEEF0; }
[data-theme="dark"] .review-count { color: #6B6B76; }
[data-theme="dark"] .close-reviews { background: #252530; color: #A0A0AB; border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .review-form textarea { background: #252530; color: #EEEEF0; border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .review-form textarea::placeholder { color: #6B6B76; }
[data-theme="dark"] .submit-review { background: #1B1B1F; color: white; }
[data-theme="dark"] .rating-input { color: #A0A0AB; }
[data-theme="dark"] .review-item { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .review-username { color: #EEEEF0; }
[data-theme="dark"] .review-content { color: #A0A0AB; }
[data-theme="dark"] .review-meta { color: #6B6B76; }
[data-theme="dark"] .review-action { color: #6B6B76; background: transparent; }
[data-theme="dark"] .review-delete { color: #6B6B76; }
[data-theme="dark"] .no-reviews { color: #6B6B76; }
[data-theme="dark"] .login-hint { color: #6B6B76; }
[data-theme="dark"] .login-hint a { color: #FF6B35; }
[data-theme="dark"] .modal-btn { background: #252530; color: #A0A0AB; }
[data-theme="dark"] .modal-btn.close { background: #FF3B30; color: white; }
[data-theme="dark"] .game-loading { background: #0F0F12; color: #A0A0AB; }
[data-theme="dark"] .game-retry-btn { background: #FF6B35; }

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  letter-spacing: -0.01em;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

/* ==================== 导航栏 ==================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(251, 251, 251, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--gap-lg);
}

.navbar-inner {
  width: 100%;
  max-width: 1440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: #1B1B1F;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  padding: 6px;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.site-name {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-text {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* 搜索框 */
.search-box {
  flex: 0 1 360px;
  min-width: 200px;
  position: relative;
  margin: 0 auto;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 16px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

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

.search-btn {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  cursor: pointer;
  padding: 7px;
}

.search-btn:hover {
  border-color: #1B1B1F;
  color: #1B1B1F;
}

.search-btn svg {
  width: 100%;
  height: 100%;
}

/* 导航菜单 */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* 用户按钮 */
.user-dropdown {
  position: relative;
  margin-left: 8px;
}

.user-btn {
  background: #FF6B35 !important;
  color: white !important;
  padding: 8px 18px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.user-btn:hover {
  transform: scale(1.02);
  background: var(--primary-dark) !important;
}

.user-btn.logged-in {
  background: var(--success) !important;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 200;
}

.user-dropdown.logged-in:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.dropdown-menu a:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* ==================== 顶部轮播广告 ==================== */
.top-banner {
  margin: var(--gap-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  height: 200px;
  position: relative;
  box-shadow: var(--shadow-card);
}

.top-banner.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
}

.top-banner h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.top-banner p {
  font-size: 13px;
  opacity: 0.7;
}

/* 轮播容器 */
.banner-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.banner-slides {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
}

.banner-slide {
  min-width: 100%;
  height: 100%;
}

.banner-slide a {
  display: block;
  width: 100%;
  height: 100%;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 轮播指示器 */
.banner-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.banner-dot.active {
  background: var(--text-primary);
  width: 24px;
  border-radius: 4px;
}

/* 轮播箭头 */
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: all 0.2s ease;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.top-banner:hover .banner-arrow {
  opacity: 1;
}

.banner-arrow:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

.banner-arrow.prev { left: 16px; }
.banner-arrow.next { right: 16px; }

/* ==================== 三栏布局 ==================== */
.main-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--aside-w);
  gap: var(--gap-lg);
  padding: 0 var(--gap-lg) var(--gap-lg);
  max-width: 1600px;
  margin: 0 auto;
}

/* ==================== 左侧边栏 ==================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.sidebar-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--gap);
  box-shadow: var(--shadow-card);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--gap);
  padding-bottom: var(--gap-sm);
  border-bottom: 1px solid var(--border-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-title svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
}

/* 分类列表 */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.category-item.active {
  background: #1B1B1F;
  color: white;
}

.category-item .icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* 平台数据 */
.stats-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.stat-row .label {
  color: var(--text-muted);
}

.stat-row .value {
  font-weight: 600;
  color: var(--text-primary);
}

.stat-row .value.online-indicator {
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-row .value.online-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* ==================== 主内容区 ==================== */
.main-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* 游戏区头部 */
.games-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px var(--gap-lg);
  box-shadow: var(--shadow-card);
}

.games-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.tab-group {
  display: flex;
  gap: 6px;
}

.tab-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 20px;
  transition: all 0.2s ease;
}

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

.tab-btn.active {
  color: white;
  background: #1B1B1F;
}

/* ==================== 游戏网格 ==================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--gap);
}

/* 游戏卡片 */
.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-card);
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
}

.game-card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-elevated);
  overflow: hidden;
}

.game-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.game-card:hover .game-card-image img {
  transform: scale(1.03);
}

/* TOP 标签 */
.top-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
  z-index: 2;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

/* 卡片信息 */
.game-card-info {
  padding: 14px 16px;
  position: relative;
  z-index: 2;
}

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

.game-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-card-category {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255, 107, 53, 0.08);
  border-radius: 4px;
  font-size: 11px;
  color: #FF6B35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.game-card-plays {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==================== 右侧边栏 ==================== */
.ranking-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* 侧边广告 */
.side-ad {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  box-shadow: var(--shadow-card);
}

.side-ad.has-image {
  background: var(--bg-elevated);
}

.side-ad a {
  display: block;
  width: 100%;
  height: 100%;
}

.side-ad img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-ad h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.side-ad p {
  font-size: 12px;
  opacity: 0.7;
}

/* 排行榜 */
.ranking-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--gap);
  box-shadow: var(--shadow-card);
}

.ranking-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--gap);
  padding-bottom: var(--gap-sm);
  border-bottom: 1px solid var(--border-light);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ranking-item:hover {
  background: var(--bg-elevated);
}

.ranking-num {
  width: 22px;
  height: 22px;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  flex-shrink: 0;
}

.ranking-item:nth-child(1) .ranking-num { 
  background: #FFD60A; 
  color: #000; 
}
.ranking-item:nth-child(2) .ranking-num { 
  background: #C0C0C0; 
  color: #000; 
}
.ranking-item:nth-child(3) .ranking-num { 
  background: #CD7F32; 
  color: #fff; 
}

.ranking-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.ranking-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ranking-rating {
  font-size: 11px;
  color: #FF6B35;
  font-weight: 500;
}

/* ==================== 分页 ==================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.page-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-right: 16px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--text-primary);
  color: white;
}

.page-btn.active {
  background: var(--text-primary);
  color: white;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-dots {
  color: var(--text-muted);
  padding: 0 6px;
}

/* ==================== 底部 ==================== */
.footer-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: var(--gap-lg) var(--gap-lg) var(--gap-lg);
  margin: var(--gap-lg);
  text-align: center;
  box-shadow: var(--shadow-card);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 16px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

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

.footer-copyright {
  font-size: 12px;
  color: var(--text-dim);
}

/* ==================== 联系客服 ==================== */
.contact-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  background: var(--text-primary);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 22px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: all 0.2s ease;
}

.contact-fab:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-lg);
}

.contact-popup {
  position: fixed;
  bottom: 92px;
  right: 28px;
  width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--gap);
  z-index: 1000;
  display: none;
  animation: popIn 0.2s ease;
}

.contact-popup.show {
  display: block;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.contact-popup h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-item .icon {
  font-size: 18px;
  flex-shrink: 0;
}

.contact-item .label {
  font-size: 11px;
  color: var(--text-muted);
}

.contact-item .value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ==================== 游戏弹窗 ==================== */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: none;
}

.game-modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-modal-content {
  width: 100%;
  height: 100%;
  background: var(--bg-page);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.game-modal-header {
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.game-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.game-modal-actions {
  display: flex;
  gap: 8px;
}

.modal-btn {
  padding: 8px 16px;
  font-size: 13px;
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-btn:hover {
  background: var(--text-primary);
  color: white;
}

.modal-btn.close {
  background: var(--danger);
  color: white;
  font-size: 15px;
  padding: 8px 14px;
}

.modal-btn.close:hover {
  background: #E5342A;
}

.game-modal-body {
  flex: 1;
  position: relative;
  background: #000;
}

.game-modal-body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}

/* 游戏加载提示 */
.game-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  color: var(--text-primary);
  z-index: 2;
}

.game-loading.hidden {
  display: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

.game-loading p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ==================== 空状态 ==================== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
}

.loading {
  text-align: center;
  padding: 50px;
  color: var(--text-muted);
}

/* ==================== 公告横幅 ==================== */
.notices-container {
  margin-bottom: 16px;
}

.notice-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: rgba(0, 113, 227, 0.06);
  border: 1px solid rgba(0, 113, 227, 0.1);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.notice-banner.info {
  background: rgba(0, 113, 227, 0.06);
  border-color: rgba(0, 113, 227, 0.1);
}

.notice-banner.warning {
  background: rgba(255, 149, 0, 0.08);
  border-color: rgba(255, 149, 0, 0.15);
}

.notice-banner.important {
  background: rgba(255, 59, 48, 0.08);
  border-color: rgba(255, 59, 48, 0.15);
}

.notice-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.notice-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.notice-content strong {
  color: var(--text-primary);
  white-space: nowrap;
}

.notice-content span {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-close {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  opacity: 0.6;
  transition: all 0.15s ease;
  border-radius: 50%;
}

.notice-close:hover {
  opacity: 1;
  background: var(--bg-hover);
}

.notice-img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .notice-img {
    max-height: 80px;
  }
}

/* ==================== 游戏评论面板 ==================== */
.reviews-panel {
  position: absolute;
  inset: 0;
  background: var(--bg-page);
  z-index: 10;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.reviews-panel.show {
  display: flex;
}

.reviews-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.reviews-title h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.rating-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.avg-rating {
  font-size: 26px;
  font-weight: 700;
  color: #FFD60A;
}

.stars {
  color: #FFD60A;
  letter-spacing: 2px;
  font-size: 15px;
}

.review-count {
  color: var(--text-muted);
}

.close-reviews {
  padding: 10px 18px;
  background: var(--text-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.close-reviews:hover {
  transform: scale(1.02);
}

/* 评论输入 */
.review-form {
  padding: 20px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.rating-input {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text-secondary);
}

.star-rating {
  display: flex;
  gap: 4px;
}

.star-rating .star {
  font-size: 26px;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.15s ease;
}

.star-rating .star:hover,
.star-rating .star.active {
  color: #FFD60A;
  transform: scale(1.1);
}

.review-form textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  height: 90px;
  margin-bottom: 14px;
  background: var(--bg-page);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.review-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.review-form textarea::placeholder {
  color: var(--text-muted);
}

.submit-review {
  padding: 12px 24px;
  background: var(--text-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.submit-review:hover {
  transform: scale(1.02);
}

/* 评论列表 */
.reviews-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.review-item {
  padding: 18px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.review-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 15px;
}

.review-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.review-info {
  flex: 1;
}

.review-username {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

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

.review-stars {
  color: #FFD60A;
}

.review-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.review-actions {
  display: flex;
  gap: 16px;
}

.review-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.review-action:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.review-action.liked {
  color: var(--danger);
}

.review-action:disabled {
  cursor: default;
  opacity: 0.6;
}

.review-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  opacity: 0.4;
  transition: all 0.15s ease;
}

.review-delete:hover {
  opacity: 1;
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
}

.no-reviews {
  text-align: center;
  padding: 50px;
  color: var(--text-muted);
}

.login-hint {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.login-hint a {
  color: var(--accent);
}

/* Toast提示 */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==================== 响应式 - 平板 ==================== */
@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 200px 1fr 220px;
  }
  
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar, .ranking-sidebar {
    display: none;
  }
  
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ==================== 手机端样式 ==================== */
.mobile-layout {
  display: none;
}

@media (max-width: 900px) {
  .pc-layout {
    display: none;
  }
  
  .mobile-layout {
    display: block;
    padding-bottom: 72px;
  }
  
  /* 手机导航 */
  .m-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 52px;
    background: rgba(251, 251, 251, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
  }
  
  .m-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
  }
  
  .m-logo .icon {
    width: 28px;
    height: 28px;
    background: #1B1B1F;
    border-radius: 6px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 14px;
  }

  .m-logo-icon {
    width: 28px;
    height: 28px;
    padding: 5px;
    background: #1D1D1F;
    border-radius: 7px;
    color: white;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  
  .m-logo-icon svg {
    stroke: white;
  }
  
  .m-user-btn {
    padding: 8px 14px;
    font-size: 12px;
    background: #FF6B35;
    color: white;
    border-radius: 16px;
    font-weight: 500;
  }
  
  /* 手机搜索 */
  .m-search {
    padding: 12px 16px;
    background: var(--bg-page);
  }
  
  .m-search input {
    width: 100%;
    height: 40px;
    padding: 0 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-primary);
  }
  
  .m-search input:focus {
    outline: none;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
  }
  
  .m-search input::placeholder {
    color: var(--text-muted);
  }
  
  /* 手机广告 */
  .m-banner {
    margin: 0 16px 12px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    box-shadow: var(--shadow-card);
  }
  
  .m-banner.has-image {
    background: var(--bg-elevated);
  }
  
  .m-banner a {
    display: block;
    width: 100%;
    height: 100%;
  }
  
  .m-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .m-banner h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
  }
  
  .m-banner p {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
  }
  
  /* 手机统计 */
  .m-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
  }
  
  .m-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .m-stats strong {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
  }

  .m-stats .stats-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    flex-shrink: 0;
  }

  .m-stats .online-dot {
    color: #22c55e;
    width: 10px;
    height: 10px;
  }
  
  /* 手机端公告 */
  .m-notices {
    margin: 0 12px 12px;
  }
  
  .m-notices .notice-banner {
    padding: 10px 14px;
    gap: 10px;
    border-radius: 10px;
  }
  
  .m-notices .notice-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 13px;
  }
  
  .m-notices .notice-content strong {
    font-size: 13px;
  }
  
  .m-notices .notice-content span {
    font-size: 12px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .m-notices .notice-icon {
    font-size: 16px;
  }
  
  .m-notices .notice-close {
    width: 22px;
    height: 22px;
    font-size: 16px;
  }
  
  /* 手机分类 */
  .m-categories {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .m-categories::-webkit-scrollbar {
    display: none;
  }
  
  .m-cat-item {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 13px;
    background: var(--bg-card);
    border: none;
    border-radius: 16px;
    white-space: nowrap;
    transition: all 0.15s ease;
    color: var(--text-secondary);
    box-shadow: var(--shadow-card);
  }
  
  .m-cat-item.active {
    background: #1B1B1F;
    color: white;
  }
  
  /* 手机端Tab切换 */
  .m-tab-switch {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
  }
  
  .m-tab-btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-card);
  }
  
  .m-tab-btn.active {
    background: #1B1B1F;
    color: white;
  }
  
  /* 手机游戏网格 */
  .m-games {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 0 16px;
  }
  
  /* 手机端TOP标签 */
  .m-game-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
  }
  
  .m-top-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 700;
    background: var(--hot);
    color: white;
    border-radius: 4px;
    z-index: 1;
  }
  
  .m-game-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-elevated);
  }
  
  .m-game-name {
    padding: 10px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
  }
  
  /* 手机加载更多 */
  .m-load-more {
    padding: 20px 16px;
  }
  
  .m-load-more button {
    width: 100%;
    padding: 14px;
    font-size: 13px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-card);
  }
  
  .m-load-more button:active {
    background: var(--bg-elevated);
  }
  
  /* 手机底部 */
  .m-footer {
    padding: 24px 16px;
    text-align: center;
  }
  
  .m-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
  }
  
  .m-footer-links a {
    font-size: 12px;
    color: var(--text-muted);
  }
  
  .m-footer p {
    font-size: 11px;
    color: var(--text-dim);
  }
  
  /* 手机底部导航 */
  .m-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(251, 251, 251, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border-light);
    display: flex;
    z-index: 100;
  }
  
  .m-tab-item.m-admin-tab {
    text-decoration: none;
  }
  
  .m-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    color: var(--text-muted);
    transition: color 0.15s ease;
  }
  
  .m-tab-item.active {
    color: var(--text-primary);
  }
  
  .m-tab-item .icon {
    font-size: 20px;
  }

  .m-tab-item .tab-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
  }

  .m-tab-item.active .tab-icon {
    stroke-width: 2.5;
  }

  .contact-fab {
    bottom: 72px;
  }
  
  .contact-popup {
    bottom: 136px;
  }
}

/* ==================== 登录/解锁提示弹窗 ==================== */
.prompt-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.prompt-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.prompt-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.prompt-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.prompt-content > p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.prompt-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.prompt-btn {
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-block;
}

.prompt-btn.primary {
  background: var(--text-primary);
  color: white;
}

.prompt-btn.primary:hover {
  transform: scale(1.02);
}

.prompt-btn.secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.prompt-btn.secondary:hover {
  background: var(--border);
}

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

.prompt-hint a {
  color: var(--accent);
}

/* 模式提示信息 */
.prompt-mode-info {
  margin: 24px 0;
  text-align: left;
}

.mode-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.mode-step span {
  width: 24px;
  height: 24px;
  background: var(--text-primary);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.mode-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.mode-option strong {
  font-size: 14px;
  color: var(--text-primary);
}

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

.prompt-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: var(--bg-elevated);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.prompt-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* 解锁选项 */
.unlock-options {
  text-align: left;
  margin-top: 24px;
}

.unlock-option {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

.unlock-option h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.unlock-option p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.game-unlock-input {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.game-unlock-input input {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}

.game-unlock-input input:focus {
  outline: none;
  border-color: var(--accent);
}

.game-unlock-input .prompt-btn {
  flex: 0 0 auto;
  padding: 0 14px;
  white-space: nowrap;
}

.unlock-option strong {
  color: var(--accent);
}

.unlock-divider {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 10px 0;
}

.invite-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.invite-progress .progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-page);
  border-radius: 4px;
  overflow: hidden;
}

.invite-progress .progress-fill {
  height: 100%;
  background: var(--text-primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.invite-progress span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.invite-link-box {
  display: flex;
  gap: 8px;
}

.invite-link-box input {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.invite-link-box button {
  padding: 10px 16px;
  font-size: 13px;
  background: var(--text-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.invite-link-box button:hover {
  transform: scale(1.02);
}

/* ==================== 骨架屏加载 ==================== */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.skeleton-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-text {
  height: 14px;
  margin: 12px 14px 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-text-sm {
  height: 10px;
  width: 60%;
  margin: 0 14px 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 手机端骨架屏 */
.m-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 12px;
}

.m-skeleton-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
}

.m-skeleton-card .skeleton-img {
  aspect-ratio: 1/1;
}

/* ==================== 动画增强 ==================== */
/* 游戏网格淡入 */
.games-grid, .m-games {
  animation: grid-fade-in 0.4s ease;
}

@keyframes grid-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 游戏卡片交错动画 */
.game-card {
  animation: card-appear 0.3s ease backwards;
}

.game-card:nth-child(1) { animation-delay: 0.02s; }
.game-card:nth-child(2) { animation-delay: 0.04s; }
.game-card:nth-child(3) { animation-delay: 0.06s; }
.game-card:nth-child(4) { animation-delay: 0.08s; }
.game-card:nth-child(5) { animation-delay: 0.1s; }
.game-card:nth-child(6) { animation-delay: 0.12s; }

@keyframes card-appear {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== NEW 角标 ==================== */
.new-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: white;
  letter-spacing: 1px;
  z-index: 2;
  background: #ff3b30;
  animation: new-pulse 2s ease-in-out infinite;
}

@keyframes new-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.m-new-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  color: white;
  background: #ff3b30;
  z-index: 2;
  animation: new-pulse 2s ease-in-out infinite;
}

/* ==================== 畅玩模式横幅 ==================== */
.freeplay-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
  color: white;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  border-radius: 10px;
}

.freeplay-banner button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .freeplay-banner {
    margin: 8px 12px;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
  }
}

/* 手机端在线指示点 */
.m-online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22C55E;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 2px;
}

/* ==================== 联系方式徽章 ==================== */
.contact-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #0071E3;
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-badge.wx {
  background: #07C160;
}

.contact-badge.em {
  background: #FF6B35;
}

/* ==================== 游戏详情弹窗 ==================== */
.game-detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.game-detail-content {
  background: var(--bg-card, #fff);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: detail-in 0.3s ease;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

@keyframes detail-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.game-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.3);
  border: none;
  border-radius: 50%;
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  transition: 0.15s;
}

.game-detail-close:hover {
  background: rgba(0,0,0,0.5);
}

.game-detail-hero {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}

.game-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-detail-info {
  padding: 20px 24px 24px;
}

.game-detail-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #1B1B1F);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

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

.game-detail-category {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255, 107, 53, 0.08);
  border-radius: 4px;
  font-size: 12px;
  color: #FF6B35;
  font-weight: 500;
}

.game-detail-tag {
  display: inline-block;
  padding: 3px 8px;
  background: var(--bg-elevated, #F5F5F7);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary, #6B6B76);
}

.game-detail-plays {
  font-size: 12px;
  color: var(--text-muted, #A0A0AB);
}

.game-detail-desc {
  font-size: 14px;
  color: var(--text-secondary, #6B6B76);
  line-height: 1.6;
  margin-bottom: 20px;
}

.game-detail-actions {
  display: flex;
  gap: 10px;
}

.game-detail-play-btn {
  flex: 1;
  padding: 14px;
  background: #FF6B35;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
}

.game-detail-play-btn:hover {
  opacity: 0.9;
  transform: scale(1.01);
}

.game-detail-action-btn {
  padding: 14px 18px;
  background: var(--bg-elevated, #F5F5F7);
  color: var(--text-secondary, #6B6B76);
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
}

.game-detail-action-btn:hover {
  background: var(--border-color, rgba(0,0,0,0.08));
}

/* ==================== 推荐列表 ==================== */
.recommend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recommend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.15s;
}

.recommend-item:hover {
  background: var(--bg-hover, rgba(0,0,0,0.02));
}

.recommend-item img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.recommend-item span {
  font-size: 13px;
  color: var(--text-secondary, #6B6B76);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== 主题切换 ==================== */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.15s;
}

.theme-toggle:hover {
  background: var(--bg-hover, rgba(0,0,0,0.04));
}

.theme-toggle svg {
  color: var(--text-muted, #A0A0AB);
}

/* ==================== 游戏详情响应式 ==================== */
@media (max-width: 768px) {
  .game-detail-modal {
    padding: 0;
    align-items: flex-end;
  }
  
  .game-detail-content {
    max-width: none;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    animation: detail-slide-up 0.3s ease;
  }
  
  @keyframes detail-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  
  .game-detail-info {
    padding: 16px 18px 20px;
  }
  
  .game-detail-title {
    font-size: 18px;
  }
  
  .game-detail-actions {
    flex-direction: column;
  }
  
  .game-detail-action-btn {
    text-align: center;
  }
}

/* ==================== 导航头像 ==================== */
.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 6px;
  vertical-align: middle;
}

.user-btn {
  display: flex !important;
  align-items: center;
  gap: 6px;
}

/* 手机端导航头像 */
.m-nav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 4px;
}

.m-user-btn {
  display: flex !important;
  align-items: center;
  gap: 4px;
}

/* ==================== 返回顶部 ==================== */
.back-to-top {
  position: fixed;
  bottom: 92px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, rgba(0,0,0,0.06));
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 90;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

@media (max-width: 900px) {
  .back-to-top {
    bottom: 140px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}

/* ==================== 搜索历史 ==================== */
.search-history-popup {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, rgba(0,0,0,0.06));
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  z-index: 200;
  margin-top: 4px;
  overflow: hidden;
}

.sh-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted, #A0A0AB);
  border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.06));
}

.sh-header button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

.sh-item {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-secondary, #6B6B76);
  cursor: pointer;
  transition: 0.1s;
}

.sh-item:hover {
  background: var(--bg-hover, rgba(0,0,0,0.02));
}

/* ==================== 游戏加载重试 ==================== */
.game-retry-btn {
  margin-top: 16px;
  padding: 10px 24px;
  background: #FF6B35;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: 0.15s;
}

.game-retry-btn:hover {
  opacity: 0.9;
}

/* ==================== 管理员编辑按钮 ==================== */
.admin-edit-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 10px;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  text-decoration: none;
  z-index: 2;
  opacity: 0;
  transition: 0.15s;
}

.game-card:hover .admin-edit-btn {
  opacity: 1;
}

/* ==================== 工具类 ==================== */
.hidden {
  display: none !important;
}
