:root {
  --bg: #08090c;
  --surface: #0e1015;
  --surface-2: #12141a;
  --surface-3: #171a21;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f5f8;
  --text-2: #a4a9b8;
  --text-3: #6f7484;
  --accent: #6d68f5;
  --accent-top: #7f7bff;
  --accent-soft: rgba(109, 104, 245, 0.14);
  --accent-line: rgba(109, 104, 245, 0.38);
  --accent-text: #a9a5ff;
  --glow: rgba(96, 90, 235, 0.18);
  --glow-2: rgba(56, 132, 255, 0.1);
  --grid: rgba(255, 255, 255, 0.035);
  --header-bg: rgba(8, 9, 12, 0.72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  --shadow-accent: 0 0 0 1px var(--accent-line), 0 0 0 5px rgba(109, 104, 245, 0.08),
    0 24px 48px -30px rgba(109, 104, 245, 0.75);
  --radius-lg: 20px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --shell: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f6f6f9;
  --surface-3: #f0f0f5;
  --border: rgba(15, 17, 28, 0.09);
  --border-strong: rgba(15, 17, 28, 0.18);
  --text: #0d0f16;
  --text-2: #5a6072;
  --text-3: #878da0;
  --accent: #5552d6;
  --accent-top: #6a66ee;
  --accent-soft: rgba(85, 82, 214, 0.09);
  --accent-line: rgba(85, 82, 214, 0.3);
  --accent-text: #4a47c8;
  --glow: rgba(120, 116, 255, 0.2);
  --glow-2: rgba(74, 158, 255, 0.13);
  --grid: rgba(15, 17, 28, 0.045);
  --header-bg: rgba(251, 251, 253, 0.76);
  --shadow-sm: 0 1px 2px rgba(16, 18, 32, 0.06);
  --shadow-md: 0 20px 44px -30px rgba(16, 18, 32, 0.35);
  --shadow-accent: 0 0 0 1px var(--accent-line), 0 24px 48px -32px rgba(85, 82, 214, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
}

::selection {
  background: var(--accent);
  color: #fff;
}

a {
  color: inherit;
}

svg {
  display: block;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
  pointer-events: none;
}

.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(820px 460px at 50% -160px, var(--glow), transparent 72%),
    radial-gradient(640px 420px at 88% -80px, var(--glow-2), transparent 70%);
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 95% 62% at 50% 0%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 95% 62% at 50% 0%, #000 20%, transparent 80%);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand img {
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.brand-chip {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.header-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 4px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.header-link:hover {
  color: var(--text);
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-icon {
  grid-area: 1 / 1;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

:root[data-theme-mode="system"] .theme-icon[data-icon="system"],
:root[data-theme-mode="light"] .theme-icon[data-icon="light"],
:root[data-theme-mode="dark"] .theme-icon[data-icon="dark"] {
  opacity: 1;
  transform: scale(1);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  align-items: center;
  gap: 52px;
  padding: 72px 0 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2fbf71;
  box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.16);
  flex: none;
}

.badge.is-stale .badge-dot {
  background: var(--text-3);
  box-shadow: none;
}

.hero h1 {
  margin: 22px 0 16px;
  font-size: clamp(2.1rem, 4.6vw, 3.35rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 650;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent-top), var(--accent-text) 55%, #3d9bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 31em;
  text-wrap: pretty;
  margin: 0;
  color: var(--text-2);
  font-size: 16.5px;
  line-height: 1.66;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-3);
  font-size: 13px;
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-points li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-strong);
}

/* ---------- terminal panel ---------- */

.hero-panel {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, #13151b, #0a0b0e 70%);
  box-shadow: 0 40px 80px -50px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  isolation: isolate;
}

.panel-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.traffic {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
}

.traffic.red {
  background: #ff5f57;
}

.traffic.amber {
  background: #febc2e;
}

.traffic.green {
  background: #28c840;
}

.panel-title {
  margin-left: 6px;
  color: #7d8296;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.panel-body {
  margin: 0;
  padding: 22px 22px 26px;
  color: #d7d9e4;
  font-family: var(--mono);
  font-size: 13.2px;
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-x: auto;
}

.panel-body .dim {
  color: #4f5466;
}

.panel-body .tag {
  color: #8f8bff;
}

.panel-body .ok {
  color: #3ddc91;
}

.panel-glow {
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(109, 104, 245, 0.35), transparent 68%);
  filter: blur(24px);
  pointer-events: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, filter 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-lg {
  padding: 13px 22px;
  font-size: 15px;
  border-radius: 14px;
}

.btn .arrow {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-top), var(--accent));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 10px 26px -16px rgba(109, 104, 245, 0.95);
}

