:root {
  color-scheme: dark;
  --page: #080f1f;
  --text: #f4f6ff;
  --muted: #bbcee4;
  --gold: #f8d9a0;
  --accent: #8ce4ff;
  --accent-rgb: 140 228 255;
  --gutter: clamp(1rem, 4.5vw, 3.5rem);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

:root[data-platform="ios"] { --accent: #c2b7ff; --accent-rgb: 194 183 255; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 45% 35%, #101d33, var(--page) 65%) no-repeat, var(--page);
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid #a3e8ff; outline-offset: 4px; }

.shell {
  width: min(calc(100% - var(--gutter) * 2), 72rem);
  margin-inline: auto;
}

.site-header {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  padding-top: env(safe-area-inset-top);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 4.75rem;
  border-bottom: 1px solid #c8d9ff3b;
}

.brand {
  display: flex;
  align-items: center;
  gap: .625rem;
  color: #fff1d0;
  font-weight: 750;
  letter-spacing: .095em;
}

.brand img { filter: drop-shadow(0 0 12px #53c9ff90); }

.guide-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: .8rem;
  border: 1px solid #e9bd754d;
  border-radius: .5rem;
  background: #0a1226b8;
  color: #fff0cf;
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
}

.guide-link:hover { border-color: var(--gold); }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: calc(7.5rem + env(safe-area-inset-top)) 0 4.5rem;
  min-height: 43rem;
  background: #0a1529;
}

.hero-art, .hero::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-art { z-index: -2; left: 29%; }

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 57%;
}

.hero::after {
  z-index: -1;
  background:
    linear-gradient(0deg, var(--page), #080f1f00 24%),
    linear-gradient(180deg, #070e1ccd, #080f1f00 22%),
    linear-gradient(90deg, #0b1528 24%, #0b1528f0 34%, #0c192ea0 43%, #0c192e10 61%, #0c192e00 78%);
  content: "";
}

.hero-content {
  display: grid;
  justify-items: start;
  gap: 1.5rem;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 1.375rem;
  max-width: 100%;
}

.app-crest {
  flex: 0 0 auto;
  padding: .4rem;
  border: 1px solid #e6bb7699;
  border-radius: 1.4rem;
  background: linear-gradient(150deg, #b48f57 0, #26384a 28%, #101a2e 75%, #5c4761 100%);
  box-shadow: 0 0 0 4px #e7ba7714, 0 .75rem 2.5rem #0009;
}

.app-crest img {
  display: block;
  border: 1px solid #ffe0a779;
  border-radius: 1rem;
}

.hero-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 .42rem;
  color: var(--gold);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-shadow: 0 1px 8px #020610;
}

.hero-label::before {
  width: .35rem;
  height: .35rem;
  transform: rotate(45deg);
  background: #ffd894;
  box-shadow: 0 0 .6rem #ffc979ac;
  content: "";
}

h1 {
  margin: 0;
  color: #ffedc3;
  font-size: clamp(3.15rem, 6.7vw, 6.75rem);
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.05;
  text-shadow: 0 .031em #a97443, 0 .055em #643e2f, 0 .1em .29em #02070f, 0 0 .5em #ffd68833;
}

.download-panel {
  position: relative;
  width: min(100%, 28rem);
  padding: 1.4rem;
  border: 1px solid #4a607a;
  border-radius: 1.125rem;
  background:
    radial-gradient(ellipse at 2% 0%, rgb(var(--accent-rgb) / .14), transparent 68%),
    linear-gradient(155deg, #162840f7, #0b1426f7 76%);
  box-shadow: 0 1rem 3rem #02071290, inset 0 1px #cfe4ff1f;
  scroll-margin-top: 1rem;
}

.download-panel::before {
  position: absolute;
  top: -1px;
  left: 1.4rem;
  width: 5.5rem;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  box-shadow: 0 0 1.1rem var(--accent);
  content: "";
}

.download-heading {
  display: flex;
  align-items: center;
  gap: .875rem;
}

.device-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid rgb(var(--accent-rgb) / .34);
  border-radius: .9rem;
  background: linear-gradient(145deg, rgb(var(--accent-rgb) / .22), rgb(var(--accent-rgb) / .03));
  color: var(--accent);
}

.device-mark::before {
  width: .85rem;
  height: 1.25rem;
  border: 2px solid currentColor;
  border-radius: .25rem;
  content: "";
}

.device-mark::after {
  position: absolute;
  bottom: .97rem;
  width: .37rem;
  height: 1px;
  background: currentColor;
  content: "";
}

[data-platform="android"] .device-mark::before {
  width: 1.3rem;
  height: .7rem;
  border: 0;
  border-radius: .7rem .7rem .2rem .2rem;
  background: radial-gradient(circle at 30% 60%, #1b3149 1px, transparent 1.5px),
              radial-gradient(circle at 70% 60%, #1b3149 1px, transparent 1.5px), currentColor;
}

[data-platform="android"] .device-mark::after {
  top: 1rem;
  width: .76rem;
  height: .35rem;
  border-inline: 1px solid currentColor;
  border-radius: .1rem;
  background: transparent;
  transform: perspective(.75rem) rotateX(30deg);
}

.download-copy h2 {
  margin: 0;
  color: #f5f8ff;
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  line-height: 1.23;
}

.download-copy p {
  margin: .4rem 0 0;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.5;
}

.download-button {
  display: block;
  width: 100%;
  min-height: 3.35rem;
  margin-top: 1.125rem;
  padding: .7rem .85rem;
  border: 1px solid #ffe8bc;
  border-radius: .625rem;
  background: linear-gradient(115deg, #fff0cb, #f1c471 65%, #dfa252);
  color: #261809;
  box-shadow: 0 .2rem #875632, inset 0 1px #fffbe6, 0 .5rem 1.6rem #efa74e24;
  font-size: 1.0625rem;
  font-weight: 800;
  transition: background .16s ease, transform .16s ease;
}

[data-platform="ios"] #platformDownload {
  border-color: #e6ddff;
  background: linear-gradient(115deg, #f3edff, #c9baff 73%, #b5a1f4);
  color: #1e1839;
  box-shadow: 0 .2rem #67578f, inset 0 1px #fff9ff, 0 .5rem 1.6rem #c2b7ff24;
}

.download-button:hover { filter: brightness(1.09); }
.download-button:active { transform: translateY(2px); }

.platform-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin-top: .75rem;
}

.platform-picker button, .invite-panel button {
  min-height: 2.75rem;
  padding: .5rem .65rem;
  border: 1px solid #567490;
  border-radius: .55rem;
  background: #1b2c45;
  color: #eef6ff;
  font-size: .875rem;
  font-weight: 650;
}

.platform-picker button:hover, .invite-panel button:hover { background: #263f5e; }

.download-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 .25rem;
  margin: .5rem 0 -.4rem;
}

.download-details p {
  margin: 0;
  color: var(--muted);
  font-size: .875rem;
}

.text-button {
  min-height: 2.75rem;
  padding: 0 .15rem;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: .25em;
}

.browser-hint {
  margin: .75rem 0 0;
  color: var(--gold);
  font-size: .9375rem;
  line-height: 1.55;
}

.invite-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .625rem;
  width: min(100%, 28rem);
  padding: .75rem;
  border: 1px solid #675742;
  border-radius: .75rem;
  background: #121b2df5;
}

.invite-panel label {
  color: var(--gold);
  font-size: .875rem;
  font-weight: 700;
}

.invite-panel p {
  margin: .12rem 0 0;
  color: var(--muted);
  font-size: .8125rem;
}

.invite-panel input, .profile-url {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .375rem .5rem;
  border: 1px solid #506882;
  border-radius: .5rem;
  background: #0b172b;
  color: var(--text);
  font-weight: 700;
}

.profile-tools { margin-top: .65rem; }
.profile-url { display: block; max-width: 35rem; font-weight: 400; }

.install {
  padding: 1rem 0 calc(4rem + env(safe-area-inset-bottom));
  scroll-margin-top: 1rem;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.25rem;
}

.section-heading h2 {
  margin: 0;
  color: #ffebbd;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  line-height: 1.3;
  letter-spacing: .06em;
}

.section-heading::after {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #b9905470, #2a3b5300);
  content: "";
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: install-step;
}

.guide-steps li {
  position: relative;
  display: grid;
  align-content: start;
  gap: .875rem;
  min-width: 0;
  padding: 1.15rem;
  border: 1px solid #33475f;
  border-radius: .85rem;
  background: linear-gradient(148deg, rgb(var(--accent-rgb) / .12), #10203a 45%, #0c182b);
  counter-increment: install-step;
}

.guide-steps li::after {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  color: var(--accent);
  opacity: .72;
  font-size: .875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  content: counter(install-step, decimal-leading-zero);
}

.guide-steps h3 {
  margin: 0;
  color: #eff5ff;
  font-size: 1.0625rem;
  line-height: 1.35;
}

.guide-steps p {
  margin: .4rem 0 0;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.6;
}

.step-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.7rem;
  height: 3.7rem;
  border: 1px solid rgb(var(--accent-rgb) / .3);
  border-radius: .8rem;
  background: radial-gradient(circle at 32% 20%, rgb(var(--accent-rgb) / .19), #10213b 78%);
  color: var(--accent);
  box-shadow: inset 0 1px #e3eeff20, 0 .3rem .9rem #030a1866;
}

.step-art i { position: relative; display: block; }
.step-art img { display: block; border: 1px solid #ffe5a15e; border-radius: .55rem; }

.file-art i {
  width: 1.2rem;
  height: 1.5rem;
  border: 2px solid currentColor;
  border-radius: .23rem;
}

.file-art i::before, .file-art i::after {
  position: absolute;
  left: .22rem;
  width: .52rem;
  height: 1px;
  background: currentColor;
  content: "";
}

.file-art i::before { top: .42rem; }
.file-art i::after { top: .7rem; }

.tray-art i {
  width: 1.4rem;
  height: .75rem;
  margin-top: .65rem;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 .27rem .27rem;
}

.tray-art i::before {
  position: absolute;
  left: 50%;
  bottom: .28rem;
  transform: translateX(-50%);
  font: 700 1.2rem/1 system-ui, sans-serif;
  content: "↓";
}

.settings-art i::before {
  font: 700 1.75rem/1 "Segoe UI Symbol", sans-serif;
  content: "⚙";
}

.toast {
  position: fixed;
  z-index: 3;
  inset: auto auto calc(1.25rem + env(safe-area-inset-bottom)) 50%;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: .75rem 1rem;
  transform: translateX(-50%);
  border: 1px solid #6282a0;
  border-radius: .75rem;
  background: #132c46;
  color: var(--text);
  box-shadow: 0 .5rem 1.5rem #030a1580;
  text-align: center;
  overflow-wrap: anywhere;
}

.toast:empty { padding: 0; border: 0; box-shadow: none; pointer-events: none; }

.wechat-locked, .wechat-locked body { overflow: hidden; }

.wechat-overlay {
  position: fixed;
  z-index: 5;
  inset: 0;
  padding: calc(6.5rem + env(safe-area-inset-top)) 1rem 2rem;
  overflow: auto;
  overscroll-behavior: contain;
  background: #030916e8;
}

.wechat-direction {
  position: absolute;
  top: calc(.875rem + env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--gold);
}

.wechat-direction span {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 2.125rem;
  padding-bottom: .25rem;
  border: 1px solid #dfb980;
  border-radius: .6rem;
  background: #211b1a;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
}

.wechat-direction::before {
  font: 700 2rem/1 "Segoe UI Symbol", sans-serif;
  transform: translateY(.25rem);
  content: "↗";
}

.wechat-card {
  width: min(100%, 27rem);
  margin-inline: auto;
  padding: 1.65rem;
  border: 1px solid #617da0;
  border-radius: 1.125rem;
  background: linear-gradient(155deg, #1d3554, #0d182b 78%);
  box-shadow: 0 1.25rem 3rem #0008;
}

.wechat-card img { display: block; border: 1px solid #e9c58a85; border-radius: .8rem; }

.wechat-card h2 {
  margin: 1rem 0 .75rem;
  color: #ffebbd;
  font-size: clamp(1.25rem, 5vw, 1.6rem);
}

.wechat-card h2:focus { outline: none; }
.wechat-card ol { margin: 0; padding-inline-start: 1.3em; color: #e0ebfc; line-height: 1.65; }
.wechat-card li + li { margin-top: .5rem; }

@media (max-width: 720px) {
  .header-content { min-height: 4rem; }

  .hero {
    min-height: 0;
    padding: calc(clamp(11rem, 51vw, 17rem) + env(safe-area-inset-top)) 0 1.7rem;
  }

  .hero-art { left: 0; height: clamp(25rem, 94vw, 33rem); }
  .hero-art img { object-position: 50% 51%; }

  .hero::after {
    background: linear-gradient(180deg, #080f1fea, #080f1f00 6.5rem),
                linear-gradient(180deg, #080f1f00 7rem, #080f1f55 11rem, #080f1fdb 19rem, var(--page) 27rem);
  }

  .hero-content { justify-items: center; gap: 1.125rem; }
  .hero-identity { width: min(100%, 28rem); gap: .9rem; }
  .app-crest { padding: .27rem; border-radius: .95rem; }
  .app-crest img { width: 3.4rem; height: 3.4rem; border-radius: .74rem; }
  h1 { font-size: clamp(3.05rem, 11vw, 5rem); }
  .download-panel { padding: 1.05rem; }
  .download-panel::before { left: 1.05rem; }
  .install { width: min(calc(100% - var(--gutter) * 2), 28rem); padding-bottom: 2rem; }

  .guide-steps { grid-template-columns: minmax(0, 1fr); gap: .625rem; }
  .guide-steps li {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .75rem;
    padding: .875rem 2.2rem .875rem .875rem;
  }

  .guide-steps li::after { top: .8rem; right: .75rem; }
  .step-art { width: 3.05rem; height: 3.05rem; }
  .step-art img { width: 2.15rem; height: 2.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .download-button { transition: none; }
}
