/* 全局样式重置和变量定义 */
:root {
  --primary-color: #6200ea;
  --primary-color-rgb: 98, 0, 234;
  --secondary-color: #b388ff;
  --background-dark: #121212;
  --surface-dark: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --max-width: 1440px;
  --header-height: 80px;
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: var(--background-dark);
  color: var(--text-primary);
  line-height: 1.6;
}

/* 导航栏样式 */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--surface-dark);
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.main-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  font-size: 1.8rem;
  color: var(--primary-color);
}

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

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--secondary-color);
}

/* 主要内容区域 */
main {
  margin-top: var(--header-height);
}

section {
  padding: 4rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Hero区域 */
.hero-section {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-dark);
  padding: 2rem;
}

.hero-content {
  width: 100%;
  max-width: var(--max-width);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: start;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  height: 100%;
}

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

.hero-text {
  text-align: left;
  max-width: 600px;
}

.hero-text h2 {
  font-size: 3.2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  text-align: left;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-text p {
  font-size: 1.3rem;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.4;
}

/* 游戏区域 */
.game-container {
  flex: 1;
  min-height: 500px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 4/3;
}

.game-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--primary-color-rgb), 0.5),
    transparent
  );
}

.game-container::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--primary-color-rgb), 0.3),
    transparent
  );
}

.game-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

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

.game-frame:fullscreen {
  background: #000;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  object-fit: contain;
}

/* 兼容 Webkit 浏览器 */
.game-frame:-webkit-full-screen {
  background: #000;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  object-fit: contain;
}

/* 兼容 Firefox */
.game-frame:-moz-full-screen {
  background: #000;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  object-fit: contain;
}

/* 兼容 IE */
.game-frame:-ms-fullscreen {
  background: #000;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  object-fit: contain;
}

/* 游戏控制按钮 */
.game-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-container:hover .game-controls {
  opacity: 1;
}

.control-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.control-button:hover {
  background: var(--primary-color);
  transform: scale(1.1);
}

.control-button svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.control-button:hover svg {
  transform: scale(0.9);
}

.control-button.refresh:hover svg {
  transform: rotate(180deg);
}

/* 全屏模式样式 */
.game-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  border-radius: 0;
  aspect-ratio: unset;
}

.game-container.fullscreen .game-controls {
  top: 2rem;
  right: 2rem;
}

.game-container.fullscreen .control-button {
  width: 48px;
  height: 48px;
}

.game-container.fullscreen .control-button svg {
  width: 28px;
  height: 28px;
}

/* 特性区域样式 */
.feature-grid {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.feature-grid:hover {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-5px);
}

.feature-item {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.feature-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.feature-item:first-child {
  padding-top: 0;
}

.feature-item h3 {
  font-size: 1.2rem;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-item h3::before {
  content: "★";
  color: var(--primary-color);
  font-size: 1rem;
}

.feature-item p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 1.5rem;
}

/* 视频区域 */
.video-container {
  aspect-ratio: 16/9;
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
  background-color: var(--surface-dark);
  border-radius: 8px;
  overflow: hidden;
}

.video-frame {
  width: 100%;
  height: 100%;
}

/* 页脚样式 */
.site-footer {
  background-color: var(--surface-dark);
  padding: 2rem;
  text-align: center;
  margin-top: 4rem;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero-content h2 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 1.2rem;
  }

  section {
    padding: 2rem 1rem;
  }
}

/* 通用标题样式 */
h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--primary-color);
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeIn 0.8s ease-out;
}

/* 截图轮播区域 */
.screenshots-section {
  background-color: var(--background-dark);
  padding: 4rem 2rem;
}

.carousel-container {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
}

.screenshot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
}

.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-button:hover {
  background: var(--primary-color);
}

.carousel-button.prev {
  left: 20px;
}

.carousel-button.next {
  right: 20px;
}

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.3s ease;
}

.carousel-dot.active {
  background: var(--primary-color);
  transform: scale(1.2);
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-right {
    gap: 2rem;
  }

  .feature-grid {
    max-width: 800px;
    margin: 0 auto;
  }

  .game-container {
    min-height: 400px;
    aspect-ratio: 16/9;
  }
}

@media (max-width: 768px) {
  .feature-item {
    padding: 1rem 0;
  }

  .feature-item h3 {
    font-size: 1.1rem;
  }

  .feature-item p {
    font-size: 0.9rem;
  }

  .hero-right {
    gap: 1.5rem;
  }

  .game-container {
    min-height: 300px;
  }
}

/* 游戏推荐区域 */
.recommendations-section {
  background-color: var(--surface-dark);
  padding: 4rem 2rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.game-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.game-image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

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

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

.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.play-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: translateY(20px);
}

.game-card:hover .play-button {
  transform: translateY(0);
}

.play-button:hover {
  background: var(--secondary-color);
}

.game-info {
  padding: 1.5rem;
}

.game-info h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.game-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.game-tags {
  display: flex;
  gap: 0.5rem;
}

.tag {
  background: rgba(98, 0, 234, 0.2);
  color: var(--secondary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .game-card {
    max-width: 500px;
    margin: 0 auto;
  }
}

/* 语言切换按钮 */
.language-switch {
  position: relative;
  margin-left: 2rem;
  z-index: 1001;
}

.language-select-wrapper {
  position: relative;
  min-width: 120px;
}

.language-select-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(var(--primary-color-rgb), 0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.language-select-header:hover {
  background: rgba(var(--primary-color-rgb), 0.2);
}

.language-select-header span {
  margin-right: 0.5rem;
  color: var(--text-primary);
}

.language-select-header::after {
  content: "▼";
  font-size: 0.8em;
  transition: transform 0.3s ease;
}

.language-switch.active .language-select-header::after {
  transform: rotate(180deg);
}

.language-options {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--surface-dark);
  border-radius: 4px;
  margin-top: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.language-switch.active .language-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.language-option:hover {
  background: rgba(var(--primary-color-rgb), 0.1);
}

.language-option.selected {
  background: rgba(var(--primary-color-rgb), 0.2);
  font-weight: 500;
}

@media (max-width: 768px) {
  .language-switch {
    margin-left: 1rem;
  }

  .language-select-wrapper {
    min-width: 100px;
  }

  .language-select-header {
    padding: 0.4rem 0.8rem;
  }
}
