/* 古风主题游戏网站样式 - 理科生与北宋沈括的故事 */

/* 基础样式设置 */
:root {
  --color-primary: #8b5a2b;
  --color-primary-light: #d4a76a;
  --color-secondary: #5a3921;
  --color-bg: #f8f4e9;
  --color-text: #333;
  --color-text-light: #f0e6d2;
  --color-dark: rgba(40, 30, 20, 0.9);
  --font-primary: "Noto Serif SC", serif;
  --font-title: "Ma Shan Zheng", cursive;
  --transition-normal: all 0.3s ease;
  --transition-slow: all 0.5s ease;
  --shadow-normal: 0 4px 8px rgba(0, 0, 0, 0.2);
  --shadow-large: 0 10px 20px rgba(0, 0, 0, 0.2);
  --border-radius: 8px;
}

/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 自定义古风滚动条样式 */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(248, 244, 233, 0.8);
  border-left: 1px solid rgba(139, 90, 43, 0.2);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4a76a, #8b5a2b);
  border-radius: 6px;
  border: 2px solid rgba(248, 244, 233, 0.8);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c09255, #744c25);
}

::-webkit-scrollbar-corner {
  background: rgba(248, 244, 233, 0.8);
}

/* 基本样式 */
body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  background-image: url("https://img.freepik.com/free-vector/chinese-pattern-background_53876-90035.jpg");
  background-attachment: fixed;
  background-size: cover;
  background-blend-mode: overlay;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-normal);
}

/* 头部样式 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  background: var(--color-dark);
  border-bottom: 1px solid var(--color-primary-light);
  z-index: 1000;
  transition: var(--transition-normal);
}

.header.scrolled {
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-title {
  font-family: var(--font-title);
  color: var(--color-primary-light);
  font-size: 2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  margin: 0;
}

.nav ul {
  display: flex;
  gap: 20px;
}

.nav a {
  color: var(--color-text-light);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  position: relative;
}

.nav a:hover {
  color: var(--color-primary-light);
}

.nav a:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary-light);
  transition: var(--transition-normal);
  transform: translateX(-50%);
}

.nav a:hover:after {
  width: 80%;
}

/* 导航高亮样式 - 指示当前页面 */
.nav a.active-link {
  background-color: rgba(139, 90, 43, 0.3);
  color: var(--color-primary-light);
  position: relative;
  border: 1px solid rgba(212, 167, 106, 0.4);
}

.nav a.active-link:after {
  width: 80%;
}

.nav a.active-link:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://img.freepik.com/free-vector/chinese-pattern-background_53876-90035.jpg");
  background-size: cover;
  opacity: 0.1;
  border-radius: var(--border-radius);
  z-index: -1;
}

.nav a.ancient-hover {
  background-color: rgba(139, 90, 43, 0.15);
  text-shadow: 0 0 5px rgba(212, 167, 106, 0.5);
  transform: translateY(-2px);
}

.nav-highlight {
  background-color: var(--color-primary);
  color: var(--color-text-light) !important;
}

/* 英雄区域样式 */
.hero-section {
  height: 100vh;
  background-image: url("hero-bg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  display: flex;
  align-items: center;
  color: var(--color-text-light);
  text-align: center;
}

.hero-section:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-large);
}

.hero-content h2 {
  font-family: var(--font-title);
  font-size: 3.5rem;
  margin-bottom: 20px;
  line-height: 1.2;
  color: var(--color-primary-light);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 30px;
  font-style: italic;
}

.btn {
  display: inline-block;
  padding: 12px 25px;
  background: var(--color-primary);
  color: var(--color-text-light);
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-normal);
}

.btn:hover {
  background: var(--color-secondary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-large);
}

.btn-primary {
  background: var(--color-primary);
  font-weight: bold;
}

.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-text-light);
  font-size: 0.9rem;
  opacity: 0.8;
}

.scroll-down i {
  font-size: 1.5rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* 一般部分样式 */
.section {
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}

.section-dark {
  background-color: var(--color-dark);
  color: var(--color-text-light);
}

.section-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 15px;
  color: var(--color-primary);
  position: relative;
}

.section-subtitle {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 50px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* 游戏概述样式 */
.overview-content {
  display: flex;
  gap: 40px;
  align-items: center;
}

.overview-text {
  flex: 1;
  background: rgba(255, 255, 255, 0.8);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-normal);
  border: 1px solid var(--color-primary-light);
  position: relative;
}

