:root {
  color-scheme: light;
  --ink: #1e2232;
  --muted: #626b88;
  --quiet: #707997;
  --purple: #6833f5;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 37%, #f0e6fc80, transparent 53%),
    radial-gradient(ellipse at 84% 64%, #e9e5ff80, transparent 52%),
    linear-gradient(135deg, #fcfbff, #fff 55%, #faf8ff);
  background-attachment: fixed;
  font-size: 14px;
  line-height: 1.6;
}
a,
button,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button,
input {
  border-radius: 0;
}
a {
  color: inherit;
}
button svg,
a svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:focus-visible {
  outline: 3px solid #9a79fb;
  outline-offset: 5px;
}
.page {
  width: min(100%, 600px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(52px, 10vh, 108px) 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.download {
  width: 100%;
  text-align: center;
}
.app-logo {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto;
  border-radius: 0;
  object-fit: contain;
}
h1 {
  margin: 17px 0 3px;
  font-size: 34px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 1px;
}
.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  letter-spacing: 0.5px;
}
.download-button,
.confirm-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(115deg, #8558fa 0%, #6230f5 100%);
  text-decoration: none;
  font-weight: 600;
  transition:
    filter 0.15s ease,
    transform 0.15s ease;
}
.download-button {
  width: min(100%, 352px);
  margin: 30px auto 0;
  font-size: 19px;
}
.download-button svg {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}
.download-button:active,
.confirm-button:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}
.release {
  margin: 11px 0 0;
  font-size: 13px;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}
.release > span {
  margin: 0 5px;
}
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: #555f80;
  text-decoration: none;
}
.copy-button {
  margin-top: 12px;
  font-size: 14px;
}
.copy-button svg {
  width: 20px;
  height: 20px;
}
.qr-code {
  margin: 21px auto 0;
}
.qr-code img {
  display: block;
  width: 132px;
  height: 132px;
  margin: auto;
  padding: 6px;
  border: 1px solid #e9e8f3;
  border-radius: 7px;
  background: #fff;
}
.qr-code figcaption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.qr-image-box {
  width: 132px;
  height: 132px;
  margin: auto;
}
.qr-error {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 132px;
  height: 132px;
  border: 1px solid #e9e8f3;
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
.qr-error button {
  padding: 5px 9px;
  border: 0;
  border-radius: 5px;
  background: #f3edff;
  color: #6944be;
  font-size: 12px;
}
.footer {
  margin-top: 21px;
  text-align: center;
}
.help-link {
  font-size: 14px;
}
.help-link svg {
  width: 20px;
  height: 20px;
}
.copyright {
  margin: 7px 0 0;
  color: var(--quiet);
  font-size: 12px;
}
.no-script {
  color: var(--muted);
  font-size: 13px;
}
.help-section {
  max-width: 520px;
  margin: 0 auto 32px;
  padding: 0 20px;
}
.help-card,
.fallback-card {
  background: #fff;
  border-radius: 20px;
  padding: 26px;
}
.help-header {
  position: relative;
  padding-right: 36px;
}
.help-header h2,
.fallback-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
}
.help-header > p {
  margin: 3px 0 0;
  color: var(--quiet);
  font-size: 13px;
}
.close-button {
  position: absolute;
  top: -5px;
  right: -9px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #64708c;
  border-radius: 50%;
}
.close-button svg {
  width: 19px;
  height: 19px;
}
.sheet-handle {
  display: none;
}
.help-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  min-height: 0;
  padding: 3px 3px 3px 0;
}
.install-steps {
  counter-reset: steps;
  list-style: none;
  padding: 0;
  margin: 19px 0 20px;
}
.install-steps li {
  position: relative;
  padding-left: 43px;
  margin-top: 18px;
}
.install-steps li::before {
  counter-increment: steps;
  content: counter(steps);
  display: grid;
  place-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(140deg, #9869ff, #6330f5);
  font-size: 13px;
  font-weight: 600;
}
.help-content h3 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
}
.help-content p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.help-note {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f5f1ff;
}
.help-note h3 {
  color: #6143a2;
  font-size: 13px;
}
.help-note p {
  color: #6b5c8b;
  font-size: 12px;
}
.network-help {
  margin-top: 18px;
}
.network-help ul {
  margin: 8px 0 2px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.network-help li + li {
  margin-top: 6px;
}
.network-help strong {
  color: #4d5772;
  font-weight: 600;
}
.confirm-button {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  font-size: 15px;
  flex-shrink: 0;
  border-radius: 9px;
}
.help-section.is-dialog,
.copy-fallback {
  position: fixed;
  inset: 0;
  z-index: 10;
  max-width: none;
  margin: 0;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16132670;
}
.is-dialog .help-card {
  width: min(100%, 460px);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 50px #24134218;
}
.is-dialog .help-header {
  flex-shrink: 0;
  padding-bottom: 12px;
}
.fallback-card {
  width: min(100%, 400px);
}
.fallback-card > p {
  color: var(--muted);
  font-size: 13px;
}
.fallback-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d8d0ee;
  border-radius: 8px;
  color: var(--ink);
  background: #faf9ff;
  font-size: 14px;
}
.toast {
  position: fixed;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100vw - 40px);
  width: max-content;
  padding: 10px 18px;
  background: #282235;
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
}
body.modal-open {
  overflow: hidden;
}
@media (hover: hover) {
  .download-button:hover,
  .confirm-button:hover {
    filter: brightness(1.04);
  }
  .text-button:hover {
    color: var(--purple);
  }
  .close-button:hover {
    background: #f4f0fc;
  }
}
@media (max-width: 767px) {
  .page {
    max-width: 430px;
    justify-content: flex-start;
    padding: clamp(52px, 12vh, 100px) 24px
      calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .app-logo {
    width: 100px;
    height: 100px;
    border-radius: 0;
  }
  h1 {
    font-size: 30px;
    margin-top: 17px;
  }
  .tagline {
    font-size: 15px;
  }
  .download-button {
    margin-top: 29px;
    min-height: 54px;
    font-size: 18px;
  }
  .release {
    font-size: 12px;
    margin-top: 12px;
  }
  .copy-button {
    margin-top: 16px;
  }
  .footer {
    width: 100%;
    margin-top: auto;
    padding-top: 48px;
  }
  .help-link {
    width: 100%;
    border-top: 1px solid #e9e7f1;
    padding-top: 17px;
  }
  .copyright {
    margin-top: 16px;
  }
  .help-section.is-dialog {
    align-items: flex-end;
    padding: 0;
  }
  .is-dialog .help-card {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 20px 20px 0 0;
    padding: 12px 22px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .is-dialog .sheet-handle {
    display: block;
    flex-shrink: 0;
    width: 34px;
    height: 4px;
    border-radius: 3px;
    background: #d1cedf;
    margin: 0 auto 15px;
  }
  .help-header h2 {
    font-size: 19px;
  }
  .install-steps {
    margin-top: 10px;
  }
}
/* 窄桌面窗口也需要二维码；仅触摸设备隐藏，避免把电脑侧栏误判为手机。 */
@media (max-width: 480px), (hover: none) and (pointer: coarse) {
  .qr-code {
    display: none;
  }
}
@media (max-height: 520px) and (min-width: 768px) {
  .page {
    padding-top: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
