/* 落地页：背景、顶栏、内容区、按钮组 */


/* 内容在背景之上 */
.landing-container {
  position: relative;
  z-index: 1;
}

/* ---------- 顶栏（文档流，背景图从其底部开始） ---------- */
.landing-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 64px;
  padding: 8px 16px;
  flex-shrink: 0;
}

/* ---------- 主背景图（topbar 兄弟节点，顶部贴齐 topbar 底边） ---------- */
.landing-bg {
  width: 100%;
  line-height: 0;
  position: relative;
  z-index: 1;
}

.landing-bg .bg-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 750 / 1413;
}

/* .landing-bg::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 100px;
  background-color: #151723;
  pointer-events: none;
} */

.landing-topbar-icon {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* 铺满顶栏，标题相对整条顶栏左右居中（与左侧图标叠层，左右留白对称） */
.landing-topbar-text {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px calc(48px + 12px + 16px);
  pointer-events: none;
  gap: 2px;
}

.landing-topbar-title {
  margin: 0;
  max-width: 100%;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.landing-topbar-desc {
  margin: 0;
  font-size: 12px;
  opacity: 0.95;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* topbar 下方 50px，水平居中 */
.landing-logo-wrap {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(64px + 50px);
  z-index: 9;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.landing-logo {
  display: block;
  width: auto;
  max-width: min(64.8vw, 288px);
  height: auto;
}

/* ---------- 底部按钮组（相对视口底部，不随背景图高度下移） ---------- */
.landing-actions {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  box-sizing: border-box;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

.landing-actions .landing-promo-banner,
.landing-actions .landing-btn-row,
.landing-actions .landing-btn-download {
  pointer-events: auto;
}

/* 首行：注册按钮 */
.landing-btn-register {
  width: 9rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  background: transparent;
  padding: 0;
}

.landing-btn-register img {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  transform-origin: center;
  animation: landing-register-breathe 2.4s ease-in-out infinite;
}

.landing-btn-register:hover,
.landing-btn-register:active {
  transform: translateY(1px);
  opacity: 0.9;
}

@keyframes landing-register-breathe {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.16));
    opacity: 1;
  }
  50% {
    transform: scale(1.035);
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.24));
    opacity: 0.96;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-btn-register img {
    animation: none;
  }
}

/* 下载按钮上方横幅（铺满 landing-container 宽，设计稿 750×121） */
.landing-promo-banner {
  width: 100%;
  align-self: stretch;
  aspect-ratio: 750 / 121;
  margin-bottom: calc(20px - 14px);
  box-sizing: border-box;
  padding: 0 8%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('../assets/media/hengfu.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
}

.landing-promo-banner__text {
  margin: 0;
  padding: 10px 0;
  width: 100%;
  text-align: center;
  white-space: pre-line;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  -webkit-text-stroke: 0.5px #000000;
  paint-order: stroke fill;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* 二行：下载 / 直接玩 */
.landing-btn-row {
  width: 100%;

  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.landing-btn-download {
  position: relative;
  z-index: 1;
  width: 9.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  background: transparent;
  padding: 0;
}

.landing-btn-download img {
  width: 100%;
  max-width: 145px;
  height: auto;
  display: block;
}

/* 下载按钮上的多语言文案，叠在图片中央 */
.landing-btn-download__text {
  position: absolute;
  left: 34%;
  bottom: 17%;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
}

.landing-btn-download:hover,
.landing-btn-download:active {
  opacity: 0.9;
  transform: scale(0.98);
}

/* ---------- 注册弹窗 ---------- */
.landing-register {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.landing-register.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.landing-register__mask {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(86, 84, 221, 0.6), rgba(7, 10, 37, 0.9));
  backdrop-filter: blur(8px);
}

.landing-register__panel {
  position: relative;
  z-index: 1;
  width: min(360px, 90vw);
  max-height: min(640px, 90vh);
  padding: 24px 20px 20px;
  border-radius: 26px;
  background: linear-gradient(165deg, #4c2af6 0%, #8e3de9 35%, #2632ff 100%);
  box-shadow:
    0 22px 40px rgba(5, 5, 40, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.24s ease-out;
}

.landing-register.is-open .landing-register__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.landing-register__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.landing-register__close:hover {
  background: rgba(0, 0, 0, 0.26);
  transform: scale(1.02);
}

.landing-register__close-icon {
  position: relative;
  width: 12px;
  height: 12px;
}

.landing-register__close-icon::before,
.landing-register__close-icon::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: #ff6b6b;
  transform-origin: center;
}

.landing-register__close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.landing-register__close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.landing-register__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  margin-top: 8px;
  margin-bottom: 2rem;
}

.landing-register__logo {
  width: 72px;
  height: auto;
}

.landing-register__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.landing-register__body {
  margin-top: 4px;
}

.landing-register__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-register__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.landing-register__field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.95;
}

.landing-register__field-label-icon {
  width: 12px;
  height: auto;
  display: inline-block;
}

.landing-register__field-label-icon--name::before,
.landing-register__field-label-icon--password::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin: 4px auto;
  background: rgba(255, 255, 255, 0.85);
}

.landing-register__field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 7, 40, 0.2);
  padding: 0 12px;
}

.landing-register__input {
  flex: 1;
  height: 40px;
  border: none;
  outline: none;
  background: transparent;
  color: #ffffff;
  font-size: 13px;
}

.landing-register__input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.landing-register__eye {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.16);
  margin-left: 8px;
  cursor: pointer;
  position: relative;
}

.landing-register__eye::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("../images/icon-see.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 70% 70%;
  opacity: 0.82;
  display: block;
}

.landing-register__agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
}

.landing-register__agree-checkbox {
  margin-top: 2px;
  width: 14px;
  height: 14px;
}

