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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(80 / 1920 * 100vw);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
    "Microsoft JhengHei", sans-serif;
  color: #333;
  background: #fff;
}

a {
  text-decoration: none;
}

/* ===== 页面容器 ===== */
.site-wrap {
  width: 100%;
  margin: 0 auto;
  background: #fff;
}

/* ===== 顶部 Tabs 栏（设计稿基准 1920×80）===== */
.header {
  --header-design-w: 1920;
  --header-design-h: 80;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  aspect-ratio: 1920 / 52;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  container-type: size;
  container-name: header;
}

.header-inner {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  line-height: normal;
}

.header-social {
  grid-column: 3;
  justify-self: end;
  margin-right: 1.25cqw;
  display: flex;
  align-items: center;
  gap: 0.521cqw;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.is-scrolled .header-social {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.header-social .social-btn {
  display: block;
  line-height: 0;
  transition: opacity 0.2s;
}

.header-social .social-btn:hover {
  opacity: 0.85;
}

.header-social .social-btn img {
  display: block;
  width: 2.0cqw;
  height: 2.0cqw;
}

/* 顶部未滚动：hero 叠在导航栏上；滚动后导航栏盖住 logo */
body:not(.is-scrolled) .hero {
  z-index: 101;
}

body.is-scrolled .header {
  z-index: 110;
}

body.is-scrolled .hero {
  z-index: 1;
}

.tabs-nav {
  grid-column: 2;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-item {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20cqh 2.083cqw;
  font-size: 1.042cqw;
  color: #666;
  font-weight: 900;
  transition: color 0.2s;
}

.tab-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 17.5cqh;
  background: #e0e0e0;
}

.tab-item span {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

/* ===== 第二模块（设计稿基准 1920×917）===== */
.module-2 {
  --m2-design-w: 1920;
  --m2-design-h: 917;
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 917;
  line-height: 0;
  overflow: hidden;
  container-type: size;
  container-name: module2;
}

.module-2-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2cqh 0.833cqw 5cqh;
  line-height: normal;
}

.module-2-title,
.module-3-title {
  display: block;
  margin: 0 auto;
  width: 14.583cqw;
  height: auto;
  flex-shrink: 0;
  pointer-events: none;
  position: relative;
  bottom: 1.309cqh;
}

/* ===== 第三模块（设计稿基准 1920×1029）===== */
.module-3 {
  --m3-design-w: 1920;
  --m3-design-h: 1029;
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 1029;
  line-height: 0;
  overflow: hidden;
  container-type: size;
  container-name: module3;
}

.module-3-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2cqh 0.833cqw 5cqh;
  line-height: normal;
}

.module-3-bg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-2-bg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 选中态：黑色文字 + 粉色下划线 */
.tab-item.active {
  color: #000;
}

.tab-item.active span::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -27.5cqh;
  width: 100%;
  height: max(2px, 0.156cqw);
  background: #e8637a;
  border-radius: 2px;
}

