:root {
  color-scheme: dark;
  --bg: #080b0f;
  --text: #edf7f2;
  --soft: #c9d9d3;
  --muted: #9fb1ad;
  --line: rgba(217, 232, 226, 0.14);
  --panel: rgba(13, 18, 25, 0.78);
  --panel-strong: rgba(16, 23, 32, 0.9);
  --teal: #49f0c7;
  --amber: #ffc857;
  --coral: #ff846d;
  --copy-bg: rgba(7, 12, 18, 0.9);
  --copy-text: #f4fffb;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 8px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f8f7;
  --text: #102027;
  --soft: #33494d;
  --muted: #607477;
  --line: rgba(17, 33, 38, 0.14);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --teal: #007c69;
  --amber: #9a6400;
  --coral: #c94f3c;
  --copy-bg: #102027;
  --copy-text: #ffffff;
  --shadow: 0 24px 70px rgba(22, 48, 52, 0.16);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(73, 240, 199, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 200, 87, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 10% 0%, rgba(73, 240, 199, 0.16), transparent 32%),
    radial-gradient(circle at 92% 14%, rgba(255, 132, 109, 0.12), transparent 30%),
    var(--bg);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.download-page {
  width: min(1120px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0 42px;
}

.topbar,
.hero,
.info-card,
.warning-card,
.install-steps {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 14px;
}

.brand {
  display: inline-grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 1px solid rgba(73, 240, 199, 0.55);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(73, 240, 199, 0.24), rgba(255, 132, 109, 0.2));
  font-weight: 900;
}

.brand-copy,
.brand-copy strong,
.brand-copy span {
  display: block;
  min-width: 0;
  line-height: 1.25;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.84rem;
}

.theme-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.theme-buttons button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.theme-buttons button[aria-pressed="true"],
.theme-buttons button:hover,
.theme-buttons button:focus-visible {
  border-color: rgba(73, 240, 199, 0.36);
  outline: none;
  background: rgba(73, 240, 199, 0.12);
  color: var(--text);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 28px;
  align-items: stretch;
  margin-top: 22px;
  padding: 38px;
  overflow: hidden;
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(135deg, rgba(73, 240, 199, 0.11), transparent 35%),
    linear-gradient(315deg, rgba(255, 132, 109, 0.1), transparent 34%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-weight: 800;
}

h1 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 1.02;
}

.lead {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--soft);
  font-size: 1.08rem;
}

.primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.primary-actions a,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid rgba(73, 240, 199, 0.42);
  border-radius: var(--radius);
  background: rgba(73, 240, 199, 0.12);
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.primary-actions a:nth-child(2) {
  border-color: rgba(255, 200, 87, 0.42);
  background: rgba(255, 200, 87, 0.12);
}

.download-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.download-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.download-card strong {
  font-size: 1.4rem;
}

.code-line {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
}

.code-line code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--teal);
  font-weight: 900;
}

.copy-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(73, 240, 199, 0.62);
  border-radius: var(--radius);
  background: var(--copy-bg);
  color: var(--copy-text);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.info-card,
.warning-card,
.install-steps {
  padding: 22px;
}

.info-card h2,
.warning-card h2,
.install-steps h2 {
  margin: 0 0 10px;
}

.info-card p,
.warning-card p,
.install-steps p,
.install-steps li {
  color: var(--soft);
}

.warning-card {
  grid-column: 1 / -1;
  border-color: rgba(255, 200, 87, 0.44);
  background: rgba(255, 200, 87, 0.1);
}

.command-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071018;
}

.command-line code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #e7fff8;
  line-height: 1.55;
}

.command-line .copy-btn {
  align-self: center;
}

.install-steps ol {
  padding-left: 1.25rem;
}

.alt-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.alt-links a {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-decoration: none;
}

.footer {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding-top: 24px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .topbar,
  .footer {
    display: grid;
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero > *,
  .content-grid > * {
    min-width: 0;
  }

  .hero {
    padding: 24px;
  }

  .primary-actions a,
  .download-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .download-page {
    width: min(100% - 20px, 520px);
    padding-top: 12px;
  }

  .hero {
    padding: 18px;
  }

  .theme-buttons {
    width: 100%;
  }

  .code-line {
    display: grid;
  }

  .command-line {
    grid-template-columns: 1fr;
  }

  .command-line .copy-btn {
    width: 100%;
  }
}
