/* ==========================================================================
   下载页样式 —— 玻璃拟态 + 蓝紫渐变
   配色变量集中在 :root，改这里即可整站换色
   ========================================================================== */

:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: #17211e;
  background: #f7f4ed;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --brand: #149a8b;
  --brand-dark: #0d7c70;
  --coral: #ee7c5b;
  --coral-dark: #d95f3f;
  --ink: #17211e;
  --muted: #6b7570;
  --line: rgba(20, 45, 38, 0.1);
  --glass: rgba(255, 255, 255, 0.66);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 73% 16%, rgba(46, 179, 155, 0.16), transparent 28rem),
    linear-gradient(145deg, #fdfcf9 0%, #f6f4ee 46%, #edf6f0 100%);
}

button,
a {
  font: inherit;
}

/* ---------- 背景光斑 ---------- */
.ambient {
  position: fixed;
  z-index: 0;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(12px);
  pointer-events: none;
}

.ambient-one {
  top: -16rem;
  left: -8rem;
  background: rgba(64, 196, 167, 0.2);
}

.ambient-two {
  right: -14rem;
  bottom: -17rem;
  background: rgba(248, 143, 106, 0.16);
}

/* ---------- 页面骨架 ---------- */
.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0;
  background: linear-gradient(145deg, #3fc2ac, #149a8b 60%, #0d7c70);
  box-shadow: 0 9px 20px rgba(15, 124, 112, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.brand-icon img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.official-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  color: #4c5362;
  font-size: 0.82rem;
  font-weight: 630;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 24px rgba(48, 74, 119, 0.08);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.official-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25c46a;
  box-shadow: 0 0 0 4px rgba(37, 196, 106, 0.12);
}

/* ---------- 主视觉 ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.82fr);
  align-items: center;
  gap: clamp(48px, 8vw, 116px);
  padding: 42px 0 64px;
}

.hero-copy {
  max-width: 630px;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.2em;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3.7rem, 7.8vw, 6.8rem);
  font-weight: 760;
  letter-spacing: -0.075em;
  line-height: 0.94;
}

h1 .accent {
  display: inline-block;
  padding-right: 0.08em;
  color: transparent;
  background: linear-gradient(112deg, #17a48f 5%, #2f9d7c 48%, #ec7a55 96%);
  -webkit-background-clip: text;
  background-clip: text;
}

.intro {
  max-width: 510px;
  margin: 28px 0 34px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

/* ---------- 下载面板 ---------- */
.download-panel {
  width: min(100%, 610px);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 30px;
  background: var(--glass);
  box-shadow: 0 24px 70px rgba(43, 78, 134, 0.13), inset 0 1px 0 #fff;
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 5px 16px;
}

.panel-heading div {
  display: grid;
  gap: 5px;
}

.panel-heading small,
.floating-label small {
  color: #969dab;
  font-size: 0.66rem;
  font-weight: 720;
  letter-spacing: 0.16em;
}

.panel-heading strong {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

/* 设备识别结果徽标 */
.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #177a6e;
  font-size: 0.7rem;
  font-weight: 650;
  background: rgba(20, 154, 139, 0.09);
  white-space: nowrap;
}

.env-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #25c46a;
}

/* ---------- 单个下载按钮 ---------- */
.download-primary {
  position: relative;
  width: 100%;
  min-height: 96px;
  padding: 18px 20px;
  border: 0;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 15px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #f89e7e 0%, #ef7c5b 52%, #e05f3f 100%);
  box-shadow: 0 20px 42px rgba(217, 95, 63, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

/* 斜向高光，避免大面积纯色显得呆板 */
.download-primary::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 70%;
  height: 220%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.22), transparent 62%);
  transform: rotate(12deg);
  pointer-events: none;
}