.landing-register__agree-text {
  opacity: 0.9;
}

.landing-register__link {
  color: #ffd76b;
  text-decoration: underline;
}

.landing-register__submit {
  margin-top: 3rem;
  width: 100%;
  height: 46px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(90deg, #ffb347 0%, #ff7742 50%, #ff2f5b 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
  position: relative;
}

.landing-register__submit-text {
  letter-spacing: 0.12em;
}

.landing-register__footer {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
}

.landing-register__footer-link {
  color: #ffd76b;
  font-weight: 500;
}

/* 小屏与安全区 */
@media (max-width: 380px) {
  .landing-logo-wrap {
    top: calc(56px + 50px);
  }

  @supports (padding: env(safe-area-inset-top)) {
    .landing-logo-wrap {
      top: calc(56px + 50px + env(safe-area-inset-top));
    }
  }

  .landing-topbar {
    min-height: 56px;
    padding: 6px 12px;
  }

  .landing-topbar-icon {
    width: 42px;
    height: 42px;
  }

  .landing-topbar-title {
    font-size: 14px;
  }

  .landing-topbar-desc {
    font-size: 11px;
  }
}

/* 安全区域（刘海、底部横条） */
@supports (padding: env(safe-area-inset-bottom)) {
  .landing-actions {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
}

@supports (padding: env(safe-area-inset-top)) {
  .landing-topbar {
    padding-top: calc(8px + env(safe-area-inset-top));
  }

  .landing-logo-wrap {
    top: calc(64px + 50px + env(safe-area-inset-top));
  }
}

/* ========== 语言切换器 ========== */
/* topbar 下方 5px，右对齐距右 5px */
.lang-switcher {
  position: absolute;
  right: 5px;
  top: calc(64px + 5px);
  z-index: 12;
  width: 140px;
  transform: scale(0.9);
  transform-origin: top right;
}

/* 有刘海的设备：topbar 因安全区变高，按钮跟着下移 */
@supports (padding: env(safe-area-inset-top)) {
  .lang-switcher {
    top: calc(64px + 5px + env(safe-area-inset-top));
  }
}

/* ---------- 语言按钮：140×46 ---------- */
.lang-btn {
  position: relative;
  width: 140px;
  height: 46px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  /* 部分浏览器 <button> 默认 overflow:hidden 会裁掉绝对定位子节点 */
  overflow: visible;
}

/* z-index: 0 确保背景在所有子节点下方 */
.lang-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('../assets/media/yuyan_anniu.png') center / contain no-repeat;
  pointer-events: none;
}

/* 子节点1：语言小图标，左对齐距左 5px，上下居中，26×26 */
.lang-btn__icon {
  position: absolute;
  z-index: 1;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 21px;
  height: 21px;
  display: block;
  pointer-events: none;
}

/* 子节点2：语种文本，上下左右居中（相对整个按钮） */
.lang-btn__text {
  position: absolute;
  z-index: 1;
  left: 5px;
  right: 0;
  top: -2px;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #000000;
  white-space: nowrap;
  overflow: visible;
  pointer-events: none;
}

/* 子节点3：箭头，右对齐距右 8px，上下居中，展开后翻转 180° */
.lang-btn__arrow {
  position: absolute;
  z-index: 1;
  right: 15px;
  top: 50%;
  width: 12px;
  height: auto;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease;
  display: block;
  pointer-events: none;
}

.lang-btn__arrow.is-open {
  transform: translateY(-50%) rotate(180deg);
}

/* ---------- 语言下拉框：紧贴按钮下方 5px，右对齐 ---------- */
.lang-dropdown {
  position: absolute;
  top: calc(46px + 5px);
  right: 0;
  width: 150px;
  /* 上下各留一点视觉呼吸，不设水平 padding（条目铺满宽度） */
  padding: 6px 0;
  display: none;
  z-index: 50;
}

.lang-dropdown.is-open {
  display: block;
}

/* 边框背景伪元素：完整图按容器拉伸铺满 */
.lang-dropdown::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../assets/media/yuyan_kuang.png') no-repeat center;
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 0;
}

/*
 * 可滚动列表容器：右侧不留 padding，让滚动条贴紧下拉框最右边
 */
.lang-dropdown__list {
  position: relative;
  z-index: 1;
  max-height: 293px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Firefox：thin 约 8px，auto 约 15px，无法指定精确像素 */
  scrollbar-width: auto;
  scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
  padding: 0 0 0 8px;
  /* 整条滚动条距下拉框右边 5px */
  margin-right: 5px;
}

/* WebKit（Chrome / Safari / Android WebView）：width 可精确控制 */
.lang-dropdown__list::-webkit-scrollbar {
  display: block;
  width: 10px;
}

.lang-dropdown__list::-webkit-scrollbar-track {
  background: transparent;
  /* 轨道距右侧 3px */
  margin-right: 3px;
}

.lang-dropdown__list::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
}

/* ---------- 语种条目：高度 38px ---------- */
.lang-item {
  position: relative;
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
}

.lang-item:active {
  opacity: 0.6;
}

/* 条目元素1：语种文本，左对齐距左 10px，黑色 */
.lang-item__text {
  padding-left: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  flex: 1;
}

/* 条目元素2：分割线图片，底部绝对定位，左移 5px，右留 10px；高度缩小到原图 1/6（当前视觉 1/2）*/
.lang-item__divider {
  position: absolute;
  bottom: 0;
  left: 0;
  width: calc(100% - 6px);
  height: auto;
  display: block;
  pointer-events: none;
  transform: translateX(-5px) scaleY(0.1665);
  transform-origin: bottom center;
}

.lang-item:last-child .lang-item__divider {
  display: none;
}
