:root {
  color-scheme: light;
  --page: #f4f6f8;
  --surface: #ffffff;
  --surface-raised: #f4f6f8;
  --line: #e2e7ec;
  --text: #0f1a22;
  --body: #3c4852;
  --muted: #6b7884;
  --accent: #29773e;
  --accent-strong: #1f5c30;
  --accent-soft: #e3f0e6;
  --ink: #ffffff;
  --live: #0e9f6e;
  --danger: #d9433d;
  --gutter: 16px;
  font-family: "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 280px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: var(--page);
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: rgb(41 119 62 / 20%);
}

.page-shell {
  display: grid;
  width: min(100% - var(--gutter) * 2, 620px);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding: clamp(36px, 8vh, 84px) 0 calc(24px + env(safe-area-inset-bottom, 0px));
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  grid-template-rows: 1fr auto;
  gap: 28px;
}

.download-card {
  align-self: center;
  padding: clamp(24px, 6vw, 40px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.language-select {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 34px 0 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--page);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236b7884' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.language-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.promo-banner {
  display: flex;
  align-items: flex-end;
  height: 124px;
  margin-bottom: 22px;
  padding-left: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--page);
}

/* 素材 384×440,与 App 主页横幅同尺寸:人像底部压出卡片 24px。 */
.promo-portrait {
  width: 124px;
  height: 142px;
  flex: 0 0 auto;
  margin-bottom: -24px;
  object-fit: contain;
}

.promo-copy {
  display: grid;
  align-self: center;
  min-width: 0;
  padding: 0 14px 0 12px;
  gap: 6px;
}

.promo-copy strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.015em;
  line-height: 1.3;
}

.promo-copy span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.brand-mark {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-raised);
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-size: clamp(40px, 10vw, 56px);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  overflow-wrap: break-word;
}

h1 span {
  color: var(--accent);
}

/* 字标跟 App 主页同一套:系统字体、最粗字重、宽字距。 */
#app-name,
.legal-brand {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Roboto, "Segoe UI", system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: 0.094em;
}

.app-summary {
  margin: 26px 0 28px;
  color: var(--body);
  font-size: 15px;
  line-height: 1.7;
}

.download-button {
  display: grid;
  min-height: 88px;
  padding: 16px 20px;
  color: var(--ink);
  text-decoration: none;
  background: var(--accent);
  border-radius: 14px;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 14px;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

@media (hover: hover) {
  .download-button:not(.is-loading):hover {
    background: var(--accent-strong);
  }
}

.download-button:not(.is-loading):active {
  background: var(--accent-strong);
  transform: translateY(1px);
}

.download-button:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 4px;
}

.download-button.is-loading {
  cursor: wait;
  opacity: 0.58;
}

.download-button.is-game {
  margin-top: 22px;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--line);
}

@media (hover: hover) {
  .download-button.is-game:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
  }
}

.download-button.is-game:active {
  background: var(--accent-soft);
  transform: translateY(1px);
}

.download-sources {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
}

.download-sources a {
  color: var(--accent-strong);
  font-weight: 800;
  text-underline-offset: 3px;
}

.download-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: sans-serif;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.download-copy {
  display: grid;
  gap: 4px;
}

.download-copy strong {
  font-size: 18px;
  font-weight: 900;
}

.download-copy small {
  font-family: "Bahnschrift", "Arial Narrow", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.68;
}

.release-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 30px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  gap: 2px 10px;
}

#version {
  font-family: "Bahnschrift", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#published-at {
  color: var(--muted);
  font-size: 13px;
}

.release-notes {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 12px;
}

.release-notes li {
  color: var(--body);
  font-size: 14px;
  line-height: 1.6;
}

