/* ============================================================
   NetSpeedTest — 官方网站样式
   暗色 GitHub Dark 风格 · 无外部依赖
   ============================================================ */

:root {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-subtle: #0a0f16;
  --border: #30363d;
  --border-muted: #21262d;
  --text: #e6edf3;
  --text-muted: #9da7b3;
  --text-faint: #6e7681;
  --blue: #58a6ff;
  --blue-strong: #1f6feb;
  --green: #3fb950;
  --green-soft: #2ea043;
  --orange: #f0883e;
  --purple: #bc8cff;
  --red: #f85149;
  --cyan: #39c5cf;
  --gradient: linear-gradient(120deg, #58a6ff 0%, #bc8cff 50%, #3fb950 100%);
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
kbd {
  font-family: var(--font-mono);
}

code {
  background: rgba(110, 118, 129, 0.15);
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.86em;
  color: #d2a8ff;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue-strong);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ---------------- 鼠标交互光效 ---------------- */

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(88, 166, 255, 0.14) 0%,
    rgba(188, 140, 255, 0.08) 38%,
    rgba(63, 185, 80, 0.04) 58%,
    transparent 72%
  );
  mix-blend-mode: screen;
  filter: blur(4px);
  pointer-events: none;
  opacity: 0.85;
  transform: translate3d(-999px, -999px, 0);
  will-change: transform;
}

.glow-card {
  position: relative;
}

.glow-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 50%),
    rgba(88, 166, 255, 0.16) 0%,
    rgba(188, 140, 255, 0.08) 42%,
    transparent 72%
  );
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.glow-card:hover::after {
  opacity: 1;
}

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.02) 48%, rgba(255, 255, 255, 0.06)),
    rgba(10, 15, 22, 0.46);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 14px 40px rgba(0, 0, 0, 0.3);
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  opacity: 0.85;
  pointer-events: none;
}

.site-header.scrolled {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 48%, rgba(255, 255, 255, 0.04)),
    rgba(10, 15, 22, 0.78);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 34px rgba(0, 0, 0, 0.42);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  border-radius: 10px;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand-text small {
  color: var(--text-muted);
  font-size: 12px;
}

.version-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.site-nav {
  position: relative;
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 2px;
  padding: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    rgba(10, 15, 22, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 10px 30px rgba(0, 0, 0, 0.3);
}

.nav-indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.42), rgba(88, 166, 255, 0.28) 55%, rgba(188, 140, 255, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 6px 18px rgba(31, 111, 235, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), width 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  will-change: transform, width;
}

.site-nav a:not(.btn) {
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  font-size: 15px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease;
}

.site-nav a:not(.btn):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.site-nav a:not(.btn).active {
  color: #fff;
}

.site-nav .icon {
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)), rgba(22, 27, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 8px 18px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.nav-toggle:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)), rgba(22, 27, 34, 0.65);
  border-color: rgba(255, 255, 255, 0.22);
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------- Buttons & icons ---------------- */

.icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #1f6feb, #388bfd);
  color: #fff;
  box-shadow: 0 8px 24px rgba(31, 111, 235, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 12px 30px rgba(31, 111, 235, 0.5);
}

.btn-ghost {
  background: rgba(22, 27, 34, 0.75);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: #6e7681;
  background: rgba(22, 27, 34, 0.95);
}

.btn-lg {
  padding: 14px 26px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-sm {
  padding: 8px 15px;
  font-size: 14px;
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  padding: 88px 0 80px;
  border-bottom: 1px solid var(--border-muted);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 78% -10%, rgba(88, 166, 255, 0.16), transparent 62%),
    radial-gradient(700px 420px at 12% 110%, rgba(188, 140, 255, 0.13), transparent 60%),
    radial-gradient(620px 380px at 95% 100%, rgba(63, 185, 80, 0.1), transparent 60%);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(48, 54, 61, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48, 54, 61, 0.28) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 20%, rgba(0, 0, 0, 0.65), transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, rgba(0, 0, 0, 0.65), transparent 75%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(63, 185, 80, 0.4);
  background: rgba(63, 185, 80, 0.09);
  color: #7ee787;
  font-size: 13.5px;
  margin-bottom: 22px;
}

