<?php
/**
 * AI智学游戏工坊 - CSS主样式表
 * 三模式（深色游戏模式/浅色清新模式/护眼学习模式）
 * 响应式设计，全设备适配
 */
header('Content-Type: text/css');
?>
/* ============================================================
   CSS变量 - 三模式主题系统
   ============================================================ */
:root {
  /* 深色游戏模式 (默认) */
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: #1a1a3e;
  --bg-gradient: linear-gradient(135deg, #0a0a1a 0%, #1a1040 50%, #0d1b3e 100%);
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0c0;
  --text-muted: #6a6a8a;
  --accent-primary: #6c5ce7;
  --accent-secondary: #a855f7;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --border-color: rgba(255,255,255,0.08);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.2);
  --skeleton-base: #1a1a3e;
  --skeleton-shine: rgba(255,255,255,0.05);
  --success: #00e676;
  --warning: #ff9100;
  --danger: #ff1744;
  --info: #40c4ff;
  --gold: #ffd700;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 浅色清新模式 */
[data-theme="light"] {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e8edf5 50%, #f0f4ff 100%);
  --text-primary: #1a1a2e;
  --text-secondary: #555577;
  --text-muted: #8888aa;
  --accent-primary: #5b8def;
  --accent-secondary: #4fc3f7;
  --accent-glow: rgba(91, 141, 239, 0.15);
  --border-color: rgba(0,0,0,0.08);
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 20px rgba(91, 141, 239, 0.1);
  --skeleton-base: #e8edf5;
  --skeleton-shine: rgba(255,255,255,0.6);
}

/* 护眼学习模式 */
[data-theme="eye"] {
  --bg-primary: #faf8f0;
  --bg-secondary: #fffdf5;
  --bg-card: #fffef9;
  --bg-gradient: linear-gradient(135deg, #faf8f0 0%, #f5f0e0 50%, #faf5e8 100%);
  --text-primary: #3d3226;
  --text-secondary: #6b5d4f;
  --text-muted: #9b8d7f;
  --accent-primary: #7cb342;
  --accent-secondary: #aed581;
  --accent-glow: rgba(124, 179, 66, 0.1);
  --border-color: rgba(61, 50, 38, 0.08);
  --shadow: 0 4px 16px rgba(61, 50, 38, 0.06);
  --shadow-glow: 0 0 16px rgba(124, 179, 66, 0.08);
  --skeleton-base: #f0ece0;
  --skeleton-shine: rgba(255,255,255,0.6);
}

/* ============================================================
   基础重置和全局样式
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: var(--transition);
  overflow-x: hidden;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--accent-secondary); }

img { max-width: 100%; height: auto; }

/* ============================================================
   布局
   ============================================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 导航栏 */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.nav-brand .logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent-primary);
  background: var(--accent-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 模式切换按钮 */
.mode-switch {
  display: flex;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 3px;
  border: 1px solid var(--border-color);
}

.mode-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
  background: transparent;
  color: var(--text-muted);
}

.mode-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover {
  color: var(--accent-primary);
  background: var(--accent-glow);
}

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; border-radius: var(--radius); }

/* ============================================================
   首页 Hero区域
   ============================================================ */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, var(--accent-glow) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
  animation: heroGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(20px, -20px) scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.hero-stat .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   双核心板块 - 游戏卡片
   ============================================================ */
.section {
  padding: 60px 0;
}

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

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title .icon {
  font-size: 1.8rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

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

.game-card-cover {
  height: 180px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card-cover .cover-placeholder {
  font-size: 3rem;
  opacity: 0.8;
}

.game-card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.badge-hot {
  background: rgba(255, 23, 68, 0.2);
  color: #ff1744;
}

.badge-new {
  background: rgba(0, 230, 118, 0.2);
  color: #00e676;
}

.badge-ai {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.badge-vip {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
}

.game-card-body {
  padding: 16px;
}

.game-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.game-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.game-card-stars {
  color: var(--gold);
}

/* 教育板块特殊样式 */
.edu-card .game-card-cover {
  background: linear-gradient(135deg, #43a047, #66bb6a);
}

/* ============================================================
   分类标签
   ============================================================ */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.category-tab {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.category-tab:hover, .category-tab.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* 搜索栏 */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  max-width: 500px;
}

.search-input {
  flex: 1;
  padding: 12px 20px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

/* ============================================================
   游戏详情页/游玩页
   ============================================================ */
.detail-header {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.detail-cover {
  width: 300px;
  height: 200px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  flex-shrink: 0;
}

.detail-info { flex: 1; min-width: 250px; }

.detail-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.detail-meta {
  display: flex;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.detail-desc {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Canvas游戏容器 */
.game-container {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-glow);
  background: #000;
}

.game-container canvas {
  display: block;
  max-width: 100%;
}

.game-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 16px;
  flex-wrap: wrap;
}

/* ============================================================
   用户中心/VIP/积分
   ============================================================ */
.user-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 32px;
  padding: 40px 0;
}

.user-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 20px;
}

.user-sidebar .user-info {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  position: relative;
}

.user-level-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 4px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.sidebar-menu a:hover, .sidebar-menu a.active {
  background: var(--accent-glow);
  color: var(--accent-primary);
}

.user-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 32px;
  min-height: 500px;
}

/* VIP套餐卡 */
.vip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.vip-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 2px solid var(--border-color);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.vip-card.featured {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transform: scale(1.03);
}

.vip-card.featured::before {
  content: '推荐';
  position: absolute;
  top: 16px;
  right: -28px;
  background: var(--accent-primary);
  color: #fff;
  padding: 4px 32px;
  transform: rotate(45deg);
  font-size: 0.75rem;
  font-weight: 600;
}

.vip-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.vip-card-price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  margin: 16px 0;
}

.vip-card-price .unit {
  font-size: 1rem;
  color: var(--text-secondary);
}

.vip-features {
  list-style: none;
  text-align: left;
  margin: 20px 0;
}

.vip-features li {
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vip-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: bold;
}

/* 积分商城 */
.mall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.mall-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}

.mall-item:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.mall-item-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.mall-item-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.mall-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.mall-item-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ============================================================
   排行榜/任务/签到
   ============================================================ */
.rank-list {
  list-style: none;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.rank-item:hover {
  background: var(--accent-glow);
}

.rank-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.rank-num.top1 { background: #ffd700; color: #000; }
.rank-num.top2 { background: #c0c0c0; color: #000; }
.rank-num.top3 { background: #cd7f32; color: #fff; }

/* 签到日历 */
.sign-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  max-width: 400px;
}

.sign-day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.sign-day.checked {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.sign-day.today {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* 进度条 */
.progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ============================================================
   模态框/弹窗
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 450px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Toast消息 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 500;
  z-index: 10000;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 360px;
}

.toast-success { background: #00c853; }
.toast-error { background: #ff1744; }
.toast-warning { background: #ff9100; }
.toast-info { background: #40c4ff; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

/* 回到顶部 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

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

/* ============================================================
   底部
   ============================================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 48px 0 24px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  padding: 4px 0;
  font-size: 0.85rem;
}

.footer-bottom {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
  margin-top: 32px;
}

/* 青少年模式提示条 */
.youth-banner {
  background: linear-gradient(90deg, #e8f5e9, #c8e6c9);
  padding: 8px 16px;
  text-align: center;
  font-size: 0.85rem;
  color: #2e7d32;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ============================================================
   骨架屏加载 (Skeleton Screen)
   ============================================================ */
.skeleton {
  background: var(--skeleton-base);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--skeleton-shine) 50%,
    transparent 100%
  );
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

@keyframes skeletonShimmer {
  0% { left: -150%; }
  100% { left: 150%; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-text:last-child { width: 60%; }

.skeleton-title {
  height: 20px;
  width: 70%;
  margin-bottom: 12px;
}

.skeleton-cover {
  height: 180px;
  border-radius: var(--radius) var(--radius) 0 0;
}

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

.skeleton-card-body {
  padding: 16px;
}

.skeleton-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* 页面加载骨架屏遮罩 */
.page-skeleton-overlay {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  transition: opacity 0.4s ease;
}

.page-skeleton-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.page-skeleton-content {
  width: 100%;
  max-width: 1280px;
  padding: 0 20px;
}

/* ============================================================
   滚动触发动画 (Scroll Animations)
   ============================================================ */
.anim-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.anim-fade-up.anim-visible {
  opacity: 1;
  transform: translateY(0);
}

.anim-fade-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.anim-fade-left.anim-visible {
  opacity: 1;
  transform: translateX(0);
}

.anim-fade-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.anim-fade-right.anim-visible {
  opacity: 1;
  transform: translateX(0);
}

.anim-scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.anim-scale-in.anim-visible {
  opacity: 1;
  transform: scale(1);
}

/* 延迟动画 */
.anim-delay-1 { transition-delay: 0.1s; }
.anim-delay-2 { transition-delay: 0.2s; }
.anim-delay-3 { transition-delay: 0.3s; }
.anim-delay-4 { transition-delay: 0.4s; }
.anim-delay-5 { transition-delay: 0.5s; }

/* ============================================================
   3D卡片悬浮效果 (3D Tilt Cards)
   ============================================================ */
.card-3d {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.card-3d-inner {
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.card-3d-hover {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3D浮动光效 */
.card-3d-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    var(--accent-glow) 0%,
    transparent 70%
  );
}

.card-3d:hover .card-3d-glow {
  opacity: 1;
}

/* ============================================================
   全局音效控制面板 (Audio Control Panel)
   ============================================================ */
.audio-control-wrapper {
  position: relative;
}

.audio-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

.audio-toggle-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.audio-toggle-btn.muted {
  color: var(--text-muted);
  opacity: 0.5;
}

.audio-toggle-btn.muted::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 20px;
  background: var(--danger);
  border-radius: 1px;
  transform: rotate(-45deg);
}

.audio-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 200px;
  box-shadow: var(--shadow);
  z-index: 1001;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.audio-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.audio-panel-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.audio-panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.audio-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.audio-panel-row:last-child { margin-bottom: 0; }

.audio-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  outline: none;
  cursor: pointer;
}

.audio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px var(--accent-glow);
}

.audio-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: none;
}

/* ============================================================
   图片懒加载占位 (Lazy Loading)
   ============================================================ */
img.lazy-img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

.bg-lazy {
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.bg-lazy::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--skeleton-base);
  z-index: 0;
  transition: opacity 0.4s ease;
}

.bg-lazy.loaded::before {
  opacity: 0;
}

.bg-lazy > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   响应式设计
   ============================================================ */
@media (max-width: 1024px) {
  .user-layout {
    grid-template-columns: 200px 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
  }
  
  .mobile-menu-btn {
    display: block !important;
  }
  
  .user-layout {
    grid-template-columns: 1fr;
  }
  
  .user-sidebar {
    display: none;
  }
  
  .hero {
    padding: 48px 0 36px;
  }
  
  .hero-stats {
    gap: 24px;
  }
  
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  
  .vip-grid {
    grid-template-columns: 1fr;
  }
  
  .detail-header {
    flex-direction: column;
  }
  
  .detail-cover {
    width: 100%;
  }
  
  .section-title {
    font-size: 1.4rem;
  }
  
  .category-tabs {
    gap: 6px;
  }
  
  .category-tab {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .game-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .mall-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .nav-brand {
    font-size: 1.1rem;
  }
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.5rem;
}
