/* 主题变量 */
:root {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f0f0;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-muted: #e5e5e5;
  --border-dark: #1a1a2e;
  --footer-bg: #1a1a2e;
  --footer-text: #ffffff;
  --footer-text-muted: rgba(255, 255, 255, 0.6);
}

body[data-theme="dark"] {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-tertiary: #0f3460;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #b0b0b0;
  --border-muted: #333333;
  --border-dark: #444444;
  --footer-bg: #0f172a;
  --footer-text: #ffffff;
  --footer-text-muted: rgba(255, 255, 255, 0.6);
}

/* 全局样式 */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

/* 主题颜色类 */
.text-theme-cyan { color: #39c5cf; }
.text-theme-blue { color: #58a6ff; }
.text-theme-purple { color: #a371f7; }
.bg-theme-cyan { background-color: #39c5cf; }
.bg-theme-blue { background-color: #58a6ff; }
.bg-theme-dark { background-color: var(--bg-tertiary); }
.border-theme-muted { border-color: var(--border-muted); }
.border-theme-dark { border-color: var(--border-dark); }

/* Swiper 轮播样式 - 渐变切换 */
.swiper-hero {
  position: relative;
  overflow: hidden;
}

/* 图片层 */
.swiper-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 6s ease-out;
}
.swiper-slide-active .swiper-slide-img {
  transform: scale(1);
}

/* 文字动画 */
.swiper-slide-title,
.swiper-slide-desc,
.swiper-slide-btn {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-out;
}
.swiper-slide-active .swiper-slide-title,
.swiper-slide-active .swiper-slide-desc,
.swiper-slide-active .swiper-slide-btn {
  opacity: 1;
  transform: translateY(0);
}
.swiper-slide-active .swiper-slide-title { transition-delay: 0.2s; }
.swiper-slide-active .swiper-slide-desc { transition-delay: 0.4s; }
.swiper-slide-active .swiper-slide-btn { transition-delay: 0.6s; }

/* 分页器 */
.swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.4);
  opacity: 1;
  transition: all 0.3s ease;
  border-radius: 4px;
}
.swiper-pagination-bullet-active {
  width: 28px;
  background: linear-gradient(90deg, #39c5cf, #58a6ff);
  box-shadow: 0 0 15px rgba(57, 197, 207, 0.6);
}

/* 导航按钮 */
.swiper-button-prev,
.swiper-button-next {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  transition: all 0.3s ease;
}
.swiper-button-prev:hover,
.swiper-button-next:hover {
  background: rgba(57, 197, 207, 0.3);
  border-color: rgba(57, 197, 207, 0.5);
  transform: scale(1.1);
}
.swiper-button-prev:after,
.swiper-button-next:after {
  font-size: 18px;
  color: #fff;
}

/* 战场卡片悬浮效果 */
.game-card { transition: all 0.3s ease; background: var(--bg-secondary); cursor: pointer; }
.game-card:hover { transform: translateY(-8px); box-shadow: 0 12px 30px rgba(0,0,0,0.15); }
.game-card img { transition: transform 0.3s ease; }
.game-card:hover img { transform: scale(1.05); }

/* 分类标签 */
.category-tab { transition: all 0.3s ease; cursor: pointer; }
.category-tab:hover { background: rgba(57, 197, 207, 0.1); color: #39c5cf; }
.category-tab.active { background: #39c5cf; color: #fff; }

/* 导航栏 */
.main-nav { background: transparent; transition: all 0.3s ease; }
.main-nav:hover, .main-nav.scrolled { background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%); }
.main-nav a { color: #fff !important; position: relative; transition: all 0.3s ease; }
.main-nav a:hover { color: #fff !important; }
.main-nav a:hover::before { content: ''; position: absolute; inset: -6px; background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%); border-radius: 4px; pointer-events: none; }

/* 热门战场区域 */
.bg-theme-primary { background-color: var(--bg-primary); }
.text-theme-primary { color: var(--text-primary); }
.text-theme-secondary { color: var(--text-secondary); }
.text-theme-muted { color: var(--text-muted); }

/* 学习路线区域 */
.bg-theme-secondary { background-color: var(--bg-secondary); }
.border-theme { border-color: var(--border-muted); }

/* 特性卡片 */
.feature-card { transition: all 0.3s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }

/* 技术栈卡片 */
.tech-card { transition: all 0.3s ease; }
.tech-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }

/* 教程卡片 */
.tutorial-card { transition: all 0.3s ease; }
.tutorial-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }

/* 章节标签 */
.chapter-tab { transition: all 0.3s ease; }
.chapter-tab:hover { background: rgba(57, 197, 207, 0.1); color: #39c5cf; }
.chapter-tab.active { background: #39c5cf; color: #fff; }

/* 关卡按钮 */
.level-btn { transition: all 0.3s ease; }
.level-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(57, 197, 207, 0.3); }
.level-btn.active { background: linear-gradient(to right, #39c5cf, #58a6ff); color: #fff; }
.level-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 代码编辑器区域 */
.editor-panel { background: var(--bg-secondary); border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.game-panel { background: var(--bg-secondary); border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

/* 代码区域 */
.code-area { background: #1a1a2e; border-radius: 8px; }

/* 按钮样式 */
.btn-primary { background: linear-gradient(to right, #39c5cf, #58a6ff); color: #fff; transition: all 0.3s ease; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-muted); transition: all 0.3s ease; }
.btn-secondary:hover { background: var(--bg-tertiary); }

/* 页脚样式 */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
}
footer a {
  color: var(--footer-text-muted);
}
footer a:hover {
  color: var(--footer-text);
}
