:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --card: rgba(255, 255, 255, 0.94);
  --line: rgba(14, 30, 56, 0.08);
  --text: #172033;
  --muted: #65738b;
  --primary: #1677ff;
  --primary-deep: #0e5fe0;
  --shadow: 0 24px 72px rgba(38, 76, 138, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

body {
  padding: 0;
}

body.wechat-mode {
  background: #f3f3f3;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
}

.hero-glow-a {
  top: -120px;
  left: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(22, 119, 255, 0.18) 0%, rgba(22, 119, 255, 0) 72%);
}

.hero-glow-b {
  right: -100px;
  bottom: 80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.12) 0%, rgba(74, 222, 128, 0) 72%);
}

.app-page {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 24px 16px 36px;
}

.wechat-page {
  position: relative;
  z-index: 1;
  width: min(100%, 768px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 0 46px;
}

.wechat-header-card {
  position: relative;
  overflow: hidden;
  min-height: 186px;
  padding: 18px 18px 32px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 10%, rgba(255, 224, 122, 0.5) 0, rgba(255, 224, 122, 0) 14%),
    radial-gradient(circle at 75% 76%, rgba(0, 219, 255, 0.55) 0, rgba(0, 219, 255, 0) 18%),
    linear-gradient(100deg, #2950ff 2%, #2a83ff 57%, #3254ff 100%);
}

.wechat-header-card::before {
  content: "";
  position: absolute;
  left: -12%;
  right: -10%;
  bottom: -54px;
  height: 124px;
  background: #f3f3f3;
  border-top-left-radius: 62% 100%;
  border-top-right-radius: 44% 100%;
  transform: rotate(-3deg);
}

.wechat-header-card::after {
  content: "";
  position: absolute;
  right: 70px;
  bottom: 16px;
  width: 102px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 205, 255, 0.8) 0%, rgba(0, 205, 255, 0.14) 58%, rgba(0, 205, 255, 0) 100%);
  filter: blur(1px);
}

.wechat-header-copy {
  position: relative;
  z-index: 1;
  max-width: 72%;
  padding-top: 10px;
}

.wechat-header-copy h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  height: 0;
}

.wechat-hero-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 14px;
  line-height: 1.8;
  color: #fff;
}

.wechat-inline-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 2px 10px 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.wechat-inline-app img {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: block;
}

.wechat-inline-app span {
  font-size: 14px;
  white-space: nowrap;
}

.wechat-header-copy p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.8;
}

.wechat-guide-arrow {
  position: absolute;
  z-index: 1;
  top: 0;
  right: -4px;
  width: 134px;
  height: auto;
}

.wechat-app-summary {
  text-align: center;
  padding: 144px 24px 0;
}

.wechat-logo-shell {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 50%;
  background: #f5f5f5;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.03),
    inset 0 2px 0 rgba(255, 255, 255, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wechat-logo {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: cover;
  display: block;
}

.wechat-app-summary h1 {
  margin: 28px 0 0;
  font-size: 24px;
  line-height: 1.2;
  color: #111;
}

.wechat-app-summary p {
  margin: 18px 0 0;
  color: #7b7b7b;
  font-size: 14px;
  line-height: 1.55;
}

.wechat-app-summary p + p {
  margin-top: 4px;
}

.wechat-copy-section {
  text-align: center;
  margin-top: 236px;
  padding: 0 24px;
}

.wechat-copy-section p {
  margin: 0 0 24px;
  color: #5d8df1;
  font-size: 16px;
  line-height: 1.7;
}

.wechat-copy-btn {
  min-width: 196px;
  padding: 13px 34px;
  border-radius: 999px;
  border: 1px solid #9fbdf3;
  background: transparent;
  color: #4f82ea;
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
}

.app-card {
  backdrop-filter: blur(12px);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px 18px 20px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-wrap {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(39, 61, 118, 0.2);
}

.app-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-link {
  display: inline-block;
  margin-top: 18px;
  color: #2e74f0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.guide-link:hover {
  color: var(--primary-deep);
}

.cta-area {
  margin-top: 18px;
  text-align: center;
}

.download-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 18px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #3290ff 0%, var(--primary) 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 18px 36px rgba(22, 119, 255, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.download-btn:hover,
.download-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(22, 119, 255, 0.32);
}

.download-btn.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
  box-shadow: none;
}

.download-icon {
  font-size: 20px;
  line-height: 1;
}

.support-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.acknowledge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.65;
  color: #4f5f79;
  cursor: pointer;
}

