:root {
  --page-bg: #fff7f1;
  --footer-text: rgba(55, 48, 41, 0.66);
  --footer-hover: #ff3d18;
  --desktop-ratio: 1672 / 941;
  --mobile-ratio: 941 / 1672;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html {
  background: var(--page-bg);
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 117, 38, 0.09), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(255, 89, 25, 0.08), transparent 30%),
    linear-gradient(180deg, #fffaf5 0%, #fff7f1 100%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #1f1f1f;
}

a {
  color: inherit;
}

.page {
  position: relative;
  width: 100%;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.home-stage {
  position: relative;
  width: min(100vw, calc(100svh * 1672 / 941));
  aspect-ratio: var(--desktop-ratio);
  background-image: url("./assets/home-bg-desktop.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  overflow: hidden;
  isolation: isolate;
}

.download-area {
  position: absolute;
  left: 13.75%;
  top: 44.45%;
  width: 25.55%;
  height: 7.05%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6.2%;
}

.download-btn {
  position: relative;
  display: block;
  flex: 1 1 0;
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  transform: translateZ(0);
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.download-btn picture {
  display: block;
  width: 100%;
  height: 100%;
}

.download-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  pointer-events: none;
}

.download-btn:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 12px 18px rgba(255, 69, 21, 0.18));
}

.download-btn:active {
  transform: translateY(0) scale(0.985);
  opacity: 0.9;
}

.footer-links {
  position: absolute;
  left: 50%;
  bottom: 2.68%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 0.78vw, 16px);
  max-width: 88%;
  white-space: nowrap;
  font-size: clamp(10px, 0.78vw, 14px);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--footer-text);
}

.footer-links a {
  text-decoration: none;
  transition: color 160ms ease, opacity 160ms ease;
}

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

.footer-links .divider {
  width: 1px;
  height: 1em;
  background: rgba(55, 48, 41, 0.28);
  flex: 0 0 auto;
}

.wechat-guide {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  padding: max(18px, env(safe-area-inset-top)) 18px 18px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}

.wechat-guide.is-show {
  display: block;
}

.guide-arrow {
  position: absolute;
  right: 24px;
  top: max(12px, env(safe-area-inset-top));
  font-size: 58px;
  line-height: 1;
  font-weight: 800;
  color: #fff;
  transform: rotate(-8deg);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.guide-card {
  width: min(86vw, 420px);
  margin: max(92px, calc(env(safe-area-inset-top) + 80px)) auto 0;
  padding: 24px 22px 26px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  color: #241f1b;
  text-align: center;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.26);
}

.guide-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff921d 0%, #ff3515 100%);
  font-size: 22px;
}

.guide-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.guide-text {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(36, 31, 27, 0.72);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px);
  z-index: 30;
  max-width: min(82vw, 420px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(22, 22, 22, 0.82);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.is-wechat .download-area {
  display: none !important;
}

@media (max-width: 768px) {
  body {
    background: #fff7f1;
  }

  .page {
    min-height: 100svh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .home-stage {
    width: min(100vw, 560px);
    aspect-ratio: var(--mobile-ratio);
    background-image: url("./assets/home-bg-mobile.png");
    background-position: top center;
    background-size: 100% 100%;
  }

  .download-area {
    left: 4.3%;
    top: 35.5%;
    width: 52.5%;
    height: 4.0%;
    gap: 2.4%;
  }
  }

  .download-btn:hover {
    transform: none;
    filter: none;
  }

  .download-btn:active {
    transform: scale(0.985);
  }

  .footer-links {
    bottom: 1.88%;
    width: 92%;
    max-width: 92%;
    flex-wrap: wrap;
    gap: 7px 10px;
    white-space: normal;
    font-size: clamp(9px, 2.35vw, 12px);
    line-height: 1.2;
    color: rgba(72, 64, 57, 0.66);
  }

  .footer-links .divider {
    height: 0.9em;
  }
}

@media (max-width: 360px) {
  .footer-links {
    font-size: 9px;
    gap: 6px 8px;
  }
}

@media (orientation: landscape) and (max-width: 768px) {
  .page {
    display: grid;
    place-items: center;
  }

  .home-stage {
    width: min(100vw, calc(100svh * 1672 / 941));
    aspect-ratio: var(--desktop-ratio);
    background-image: url("./assets/home-bg-desktop.png");
  }

  .download-area {
    left: 13.75%;
    top: 44.45%;
    width: 25.55%;
    height: 7.05%;
    gap: 6.2%;
  }

  .footer-links {
    bottom: 2.68%;
    width: auto;
    max-width: 88%;
    flex-wrap: nowrap;
    white-space: nowrap;
    font-size: clamp(9px, 1.6vw, 12px);
  }
}
