/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0f1e;
  --bg-secondary: #111827;
  --bg-card: #1a2332;
  --bg-elevated: #1f2a3a;
  --border: rgba(99, 102, 241, 0.15);
  --border-hover: rgba(99, 102, 241, 0.35);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.3);
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;

  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--cyan);
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Background Effects ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-glow {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.bg-glow--top {
  top: -20%;
  left: 10%;
  width: 600px;
  height: 600px;
  background: var(--accent);
}

.bg-glow--bottom {
  bottom: -30%;
  right: -5%;
  width: 700px;
  height: 700px;
  background: var(--cyan);
}

/* ===== Layout ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 15, 30, 0.7);
  transition: background var(--transition), border-color var(--transition);
}
.nav.scrolled {
  background: rgba(10, 15, 30, 0.9);
  border-bottom-color: var(--border-hover);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff !important;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition) !important;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 30px var(--accent-glow);
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  z-index: 1;
  padding: 10rem 0 6rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease both;
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease 0.1s both;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--cyan) 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 24px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 35px var(--accent-glow);
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-hover);
}
.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--text-primary);
}

/* ===== Tech Stack ===== */
.tech-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  animation: fadeInUp 0.6s ease 0.4s both;
}
.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.tech-tag .tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.tech-tag .tag-dot.rust { background: #ef7a4c; }
.tech-tag .tag-dot.tauri { background: #ffc131; }
.tech-tag .tag-dot.react { background: #61dafb; }
.tech-tag .tag-dot.clash { background: var(--accent); }

/* ===== Features Section ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 6rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}
.section-header h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
}
.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}
.feature-icon.blue { background: rgba(99, 102, 241, 0.15); color: var(--accent-light); }
.feature-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--cyan); }
.feature-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--green); }
.feature-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--orange); }
.feature-icon.purple { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.feature-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--red); }

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ===== Highlights ===== */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.highlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  transition: all var(--transition);
}
.highlight-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.highlight-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.highlight-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
}
.footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}
.footer .footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Download Page ===== */
.download-hero {
  position: relative;
  z-index: 1;
  padding: 8rem 0 3rem;
  text-align: center;
}
.download-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
}
.download-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.download-section {
  position: relative;
  z-index: 1;
  padding: 2rem 0 6rem;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all var(--transition);
}
.platform-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.platform-card.recommended {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, var(--bg-card) 40%);
  position: relative;
}
.platform-card.recommended::before {
  content: "推荐";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 1rem;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
}

.platform-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  font-size: 1.8rem;
  background: var(--bg-elevated);
}

.platform-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.platform-arch {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}
.platform-version {
  font-size: 0.85rem;
  color: var(--accent-light);
  font-family: var(--font-mono);
  margin-bottom: 1.25rem;
}

.btn-download {
  width: 100%;
  justify-content: center;
  font-size: 0.9rem;
}

.download-info {
  margin-top: 3rem;
  text-align: center;
}

.version-selector {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 1.5rem;
}
.version-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.version-btn.active {
  background: var(--accent);
  color: #fff;
}

.system-req {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 700px;
  margin: 3rem auto 0;
}
.system-req h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}
.req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.req-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.req-item .req-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.req-item .req-value {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== 404 Page ===== */
.page-404 {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 2rem;
}

.error-code {
  font-size: clamp(6rem, 15vw, 12rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--cyan) 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.error-subtitle {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.error-desc {
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.error-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.error-illustration {
  margin-bottom: 2rem;
  font-size: 5rem;
  opacity: 0.6;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .hero {
    padding: 7rem 0 4rem;
  }
  .section {
    padding: 4rem 0;
  }
  .container {
    padding: 0 1.25rem;
  }
  .nav-inner {
    padding: 0 1.25rem;
  }
  .platform-grid {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    justify-content: center;
  }
  .footer .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}
