:root {
  color-scheme: dark;
  --bg: #070a14;
  --panel: rgba(18, 25, 45, 0.78);
  --panel-strong: #111a31;
  --text: #eef4ff;
  --muted: #aab6ca;
  --line: rgba(255, 255, 255, 0.12);
  --orange: #ff6b1a;
  --amber: #ffb000;
  --cyan: #00e5ff;
  --blue: #4367ff;
  --green: #28f29a;
  --danger: #ff335f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 78% 8%, rgba(0, 229, 255, 0.18), transparent 30%),
    radial-gradient(circle at 20% 20%, rgba(255, 107, 26, 0.20), transparent 28%),
    linear-gradient(180deg, #090d18 0%, var(--bg) 46%, #04060d 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(7, 10, 20, 0.76);
  border-bottom: 1px solid var(--line);
}

.nav, .hero, .section, .cta-section, .footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.02em;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 950;
  color: #07101c;
  background: linear-gradient(135deg, var(--cyan), var(--amber) 54%, var(--orange));
  box-shadow: 0 0 34px rgba(0, 229, 255, 0.35);
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 2px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links a {
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  transition: 180ms ease;
}
.nav-links a:hover, .nav-links a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.nav-links .nav-cta {
  color: #06111a;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--amber));
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
}
.nav-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
  border-radius: 10px;
}

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: 54px;
  padding: 56px 0 80px;
}
.eyebrow {
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 900;
  margin: 0 0 14px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 720px;
  font-size: clamp(3.1rem, 8vw, 6.9rem);
  line-height: 0.88;
  letter-spacing: -0.075em;
  margin-bottom: 28px;
}
h2 {
  font-size: clamp(2rem, 4vw, 3.45rem);
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: 18px;
}
h3 { font-size: 1.24rem; margin-bottom: 10px; }
p { color: var(--muted); line-height: 1.72; }
.hero-lead { font-size: 1.08rem; max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 34px 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #07101a;
  background: linear-gradient(135deg, var(--amber), var(--orange) 52%, var(--cyan));
  box-shadow: 0 14px 35px rgba(255, 107, 26, 0.32);
}
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.07);
}
.btn.full { width: 100%; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
}
.hero-stats span {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
}
.hero-stats strong {
  display: block;
  color: var(--text);
  font-size: 1.6rem;
}

