/* ========== 全局变量和基础样式 ========== */
:root {
  --primary-color: #ffb400;
  --secondary-color: #48c6ef;
  --background: #0d0d0d;
  --card-bg: #1c1c1c;
  --text: #f2f2f2;
  --muted: #888;
  --hover-glow: rgba(255, 180, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ========== Header 样式 ========== */
header {
  background: linear-gradient(135deg, var(--primary-color), #ff8c00);
  color: #000;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 20px rgba(255, 180, 0, 0.3);
}

/* 首页Header */
.home-header {
  text-align: center;
}

/* 游戏页面Header */
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.logo-box {
  width: 52px;
  height: 52px;
  background: linear-gradient(145deg, #000, #333);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* 游戏页面的logo稍小一些 */
.game-page .logo-box {
  width: 45px;
  height: 45px;
  border-radius: 10px;
}

.logo-box span {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  color: var(--primary-color);
  filter: drop-shadow(0 0 5px var(--primary-color));
}

.game-page .logo-box span {
  font-size: 1.4rem;
}

.site-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.2rem;
  letter-spacing: 3px;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-page .site-title {
  font-size: 1.8rem;
  letter-spacing: 2px;
}

.tagline {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  opacity: 0.9;
}

.back-button {
  background: rgba(0,0,0,0.3);
  color: #fff;
  border: 2px solid #fff;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-button:hover {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
}

/* ========== 主页游戏区域样式 ========== */
section {
  padding: 3rem 0;
  margin: 0 1rem;
}

.section-title {
  font-size: 2.2rem;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 30px;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

.carousel-container {
  position: relative;
  overflow: hidden;
  padding: 0 60px;
}

.carousel {
  display: flex;
  gap: 15px;
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

.game-card {
  flex: 0 0 auto;
  width: 220px;
  height: 340px;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  position: relative;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 180, 0, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.game-card:hover {
  transform: scale(1.05) translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 30px var(--hover-glow);
}

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

.game-thumbnail {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #2c3e50, #3498db, #9b59b6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

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

.game-thumbnail::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}

.game-card:hover .game-thumbnail::after {
  left: 100%;
}

.game-info {
  padding: 1.5rem;
  height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 1.5em;
  line-height: 1.5;
}

.game-category {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.8rem;
}

.play-button {
  background: linear-gradient(135deg, var(--primary-color), #ff8c00);
  color: #000;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: center;
  box-shadow: 0 4px 15px rgba(255, 180, 0, 0.3);
}

.play-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 180, 0, 0.5);
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.7);
  border: none;
  color: var(--text);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.carousel-nav:hover {
  background: rgba(255, 180, 0, 0.8);
  color: #000;
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}

.loading-placeholder {
  background: linear-gradient(90deg, #1c1c1c 25%, #2a2a2a 50%, #1c1c1c 75%);
  background-size: 200% 100%;
  animation: loading 2s infinite;
}

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

/* ========== 游戏页面专用样式 ========== */
.game-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.game-main {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.game-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  border-bottom: 1px solid #333;
}

.game-header .game-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  text-align: left;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  height: auto;
}

.game-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.game-badge {
  background: linear-gradient(135deg, var(--primary-color), #ff8c00);
  color: #000;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
}

.game-description {
  color: var(--muted);
  line-height: 1.6;
}

.game-frame-container {
  position: relative;
  width: 100%;
  height: 600px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: opacity 0.5s ease;
}

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

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.game-controls {
  padding: 1.5rem;
  background: #1a1a1a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-button {
  background: linear-gradient(135deg, var(--primary-color), #ff8c00);
  color: #000;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.control-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 180, 0, 0.5);
}

.control-button.secondary {
  background: linear-gradient(135deg, var(--secondary-color), #00bcd4);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.info-panel {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.info-panel h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.game-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: #1a1a1a;
  border-radius: 8px;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-color);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stars {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.related-games {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.related-game {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #1a1a1a;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.related-game:hover {
  background: #2a2a2a;
  transform: translateX(5px);
}

.related-thumbnail {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #2c3e50, #3498db);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.related-info h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.related-info p {
  font-size: 0.8rem;
  color: var(--muted);
}

.fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: var(--text);
  border: none;
  padding: 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  z-index: 10;
}

.fullscreen-btn:hover {
  background: var(--primary-color);
  color: #000;
}

/* ========== Footer 样式 ========== */
footer {
  background: linear-gradient(135deg, #111, #1a1a1a);
  text-align: center;
  font-size: 0.9rem;
  padding: 2rem;
  color: #666;
  margin-top: 3rem;
  border-top: 1px solid #333;
}

footer a {
  color: var(--secondary-color);
  text-decoration: none;
  margin: 0 0.8rem;
  transition: color 0.3s ease;
}

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

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  /* Header响应式 */
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  /* 轮播图响应式 */
  .carousel-container {
    padding: 0 50px;
  }
  
  .game-card {
    width: 180px;
    height: 300px;
  }
  
  .game-thumbnail {
    height: 140px;
    font-size: 2.5rem;
  }
  
  .game-info {
    padding: 1.5rem;
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  /* 游戏页面响应式 */
  .game-page .game-title {
    font-size: 2rem;
  }
  
  .game-controls {
    flex-direction: column;
    gap: 1rem;
  }
  
  .game-frame-container {
    height: 400px;
  }
}

@media (max-width: 480px) {
  .carousel-container {
    padding: 0 40px;
  }
  
  .game-card {
    width: 160px;
    height: 280px;
  }
  
  .carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}