/* 与根目录一致：背景图为 imgs/bg.webp */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: #eef2ff;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #241232;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.main {
  background-color: #eef2ff;
  background-image: url("../imgs/bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.color-desc {
  color: #241232;
  font-size: 22px;
  font-weight: 700;
  margin-top: 34px;
}

.download-item {
  margin-top: 0;
}

.download-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: min(280px, 86vw);
  margin-top: 20px;
}

.download-item img {
  max-width: 100%;
  height: auto;
}

.hidePC {
  display: flex;
}

.hideMobile {
  display: none;
}

.wrap {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.w-screen {
  width: 100%;
  max-width: 100%;
}

.h-screen {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

.overflow-auto {
  overflow: auto;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

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

.logo-hit {
  text-decoration: none;
  display: inline-block;
}

.nav-brand {
  font-weight: 800;
  font-size: 1.125rem;
  color: #241232;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.content-box {
  align-items: center;
  max-width: 1392px;
  width: 100%;
  padding: 0 2%;
  flex-wrap: nowrap;
  gap: 0;
}

.box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 32px;
  flex-wrap: nowrap;
  gap: 30px;
}

.download-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.qrcode {
  width: 172px;
  height: auto;
  aspect-ratio: 1;
}

.btn {
  width: 172px;
  height: auto;
  max-height: 61px;
  margin-top: 20px;
}

.tip {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 34px;
  color: #ffffff;
  text-align: center;
}

.buy-ticket-btn {
  margin-top: 42px;
  width: 320px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(278deg, #2a14f6 -45%, #e409f9 98%);
  border: 1px solid #ffffff;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}

.logo-main {
  display: block;
  width: 322px;
  max-width: 100%;
  height: auto;
}

.text {
  font-size: 32px;
  font-weight: bold;
  line-height: 1.75;
  margin-top: 16px;
  margin-bottom: 0;
  color: #241232;
}

.left-img {
  margin-right: 5%;
  height: auto;
  max-height: 80vh;
  width: auto;
  max-width: 40%;
  object-fit: contain;
  flex-shrink: 0;
}

@media all and (max-width: 768px) {
  /* 全屏固定背景层：滚动时仍铺满视口，避免露底或背景只跟内容高度走 */
  html {
    isolation: isolate;
  }

  body {
    isolation: isolate;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background-color: #eef2ff;
    background-image: url("../imgs/bg.webp");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
  }

  .hidePC {
    display: none !important;
  }

  .hideMobile {
    display: flex !important;
  }

  .main {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    justify-content: flex-start;
  }

  /* 由 body::before 铺底，避免双层背景错位 */
  .main.hideMobile {
    background-image: none;
    background-color: transparent;
  }

  .main .nav {
    flex-shrink: 0;
    box-sizing: border-box;
    padding-top: max(0px, env(safe-area-inset-top, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: 0;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    min-height: calc(56px + env(safe-area-inset-top, 0px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background-color: #fff;
  }

  .main .nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .main .nav .nav-brand-img {
    display: block;
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
  }

  .main .nav .user-icon {
    width: 24px;
    height: 24px;
  }

  .main .content {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
  }

  /* 固定在视口最底部，避免短页或部分机型 flex 未撑满时按钮悬空 */
  .main .footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    flex-shrink: 0;
    margin-top: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 12px max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    display: flex;
    justify-content: stretch;
    align-items: stretch;
    background-color: #fff;
    box-shadow: 0 -1px 0 rgba(36, 18, 50, 0.06);
  }

  .main .footer .btn-b {
    width: 100%;
    max-width: none;
    min-height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(277deg, #2a14f6 -46%, #e409f9 97%);
    text-decoration: none;
    touch-action: manipulation;
  }

  .main .btn {
    width: 100%;
    height: auto;
    display: block;
  }

  .download-stack .download-item {
    width: 100%;
    display: block;
    touch-action: manipulation;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(36, 18, 50, 0.08);
  }

  .download-stack .download-item img {
    width: 100%;
    height: auto;
    vertical-align: middle;
    display: block;
  }

  .left-img {
    width: 100%;
    max-width: min(300px, 92vw);
    height: auto;
    margin-top: 20px;
    margin-bottom: 4px;
    margin-right: 0;
    max-height: min(46vh, 360px);
    object-fit: contain;
  }

  .color-desc {
    font-size: clamp(18px, 4.5vw, 22px);
    padding: 0 16px;
    font-weight: 700;
    text-align: center;
    word-break: break-word;
  }

  /* 填满视口；底部留白给 fixed footer（上内边距 + 按钮 min-height + 下内边距 + 安全区） */
  main.fantopia-download > section.main.hideMobile {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100svh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    align-self: stretch;
    padding-bottom: calc(12px + 48px + max(12px, env(safe-area-inset-bottom, 0px)));
    box-sizing: border-box;
  }
}

/* 超窄屏再收紧间距 */
@media all and (max-width: 380px) {
  .main .content {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .color-desc {
    font-size: 17px;
  }
}

@media all and (min-width: 769px) {
  .hideMobile {
    display: none !important;
  }

  .hidePC {
    display: flex !important;
  }

  .main {
    position: relative;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .content-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .main .content-box {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 1392px;
    padding: 0 2%;
    z-index: 1;
  }

  .main .content-box .logo-main {
    width: 322px;
    max-width: 100%;
  }
}

main.fantopia-download {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  width: 100%;
}