.pulse-dot,
.live-tag i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.6);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 0 30px;
  font-size: 17px;
  color: var(--text-muted);
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.hero-meta {
  margin: 0;
  color: var(--text-faint);
  font-size: 14px;
}

/* Demo card */

.hero-visual {
  position: relative;
}

.demo-card {
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.96), rgba(13, 17, 23, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.demo-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-muted);
  font-size: 13px;
  color: var(--text-muted);
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #30363d;
}

.window-dots i:nth-child(1) { background: #f85149; }
.window-dots i:nth-child(2) { background: #d29922; }
.window-dots i:nth-child(3) { background: #3fb950; }

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.demo-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 8px;
}

.demo-value {
  padding: 12px 14px;
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  background: rgba(10, 15, 22, 0.6);
  min-width: 0;
}

.demo-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.demo-label::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: 1px;
}

.download-label::before { background: var(--blue); }
.upload-label::before { background: var(--green); }
.total-label::before { background: var(--purple); }

.demo-value strong {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  color: var(--text);
  letter-spacing: -0.02em;
}

.demo-value small {
  color: var(--text-muted);
  margin-left: 4px;
  font-size: 12px;
}

.demo-card canvas {
  width: 100%;
  height: 210px;
  display: block;
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  background: rgba(10, 15, 22, 0.55);
}

.demo-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  color: var(--text-faint);
  font-size: 12px;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

.legend-download { background: var(--blue); }
.legend-upload { background: var(--green); }
.legend-avg { background: var(--purple); opacity: 0.75; }

#demoElapsed {
  margin-left: auto;
  font-family: var(--font-mono);
}

/* Hero stats */

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 64px;
}

.stat-item {
  padding: 20px 22px;
  background: rgba(22, 27, 34, 0.66);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.stat-item strong {
  display: block;
  font-size: 30px;
  line-height: 1.2;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-item strong em {
  font-style: normal;
  font-size: 17px;
}

.stat-item > span {
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ---------------- Sections ---------------- */

.section {
  padding: 92px 0;
}

.section-alt {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
}

section[id] {
  scroll-margin-top: 86px;
}

.section-head {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-head.align-left {
  margin: 0 0 28px;
  text-align: left;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  letter-spacing: -0.02em;
}

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

/* ---------------- Features ---------------- */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: #484f58;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-size: 26px;
  border-radius: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.6);
}

.feature-icon.blue { box-shadow: inset 0 0 24px rgba(88, 166, 255, 0.14); }
.feature-icon.green { box-shadow: inset 0 0 24px rgba(63, 185, 80, 0.14); }
.feature-icon.orange { box-shadow: inset 0 0 24px rgba(240, 136, 62, 0.14); }
.feature-icon.purple { box-shadow: inset 0 0 24px rgba(188, 140, 255, 0.14); }
.feature-icon.red { box-shadow: inset 0 0 24px rgba(248, 81, 73, 0.14); }
.feature-icon.cyan { box-shadow: inset 0 0 24px rgba(57, 197, 207, 0.14); }

.feature-card h3 {
  margin: 0 0 14px;
  font-size: 19px;
}

.new-badge {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.35);
}

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

.check-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-weight: 700;
}

/* ---------------- Screenshot ---------------- */

.screenshot-frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-elevated);
}

.screenshot-frame img {
  width: 100%;
  height: auto;
}

.screenshot-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-muted);
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ---------------- Toolbox ---------------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.tool-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  row-gap: 3px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.tool-item:hover {
  border-color: var(--blue);
  background: rgba(88, 166, 255, 0.05);
  transform: translateY(-2px);
}

.tool-item strong {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14.5px;
}