.overview-text::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 1px dashed var(--color-primary-light);
  border-radius: calc(var(--border-radius) - 2px);
  pointer-events: none;
}

.overview-text p {
  margin-bottom: 20px;
  line-height: 1.8;
}

.overview-image {
  flex: 1;
  height: 400px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-primary-light);
  background-image: url("https://img.freepik.com/free-vector/hand-painted-watercolor-chinese-landscape-background_52683-69876.jpg");
  background-size: cover;
  background-position: center;
}

.image-placeholder {
  background: rgba(0, 0, 0, 0.7);
  color: var(--color-text-light);
  padding: 15px 30px;
  border-radius: var(--border-radius);
  font-style: italic;
}

/* 特色区域样式 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 30px;
  text-align: center;
  transition: var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover {
  transform: translateY(-10px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-large);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--color-primary-light);
}

.feature-card h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
}

/* 章节预览样式 */
.chapters-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.chapter-card {
  padding: 35px 20px 30px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--border-radius);
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow: var(--shadow-normal);
  transition: var(--transition-normal);
  border: 1px solid var(--color-primary-light);
  display: flex;
  flex-direction: column;
}

.chapter-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-large);
}

.chapter-card::before {
  content: attr(data-number);
  position: absolute;
  top: 5px;
  right: 10px;
  font-family: var(--font-title);
  font-size: 4rem;
  color: var(--color-primary-light);
  opacity: 0.2;
  z-index: -1;
}

.chapter-number {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-text-light);
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 4px;
  margin-bottom: 14px;
}

.chapter-card h3 {
  margin-bottom: 12px;
  font-size: 1.3rem;
  color: var(--color-primary);
}

.chapter-card p {
  font-size: 0.95rem;
  line-height: 1.7;
  flex: 1;
}

/* 下载区域样式 */
.section-download {
  background-image: url("https://img.freepik.com/free-vector/hand-painted-watercolor-nature-background_23-2148941599.jpg");
  background-size: cover;
  background-position: center;
  color: var(--color-text-light);
  text-align: center;
  position: relative;
}

.section-download:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.download-content {
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.7);
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  border-radius: var(--border-radius);
  border: 1px solid var(--color-primary-light);
}

.download-poem {
  font-family: var(--font-title);
  font-size: 1.6rem;
  line-height: 1.8;
  margin-bottom: 30px;
  color: var(--color-primary-light);
}

.download-options {
  margin-bottom: 30px;
}

.btn-download {
  padding: 15px 40px;
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.download-info {
  display: block;
  opacity: 0.8;
  font-size: 0.9rem;
}

.qrcode-container {
  margin-top: 30px;
}

.qrcode-placeholder {
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  color: var(--color-text);
  font-size: 0.8rem;
  text-align: center;
  padding: 10px;
}

/* 页脚样式 */
.footer {
  background: var(--color-dark);
  color: var(--color-text-light);
  padding: 40px 0;
  position: relative;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-poem {
  font-family: var(--font-title);
  font-size: 1.2rem;
  margin-bottom: 20px;
  text-align: center;
  color: var(--color-primary-light);
}

.footer-poem p {
  margin-bottom: 10px;
}

.footer-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  opacity: 0.8;
  transition: var(--transition-normal);
}

.footer-links a:hover {
  opacity: 1;
  color: var(--color-primary-light);
}

/* 淡入动画 */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: 0.2s;
}

.delay-2 {
  transition-delay: 0.4s;
}

/* 响应式调整 */
@media (max-width: 992px) {
  .overview-content {
    flex-direction: column;
  }

  .overview-image {
    width: 100%;
    height: 300px;
  }

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

  .chapters-container {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
  }

  .chapter-card {
    padding: 28px 14px 24px;
  }

  .chapter-card h3 {
    font-size: 1.15rem;
  }

  .chapter-card p {
    font-size: 0.88rem;
  }

  .chapter-card::before {
    font-size: 3.5rem;
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    gap: 15px;
  }

  .nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 60px 0;
  }

  .hero-content {
    padding: 20px;
  }

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

  .footer-content {
    text-align: center;
  }

  .chapters-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .chapter-card {
    min-width: 200px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }
}