.error-message {
  margin: 18px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-inline: 6px;
  color: var(--muted);
  gap: 6px 14px;
  font-family: "Bahnschrift", "Arial Narrow", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

footer a {
  display: inline-block;
  padding-block: 5px;
  color: inherit;
  text-decoration-color: rgb(41 119 62 / 45%);
  text-underline-offset: 4px;
}

footer a:hover {
  color: var(--accent-strong);
}

.legal-page {
  background:
    linear-gradient(132deg, transparent 68%, rgb(41 119 62 / 4%) 68.15%, transparent 68.35%),
    var(--page);
}

.legal-shell {
  width: min(100% - var(--gutter) * 2, 860px);
  margin-inline: auto;
  padding: 28px 0 calc(32px + env(safe-area-inset-bottom, 0px));
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
}

.legal-nav {
  display: grid;
  align-items: center;
  margin-bottom: 26px;
  padding-inline: 6px;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
}

.legal-nav .back-link {
  justify-self: end;
  text-align: right;
}

.legal-brand {
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  gap: 10px;
}

.legal-brand img {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.legal-brand strong {
  color: var(--accent);
}

.back-link {
  display: inline-block;
  padding-block: 6px;
  color: var(--muted);
  font-family: "Bahnschrift", "Arial Narrow", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration-color: rgb(41 119 62 / 45%);
  text-underline-offset: 5px;
  text-transform: uppercase;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--accent-strong);
}

.legal-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.legal-header {
  padding: clamp(30px, 7vw, 52px);
  border-bottom: 1px solid var(--line);
}

.legal-header h1 {
  max-width: 560px;
  margin: 12px 0 18px;
  font-size: clamp(30px, 7.6vw, 72px);
  letter-spacing: -0.065em;
  overflow-wrap: break-word;
  hyphens: auto;
}

.legal-intro {
  max-width: 650px;
  margin: 0;
  color: var(--body);
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.72;
}

.effective-date {
  display: inline-block;
  margin: 26px 0 0;
  padding: 7px 10px;
  color: var(--accent-strong);
  border: 1px solid rgb(41 119 62 / 30%);
  border-radius: 5px;
  font-family: "Bahnschrift", "Arial Narrow", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-sections {
  padding: clamp(28px, 7vw, 58px);
}

.legal-sections section + section {
  margin-top: 42px;
  padding-top: 42px;
  border-top: 1px solid var(--line);
}

.legal-sections h2 {
  display: flex;
  align-items: baseline;
  margin: 0 0 18px;
  color: var(--text);
  font-size: clamp(20px, 3vw, 25px);
  letter-spacing: -0.025em;
  gap: 12px;
}

.legal-sections h2 .section-index {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: "Bahnschrift", "Arial Narrow", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.legal-sections h3 {
  margin: 26px 0 8px;
  color: var(--text);
  font-size: 15px;
}

.legal-sections p,
.legal-sections li {
  color: var(--body);
  font-size: 14px;
  line-height: 1.8;
}

.legal-sections p {
  margin: 0;
}

.legal-sections ul {
  display: grid;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  gap: 9px;
}

.legal-sections li {
  position: relative;
  padding-left: 20px;
}

.legal-sections li::before {
  position: absolute;
  top: 0.72em;
  left: 2px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  content: "";
  transform: rotate(45deg);
}

.contact-section a {
  color: var(--accent-strong);
  font-weight: 700;
  text-underline-offset: 4px;
}

.legal-footer {
  margin-top: 22px;
}

.legal-footer a[aria-current="page"] {
  color: var(--accent);
}

@media (max-width: 480px) {
  :root {
    --gutter: 10px;
  }

  .page-shell {
    padding-top: 20px;
    gap: 20px;
  }

  .download-card {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .brand-mark {
    width: 62px;
    height: 62px;
  }

  .brand-row {
    gap: 14px;
  }

  .app-summary {
    margin: 20px 0 22px;
  }

  .download-button {
    min-height: 80px;
    padding-inline: 16px;
    grid-template-columns: 40px 1fr;
    gap: 12px;
  }

  .download-icon {
    width: 40px;
    height: 40px;
    font-size: 25px;
  }

  .download-copy strong {
    font-size: 17px;
  }

  .release-head {
    margin-top: 28px;
  }

  .legal-shell {
    padding-top: 18px;
  }

  .legal-nav {
    grid-template-columns: 1fr auto;
    margin-bottom: 18px;
    gap: 12px 16px;
  }

  .legal-nav .language-select {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .legal-card {
    border-radius: 16px;
  }

  .legal-header,
  .legal-sections {
    padding: 26px 21px;
  }

  .legal-sections section + section {
    margin-top: 34px;
    padding-top: 34px;
  }
}

@media (max-width: 360px) {
  :root {
    --gutter: 8px;
  }

  .download-card {
    padding: 20px 16px;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  .download-copy strong {
    font-size: 16px;
  }

  .legal-header,
  .legal-sections {
    padding: 22px 16px;
  }

  footer {
    letter-spacing: 0.04em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