.download-primary:hover:not(.is-disabled) {
  transform: translateY(-2px);
  box-shadow: 0 26px 52px rgba(217, 95, 63, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.download-primary:active:not(.is-disabled) {
  transform: translateY(0) scale(0.995);
}

.download-primary:focus-visible {
  outline: 3px solid rgba(20, 154, 139, 0.32);
  outline-offset: 3px;
}

/* 点击后的确认态 */
.download-primary.is-selected {
  background: linear-gradient(135deg, #12b866 0%, #0a9a54 55%, #068249 100%);
  box-shadow: 0 20px 42px rgba(8, 150, 84, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
/* 两端地址都没配置时的置灰态 */
.download-primary.is-disabled {
  color: #8d94a1;
  background: rgba(247, 249, 252, 0.9);
  box-shadow: none;
  cursor: not-allowed;
}

.download-primary.is-disabled::after {
  display: none;
}

/* 微信内引导态：点击不跳转，改弹引导 */
.download-primary.is-guide {
  background: linear-gradient(135deg, #2fb3a0 0%, #149a8b 55%, #0d7c70 100%);
  box-shadow: 0 20px 42px rgba(15, 124, 112, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.primary-icon {
  position: relative;
  z-index: 1;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.primary-icon svg {
  display: none;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-icon[data-os="android"] .icon-android,
.primary-icon[data-os="ios"] .icon-apple,
.primary-icon[data-os="wechat"] .icon-wechat {
  display: block;
}

.primary-icon .icon-apple,
.primary-icon .icon-wechat {
  fill: currentColor;
  stroke: none;
}

.primary-text {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 5px;
}

.primary-text small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.primary-text strong {
  overflow: hidden;
  font-size: 1.06rem;
  font-weight: 720;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.primary-cta {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--coral-dark);
  font-size: 0.78rem;
  font-weight: 720;
  white-space: nowrap;
  background: #fff;
  box-shadow: 0 6px 16px rgba(190, 70, 40, 0.18);
  transition: transform 180ms ease;
}

.download-primary:hover:not(.is-disabled) .primary-cta {
  transform: translateX(2px);
}

.download-primary.is-disabled .primary-text small {
  color: #a4aab5;
}

.download-primary.is-disabled .primary-cta {
  color: #9ba1ac;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}

.panel-note {
  margin: 13px 5px 1px;
  color: #8b92a0;
  font-size: 0.7rem;
  line-height: 1.5;
}

/* ---------- 微信内下载引导 ---------- */
.wechat-guide {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 12px 16px;
  background: rgba(8, 14, 26, 0.66);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: guideFade 220ms ease both;
}

.wechat-guide[hidden] {
  display: none;
}

.wechat-guide-card {
  position: relative;
  width: min(320px, calc(100% - 12px));
  margin-top: 56px;
  padding: 22px 20px 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: guideIn 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.guide-arrow {
  position: absolute;
  top: -54px;
  right: 6px;
  width: 44px;
  height: 44px;
  color: #fff;
  animation: guideArrow 1.5s ease-in-out infinite;
}

.guide-arrow svg {
  width: 100%;
  height: 100%;
}

.wechat-guide-card strong {
  display: block;
  color: #101114;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.wechat-guide-card p {
  margin: 9px 0 16px;
  color: #69707d;
  font-size: 0.86rem;
  line-height: 1.65;
}

.guide-close {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 680;
  background: linear-gradient(135deg, #f89e7e, #ef7c5b);
  cursor: pointer;
}

.guide-close:active {
  transform: scale(0.99);
}

@keyframes guideFade {
  from {
    opacity: 0;
  }
}

@keyframes guideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
}

@keyframes guideArrow {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(5px, -5px);
  }
}

/* ---------- 右侧品牌视觉 ---------- */
.visual-stage {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.visual-stage::before {
  content: "";
  position: absolute;
  z-index: -3;
  width: min(39vw, 455px);
  height: min(39vw, 455px);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.96), rgba(178, 232, 214, 0.7) 34%, rgba(38, 159, 138, 0.22) 69%, transparent 70%);
  filter: drop-shadow(0 30px 50px rgba(38, 110, 96, 0.16));
}

.glass-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.4), rgba(80, 190, 165, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 30px 60px rgba(31, 94, 84, 0.09);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.orbit-back {
  width: 390px;
  height: 390px;
  transform: rotate(-12deg) scaleY(0.64);
}

.orbit-front {
  width: 460px;
  height: 460px;
  transform: rotate(52deg) scaleY(0.48);
}

.app-tile {
  position: relative;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 48px;
  color: #fff;
  background: linear-gradient(145deg, #63d9c3 0%, #17a78f 40%, #119a83 72%, #0e7f72 100%);
  box-shadow: 0 38px 70px rgba(15, 110, 96, 0.34), inset 0 2px 0 rgba(255, 255, 255, 0.56);
  transform: rotate(-4deg);
}

/* 图标位填充真实应用图标时 */
.app-tile .tile-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-tile.has-image .tile-shine,
.app-tile.has-image::after,
.app-tile.has-image .tile-face {
  display: none;
}

.app-tile::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 39px;
}

.app-tile .tile-face {
  position: relative;
  z-index: 1;
  font-size: 7rem;
  font-weight: 650;
  letter-spacing: -0.08em;
  text-shadow: 0 12px 30px rgba(19, 56, 143, 0.28);
}

.tile-shine {
  position: absolute;
  top: -52%;
  left: -20%;
  width: 120%;
  height: 90%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transform: rotate(-18deg);
}

.floating-label {
  position: absolute;
  min-width: 176px;
  min-height: 62px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 18px 48px rgba(46, 77, 124, 0.14), inset 0 1px 0 #fff;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.floating-label > span:first-child {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #35b9a1, #12857a);
}

.floating-label div {
  display: grid;
  gap: 3px;
}

.floating-label strong {
  font-size: 0.78rem;
  white-space: nowrap;
}

.label-top {
  top: 16%;
  right: -1%;
  transform: rotate(3deg);
}

.label-bottom {
  bottom: 17%;
  left: -4%;
  transform: rotate(-3deg);
}

.floating-label .pulse {
  position: relative;
  background: rgba(29, 196, 103, 0.12);
}

.floating-label .pulse::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1bc468;
  box-shadow: 0 0 0 5px rgba(27, 196, 104, 0.14);
}

/* ---------- 页脚 ---------- */
footer {
  min-height: 58px;
  border-top: 1px solid rgba(34, 49, 78, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #9298a4;
  font-size: 0.72rem;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 34px, 680px);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 26px 0 48px;
  }

  .hero-copy {
    max-width: none;
  }

  .visual-stage {
    min-height: 410px;
  }

  .visual-stage::before {
    width: 350px;
    height: 350px;
  }

  .app-tile {
    width: 150px;
    height: 150px;
    border-radius: 39px;
  }

  .app-tile .tile-face {
    font-size: 5.6rem;
  }

  .orbit-back {
    width: 310px;
    height: 310px;
  }

  .orbit-front {
    width: 370px;
    height: 370px;
  }

  .label-top {
    top: 12%;
    right: 5%;
  }

  .label-bottom {
    bottom: 10%;
    left: 4%;
  }
}

@media (max-width: 600px) {
  .page-shell {
    width: min(100% - 26px, 470px);
  }

  .site-header {
    min-height: 72px;
  }

  .official-pill {
    min-height: 31px;
    padding: 0 11px;
    font-size: 0.74rem;
  }

  .hero {
    gap: 20px;
    padding: 12px 0 36px;
  }

  .visual-stage {
    min-height: 315px;
  }

  .visual-stage::before {
    width: 270px;
    height: 270px;
  }

  .app-tile {
    width: 126px;
    height: 126px;
    border-radius: 34px;
  }

  .app-tile .tile-face {
    font-size: 4.7rem;
  }

  .orbit-back {
    width: 250px;
    height: 250px;
  }

  .orbit-front {
    width: 292px;
    height: 292px;
  }

  .floating-label {
    min-width: 148px;
    min-height: 52px;
    padding: 8px 10px;
    border-radius: 17px;
  }

  .floating-label > span:first-child {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .floating-label strong {
    font-size: 0.7rem;
  }

  .label-top {
    top: 4%;
    right: -2%;
  }

  .label-bottom {
    bottom: 2%;
    left: -2%;
  }

  .eyebrow {
    margin-bottom: 14px;
    font-size: 0.7rem;
  }

  h1 {
    font-size: clamp(3.35rem, 16vw, 4.6rem);
  }

  .intro {
    margin: 21px 0 25px;
    font-size: 1rem;
    line-height: 1.65;
  }

  .download-panel {
    padding: 14px;
    border-radius: 26px;
  }

  .panel-heading {
    padding-bottom: 13px;
  }

  /* 手机端按钮收窄：图标缩小、CTA 变为纯文字，保证主文案不被挤压 */
  .download-primary {
    min-height: 88px;
    padding: 15px 16px;
    gap: 12px;
    border-radius: 20px;
  }

  .primary-icon {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .primary-icon svg {
    width: 25px;
    height: 25px;
  }

  .primary-text strong {
    font-size: 0.98rem;
  }

  .primary-text small {
    font-size: 0.68rem;
  }

  .primary-cta {
    padding: 8px 11px;
    font-size: 0.72rem;
  }

  footer {
    min-height: 54px;
  }
}

@media (max-width: 360px) {
  .primary-cta {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .download-primary,
  .primary-cta {
    transition: none;
  }

  .guide-arrow {
    animation: none;
  }
}
