/* ============================================
   Flat SaaS Landing Page - Stylesheet
   Style: Flat Design (no shadows, no gradients,
          solid colors, clean geometry)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* --- CSS Variables --- */
:root {
  /* Flat Palette - SaaS trust blue + orange CTA */
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --secondary: #3B82F6;
  --accent: #EA580C;
  --accent-hover: #C2410C;
  --success: #059669;
  --danger: #DC2626;

  /* Surfaces */
  --bg: #F8FAFC;
  --bg-white: #FFFFFF;
  --bg-muted: #E9EFF8;
  --bg-section: #EFF6FF;

  /* Text */
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-white: #FFFFFF;

  /* Borders */
  --border: #E2E8F0;
  --border-dark: #CBD5E1;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing (8px scale) */
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;
  --s7: 64px;
  --s8: 96px;

  /* Flat Design: NO shadows, NO gradients */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Transitions */
  --ease: 200ms ease;

  /* Z-index */
  --z-sticky: 20;
  --z-overlay: 40;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg-white);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.no-scroll,
html.no-scroll body {
  overflow: hidden;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* --- Utility --- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s4);
}

.section {
  padding: var(--s8) 0;
}

.section--alt {
  background: var(--bg-section);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: var(--s2);
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
  min-height: 48px;
  line-height: 1;
}

.btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-accent {
  background: var(--accent);
  color: var(--text-white);
}

.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: var(--bg-white);
  color: var(--primary);
  border-color: var(--border-dark);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--bg-section);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-muted);
}

.btn-white {
  background: var(--bg-white);
  color: var(--primary);
}

.btn-white:hover {
  background: var(--bg-muted);
}

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: transparent;
  border-radius: var(--radius-sm);
  display: block;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s4);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--ease);
}

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--s2);
  min-width: 48px;
  min-height: 48px;
}

.mobile-toggle svg {
  width: 24px;
  height: 24px;
}

/* --- Hero --- */
.hero {
  padding: var(--s8) 0 var(--s7);
  background: var(--bg-white);
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s7);
  align-items: center;
}

.hero-content {
  max-width: 540px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-section);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: var(--s4);
  border: 1px solid var(--border);
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: var(--s4);
  color: var(--text-primary);
}

.hero-title .highlight {
  color: var(--primary);
  font-size: 0.7em;
  font-weight: 800;
  white-space: nowrap;
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--s5);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--s4);
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
}

.hero-meta-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-meta-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Hero visual - flat geometric illustration */
.hero-visual {
  position: relative;
}

.hero-illustration {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-section);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

/* Flat geometric shapes inside illustration */
.geo-shape {
  position: absolute;
}

.geo-shape--circle {
  border-radius: 50%;
}

.geo-shape--rect {
  border-radius: var(--radius-sm);
}

.geo-shape--1 {
  width: 120px;
  height: 120px;
  background: var(--primary);
  top: 15%;
  left: 10%;
  opacity: 0.15;
}

.geo-shape--2 {
  width: 80px;
  height: 80px;
  background: var(--accent);
  top: 20%;
  right: 15%;
  opacity: 0.12;
}

.geo-shape--3 {
  width: 60px;
  height: 60px;
  background: var(--success);
  bottom: 20%;
  left: 30%;
  opacity: 0.1;
}

/* Flat mockup inside illustration */
.flat-mockup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75%;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.flat-mockup-bar {
  height: 32px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--s3);
  gap: 6px;
}

.flat-mockup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-dark);
}

.flat-mockup-body {
  padding: var(--s4);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
}

.flat-block {
  height: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
}

.flat-block--short { width: 60%; }
.flat-block--medium { width: 80%; }
.flat-block--accent { background: var(--primary); opacity: 0.2; }

.flat-block-tall {
  height: 60px;
  border-radius: var(--radius-sm);
  background: var(--bg-section);
  border: 1px solid var(--border);
}

/* --- Features --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
  margin-top: var(--s6);
}

.product-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--s6);
  align-items: center;
  margin-top: var(--s6);
  padding: var(--s6);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-section);
}

.product-hero__title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: var(--s3) 0 var(--s2);
}

.product-hero__desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--s4);
  max-width: 560px;
}

.product-hero__actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

.product-hero__media {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
  overflow: hidden;
}

.product-hero__img {
  display: block;
  width: 100%;
  height: auto;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
  margin-top: var(--s6);
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: var(--s5);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  background: var(--bg-white);
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
  min-height: 220px;
}

.product-card:hover {
  border-color: var(--primary);
  background: var(--bg-section);
}

.product-card:active {
  transform: scale(0.99);
}

.product-card__badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--text-white);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  width: fit-content;
}

.product-card__badge--accent { background: var(--accent); }
.product-card__badge--success { background: var(--success); }

.product-card__title {
  margin-top: var(--s3);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.product-card__desc {
  margin-top: var(--s2);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.product-card__tag {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-white);
}

.product-card__cta {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.875rem;
}

.products-showcase {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s4);
  margin-top: var(--s6);
}

.product-showcase-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-white);
}

.product-showcase-media {
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}

.product-showcase-img {
  display: block;
  width: 100%;
  height: auto;
}

.product-showcase-body {
  padding: var(--s4);
}

.product-showcase-title {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.product-showcase-desc {
  margin-top: var(--s2);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.products-cta {
  margin-top: var(--s5);
  display: flex;
  justify-content: center;
}

.feature-card {
  padding: var(--s5);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--ease), background var(--ease);
  background: var(--bg-white);
}

.feature-card:hover {
  border-color: var(--primary);
  background: var(--bg-section);
}

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

.feature-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.feature-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--s2);
  color: var(--text-primary);
}

.feature-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- Stats Bar --- */
.stats-bar {
  background: var(--primary);
  padding: var(--s6) 0;
}

