/*
  ★ Insight ─────────────────────────────────────
  CSS 设计系统用自定义属性（--color-*）集中管理配色，
  改品牌色只需改 :root 里的几个变量。
  clamp() 让字体在移动端和桌面端之间自动缩放，
  不需要 @media 逐屏写字号。
  ─────────────────────────────────────────────────
*/

/* ==================== CSS 变量 ==================== */
:root {
  /* 配色 — 改这里调整整体风格 */
  --color-bg:         #0a0a0f;
  --color-bg-alt:     #111118;
  --color-surface:    #1a1a24;
  --color-border:     #2a2a3a;
  --color-text:       #e0e0e8;
  --color-text-dim:   #8888a0;
  --color-accent:     #7c8cf8;   /* 糖果蓝紫点缀，可换成你的品牌色 */
  --color-accent-dim: #5a4fcf;

  /* 字体 */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", sans-serif;

  /* 间距 */
  --section-gap: clamp(60px, 10vw, 120px);
  --container-max: 1200px;
  --nav-height: 72px;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* 过渡 */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 重置 & 基础 ==================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ==================== 通用容器 ==================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  text-align: center;
  margin-bottom: clamp(8px, 2vw, 16px);
  letter-spacing: 0.05em;
}

.section-desc {
  text-align: center;
  color: var(--color-text-dim);
  font-size: clamp(1rem, 2vw, 1.15rem);
  margin-bottom: clamp(40px, 8vw, 64px);
}

/* ==================== 导航栏 ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(10, 18, 32, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}

/* JS 会加上这个 class */
.navbar.scrolled {
  background: rgba(10, 16, 28, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 101;
}

.logo-img {
  height: 36px;
  width: auto;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* 导航链接 */
.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.14);
}

/* 汉堡菜单按钮 */
.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.menu-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* 打开状态：变成 X */
.menu-btn.open .menu-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn.open .menu-bar:nth-child(2) {
  opacity: 0;
}

.menu-btn.open .menu-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==================== Hero ==================== */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh; /* 移动端动态视口高度 */
  background:
    linear-gradient(180deg, rgba(10,10,15,0.4) 0%, rgba(10,10,15,0.7) 60%, var(--color-bg) 100%),
    url('../img/hero-bg.jpg') center/cover no-repeat;
  /*
    如果没有 hero-bg.jpg，CSS 渐变本身就是深色背景，效果也不差。
    替换 hero-bg.jpg 即可。
  */
  text-align: center;
  padding: var(--nav-height) 20px 40px;
}

.hero-overlay {
  display: none; /* 用 background gradient 替代，更简洁 */
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  animation: fadeInUp 0.8s ease-out;
}

.hero-logo {
  width: clamp(80px, 15vw, 120px);
  margin: 0 auto clamp(16px, 3vw, 24px);
}

.hero-title {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin-bottom: clamp(12px, 2vw, 20px);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--color-text-dim);
  margin-bottom: clamp(32px, 6vw, 48px);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* Hero 按钮 */
.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--color-accent);
  color: #1a1a1a;
}

.btn-primary:hover {
  background: #9a9fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 140, 248, 0.35);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--color-text);
}

.btn-outline:hover {
  border-color: var(--color-text);
  background: rgba(255, 255, 255, 0.05);
}

/* 向下滚动提示箭头 */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-arrow {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--color-text-dim);
  border-bottom: 2px solid var(--color-text-dim);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease infinite;
}

/* ==================== 游戏特色 ==================== */
.features {
  padding: var(--section-gap) 0;
  background: var(--color-bg-alt);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 3vw, 28px);
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 40px);
  text-align: center;
  transition: transform var(--transition), border-color var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent-dim);
}

.feature-icon {
  color: var(--color-accent);
  margin-bottom: 20px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

.feature-title {
  font-size: 1.15rem;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}

.feature-text {
  font-size: 0.92rem;
  color: var(--color-text-dim);
  line-height: 1.6;
}

/* ==================== 截图画廊 ==================== */
.gallery {
  padding: var(--section-gap) 0;
}

.gallery-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.gallery-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  cursor: grab;
  padding-bottom: 8px;
  user-select: none;
}

.gallery-scroll.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.gallery-scroll::-webkit-scrollbar {
  height: 6px;
}

.gallery-scroll::-webkit-scrollbar-track {
  background: var(--color-surface);
  border-radius: 3px;
}

.gallery-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.gallery-track {
  display: flex;
  gap: 20px;
  padding: 0 clamp(20px, 5vw, 40px);
  max-width: max-content;
  margin: 0 auto;
}

