:root {
  color-scheme: light;
  --page-bg: #ffeff0;
  --text-main: #191919;
  --text-muted: #666;
  --text-soft: rgba(72, 39, 50, 0.7);
  --pink: #ff5084;
  --pink-deep: #ff4768;
  --pink-soft: #ff8cad;
  --panel-bg: rgba(255, 255, 255, 0.55);
  --white: #fff;
  --android: #22d446;
  --ios: #47bcff;
  --shadow-soft: 0 20px 60px rgba(255, 117, 149, 0.18);
  --shadow-panel: 0 24px 60px rgba(255, 113, 150, 0.18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: MiSans, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page-bg);
}

body {
  color: var(--text-main);
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.hidden {
  display: none !important;
}

.page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.95), transparent 22%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.65), transparent 30%),
    radial-gradient(circle at 80% 28%, rgba(255, 177, 198, 0.46), transparent 20%),
    radial-gradient(circle at bottom right, rgba(255, 141, 170, 0.28), transparent 25%),
    var(--page-bg);
}

.page::before,
.page::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.7;
  pointer-events: none;
}

.page::before {
  top: 110px;
  left: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.32);
}

.page::after {
  right: -36px;
  bottom: 150px;
  width: 140px;
  height: 140px;
  background: rgba(255, 133, 167, 0.2);
}

.phone-shell {
  min-height: 100vh;
  max-width: 460px;
  margin: 0 auto;
  padding: calc(20px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
  background: url("./assets/home_bg.png") no-repeat center top / cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.hero {
  min-height: 46vh;
}

.top-bar {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.hero-badge {
  width: fit-content;
  margin: 18px auto 0;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(10px);
  color: var(--pink-deep);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.brand {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.brand-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow:
    0 14px 32px rgba(255, 105, 145, 0.2),
    0 0 0 6px rgba(255, 255, 255, 0.32);
}

.brand-logo img,
.brand-title,
.brand-subtitle {
  display: block;
  width: 100%;
  height: auto;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.brand-title {
  width: 94px;
}

.brand-subtitle {
  width: auto;
  height: 9px;
}

.hero-copy {
  margin-top: 22px;
  text-align: center;
}

.hero-title {
  margin: 0;
  color: #7a2f49;
  font-size: clamp(24px, 5vw, 30px);
  line-height: 1.16;
  font-weight: 700;
}

.hero-desc {
  max-width: 290px;
  margin: 10px auto 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.download-panel {
  position: relative;
  z-index: 1;
  padding: 22px 16px 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 246, 248, 0.88)),
    var(--panel-bg);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(12px);
}

.download-panel h1 {
  margin: 0 0 18px;
  color: var(--pink);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.download-tip {
  margin: -8px auto 18px;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 80, 132, 0.09);
  color: rgba(255, 80, 132, 0.82);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.invite-card {
  margin-bottom: 16px;
  padding: 14px 14px 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 245, 247, 0.96), rgba(255, 255, 255, 0.88));
  border: 1px solid rgba(255, 147, 178, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  text-align: center;
}

.invite-label {
  color: #8d7280;
  font-size: 12px;
  font-weight: 600;
}

.invite-value {
  margin-top: 6px;
  color: #ff4768;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  word-break: break-word;
}

.invite-value.is-empty {
  color: #ff8b9e;
  font-size: 18px;
}

.invite-hint {
  margin: 8px auto 0;
  max-width: 300px;
  color: #8d7280;
  font-size: 12px;
  line-height: 1.55;
}

.invite-hint.is-warning {
  color: #e45d86;
  font-weight: 600;
}

.service-button {
  margin: 12px auto 0;
  width: fit-content;
  min-width: 116px;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ff7ea4 0%, #ff4f83 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(255, 79, 131, 0.22);
}

.service-note {
  margin: 8px 0 0;
  color: #a17385;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.download-card {
  padding: 14px 10px 10px;
  min-width: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.download-button {
  width: 100%;
  min-height: 50px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.download-button:active {
  transform: translateY(1px) scale(0.99);
  filter: saturate(1.04);
}

.download-button img {
  width: 16px;
  height: 16px;
}

.download-button.android {
  background:
    linear-gradient(180deg, rgba(182, 255, 194, 0.96) 0%, rgba(182, 255, 194, 0) 62%),
    linear-gradient(180deg, #34df5a 0%, #22d446 100%);
}

.download-button.ios {
  background:
    linear-gradient(180deg, rgba(194, 234, 255, 0.94) 0%, rgba(194, 234, 255, 0) 62%),
    linear-gradient(180deg, #5dc8ff 0%, #47bcff 100%);
}

.helper-text {
  margin: 10px 0 8px;
  color: #8d7280;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.backup-item {
  width: 100%;
  min-height: 30px;
  padding: 4px 4px 4px 12px;
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 126, 160, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.backup-label {
  color: var(--pink-deep);
  font-size: 10px;
  font-weight: 600;
}

.backup-link {
  min-width: 56px;
  height: 22px;
  padding: 0 8px;
  border-radius: 23px;
  background: var(--pink-deep);
  color: var(--white);
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(255, 71, 104, 0.22);
}

.service-text {
  margin: 18px auto 0;
  max-width: 320px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 94, 137, 0.08);
  color: #e45d86;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
  text-align: center;
}

.wechat-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wechat-guide {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.wechat-arrow {
  width: 120px;
  height: 120px;
  opacity: 0.92;
}

.wechat-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--white);
  text-align: right;
}

.wechat-step {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.wechat-tip {
  padding: 0 24px;
  color: var(--white);
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(40px + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(25, 25, 25, 0.86);
  color: var(--white);
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
  z-index: 10000;
}

@media (max-width: 520px) {
  .phone-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero {
    min-height: 40vh;
  }

  .download-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .download-grid {
    gap: 12px;
  }

  .download-button {
    min-height: 46px;
    font-size: 13px;
  }

  .backup-label {
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .phone-shell {
    padding-top: calc(16px + var(--safe-top));
    padding-bottom: calc(18px + var(--safe-bottom));
  }

  .hero-badge {
    margin-top: 14px;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 32vh;
  }

  .hero-title {
    font-size: 22px;
  }

  .hero-desc {
    font-size: 12px;
  }

  .download-panel h1 {
    margin-bottom: 14px;
    font-size: 22px;
  }

  .download-tip {
    margin-top: -4px;
    margin-bottom: 12px;
    font-size: 11px;
  }

  .invite-card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .invite-value {
    font-size: 20px;
  }

  .service-text {
    font-size: 11px;
  }
}

@media (max-height: 760px) {
  .hero {
    min-height: 30vh;
  }

  .download-panel {
    padding-top: 8px;
  }
}
