/* ============================================
   《钟鸣九州》游戏网站 - 样式文件
   ============================================ */

/* CSS变量 */
:root {
  /* 背景色 */
  --bg-cream: #FFF5E1;
  --bg-sky: #87CEEB;
  --bg-grass: #90EE90;

  /* 主题色 */
  --primary: #4CAF50;
  --secondary: #FF6B6B;
  --accent: #FFD93D;
  --sky-blue: #74B9FF;

  /* 文字色 */
  --text-dark: #2D3436;
  --text-light: #636E72;

  /* 像素UI */
  --pixel-border: #1A1A2E;

  /* 间距 */
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 48px;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Courier Prime', 'Microsoft YaHei', monospace;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../assets/images/sky_background.png');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  z-index: -1;
}

/* 像素图清晰显示 - 关键属性 */
.pixel-art {
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  image-rendering: -o-crisp-edges;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ============================================
   导航栏
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 245, 225, 0.4);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(255, 245, 225, 0.6);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: block;
}

.nav-logo img {
  height: 75px;
  width: auto;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--spacing-lg);
}

.nav-link {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 700;
  font-size: 16px;
  position: relative;
  padding: var(--spacing-sm) 0;
  transition: color 0.3s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--primary);
  transition: width 0.3s;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-dark);
  transition: all 0.3s;
}

/* ============================================
   Hero 区域
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 60px;
  margin-top: -80px;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: transparent;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  width: 100%;
  height: 100%;
  justify-content: flex-end;
}

.hero-logo {
  display: block;
  margin-bottom: 0;
  width: 100%;
  height: auto;
  max-height: 70vh;
}

.hero-logo img {
  width: 64%;
  height: 64%;
  object-fit: contain;
  animation: logoFall 0.6s ease-out;
}

@keyframes logoFall {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.hero-dialog-wrapper {
  position: relative;
  width: 90vw;
  max-width: 90vw;
  margin: 0 auto;
  height: 50vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-portraits-container {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  gap: 0;
  align-items: flex-end;
}

.hero-left-portrait,
.hero-right-portrait {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  animation: portraitAppear 0.6s ease-out 0.2s backwards;
}

.hero-right-portrait {
  margin-left: -150px;
}

.hero-left-portrait img,
.hero-right-portrait img {
  max-height: 50vh;
  width: auto;
  display: block;
}

.hero-dialog-box {
  position: relative;
  margin-left: 0;
  width: 75vw;
  height: 19vh;
  z-index: 10;
  flex-shrink: 0;
}

.hero-dialog-box .dialog-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-dialog-content {
  position: relative;
  z-index: 2;
  padding: 50px 30px 0px 30px;
  color: white !important;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  box-sizing: border-box;
}

.dialog-text {
  font-size: 14px;
  line-height: 1.6;
  color: white !important;
  text-align: left;
}



.player-keys {
  font-size: 13px;
  color: #FFD93D;
  line-height: 1.6;
}

.hero-download-btn {
  display: inline-block;
  position: relative;
  text-decoration: none;
  transition: transform 0.1s;
  margin-top: var(--spacing-xl);
}

.hero-download-btn .btn-bg {
  width: 160px;
  height: auto;
}

.hero-download-btn span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: 700;
  font-size: 16px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.hero-download-btn:hover {
  transform: scale(1.05);
}

.hero-download-btn:active {
  transform: scale(0.95);
}

/* ============================================
   场地展示区
   ============================================ */
.stage {
  position: relative;
  width: 100%;
  min-height: 120vh;
  overflow: hidden;
  background: transparent;
  padding: var(--spacing-xl) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3vh;
}