.acknowledge input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.platform-card {
  text-align: left;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.platform-card:hover,
.platform-card:active {
  transform: translateY(-1px);
  border-color: rgba(22, 119, 255, 0.2);
  box-shadow: 0 18px 34px rgba(48, 77, 141, 0.12);
}

.platform-card strong,
.platform-card small {
  display: block;
}

.platform-card strong {
  margin-top: 12px;
  font-size: 16px;
  color: var(--text);
}

.platform-card small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.platform-badge.ios {
  color: #1559cf;
  background: rgba(21, 89, 207, 0.1);
}

.platform-badge.android {
  color: #198754;
  background: rgba(25, 135, 84, 0.1);
}

.qr-block {
  margin-top: 22px;
  text-align: center;
}

.qr-image {
  width: min(220px, 68vw);
  height: auto;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.06);
  padding: 12px;
  box-shadow: 0 16px 34px rgba(31, 52, 101, 0.1);
}

.qr-block p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

hr {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 24px 0 20px;
}

.app-desc h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.app-desc p {
  margin: 0;
  color: #52627c;
  line-height: 1.8;
  font-size: 14px;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
  color: #718099;
  font-size: 13px;
}

.page-footer a {
  color: inherit;
  text-decoration: none;
}

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

.overlay,
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.hidden {
  display: none !important;
}

.overlay-backdrop,
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 25, 0.64);
}

.overlay-panel {
  position: absolute;
  inset: 0;
  padding: 18px;
}

.overlay-arrow {
  position: absolute;
  top: 22px;
  right: 28px;
  width: 32px;
  height: 32px;
  border-top: 4px solid #fff;
  border-right: 4px solid #fff;
  transform: rotate(-45deg);
}

.overlay-content {
  position: absolute;
  top: 72px;
  right: 20px;
  width: min(320px, calc(100vw - 40px));
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 18px 16px;
  color: #fff;
  backdrop-filter: blur(16px);
}

.overlay-content h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.overlay-content p {
  margin: 0;
  line-height: 1.7;
  font-size: 14px;
}

.close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-panel {
  position: relative;
  width: min(92vw, 420px);
  margin: 11vh auto 0;
  background: #fff;
  border-radius: 24px;
  padding: 22px 18px 18px;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.3);
}

.modal-close {
  background: rgba(15, 23, 42, 0.08);
  color: #20304d;
}

.modal-panel h3 {
  margin: 0 0 14px;
  font-size: 20px;
  color: var(--text);
}

.modal-content {
  max-height: min(60vh, 460px);
  overflow: auto;
  color: #4e5f78;
  line-height: 1.8;
  font-size: 14px;
  padding-right: 2px;
}

.modal-content p {
  margin: 0 0 12px;
}

.modal-content p:last-child {
  margin-bottom: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 16px 36px rgba(23, 32, 51, 0.24);
}

@media (max-width: 520px) {
  body.wechat-mode .hero-glow {
    display: none;
  }

  .app-page {
    padding: 16px 12px 28px;
  }

  .app-card {
    border-radius: 24px;
    padding: 18px 14px 18px;
  }

  .app-brand {
    align-items: flex-start;
  }

  .logo-wrap {
    width: 84px;
    height: 84px;
    border-radius: 20px;
  }

  .brand-copy h1 {
    font-size: 26px;
  }

  .wechat-header-card {
    min-height: 154px;
    padding: 16px 16px 28px;
  }

  .wechat-header-copy {
    max-width: 74%;
    padding-top: 4px;
  }

  .wechat-header-copy h2 {
    font-size: 0;
  }

  .wechat-hero-tip {
    gap: 2px 6px;
    font-size: 13px;
  }

  .wechat-inline-app {
    min-height: 28px;
    padding: 2px 8px 2px 5px;
  }

  .wechat-inline-app img {
    width: 22px;
    height: 22px;
  }

  .wechat-inline-app span,
  .wechat-header-copy p {
    font-size: 13px;
  }

  .wechat-guide-arrow {
    top: 0;
    right: -8px;
    width: 104px;
  }

  .wechat-app-summary {
    padding-top: 124px;
  }

  .wechat-logo-shell {
    width: 100px;
    height: 100px;
  }

  .wechat-logo {
    width: 66px;
    height: 66px;
    border-radius: 16px;
  }

  .wechat-app-summary h1 {
    font-size: 22px;
    margin-top: 24px;
  }

  .wechat-app-summary p {
    font-size: 14px;
  }

  .wechat-copy-section {
    margin-top: 228px;
  }

  .wechat-copy-section p {
    font-size: 14px;
    margin-bottom: 18px;
  }

  .wechat-copy-btn {
    min-width: 154px;
    padding: 12px 28px;
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .platform-grid {
    grid-template-columns: 1fr;
  }
}