@container header (max-width: 768px) {
  .header-inner {
    display: flex;
    align-items: center;
    padding-right: 1.25cqw;
  }

  .tabs-nav {
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
  }

  .header-social {
    flex-shrink: 0;
    margin-right: 0;
    margin-left: 0.521cqw;
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 52px;
  }

  .header {
    aspect-ratio: auto;
    height: 52px;
    min-height: 52px;
  }

  .tab-item {
    padding: 0 14px;
    font-size: 14px;
  }

  .tab-item:not(:last-child)::after {
    height: 16px;
  }

  .tab-item.active span::after {
    bottom: -6px;
    height: 2px;
  }

  .header-social {
    gap: 6px;
    margin-left: 8px;
  }

  .header-social .social-btn img {
    width: auto;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .header {
    height: 48px;
    min-height: 48px;
  }

  html {
    scroll-padding-top: 48px;
  }

  .tab-item {
    padding: 0 10px;
    font-size: 13px;
  }

  .header-social .social-btn img {
    height: 16px;
  }
}

/* ===== Hero 首屏模块（桌面设计稿 1920×974，手机 1080×1103）===== */
.hero {
  --hero-split-top: 729;
  --hero-split-bottom: 244;
  --hero-split-total: 974;
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 974;
  line-height: 0;
  overflow: visible;
  container-type: size;
  container-name: hero;
}

.hero-bg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.hero-bg-split {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.hero-bg-top {
  flex: var(--hero-split-top) 0 0;
  overflow: hidden;
}

.hero-bg-bottom {
  flex: var(--hero-split-bottom) 0 0;
  overflow: visible;
  position: relative;
}

.hero-bg-bottom img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.hero-bg-top img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.hero-bg-mobile {
  display: none;
}

.hero-content {
  position: absolute;
  inset: 0;
  line-height: normal;
}

/* Logo 左上角（设计稿桌面 1920×974，手机 1080×1103）*/
.hero-logo {
  position: absolute;
  left: 7.8125cqw;
  top: 0;
  transform: translateY(-40%);
  z-index: 3;
  line-height: 0;
}

.hero-logo img {
  display: block;
  width: 5.208cqw;
  height: auto;
  max-width: none;
}

/* 下载按钮 2x2 网格（锚定在第二张背景图顶部居中） */
.download-btns {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 1.848cqh 1.25cqw;
  justify-content: center;
  z-index: 2;
  line-height: normal;
}

.download-btn {
  display: block;
  line-height: 0;
  transition: opacity 0.2s;
}

.download-btn:hover {
  opacity: 0.85;
}

.download-btn img {
  display: block;
  height: max(38px, 7.392cqh);
  width: auto;
}

/* TOP-UP 切图内边距较大，略放大以与其他商店按钮视觉一致 */
.download-btn img[alt="TOP-UP"] {
  height: max(40px, 7.695cqh);
  position: relative;
  bottom: 3px;
}

/* 右侧社群按钮（固定于视口，随页面滚动始终可见） */
.social-sidebar {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 102;
  padding: 16px 12px;
  border-radius: 12px;
}

.social-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  pointer-events: none;
}

body.is-scrolled .social-sidebar::before {
  opacity: 1;
}

.social-btn {
  display: block;
  line-height: 0;
  transition: opacity 0.2s;
}

.social-btn:hover {
  opacity: 0.85;
}

.social-btn img {
  display: block;
  width: 44px;
  height: 44px;
}

@container hero (max-width: 768px) {
  .hero-logo {
    left: auto;
    right: 1.481cqw;
    top: 1.088cqh;
    transform: none;
  }

  .hero-logo img {
    width: 8.333cqw;
  }
}

@container hero (max-width: 480px) {
  .hero-logo {
    left: 1.111cqw;
    right: auto;
    top: 0.906cqh;
  }

  .hero-logo img {
    width: 19.407cqw;
  }
}

/* ===== Hero 手机端适配 ===== */
@media (max-width: 768px) {
  .hero {
    aspect-ratio: 1080 / 1103;
  }

  .hero-bg-split {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
  }

  .hero-bg-top {
    display: none;
  }

  .hero-bg-bottom {
    position: absolute;
    inset: 0;
    flex: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 40px;
    pointer-events: none;
  }

  .hero-bg-bottom img {
    display: none;
  }

  .hero-bg-mobile {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .hero-bg-mobile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero-content {
    z-index: 1;
    pointer-events: none;
  }

  .hero-logo {
    pointer-events: auto;
  }

  .download-btns {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    z-index: 5;
    margin: 0;
    gap: 10px 12px;
    pointer-events: auto;
  }

  .download-btn {
    min-height: 38px;
  }

  /* 不用 cqh/cqw：嵌套绝对定位下容器单位会解析为 0，导致 a/img 无高度 */
  .hero .download-btns .download-btn img {
    display: block;
    height: 38px;
    min-height: 38px;
    width: auto;
    max-height: none;
    position: static;
    bottom: auto;
  }

  .hero .download-btns .download-btn img[alt="TOP-UP"] {
    height: 40px;
    min-height: 40px;
  }

  .social-sidebar {
    right: 12px;
    gap: 14px;
    padding: 12px 8px;
  }

  .social-btn img {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .social-sidebar {
    right: 8px;
    gap: 12px;
    padding: 10px 6px;
  }

  .social-btn img {
    width: 32px;
    height: 32px;
  }
}