.stats-bar .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s4);
  text-align: center;
}

.stat-value {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--text-white);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: var(--s1);
  font-weight: 500;
}

/* --- Pricing --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
  margin-top: var(--s6);
}

.pricing-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s5);
  background: var(--bg-white);
  display: flex;
  flex-direction: column;
}

.pricing-card--featured {
  border-color: var(--primary);
  position: relative;
}

.pricing-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--text-white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.pricing-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--s1);
}

.pricing-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--s4);
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: var(--s1);
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-period {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--s4);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}

.pricing-features {
  list-style: none;
  margin-bottom: var(--s4);
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.pricing-features li svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pricing-features li svg.check {
  color: var(--success);
}

.pricing-features li svg.x {
  color: var(--text-muted);
}

.pricing-card .btn {
  width: 100%;
  margin-top: auto;
}

/* --- Testimonials --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
  margin-top: var(--s6);
}

.testimonial-card {
  padding: var(--s5);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
}

.testimonial-stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--s3);
}

.testimonial-stars svg {
  width: 16px;
  height: 16px;
  fill: #F59E0B;
}

.testimonial-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--s4);
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-white);
}

.testimonial-avatar--blue { background: var(--primary); }
.testimonial-avatar--orange { background: var(--accent); }
.testimonial-avatar--green { background: var(--success); }

.testimonial-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.testimonial-role {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --- CTA --- */
.cta {
  background: var(--text-primary);
  padding: var(--s8) 0;
}

.cta .container {
  text-align: center;
}

.cta-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--text-white);
  letter-spacing: -0.03em;
  margin-bottom: var(--s3);
}

.cta-desc {
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.125rem;
  margin-bottom: var(--s5);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

/* --- Footer --- */
.footer {
  padding: var(--s5) 0;
  border-top: 1px solid var(--border);
  background: var(--bg-white);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3);
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: var(--s4);
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--ease);
}

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

/* --- WeChat QR Modal --- */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: none;
}

.qr-modal.is-open {
  display: block;
}

.qr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
}

.qr-modal__panel {
  position: relative;
  width: min(92vw, 420px);
  margin: 10vh auto 0;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.qr-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-section);
}

.qr-modal__title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.qr-modal__close {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--text-primary);
}

.qr-modal__close:hover {
  border-color: var(--primary);
}

.qr-modal__img {
  display: block;
  width: 100%;
  height: auto;
}

.qr-modal__hint {
  padding: var(--s3) var(--s4) var(--s4);
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* --- Scroll Animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive: Tablet --- */
@media (max-width: 1024px) {
  .features-grid,
  .pricing-grid,
  .testimonials-grid,
  .products-grid,
  .products-showcase {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-bar .container {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s5);
  }

  .product-hero {
    grid-template-columns: 1fr;
    gap: var(--s5);
  }
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
  .section { padding: var(--s6) 0; }

  .hero .container {
    grid-template-columns: 1fr;
    gap: var(--s5);
  }

  .hero-visual { order: -1; }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions .btn { width: 100%; max-width: 320px; }

  .nav-links { display: none; }
  .mobile-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 2px solid var(--border);
    padding: var(--s4);
    gap: var(--s3);
  }

  .features-grid,
  .pricing-grid,
  .testimonials-grid,
  .products-grid,
  .products-showcase {
    grid-template-columns: 1fr;
  }

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

  .product-hero {
    padding: var(--s5);
  }

  .product-hero__actions .btn { width: 100%; max-width: 320px; }

  .products-cta .btn { width: 100%; max-width: 320px; }

  .cta-actions {
    flex-direction: column;
  }

  .cta-actions .btn { width: 100%; max-width: 320px; }

  .footer .container {
    flex-direction: column;
    text-align: center;
  }
}

/* --- Responsive: Small Mobile --- */
@media (max-width: 375px) {
  .container { padding: 0 var(--s3); }
  .hero-title { font-size: 2rem; }
  .section-title { font-size: 1.5rem; }
}
