/* ============================================
   BotFixBot / 智修宝 — Design System & Styles
   ============================================ */

/* --- Custom Properties --- */
:root {
  --color-primary: #0066CC;
  --color-primary-dark: #004C99;
  --color-primary-light: #E6F0FF;
  --color-primary-ghost: #F0F6FF;
  --color-accent: #00A86B;
  --color-accent-dark: #008F5A;
  --color-accent-light: #E6FFF5;
  --color-text: #111827;
  --color-text-secondary: #4B5563;
  --color-text-muted: #9CA3AF;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F8FAFC;
  --color-bg-dark: #0A1628;
  --color-border: #E5E7EB;
  --color-border-light: #F1F3F5;

  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "PingFang SC", "Microsoft YaHei", "Courier New", monospace;

  --max-width: 1120px;
  --header-h: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Language Toggle Rules --- */
.lang-zh [data-lang="en"] { display: none !important; }
.lang-en [data-lang="zh"] { display: none !important; }

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }

/* --- Utility --- */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Reveal Animation --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.site-header.scrolled {
  border-bottom-color: var(--color-border);
  background: rgba(255, 255, 255, 0.95);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--color-primary);
}

.logo-icon { color: var(--color-primary); }

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.main-nav a:hover {
  color: var(--color-primary);
  background: var(--color-primary-ghost);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language Toggle */
.lang-toggle {
  position: relative;
  padding: 3px;
  border-radius: 20px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  transition: border-color 0.2s;
}

.lang-toggle:hover {
  border-color: var(--color-primary);
}

.lang-toggle-track {
  display: flex;
  align-items: center;
  position: relative;
  height: 28px;
}

.lang-toggle-option {
  position: relative;
  z-index: 2;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  transition: color 0.25s;
  color: var(--color-text-muted);
  user-select: none;
}

.lang-toggle-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 28px;
  background: var(--color-primary);
  border-radius: 16px;
  transition: transform 0.3s var(--ease-spring);
  z-index: 1;
}

/* Active states for language toggle */
.lang-zh .lang-toggle-option[data-for="zh"] { color: #fff; }
.lang-zh .lang-toggle-thumb { transform: translateX(0); }
.lang-en .lang-toggle-option[data-for="en"] { color: #fff; }
.lang-en .lang-toggle-thumb { transform: translateX(36px); }

/* Hamburger */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
}

.nav-burger span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
  transform-origin: center;
}

.nav-burger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-burger.active span:nth-child(2) {
  opacity: 0;
}
.nav-burger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 64px) 0 80px;
  overflow: hidden;
}

/* Dot grid background */
.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--color-primary) 0.6px, transparent 0.6px);
  background-size: 32px 32px;
  opacity: 0.04;
  pointer-events: none;
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-radius: 20px;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.25s var(--ease-out);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 168, 107, 0.25);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  box-shadow: 0 4px 16px rgba(0, 168, 107, 0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--color-text-secondary);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-ghost);
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 32px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat-num {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-primary);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.hero-stat-label {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Hero Visual */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-device {
  position: relative;
  width: 100%;
  max-width: 400px;
  filter: drop-shadow(0 20px 40px rgba(0, 102, 204, 0.1));
}

.hero-illustration {
  width: 100%;
  height: auto;
}

/* ============================================
   Sections Common
   ============================================ */
.section-header {
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 12px;
  position: relative;
  padding-left: 20px;
}

.section-tag::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

.section-header h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.section-desc {
  margin-top: 16px;
  font-size: 17px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: 560px;
}

/* ============================================
   Features
   ============================================ */
.features {
  padding: 96px 0;
  background: var(--color-bg-alt);
  position: relative;
}

.features::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.feature-card {
  padding: 36px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.35s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-ghost);
  color: var(--color-primary);
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--color-text);
}

.feature-card p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* ============================================
   How It Works
   ============================================ */
.how-it-works {
  padding: 96px 0;
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.step {
  flex: 1;
  max-width: 300px;
  text-align: center;
  padding: 0 16px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  opacity: 0.5;
  margin-bottom: 16px;
}

.step-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary-ghost);
  color: var(--color-primary);
  border: 2px solid var(--color-primary-light);
}

.step h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.step p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.step-connector {
  display: flex;
  align-items: center;
  padding-top: 60px;
  flex-shrink: 0;
}

/* ============================================
   Download
   ============================================ */
.download {
  padding: 96px 0;
  background: var(--color-bg-dark);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.download::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.download .section-tag {
  color: var(--color-accent);
}

.download .section-tag::before {
  background: var(--color-accent);
}

.download .section-header h2 {
  color: #fff;
}

.download .section-desc {
  color: rgba(255, 255, 255, 0.6);
}

.download-row {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.store-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s, border-color 0.2s;
  min-width: 200px;
}

.store-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.store-btn svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.store-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.store-btn-text small {
  font-size: 11px;
  opacity: 0.6;
  letter-spacing: 0.03em;
}

.store-btn-text strong {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

/* QR Code */
.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qr-box {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.35);
}

.qr-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

.contact-line {
  margin-top: 40px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.5);
}

.contact-line a {
  color: var(--color-accent);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

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

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--color-bg-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-brand .logo-text {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.footer-tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  font-size: 13px;
}

.icp {
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  /* Mobile Nav */
  .nav-burger {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease-out), opacity 0.35s;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav a {
    padding: 12px 0;
    font-size: 16px;
    width: 100%;
    border-bottom: 1px solid var(--color-border-light);
  }

  /* Hero */
  .hero {
    padding: calc(var(--header-h) + 40px) 0 56px;
  }

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

  .hero-visual {
    order: -1;
  }

  .hero-device {
    max-width: 280px;
  }

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

  .hero-actions {
    flex-direction: column;
    margin-bottom: 36px;
  }

  .btn {
    justify-content: center;
    padding: 14px 24px;
  }

  .hero-stats {
    gap: 20px;
  }

  .hero-stat-num {
    font-size: 22px;
  }

  .hero-stat-label {
    font-size: 12px;
  }

  /* Features */
  .features {
    padding: 64px 0;
  }

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

  .feature-card {
    padding: 28px;
  }

  .section-header {
    margin-bottom: 40px;
  }

  /* How It Works */
  .how-it-works {
    padding: 64px 0;
  }

  .steps {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .step {
    max-width: 100%;
    padding: 16px 0;
  }

  .step-connector {
    padding-top: 0;
    transform: rotate(90deg);
  }

  /* Download */
  .download {
    padding: 64px 0;
  }

  .download-row {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }

  .download-buttons {
    width: 100%;
  }

  .store-btn {
    width: 100%;
  }

  .contact-line {
    text-align: center;
  }

  /* Footer */
  .footer-top {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-links {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .hero h1 {
    font-size: 28px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 12px;
  }

  .hero-stat {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
}