.tool-item small {
  display: block;
  flex: 1 1 100%;
  margin-left: 34px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.4;
}

/* ---------------- Split grid / shortcuts / params ---------------- */

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.key-list {
  display: grid;
  gap: 10px;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
}

.key-row span {
  color: var(--text-muted);
}

kbd {
  display: inline-block;
  min-width: 40px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  background: #21262d;
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  background: var(--bg-elevated);
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.param-table th,
.param-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
}

.param-table tr:last-child td {
  border-bottom: 0;
}

.param-table th {
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.param-table td strong {
  color: var(--green);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ---------------- Architecture ---------------- */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stack-item {
  padding: 24px;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.stack-item:hover {
  border-color: var(--blue);
  transform: translateY(-3px);
}

.stack-badge {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

.stack-item strong {
  display: block;
  font-size: 19px;
  margin-bottom: 4px;
}

.stack-item small {
  color: var(--text-muted);
}

/* ---------------- Changelog ---------------- */

.changelog-wrap {
  max-width: 820px;
}

.changelog {
  display: grid;
  gap: 12px;
}

.changelog-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.changelog-item summary {
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  cursor: pointer;
  padding: 17px 20px;
  user-select: none;
}

.changelog-item summary::-webkit-details-marker {
  display: none;
}

.changelog-item summary:hover {
  background: rgba(88, 166, 255, 0.04);
}

.version-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--blue);
  flex: none;
}

.version-date {
  color: var(--text-faint);
  font-size: 13px;
  flex: none;
}

.version-title {
  font-weight: 600;
  margin-right: auto;
}

.chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex: none;
}

.changelog-item[open] .chevron {
  transform: rotate(225deg);
}

.changelog-body {
  padding: 2px 22px 20px;
  border-top: 1px solid var(--border-muted);
  color: var(--text-muted);
}

.changelog-body h4 {
  margin: 16px 0 8px;
  color: var(--text);
  font-size: 15px;
}

.changelog-body ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 5px;
}

.changelog-more {
  text-align: center;
  margin-top: 22px;
  color: var(--text-muted);
}

/* ---------------- Download ---------------- */

.download-section {
  padding-bottom: 110px;
}

.download-box {
  text-align: center;
  padding: 64px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(600px 260px at 50% 0%, rgba(88, 166, 255, 0.14), transparent 70%),
    radial-gradient(500px 240px at 50% 100%, rgba(63, 185, 80, 0.1), transparent 70%),
    var(--bg-elevated);
  box-shadow: var(--shadow);
}

.download-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 22px;
  border-radius: 22px;
}

.download-box h2 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 3.5vw, 2.7rem);
}

.download-box > p {
  margin: 0 0 28px;
  color: var(--text-muted);
}

.download-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 30px;
}

.build-steps {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  color: var(--text-faint);
  font-size: 13.5px;
}

.build-steps code {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px 14px;
  color: #7ee787;
  white-space: nowrap;
}

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--border-muted);
  padding: 46px 0;
  background: var(--bg-subtle);
}