.gallery-item {
  flex-shrink: 0;
  width: clamp(220px, 26vw, 360px);
  scroll-snap-align: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition);
  border: 1px solid var(--color-border);
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  pointer-events: none;
}

.gallery-nav {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(18, 28, 48, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), opacity var(--transition);
  color: #fff;
}

.gallery-nav:hover {
  transform: translateY(-2px);
  background: rgba(32, 52, 88, 0.92);
  border-color: rgba(255, 255, 255, 0.24);
}

.gallery-nav span {
  width: 12px;
  height: 12px;
  display: block;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.gallery-prev span {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.gallery-next span {
  transform: rotate(45deg);
  margin-right: 4px;
}

.gallery-nav:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), width var(--transition);
}

.gallery-dot.active {
  width: 28px;
  background: var(--color-accent);
}

/* 视频 */
.video-section {
  margin-top: clamp(40px, 8vw, 80px);
  text-align: center;
}

.video-title {
  font-size: 1.3rem;
  margin-bottom: 28px;
  letter-spacing: 0.05em;
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ==================== Lightbox ==================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  padding: 40px;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform var(--transition);
}

.lightbox.open .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}

.lightbox-close:hover {
  color: var(--color-accent);
}

/* ==================== 下载入口 ==================== */
.download {
  padding: var(--section-gap) 0;
  background: var(--color-bg-alt);
  text-align: center;
}

.download-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: clamp(32px, 5vw, 48px);
}

.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition);
  border: 2px solid var(--color-border);
  min-width: 200px;
}

.btn-appstore {
  background: #000;
  color: #fff;
}

.btn-appstore:hover {
  border-color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

.btn-googleplay {
  background: #000;
  color: #fff;
}

.btn-googleplay:hover {
  border-color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

.store-icon {
  flex-shrink: 0;
}

.store-text {
  text-align: left;
  line-height: 1.3;
}

.store-text small {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.7;
}

/* 二维码 */
.download-qr p {
  color: var(--color-text-dim);
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.qr-image {
  width: min(220px, 58vw);
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

/* ==================== 关于我们 ==================== */
.about {
  padding: var(--section-gap) 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 8vw, 64px);
  align-items: start;
}

.about-text p {
  margin-bottom: 16px;
  color: var(--color-text-dim);
  line-height: 1.8;
  font-size: 0.95rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
}

.contact-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.contact-card p {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-dim);
  font-size: 0.92rem;
}

.contact-card a {
  color: var(--color-accent);
  transition: color var(--transition);
}

.contact-card a:hover {
  color: var(--color-accent);
}

.contact-icon {
  flex-shrink: 0;
  opacity: 0.5;
}

/* 社交媒体 */
.social-links {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-dim);
  transition: all var(--transition);
}

.social-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* ==================== 页脚 ==================== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer p {
  font-size: 0.88rem;
  color: var(--color-text-dim);
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}

.footer-links a {
  color: var(--color-text-dim);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-divider {
  color: var(--color-border);
}

/* ==================== 滚动揭示动画 ==================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 卡片依次延迟 */
.features-grid .feature-card:nth-child(1) { transition-delay: 0.05s; }
.features-grid .feature-card:nth-child(2) { transition-delay: 0.10s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.15s; }
.features-grid .feature-card:nth-child(4) { transition-delay: 0.20s; }
.features-grid .feature-card:nth-child(5) { transition-delay: 0.25s; }
.features-grid .feature-card:nth-child(6) { transition-delay: 0.30s; }

/* ==================== 关键帧动画 ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollBounce {
  0%, 100% {
    transform: rotate(45deg) translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: rotate(45deg) translateY(8px);
    opacity: 1;
  }
}

/* ==================== 响应式 ==================== */
/* 平板 */
@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  /* 移动端导航 */
  .menu-btn {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: calc(var(--nav-height) + 20px) 28px 28px;
    gap: 4px;
    transition: right var(--transition);
    border-left: 1px solid var(--color-border);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-link {
    padding: 14px 12px;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
  }

  /* 菜单打开时背景遮罩 */
  .nav-links::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition);
  }

  .nav-links.open::before {
    opacity: 1;
  }
}

/* 手机 */
@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: clamp(1.8rem, 10vw, 2.8rem);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 280px;
  }

  .download-buttons {
    flex-direction: column;
    align-items: center;
  }

  .gallery-item {
    width: min(72vw, 340px);
  }

  .gallery-shell {
    gap: 8px;
  }

  .gallery-nav {
    display: none;
  }
}
