/* 设置CSS变量用于主题颜色 */
:root {
  --primary-color: #08aa52; /* 主要绿色 - 用于页眉/页脚 */
  --secondary-color: #740c24; /* 深绿色 - 用于按钮，与主色搭配 */
  --background-color: #ffffff; /* 纯白色背景 */
  --section-bg: #f9faf9; /* 浅灰白色 - 用于区块背景 */
  --dark-text: #111111; /* 深色文字 - 用于浅色背景 */
  --light-text: #ffffff; /* 白色文字 - 用于深色背景 */
  --accent-color: #42c811; /* 强调色 - 使用次要绿色 */
  --border-color: #e5e5e5; /* 边框颜色 */
  --dark-bg: #08aa52; /* 深色背景 */
  --heading-font: "Press Start 2P", cursive, sans-serif;
  --body-font: "Roboto", sans-serif;
}

/* 全局样式重置 */
html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--body-font);
  line-height: 1.6;
  color: var(--dark-text);
  background-color: var(--background-color);
}

.container {
  width: 90%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 排版 */
h1,
h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}
h3 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}
h4,
h5,
h6 {
  font-family: var(--heading-font);
  margin-bottom: 1rem;
  color: var(--primary-color);
}

h1 {
  font-size: 2.5rem;
  color: var(--light-text);
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* 头部样式 */
header {
  background-color: var(--primary-color);
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo h1 {
  margin-bottom: 0;
  font-size: 1.8rem;
  display: inline-block;
  color: var(--light-text);
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: var(--light-text);
  font-weight: bold;
  position: relative;
}

nav ul li a:hover {
  color: var(--secondary-color);
  text-decoration: none;
}

nav ul li a[aria-current="page"] {
  color: var(--secondary-color);
}

nav ul li a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
}

/* 主要内容区域 */
main {
  padding-top: 5rem;
  padding-bottom: 2rem;
}

/* 节区域样式 */
.section-area {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

section {
  margin-bottom: 2rem;
}

/* 左右布局结构 */
.main-layout {
  display: flex;
  gap: 2rem;
}

.main-content {
  flex: 1;
  min-width: 0; /* 防止溢出 */
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
}

/* Play Now 区域 */
#play-now {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.game-container {
  margin-bottom: 1rem;
}

.game-display {
  background-color: #000;
  border: 5px solid #333;
  border-radius: 5px;
  height: 600px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.game-placeholder {
  text-align: center;
  color: #666;
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.control-btn {
  background-color: var(--secondary-color);
  color: var(--light-text);
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 5px;
  font-family: var(--heading-font);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-btn:hover {
  background-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Download 区域 */
#download {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.download-options {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}

.download-card {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  flex: 1;
  min-width: 250px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.download-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.download-btn {
  display: block;
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-btn:hover {
  background-color: var(--secondary-color);
  transform: scale(1.05);
}

/* Features 区域 */
#features {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
}

.feature-card {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* What is 区域 */
#what-is {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
}

.collection-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin-top: 1rem;
}

.collection-list li {
  margin-bottom: 0.5rem;
  position: relative;
}

/* How to Play 区域 */
#how-to-play {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
}

.how-to-play {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.step-number {
  background-color: var(--primary-color);
  color: white;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  margin-bottom: 0.5rem;
}

/* Why Play 区域 */
#why-play {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
}

.why-play-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.why-play-item {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.why-play-item h3 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

/* FAQ 区域 */
#faq {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
}

.faq-content {
  
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  color: var(--secondary-color);
  margin-bottom: 0.8rem;
  cursor: pointer;
}

.view-more-btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border-radius: 5px;
  margin-top: 1rem;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
}

.view-more-btn:hover {
  background-color: var(--secondary-color);
  text-decoration: none;
  transform: translateY(-2px);
}

/* SEO 内容区域 */
.seo-content {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.seo-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.seo-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.content-columns {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.column {
  flex: 1;
}

.timeline {
  list-style: none;
  padding-left: 1.5rem;
  border-left: 2px solid var(--primary-color);
}

.timeline li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary-color);
}

/* 游戏卡片样式 */
.game-recommendation {
  margin-top: 1.5rem;
}

.game-card {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.game-card-img {
  height: 150px;
  background-size: cover;
  background-position: center;
  border-bottom: 3px solid var(--primary-color);
}

.snake-preview {
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
    url("https://via.placeholder.com/300x150?text=Snake");
}

.tetris-preview {
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
    url("https://via.placeholder.com/300x150?text=Tetris");
}

.pacman-preview {
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
    url("https://via.placeholder.com/300x150?text=Pac-Man");
}

.space-invaders-preview {
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
    url("https://via.placeholder.com/300x150?text=Space+Invaders");
}

.game-card-info {
  padding: 1.2rem;
}

.game-card-info h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.game-card-info p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: #333333;
}

.game-card .game-btn {
  width: 100%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.game-card .game-btn:hover {
  background-color: var(--secondary-color);
}

/* 分数板样式 */
.top-scores {
  margin-top: 2.5rem;
}

.score-board {
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 1rem;
}

.score-header,
.score-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 0.8rem 1rem;
  text-align: center;
}

.score-header {
  background-color: var(--section-bg);
  font-weight: bold;
  border-bottom: 2px solid var(--primary-color);
}

.score-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-item:last-child {
  border-bottom: none;
}

.score-item span:last-child {
  color: var(--accent-color);
  font-weight: bold;
}

/* 页脚样式 */
footer {
  background-color: var(--primary-color);
  color: var(--light-text);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column {
  flex: 1;
  min-width: 200px;
}

footer h4 {
  color: var(--light-text);
  margin-bottom: 1.5rem;
}

footer ul {
  list-style: none;
}

footer ul li {
  margin-bottom: 0.5rem;
}

footer ul li a {
  color: var(--light-text);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

footer ul li a:hover {
  opacity: 1;
  color: var(--secondary-color);
}

.social-links li a {
  display: flex;
  align-items: center;
}

.copyright {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--light-text);
  opacity: 0.8;
}

/* About 页面样式 */
.about-section,
.history-section,
.faq-section {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.about-content {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

.about-text {
  flex: 2;
}

.about-image {
  flex: 1;
}

.retro-console-image {
  border: 3px solid var(--primary-color);
  border-radius: 5px;
  overflow: hidden;
}

.timeline-container {
  padding-left: 1.5rem;
  border-left: 3px solid var(--primary-color);
  margin-top: 2rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: 3px solid var(--dark-bg);
}

.timeline-item h3 {
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

.faq-list {
  margin-top: 2rem;
}

.faq-item {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

/* 联系页面样式 */
.contact-section,
.faq-shortcut {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.contact-content {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

.contact-info {
  flex: 1;
}

.contact-form {
  flex: 2;
}

.contact-methods {
  margin-top: 2rem;
}

.contact-method {
  margin-bottom: 1.5rem;
}

.contact-method h4 {
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.contact-social {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  color: var(--dark-text);
  font-family: var(--body-font);
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--background-color);
}

.submit-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 5px;
  font-family: var(--heading-font);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.faq-shortcut {
  text-align: center;
  padding: 1.5rem;
}

.faq-shortcut a {
  font-weight: bold;
}

.tags {
  color: #000;
}

/* 响应式设计 */
@media screen and (max-width: 992px) {
  .main-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .content-columns {
    flex-direction: column;
  }

  .download-options {
    flex-direction: column;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .why-play-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  header .container {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    justify-content: center;
    flex-wrap: wrap;
  }

  nav ul li {
    margin: 0 0.75rem;
  }

  .game-display {
    height: 450px;
  }

  .about-content {
    flex-direction: column;
  }

  .about-image {
    margin-top: 2rem;
  }

  .contact-content {
    flex-direction: column;
  }

  .contact-form {
    margin-top: 2rem;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-play-content {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .game-display {
    height: 200px;
  }

  .footer-column {
    flex: 1 100%;
  }

  .contact-social {
    justify-content: center;
  }

  .step {
    flex-direction: column;
  }

  .step-number {
    margin: 0 auto 1rem auto;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* 侧边栏样式 */
.sidebar-content {
  background-color: var(--section-bg);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.post-meta {
  color: var(--light-text);
}

/* 锚点链接调整，防止内容被固定导航遮挡 */
section[id] {
  scroll-margin-top: 5rem;
}