.footer-inner {
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-brand img {
  border-radius: 8px;
}

.footer-inner p {
  margin: 4px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.footer-inner .footer-meta {
  color: var(--text-faint);
  font-size: 13px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 16px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
}

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

/* ---------------- Reveal animation ---------------- */

html.js :where(.reveal) {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js :where(.reveal.visible) {
  opacity: 1;
  transform: none;
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

    .cursor-glow {
      display: none;
    }


  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 960px) {
  .hero {
    padding-top: 64px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .hero-subtitle {
    max-width: none;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-toggle {
    display: flex;
  }

  .header-tools {
    margin-left: auto;
  }

  .site-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 12px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)), rgba(13, 17, 23, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 24px;
      backdrop-filter: blur(24px) saturate(170%);
      -webkit-backdrop-filter: blur(24px) saturate(170%);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 18px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }

  .site-nav.open {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

    .nav-indicator {
      top: 8px;
      bottom: auto;
      left: 8px;
      right: 8px;
      width: auto;
      height: 0;
      border-radius: 18px;
      transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), height 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
    }


  .site-nav a:not(.btn) {
    padding: 11px 14px;
      border-radius: 16px;
    font-size: 16px;
  }

  .site-nav .btn {
    margin-top: 8px;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 28px);
  }

  .brand-text small {
    display: none;
  }

  .hero {
    padding: 48px 0 60px;
  }

  .hero h1 {
    font-size: clamp(1.5rem, 8.5vw, 1.9rem);
        white-space: nowrap;
      white-space: normal;
        white-space: nowrap;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 44px;
  }

  .stat-item {
    padding: 16px;
  }

  .stat-item strong {
    font-size: 25px;
  }

  .section {
    padding: 68px 0;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

  .demo-values {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .demo-card {
    padding: 14px;
  }

  .demo-card canvas {
    height: 170px;
  }

  .demo-foot {
    flex-wrap: wrap;
    gap: 10px;
  }

  #demoElapsed {
    width: 100%;
    margin-left: 0;
    text-align: right;
  }

  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

    .tool-item small {
      margin-left: 0;
      flex: none;
    }


  .changelog-item summary {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .version-title {
    width: 100%;
    order: 3;
  }

  .download-box {
    padding: 48px 20px;
  }

  .build-steps code {
    white-space: normal;
    word-break: break-all;
  }
}

/* ---------------- 顶栏主题/语言控件 ---------------- */
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle,
.lang-switch {
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)), rgba(22, 27, 34, 0.5);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle {
  width: 36px;
  font-size: 15px;
  line-height: 1;
}

.lang-switch {
  padding: 0 8px;
  font-size: 12px;
  outline: none;
}

.lang-switch option {
  background: #161b22;
  color: #e6edf3;
}

.theme-toggle:hover,
.lang-switch:hover {
  border-color: rgba(88, 166, 255, 0.6);
}

/* ---------------- 亮色主题 ---------------- */
html.light {
  --bg: #f2f5f9;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef2f7;
  --border: #d5dce5;
  --border-muted: #e3e8ef;
  --text: #1f242b;
  --text-muted: #596273;
  --text-faint: #8993a0;
  --shadow: 0 18px 50px rgba(30, 45, 70, 0.14);
}

html.light body {
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(88, 166, 255, 0.2), transparent 60%),
    radial-gradient(700px 400px at 5% 110%, rgba(188, 140, 255, 0.16), transparent 60%),
    var(--bg);
}

html.light .site-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62));
  border-bottom-color: rgba(15, 25, 45, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 32px rgba(30, 45, 70, 0.08);
}

html.light .site-header.scrolled {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
}

html.light .site-nav {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72));
  border-color: rgba(15, 25, 45, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 10px 28px rgba(30, 45, 70, 0.1);
}

html.light .site-nav a:not(.btn):hover {
  background: rgba(15, 25, 45, 0.06);
}

html.light .site-nav a:not(.btn).active {
  color: #0b5dd6;
}

html.light .nav-indicator {
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.2), rgba(88, 166, 255, 0.14) 55%, rgba(188, 140, 255, 0.12));
  border-color: rgba(31, 111, 235, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 6px 18px rgba(31, 111, 235, 0.14);
}

html.light .theme-toggle,
html.light .lang-switch,
html.light .nav-toggle {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  border-color: rgba(15, 25, 45, 0.14);
  color: var(--text);
}

html.light .lang-switch option {
  background: #ffffff;
  color: #1f242b;
}

html.light .btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(15, 25, 45, 0.16);
  color: var(--text);
}

html.light .btn-ghost:hover {
  border-color: rgba(31, 111, 235, 0.5);
  background: #ffffff;
}