.hero-visual { position: relative; min-height: 520px; display: grid; place-items: center; }
.speed-lines {
  position: absolute;
  inset: 10% -18% 8% 0;
  background: repeating-linear-gradient(-14deg, transparent 0 26px, rgba(0,229,255,0.12) 27px 29px, transparent 30px 54px);
  filter: blur(0.2px);
  transform: skewY(-8deg);
}
.track-card {
  position: relative;
  width: min(500px, 100%);
  border: 1px solid var(--line);
  border-radius: 38px;
  padding: 22px;
  background: linear-gradient(160deg, rgba(23,33,61,0.94), rgba(8,10,20,0.88));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.12);
  overflow: hidden;
}
.track-card::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -80px;
  top: -90px;
  border-radius: 50%;
  background: rgba(255,107,26,0.25);
  filter: blur(20px);
}
.hud-row { position: relative; display: flex; justify-content: space-between; color: var(--cyan); font-size: 0.8rem; font-weight: 900; }
.hud-row strong { color: var(--amber); }
.car-scene { position: relative; height: 390px; border-radius: 28px; margin-top: 20px; background: linear-gradient(#111b35 0 40%, #060812 40%); overflow: hidden; }
.moon { position: absolute; width: 82px; height: 82px; right: 36px; top: 34px; border-radius: 50%; background: radial-gradient(circle at 32% 32%, #fff, #86f3ff 70%); box-shadow: 0 0 48px rgba(0,229,255,0.72); }
.car-body {
  position: absolute;
  left: 50%;
  bottom: 104px;
  width: 310px;
  height: 86px;
  transform: translateX(-50%);
  border-radius: 60px 74px 30px 30px;
  background: linear-gradient(135deg, #ff8a00, #ff365d 54%, #542dff);
  box-shadow: 0 18px 40px rgba(255,54,93,0.30);
}
.car-roof { position: absolute; left: 72px; top: -48px; width: 134px; height: 62px; border-radius: 76px 76px 12px 10px; background: linear-gradient(135deg, #152345, #00e5ff); }
.car-light { position: absolute; top: 42px; width: 38px; height: 12px; border-radius: 10px; background: #fff7a8; box-shadow: 0 0 28px #ffec66; }
.car-light.left { left: 22px; }
.car-light.right { right: 22px; background: #98f7ff; box-shadow: 0 0 28px var(--cyan); }
.wheel { position: absolute; bottom: -30px; width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle, #1d2942 0 28%, #05070c 30% 58%, var(--cyan) 60% 64%, #05070c 66%); animation: spin 1.1s linear infinite; }
.wheel-left { left: 48px; } .wheel-right { right: 48px; }
.road { position: absolute; inset: auto 0 0; height: 120px; background: linear-gradient(90deg, #111, #1b2133, #111); }
.road span { position: absolute; top: 58px; width: 90px; height: 6px; border-radius: 8px; background: rgba(255,255,255,0.55); animation: lane 1.2s linear infinite; }
.road span:nth-child(1) { left: 12%; } .road span:nth-child(2) { left: 48%; animation-delay: -0.4s; } .road span:nth-child(3) { left: 82%; animation-delay: -0.8s; }
.boost-meter { position: relative; height: 12px; border-radius: 99px; margin-top: 18px; background: rgba(255,255,255,0.08); overflow: hidden; }
.boost-meter span { display: block; height: 100%; width: 76%; background: linear-gradient(90deg, var(--green), var(--amber), var(--orange)); border-radius: inherit; }

.section { padding: 92px 0; }
.section-heading { max-width: 760px; margin-bottom: 34px; }
.section-heading.compact { max-width: 620px; }
.mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mode-card, .track-showcase, .lab-panel, .leaderboard-table, .feedback-card, .cta-section {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 20px 70px rgba(0,0,0,0.18);
}
.mode-card { padding: 24px; border-radius: 26px; position: relative; overflow: hidden; }
.mode-card.hot { background: linear-gradient(160deg, rgba(255,107,26,0.24), rgba(18,25,45,0.82)); }
.mode-card::after { content: ""; position: absolute; width: 100px; height: 100px; right: -35px; bottom: -35px; border-radius: 50%; background: rgba(0,229,255,0.12); }
.card-icon { font-size: 2rem; display: inline-block; margin-bottom: 18px; }
.mode-card a { color: var(--cyan); font-weight: 900; }

.garage-layout { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 18px; align-items: stretch; }
.car-list { display: grid; gap: 12px; }
.car-card { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: rgba(255,255,255,0.055); }
.car-card.active { border-color: rgba(0,229,255,0.45); box-shadow: inset 0 0 0 1px rgba(0,229,255,0.12); }
.car-card p { margin: 0; }
.car-card strong { margin-left: auto; color: var(--amber); font-size: 1.4rem; }
.car-chip { width: 62px; height: 34px; border-radius: 14px 22px 10px 10px; box-shadow: inset 0 -8px rgba(0,0,0,0.28); }
.car-chip.neon { background: linear-gradient(135deg, var(--cyan), var(--blue)); }
.car-chip.rally { background: linear-gradient(135deg, #c57139, var(--green)); }
.car-chip.drift { background: linear-gradient(135deg, #f83dff, var(--orange)); }
.track-showcase { min-height: 300px; border-radius: var(--radius); padding: 30px; background: linear-gradient(135deg, rgba(67,103,255,0.22), rgba(255,107,26,0.13)), url('data:image/svg+xml,%3Csvg width="520" height="320" viewBox="0 0 520 320" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M-20 254C91 211 118 70 245 102c85 21 64 123 155 135 52 7 91-15 140-44" fill="none" stroke="%2300e5ff" stroke-width="18" stroke-linecap="round" opacity=".26"/%3E%3Cpath d="M-10 277C105 233 129 92 247 124c75 20 63 122 151 134 52 7 98-17 153-49" fill="none" stroke="%23ffb000" stroke-width="4" stroke-dasharray="18 18" opacity=".72"/%3E%3C/svg%3E') center/cover, var(--panel-strong); }
.track-badge { display: inline-block; padding: 8px 12px; border-radius: 999px; color: #081018; font-weight: 900; background: var(--amber); margin-bottom: 60px; }
.track-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.track-meta span { padding: 10px 12px; border-radius: 999px; background: rgba(0,0,0,0.24); color: var(--text); }

.lab-panel { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 18px; padding: 18px; border-radius: 34px; }
.race-form { display: grid; gap: 16px; padding: 14px; }
label { display: grid; gap: 9px; color: var(--text); font-weight: 850; }
select, input[type="range"] { width: 100%; }
select {
  appearance: none;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: #0c1428;
  font: inherit;
}
input[type="range"] { accent-color: var(--orange); }
.range-output { color: var(--muted); font-weight: 700; }
.race-result { border-radius: 26px; padding: 28px; background: radial-gradient(circle at top right, rgba(0,229,255,0.16), transparent 36%), rgba(255,255,255,0.055); }
.result-topline { display: flex; justify-content: space-between; color: var(--muted); text-transform: uppercase; font-size: 0.82rem; letter-spacing: 0.08em; }
.result-topline strong { color: var(--green); }
.speedometer { margin: 24px 0; display: flex; align-items: baseline; gap: 10px; }
.speedometer span { font-size: clamp(4rem, 10vw, 7.5rem); font-weight: 950; line-height: 0.84; letter-spacing: -0.06em; color: var(--text); text-shadow: 0 0 28px rgba(0,229,255,0.45); }
.speedometer small { color: var(--cyan); font-weight: 900; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.result-grid span { padding: 14px; border-radius: 18px; background: rgba(0,0,0,0.22); color: var(--muted); }
.result-grid strong { display: block; color: var(--text); margin-top: 4px; }

.board-layout { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 18px; }
.leaderboard-table, .feedback-card { border-radius: var(--radius); padding: 20px; }
.table-row { display: grid; grid-template-columns: 0.55fr 1fr 1fr 0.8fr; gap: 12px; align-items: center; padding: 16px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.table-row:last-child { border-bottom: 0; }
.table-row strong { color: var(--amber); }
.table-head { color: var(--cyan); font-size: 0.78rem; font-weight: 900; text-transform: uppercase; }
.feedback-card { background: linear-gradient(160deg, rgba(40,242,154,0.13), rgba(18,25,45,0.86)); }
.pulse { width: 14px; height: 14px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(40,242,154,0.7); animation: pulse 1.6s infinite; }

.cta-section { margin-top: 40px; margin-bottom: 70px; padding: 34px; border-radius: 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(135deg, rgba(255,176,0,0.16), rgba(0,229,255,0.10)), var(--panel); }
.cta-section h2 { max-width: 780px; }
.footer { padding: 36px 0 52px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 28px; }
.footer p { margin: 12px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; justify-content: flex-end; }
.footer-links a { padding: 10px 12px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,0.055); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes lane { from { transform: translateX(150px); opacity: 0; } 35% { opacity: 1; } to { transform: translateX(-220px); opacity: 0; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 14px rgba(40,242,154,0); } 100% { box-shadow: 0 0 0 0 rgba(40,242,154,0); } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 38px; }
  .hero-visual { min-height: 460px; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .garage-layout, .lab-panel, .board-layout { grid-template-columns: 1fr; }
  .cta-section { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  .nav, .hero, .section, .cta-section, .footer { width: min(100% - 28px, 1180px); }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 68px;
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(9, 13, 24, 0.97);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: 180ms ease;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 13px 14px; }
  h1 { font-size: clamp(3.2rem, 16vw, 5rem); }
  .hero-stats, .mode-grid, .result-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 390px; }
  .track-card { border-radius: 26px; padding: 14px; }
  .car-scene { height: 310px; }
  .car-body { width: 245px; height: 72px; bottom: 86px; }
  .car-roof { left: 58px; top: -42px; width: 108px; height: 52px; }
  .wheel { width: 58px; height: 58px; bottom: -24px; }
  .wheel-left { left: 36px; } .wheel-right { right: 36px; }
  .section { padding: 64px 0; }
  .table-row { grid-template-columns: 0.45fr 1fr; }
  .table-row span:nth-child(3), .table-row strong { text-align: left; }
  .footer { flex-direction: column; }
  .footer-links { justify-content: flex-start; }
}
