/* ========== 基础重置与变量 ========== */
:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --secondary: #1d3557;
  --accent: #f4a261;
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-hover: #252542;
  --text: #ffffff;
  --text-secondary: #a0a0b0;
  --border: #2d2d44;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --radius: 12px;
  --header-height: 64px;
}

/* 亮色主题 */
[data-theme="light"] {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --secondary: #4a90d9;
  --accent: #f4a261;
  --bg: #f5f6fa;
  --bg-card: #ffffff;
  --bg-hover: #f0f1f5;
  --text: #333333;
  --text-secondary: #666666;
  --border: #e1e4e8;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* ========== 顶部导航 ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.logo-icon {
  width: 32px;
  height: 32px;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav-item {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.3s;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--primary);
  background: rgba(230, 57, 70, 0.15);
}

.header-center {
  flex: 1;
  max-width: 360px;
  margin: 0 24px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  transition: border-color 0.3s;
}

.search-box:focus-within {
  border-color: var(--primary);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-btn {
  color: var(--text-secondary);
  padding: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s;
}

.login-btn {
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.login-btn:hover {
  border-color: var(--primary);
}

.register-btn {
  color: white;
  background: var(--primary);
}

.register-btn:hover {
  background: var(--primary-dark);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: border-color 0.3s;
}

.user-avatar:hover {
  border-color: var(--primary);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========== 主题切换按钮 ========== */
.theme-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.3s;
}

.theme-toggle:hover {
  border-color: var(--primary);
}

.theme-toggle::before {
  content: '🌙';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.3s;
}

[data-theme="light"] .theme-toggle::before {
  content: '☀️';
  left: auto;
  right: 2px;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  transition: all 0.3s;
}

[data-theme="light"] .theme-toggle::after {
  left: 20px;
}

/* ========== 轮播图 ========== */
.banner-slider {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.slider-container {
  display: flex;
  transition: transform 0.5s ease;
}

.slider-slide {
  min-width: 100%;
  position: relative;
}

.slider-slide img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.slider-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 40px 30px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
}

.slider-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.slider-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.slider-desc {
  font-size: 14px;
  opacity: 0.9;
  max-width: 600px;
}

.slider-dots {
  position: absolute;
  bottom: 20px;
  right: 40px;
  display: flex;
  gap: 8px;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s;
}

.slider-dot.active {
  background: var(--primary);
  transform: scale(1.2);
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 10;
}

.slider-arrow:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.slider-arrow.prev { left: 20px; }
.slider-arrow.next { right: 20px; }

/* ========== 热门游戏标签 ========== */
.game-tags {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.game-tags-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-tags-label {
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.game-tags-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
}

.game-tag {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.3s;
}

.game-tag:hover,
.game-tag.active {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(230, 57, 70, 0.1);
}

/* ========== 主内容区 ========== */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}

/* ========== 内容卡片 ========== */
.content-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

.more-link {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.3s;
}

.more-link:hover {
  color: var(--primary);
}

/* ========== 新闻卡片 ========== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.news-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s;
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.news-card.featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
}

.news-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.news-card.featured .news-image {
  height: 100%;
  min-height: 280px;
}

.news-content {
  padding: 16px;
}

.news-card.featured .news-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-category {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(230, 57, 70, 0.15);
  color: var(--primary);
  font-size: 12px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.news-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card.featured .news-title {
  font-size: 22px;
  -webkit-line-clamp: 3;
}

.news-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.news-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========== 热门攻略 ========== */
.strategy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.strategy-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.3s;
  cursor: pointer;
}

.strategy-card:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.strategy-image {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.strategy-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.strategy-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.strategy-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== 侧边栏 ========== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ========== 热门话题 ========== */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topic-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
  transition: all 0.3s;
}

.topic-item:hover {
  background: var(--bg-hover);
}

.topic-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: 4px;
}

.topic-rank.top {
  color: var(--primary);
  background: rgba(230, 57, 70, 0.15);
}

.topic-info {
  flex: 1;
}

.topic-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.topic-count {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== 热门帖子 ========== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-item {
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.post-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.post-content {
  flex: 1;
}

.post-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s;
}

.post-item:hover .post-title {
  color: var(--primary);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== 游戏排行榜 ========== */
.game-rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
  transition: all 0.3s;
}

.game-rank-item:hover {
  background: var(--bg-hover);
}

.game-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
}

.game-rank.top1 { color: #ffd700; }
.game-rank.top2 { color: #c0c0c0; }
.game-rank.top3 { color: #cd7f32; }

.game-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.game-info {
  flex: 1;
}

.game-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.game-type {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== 底部 ========== */
.footer {
  margin-top: 60px;
  padding: 40px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.footer-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-section h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1400px;
  margin: 30px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .main {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    order: -1;
  }
  
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header-center {
    display: none;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .news-card.featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
  
  .news-card.featured .news-image {
    height: 200px;
  }
  
  .game-rank-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