.stage-container {
  position: relative;
  margin: 0 auto;
  background-image: url('../assets/images/building_background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 6px solid var(--pixel-border);
  box-shadow: 8px 8px 0 var(--pixel-border);
  padding: 2% 6% 4% 6%;
  width: 40vw;
  height: auto;
  aspect-ratio: 900 / 350;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.stage-video {
  width: 60vw;
  max-width: 60vw;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
}

.stage-video iframe {
  width: 100%;
  height: 100%;
  border: 4px solid var(--pixel-border);
  box-shadow: 4px 4px 0 var(--pixel-border);
}

.stage-bg {
  display: none;
}

.npc-container {
  position: relative;

  display: flex;
  justify-content: bottom;
  align-items: flex-end;
  gap: 40px;
  padding-bottom: 0;
}

.npc {
  position: relative;
  width: 16vw;
  height: 16vw;
  max-width: 120px;
  max-height: 120px;
}

.sprite-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* ============================================
   截图轮播区
   ============================================ */
.screenshots {
  padding: var(--spacing-xl) 0;
  background: transparent;
}

.section-title {
  font-size: 48px;
  text-align: center;
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
  font-weight: bold;
  letter-spacing: 2px;
}

.section-desc {
  text-align: center;
  color: var(--text-light);
  margin-bottom: var(--spacing-lg);
  font-size: 18px;
}

.banner-carousel {
  position: relative;
  max-width: 80vw;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.banner-viewport {
  flex: 1;
  border: 4px solid var(--pixel-border);
  box-shadow: 4px 4px 0 var(--pixel-border);
  overflow: hidden;
  background: var(--bg-cream);
}

.banner-viewport img {
  width: 100%;
  height: auto;
  display: block;
}

.banner-prev,
.banner-next {
  width: 5vw;
  height: 5vw;
  min-width: 50px;
  min-height: 50px;
  border: 4px solid var(--pixel-border);
  background: var(--primary);
  color: white;
  font-size: 3vw;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: bold;
  box-shadow: 2px 2px 0 var(--pixel-border);
}

.banner-prev:hover,
.banner-next:hover {
  background: var(--accent);
  color: var(--text-dark);
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--pixel-border);
}

.banner-prev:active,
.banner-next:active {
  transform: translateY(0);
  box-shadow: 2px 2px 0 var(--pixel-border);
}

.banner-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: bold;
  border: 2px solid white;
}

/* ============================================
   下载区域
   ============================================ */
.download {
  padding: var(--spacing-xl) 0;
  background: transparent;
}

.dialog-box {
  background: var(--bg-cream);
  border: 4px solid var(--pixel-border);
  box-shadow: 6px 6px 0 var(--pixel-border);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  max-width: 60vw;
  margin: 0 auto;
}

.dialog-portrait {
  flex-shrink: 0;
}

.dialog-portrait img {
  width: 150px;
  height: auto;
}

.dialog-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.dialog-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
}

.dialog-subtext {
  color: var(--text-light);
  margin-bottom: var(--spacing-lg);
}

.download-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  justify-content: center;
}

.download-btn {
  display: inline-block;
  position: relative;
  text-decoration: none;
  transition: transform 0.1s;
}

.download-btn .btn-bg {
  width: 150px;
  height: auto;
}

.download-btn span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.download-btn:hover {
  transform: scale(1.05);
}

.download-btn:active {
  transform: scale(0.95);
}

.download-hint {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
}

/* ============================================
   页脚
   ============================================ */
.footer {
  background: rgba(26, 26, 46, 0.8);
  color: white;
  padding: var(--spacing-xl) 0;
  margin-top: var(--spacing-xl);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.footer-links {
  display: flex;
  gap: var(--spacing-lg);
}

.footer-link {
  color: white;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.3s;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-copyright {
  font-size: 14px;
  opacity: 0.8;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-dialog-container {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
  }

  .hero-left-portrait,
  .hero-right-portrait {
    max-width: 200px;
  }

  .hero-left-portrait img,
  .hero-right-portrait img {
    max-height: 300px;
  }

  .hero-dialog-box {
    flex: 1;
    width: 100%;
    min-height: 250px;
  }

  .stage-container {
    width: 90%;
    margin: 0 auto;
  }

  .dialog-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .dialog-content {
    text-align: center;
  }

  .banner-carousel {
    flex-direction: column;
  }

  .footer-content {
    text-align: center;
  }
}