.btn-primary:hover {
  filter: brightness(1.07);
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
  font-weight: 550;
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.btn small {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  opacity: 0.72;
  letter-spacing: 0.01em;
}

.btn[aria-disabled="true"] {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-3);
  box-shadow: none;
  pointer-events: none;
}

/* ---------- sections ---------- */

.section {
  margin-top: 68px;
  scroll-margin-top: 88px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 620;
  letter-spacing: -0.022em;
}

.section-head p {
  margin: 0;
  color: var(--text-3);
  font-size: 13.5px;
}

/* ---------- download cards ---------- */

.downloads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.downloads[data-current="windows"] .card[data-os="windows"],
.downloads[data-current="macos"] .card[data-os="macos"] {
  order: -1;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--surface));
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card.is-current {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-accent);
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 42%),
    var(--surface);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.chip {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.chip[hidden] {
  display: none;
}

.card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.card-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--text-3);
  font-size: 13.5px;
}

.arch {
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.arch[hidden] {
  display: none;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.card-actions .btn {
  width: 100%;
  justify-content: space-between;
}

.card-actions .btn-secondary {
  justify-content: center;
  font-size: 13px;
  padding: 9px 14px;
  color: var(--text-2);
}

.fallback {
  margin: 18px 0 0;
  color: var(--text-3);
  font-size: 13.5px;
}

.fallback a {
  color: var(--accent-text);
}

/* ---------- steps ---------- */

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

.steps li {
  position: relative;
  padding: 22px 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  counter-increment: step;
}

.step-num {
  display: block;
  margin-bottom: 14px;
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.steps h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 620;
  letter-spacing: -0.015em;
}

.steps p {
  margin: 0;
  color: var(--text-2);
  font-size: 13.8px;
  line-height: 1.6;
}

.steps a {
  color: var(--accent-text);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
}

.steps a:hover {
  border-bottom-color: var(--accent);
}

/* ---------- detail grid ---------- */

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

.panel-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-card h2 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.panel-card p {
  margin: 0 0 12px;
  color: var(--text-2);
  font-size: 13.6px;
  line-height: 1.66;
}

.panel-card p:last-child {
  margin-bottom: 0;
}

.panel-card strong {
  color: var(--text);
  font-weight: 600;
}

.panel-card code {
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}

.file-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.6px;
}

.file-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.file-list a {
  color: var(--accent-text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12.8px;
}

.file-list a:hover {
  text-decoration: underline;
}

.file-list span {
  margin-left: auto;
  color: var(--text-3);
  font-size: 12.5px;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 76px;
  border-top: 1px solid var(--border);
  padding: 26px 0;
  color: var(--text-3);
  font-size: 12.5px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-brand {
  color: var(--text-2);
  font-weight: 600;
}

.footer-dot {
  opacity: 0.5;
}

.site-footer a {
  color: var(--text-2);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- focus & motion ---------- */

:focus-visible {
  outline: 2px solid var(--accent-top);
  outline-offset: 2px;
  border-radius: 6px;
}

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

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

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding-top: 52px;
  }

  .hero-panel {
    max-width: 560px;
  }

  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 0 20px;
  }

  .header-inner {
    height: 58px;
    gap: 10px;
  }

  .header-link {
    display: none;
  }

  .downloads,
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .section {
    margin-top: 56px;
  }

  .hero h1 {
    letter-spacing: -0.03em;
  }

  .hero-sub {
    font-size: 15.5px;
  }

  .hero-cta .btn {
    flex: 1 1 auto;
  }

  .site-footer {
    margin-top: 64px;
  }
}

@media (max-width: 480px) {
  .brand-name {
    font-size: 14.5px;
  }

  .lang-switch button {
    padding: 3px 8px;
    font-size: 12px;
  }

  .hero {
    padding-top: 42px;
  }

  .panel-body {
    font-size: 11.6px;
    padding: 18px;
  }

  .card,
  .panel-card {
    padding: 20px;
  }
}
