* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #edf3f8;
}

body.app-download-page {
  min-height: 100vh;
  margin: 0;
  color: #10254f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
  background:
    linear-gradient(150deg, rgba(26, 122, 215, 0.14), transparent 36%),
    linear-gradient(22deg, rgba(245, 181, 46, 0.12), transparent 42%),
    #edf3f8;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-download-shell {
  width: 100%;
  min-height: 100vh;
  padding: 28px 14px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-download-card {
  width: min(100%, 430px);
  padding: 22px;
  border: 1px solid rgba(44, 105, 178, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(28, 72, 126, 0.14);
}

.app-download-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: #1f3f8f;
  font-size: 18px;
  font-weight: 700;
}

.app-download-brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(31, 63, 143, 0.12);
}

.app-download-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #1f4fb4 0%, #0aa4ce 74%, #f1b933 100%);
}

.app-download-kicker {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.app-download-hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: 30px;
  line-height: 1.12;
}

.app-version {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
}

.app-status-pill {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  color: #0b6c8d;
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.app-intro {
  margin: 20px 2px 0;
  color: #52627d;
  font-size: 15px;
  line-height: 1.75;
}

.wechat-guide {
  margin-top: 18px;
  padding: 14px 15px;
  border: 1px solid rgba(245, 181, 46, 0.38);
  border-radius: 12px;
  color: #704b00;
  background: #fff8e8;
}

.wechat-guide strong,
.wechat-guide span {
  display: block;
}

.wechat-guide strong {
  margin-bottom: 4px;
  color: #8a5a00;
  font-size: 15px;
}

.wechat-guide span {
  font-size: 13px;
  line-height: 1.65;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 22px;
  border: 0;
  border-radius: 13px;
  color: #ffffff;
  background: linear-gradient(135deg, #0aa4ce, #2d62bc);
  box-shadow: 0 12px 24px rgba(22, 119, 210, 0.22);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(22, 119, 210, 0.26);
}

.download-btn.is-loading {
  opacity: 0.76;
  cursor: wait;
}

.download-btn.is-disabled {
  color: #7a879a;
  background: #e9f0f7;
  box-shadow: none;
  cursor: not-allowed;
}

.download-btn.is-disabled:hover,
.download-btn.is-loading:hover {
  transform: none;
}

.download-hint {
  margin: 12px 4px 0;
  color: #6c7a91;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.desktop-qr {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid rgba(44, 105, 178, 0.14);
  border-radius: 14px;
  background: #f7fbff;
}

.desktop-qr-code {
  width: 132px;
  height: 132px;
  padding: 8px;
  border-radius: 12px;
  background: #ffffff;
}

.desktop-qr-code img,
.desktop-qr-code canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.desktop-qr strong,
.desktop-qr span {
  display: block;
}

.desktop-qr strong {
  color: #1f3f8f;
  font-size: 15px;
}

.desktop-qr span {
  margin-top: 6px;
  color: #66758d;
  font-size: 13px;
  line-height: 1.55;
}

.wechat-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  padding: 18px;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
}

.wechat-modal.is-open {
  display: flex;
}

.wechat-modal-arrow {
  position: absolute;
  top: 8px;
  right: 18px;
  width: min(178px, 42vw);
  height: auto;
  pointer-events: none;
  user-select: none;
}

.wechat-modal-panel {
  width: min(100%, 390px);
  margin-top: 156px;
  padding: 18px;
  border-radius: 16px;
  color: #ffffff;
  background: rgba(17, 35, 70, 0.94);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.wechat-modal-close {
  display: block;
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  cursor: pointer;
}

.wechat-modal-path {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px 12px;
  align-items: center;
  margin-top: 18px;
}

.wechat-modal-path span:nth-child(odd) {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #164792;
  background: #ffffff;
  font-weight: 800;
  line-height: 32px;
  text-align: center;
}

.wechat-modal-path span:nth-child(even) {
  font-size: 16px;
  font-weight: 700;
}

.wechat-modal-panel p {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 520px) {
  .app-download-shell {
    align-items: stretch;
    padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
  }

  .app-download-card {
    width: 100%;
    min-height: calc(100vh - 30px);
    padding: 18px;
    border-radius: 16px;
  }

  .app-download-hero {
    padding: 18px;
  }

  .app-download-hero h1 {
    font-size: 28px;
  }

  .desktop-qr {
    grid-template-columns: 112px 1fr;
  }

  .desktop-qr-code {
    width: 112px;
    height: 112px;
  }

  .wechat-modal-panel {
    margin-top: 132px;
  }
}

@media (max-width: 360px) {
  .app-download-card {
    padding: 15px;
  }

  .app-download-brand img {
    width: 38px;
    height: 38px;
  }

  .app-download-hero {
    display: block;
  }

  .app-status-pill {
    display: inline-block;
    margin-top: 14px;
  }

  .desktop-qr {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}
