:root {
  --background: #ffffff;
  --surface: #f7f9fb;
  --ink: #191d22;
  --muted: #777f89;
  --line: #e5e9ee;
  --blue: #2478df;
  --blue-dark: #175eb4;
  --jade: #27836f;
  --danger: #c94d42;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--background);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(36, 120, 223, 0.025), transparent 520px),
    var(--background);
}

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

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

.page-shell,
footer {
  width: min(980px, calc(100% - 48px));
  margin-inline: auto;
}

.download-screen {
  position: relative;
  min-height: 760px;
  padding: 68px 0 76px;
}

.app-heading {
  display: flex;
  align-items: center;
  gap: 24px;
}

.app-icon {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(20, 40, 62, 0.14);
}

.app-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.3;
}

.app-heading-copy > p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 20px;
}

.official-badge {
  padding: 4px 8px;
  border: 1px solid rgba(39, 131, 111, 0.34);
  border-radius: 4px;
  color: var(--jade);
  font-size: 11px;
  font-weight: 700;
}

.platform-tabs {
  display: grid;
  grid-template-columns: repeat(4, 132px);
  justify-content: center;
  gap: 40px;
  margin: 28px auto 0;
  border-bottom: 1px solid #f1f3f5;
}

.platform-tab {
  position: relative;
  height: 56px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 17px;
}

.platform-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: transparent;
}

.platform-tab[aria-selected="true"] {
  color: var(--blue);
  font-weight: 700;
}

.platform-tab[aria-selected="true"]::after {
  background: var(--blue);
}

.download-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 42px;
}

.qr-card {
  position: relative;
  width: 236px;
  height: 236px;
  padding: 12px;
  border: 1px solid rgba(36, 120, 223, 0.34);
  border-radius: 5px;
  background: white;
  box-shadow: 0 12px 30px rgba(35, 59, 91, 0.12);
}

.qr-card > img:first-child {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  padding: 4px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 10px rgba(20, 35, 52, 0.18);
  transform: translate(-50%, -50%);
}

.scan-label {
  margin: 12px 0 14px;
  color: var(--blue);
  font-size: 14px;
}

/* 电脑安装包扫到手机上装不了,「扫码获取」只留给手机两端。 */
body[data-platform="windows"] .qr-card,
body[data-platform="windows"] .scan-label,
body[data-platform="macos"] .qr-card,
body[data-platform="macos"] .scan-label {
  display: none;
}

.platform-note {
  max-width: 460px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
  white-space: pre-line;
  text-wrap: pretty;
}

.platform-note:empty {
  display: none;
}

.download-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 5px;
  font-size: 14px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.download-button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.48;
}

.platform-primary {
  display: inline-flex;
  width: 226px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
}

.primary-button:hover {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
}

.release-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.release-status.is-error {
  color: var(--danger);
}

.release-status:empty {
  display: none;
}

.scroll-cue {
  position: absolute;
  right: 0;
  bottom: 24px;
  left: 0;
  width: 34px;
  height: 34px;
  margin: auto;
}

.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 9px;
  width: 16px;
  height: 16px;
  border-right: 1px solid #b9c0c8;
  border-bottom: 1px solid #b9c0c8;
  transform: rotate(45deg);
}

.app-description,
.screenshots-section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

.section-heading > span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.section-heading h2 {
  margin: 8px 0 28px;
  font-size: 28px;
}

.description-copy p {
  max-width: 900px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.screenshots-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.screenshots-track figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.screenshots-track img {
  display: block;
  width: 100%;
  height: auto;
}

footer {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

footer nav {
  display: flex;
  gap: 24px;
}

footer a:hover {
  color: var(--blue);
}

.wechat-guide[hidden] {
  display: none;
}

.wechat-guide {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.guide-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(18, 24, 31, 0.5);
}

.guide-sheet {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  padding: 18px 24px calc(24px + env(safe-area-inset-bottom));
  border-radius: 8px 8px 0 0;
  background: white;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.16);
}

.guide-handle {
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto 24px;
  border-radius: 2px;
  background: #d9dde2;
}

.guide-kicker {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.guide-sheet h2 {
  margin-bottom: 12px;
  font-size: 22px;
}

.guide-sheet > p:not(.guide-kicker) {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.guide-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.guide-copy,
.guide-close {
  min-height: 48px;
  border-radius: 5px;
  font-size: 15px;
  cursor: pointer;
}

.guide-copy {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.guide-close {
  border: 0;
  background: var(--ink);
  color: white;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  border-radius: 4px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 680px) {
  body {
    background: white;
  }

  .page-shell,
  footer {
    width: 100%;
  }

  .download-screen {
    min-height: 100svh;
    padding: max(34px, env(safe-area-inset-top)) 16px 72px;
  }

  .app-heading {
    flex-direction: column;
    gap: 18px;
    text-align: center;
  }

  .app-icon {
    width: 100px;
    height: 100px;
    border-radius: 21px;
  }

  .app-name-row {
    justify-content: center;
  }

  h1 {
    font-size: 25px;
  }

  .app-heading-copy > p {
    margin-top: 12px;
    font-size: 18px;
  }

  .official-badge {
    display: none;
  }

  .platform-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: min(360px, 100%);
    margin-top: 24px;
  }

  .platform-tab {
    height: 52px;
    font-size: 15px;
  }

  .download-center {
    padding-top: 28px;
  }

  .qr-card {
    width: 184px;
    height: 184px;
    padding: 8px;
    box-shadow: none;
  }

  .qr-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .scan-label {
    margin: 11px 0 13px;
  }

  .release-status {
    margin-top: 9px;
    font-size: 11px;
  }

  .scroll-cue {
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  .app-description,
  .screenshots-section {
    padding: 48px 20px;
  }

  .section-heading h2 {
    margin-bottom: 22px;
    font-size: 24px;
  }

  .description-copy p {
    font-size: 14px;
    line-height: 1.85;
  }

  .screenshots-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 2px 20px 14px;
    margin-inline: -20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .screenshots-track::-webkit-scrollbar {
    display: none;
  }

  .screenshots-track figure {
    width: min(76vw, 290px);
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  footer {
    min-height: 112px;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
  }
}

/* 四个页签在 320 宽的屏幕上,选中态加粗的「Windows」会比格子宽一点、贴到「macOS」。 */
@media (max-width: 360px) {
  .platform-tab {
    font-size: 14px;
  }
}

@media (max-height: 700px) and (max-width: 680px) {
  .download-screen {
    min-height: 700px;
  }

  .app-icon {
    width: 82px;
    height: 82px;
  }

  .download-center {
    padding-top: 18px;
  }

  .qr-card {
    width: 160px;
    height: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