html.light .hero-bg {
  background:
    radial-gradient(900px 480px at 78% -10%, rgba(88, 166, 255, 0.2), transparent 62%),
    radial-gradient(700px 420px at 12% 110%, rgba(188, 140, 255, 0.17), transparent 60%),
    radial-gradient(620px 380px at 95% 100%, rgba(63, 185, 80, 0.12), transparent 60%);
}

html.light .hero-bg::after {
  background-image:
    linear-gradient(rgba(120, 135, 155, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 135, 155, 0.18) 1px, transparent 1px);
}

html.light .hero-badge {
  background: rgba(63, 185, 80, 0.1);
  border-color: rgba(46, 160, 67, 0.4);
  color: #1a7f37;
}

html.light .demo-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72));
  border-color: rgba(15, 25, 45, 0.12);
}

html.light .demo-card-head {
  border-bottom-color: rgba(15, 25, 45, 0.1);
}

html.light .demo-value {
  background: rgba(245, 248, 252, 0.85);
  border-color: rgba(15, 25, 45, 0.1);
}

html.light .demo-card canvas {
  background: rgba(245, 248, 252, 0.75);
  border-color: rgba(15, 25, 45, 0.1);
}

html.light .stat-item,
html.light .feature-card,
html.light .tool-item,
html.light .stack-item,
html.light .key-row,
html.light .table-wrap,
html.light .changelog-item,
html.light .screenshot-frame {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 25, 45, 0.12);
}

html.light .feature-card:hover,
html.light .tool-item:hover,
html.light .stack-item:hover {
  border-color: rgba(31, 111, 235, 0.4);
  box-shadow: 0 18px 44px rgba(30, 45, 70, 0.12);
}

html.light .tool-item:hover {
  background: rgba(31, 111, 235, 0.06);
}

html.light .param-table th,
html.light .param-table td {
  border-bottom-color: rgba(15, 25, 45, 0.1);
}

html.light kbd {
  background: #ffffff;
  border-color: rgba(15, 25, 45, 0.16);
  color: var(--text);
}

html.light code {
  background: rgba(31, 111, 235, 0.08);
  border-color: rgba(31, 111, 235, 0.2);
  color: #6f42c1;
}

html.light .download-box {
  background:
    radial-gradient(600px 260px at 50% 0%, rgba(88, 166, 255, 0.16), transparent 70%),
    radial-gradient(500px 240px at 50% 100%, rgba(63, 185, 80, 0.12), transparent 70%),
    rgba(255, 255, 255, 0.8);
  border-color: rgba(15, 25, 45, 0.12);
}

html.light .site-footer {
  background: rgba(255, 255, 255, 0.6);
  border-top-color: rgba(15, 25, 45, 0.1);
}

html.light .cursor-glow {
  mix-blend-mode: normal;
  opacity: 0.5;
}

@media (max-width: 640px) {
  .lang-switch {
    max-width: 70px;
  }
}

html[lang="en"] .hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
}

/* ---------------- 联系方式 ---------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 26px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  border-color: rgba(88, 166, 255, 0.6);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  font-size: 30px;
  border-radius: 18px;
  margin-bottom: 16px;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.25);
}

.contact-card img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 14px;
}

.contact-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.contact-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  word-break: break-all;
}

@media (max-width: 960px) {
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

html.light .contact-card {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(15, 25, 45, 0.12);
}

html.light .contact-card:hover {
  border-color: rgba(31, 111, 235, 0.4);
  box-shadow: 0 18px 40px rgba(30, 45, 70, 0.12);
}

/* ---------------- 联系方式交互 ---------------- */
.qr-link {
  display: block;
  border-radius: 14px;
  overflow: hidden;
}

.qr-link img {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.qr-link:hover img {
  transform: scale(1.04);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.contact-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.contact-card p a {
  color: var(--blue);
  text-decoration: none;
}

.contact-card p a:hover {
  text-decoration: underline;
}

.footer-credit {
  margin: 12px 0 0 !important;
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 0.04em;
}
