/* ==========================================================================
   繁花俱乐部 Design System
   Single-file CSS: tokens → reset → base → layout → components → pages → responsive
   ========================================================================== */

/* ==========================================================================
   Section 1: Design Tokens
   ========================================================================== */

:root {
  /* Primary */
  --color-primary: #1E6B4E;
  --color-primary-dark: #145A3E;
  --color-primary-light: #E8F5EE;

  /* Accent */
  --color-accent: #E8B84B;
  --color-accent-dark: #D4A63A;
  --color-accent-light: #FFF3D6;

  /* Neutral */
  --color-bg-page: #FEFCF7;
  --color-bg-card: #FFFFFF;
  --color-bg-alt: #FFF9EF;
  --color-text-primary: #2C2C2C;
  --color-text-secondary: #7A7A7A;
  --color-text-muted: #AAAAAA;
  --color-border: #E8E4DC;
  --color-divider: #F0EDE6;

  /* Functional */
  --color-urgent: #E67E4A;
  --color-success: #2E9B6A;
  --color-error: #D4534B;

  /* Shadows */
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-plus: 0 4px 24px rgba(232, 184, 75, 0.15);
  --shadow-fab: 0 4px 16px rgba(0, 0, 0, 0.15);
  --overlay-modal: rgba(0, 0, 0, 0.5);

  /* Typography */
  --font-sans: "Alibaba PuHuiTi 2.0", "PingFang SC", "Microsoft YaHei", sans-serif;

  /* Spacing (8px base grid, 4px exception) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 80px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Layout */
  --width-content: 1200px;
  --width-narrow: 800px;
  --padding-page: 20px;
}


/* ==========================================================================
   Section 2: CSS Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text-primary);
  background-color: var(--color-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}


/* ==========================================================================
   Section 2b: Base Typography (Mobile-First)
   ========================================================================== */

.display {
  font-size: 1.75rem;   /* 28px */
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1, .h1 {
  font-size: 1.5rem;    /* 24px */
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h2, .h2 {
  font-size: 1.25rem;   /* 20px */
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

h3, .h3 {
  font-size: 1.125rem;  /* 18px */
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}

p, .body-text {
  font-size: 1rem;      /* 16px */
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0;
}

.text-sm {
  font-size: 0.875rem;  /* 14px */
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
}

.caption {
  font-size: 0.75rem;   /* 12px */
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.data-number {
  font-size: 2.25rem;   /* 36px */
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
}


/* ==========================================================================
   Section 3: Layout Utilities
   ========================================================================== */

.container {
  max-width: var(--width-content);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--padding-page);
  padding-right: var(--padding-page);
}

.container-narrow {
  max-width: var(--width-narrow);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--padding-page);
  padding-right: var(--padding-page);
}

.section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

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

.section-dark {
  background: linear-gradient(150deg, #1E6B4E, #145A3E, #0E4830);
  color: #FFFFFF;
}


/* ==========================================================================
   Section 4: Component Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   4.1 Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 200ms ease-out;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
}

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

.btn-accent {
  background-color: var(--color-accent);
  color: #1A1A1A;
}

.btn-accent:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-primary-light);
}


/* --------------------------------------------------------------------------
   4.2 Cards
   -------------------------------------------------------------------------- */

.card {
  background-color: var(--color-bg-card);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.card-plus {
  background: linear-gradient(135deg, #FFF9EF, #FFF3D6);
  border: 2px solid var(--color-accent);
  box-shadow: var(--shadow-plus);
}


/* --------------------------------------------------------------------------
   4.3 FAQ Accordion
   -------------------------------------------------------------------------- */

.faq-item {
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 8px;
}

.faq-question {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
  gap: 12px;
}

.faq-icon {
  color: var(--color-text-secondary);
  transition: transform 200ms ease-out;
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 250ms ease-in-out;
  color: var(--color-text-secondary);
  line-height: 1.75;
}

.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
}

.faq-item.is-open .faq-answer {
  max-height: 500px;
  padding-top: 12px;
}


/* --------------------------------------------------------------------------
   4.4 FAB (Floating Action Button)
   -------------------------------------------------------------------------- */

.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #FFFFFF;
  z-index: 1000;
  box-shadow: var(--shadow-fab);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  transition: background-color 200ms ease-out;
}

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

.fab-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: 280px;
  background-color: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-hover);
  padding: 24px;
  z-index: 1001;
  text-align: center;
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition: all 200ms ease-out;
}

.fab-panel.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.fab-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--overlay-modal);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out;
}

.fab-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}


/* --------------------------------------------------------------------------
   4.5 Early Bird Tag
   -------------------------------------------------------------------------- */

.early-tag {
  display: inline-block;
  background-color: var(--color-urgent);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}


/* --------------------------------------------------------------------------
   4.6 Data Bar (trust data)
   -------------------------------------------------------------------------- */

.data-bar {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.data-item {
  text-align: center;
}

.data-label {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
  font-weight: 500;
}


/* --------------------------------------------------------------------------
   4.7 Compare Table
   -------------------------------------------------------------------------- */

.compare-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--padding-page));
  padding: 0 var(--padding-page);
}

.compare-table table {
  width: 100%;
  min-width: 500px;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.compare-table th,
.compare-table td {
  padding: 14px 16px;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid var(--color-divider);
}

.compare-table th {
  font-weight: 700;
  font-size: 15px;
}

/* First column: feature names — left-aligned */
.compare-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--color-text-primary);
}

.compare-table th:first-child {
  text-align: left;
}

/* Header: first column */
.compare-table thead th:first-child {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

/* Header: BASIC column */
.compare-table thead th:nth-child(2) {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* Header: PLUS column */
.compare-table thead th:nth-child(3) {
  background-color: var(--color-accent);
  color: #1A1A1A;
}

/* Alternating row colors */
.compare-table tbody tr:nth-child(even) {
  background-color: var(--color-bg-alt);
}

.compare-table tbody tr:nth-child(odd) {
  background-color: var(--color-bg-card);
}

/* Check mark */
.compare-check {
  color: var(--color-success);
  font-weight: 700;
}

/* Dash / not available */
.compare-dash {
  color: var(--color-text-muted);
}

/* Price row */
.compare-table .price-row td {
  font-weight: 700;
  font-size: 18px;
  border-bottom: none;
}

.compare-table .price-row td:nth-child(3) {
  color: var(--color-accent-dark);
}


/* --------------------------------------------------------------------------
   4.8 Wave Divider
   -------------------------------------------------------------------------- */

.wave-divider {
  width: 100%;
  display: block;
  line-height: 0;
  overflow: hidden;
}

.wave-divider svg {
  width: 100%;
  height: 48px;
  display: block;
}


/* --------------------------------------------------------------------------
   4.9 Photo Filter
   -------------------------------------------------------------------------- */

.photo-filter {
  filter: saturate(0.95) brightness(1.05) sepia(0.08);
}


/* --------------------------------------------------------------------------
   4.10 Scroll Animation (CSS part)
   -------------------------------------------------------------------------- */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ==========================================================================
   Section 5: Page-Specific Styles
   ========================================================================== */

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

.hero {
  background: linear-gradient(150deg, #1E6B4E, #145A3E, #0E4830);
  color: #FFFFFF;
  min-height: var(--vh, 100vh);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl) var(--padding-page);
  position: relative;
  overflow: hidden;
}

.hero .display {
  color: #FFFFFF;
}

.hero .data-number {
  color: var(--color-accent);
}

.hero .subtitle {
  color: rgba(255, 255, 255, 0.8);
}

.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s ease-in-out infinite;
  color: rgba(255, 255, 255, 0.6);
}


/* --------------------------------------------------------------------------
   5.3 Detail Page Variants
   -------------------------------------------------------------------------- */

.page-basic {
  border-top: 4px solid var(--color-primary);
}

.page-plus {
  border-top: 4px solid var(--color-accent);
}

.page-plus .card {
  background: linear-gradient(135deg, #FFF9EF, #FFF3D6);
  border: 2px solid var(--color-accent);
  box-shadow: var(--shadow-plus);
}


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

.footer {
  background-color: #0E4830;
  color: rgba(255, 255, 255, 0.7);
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  text-align: center;
}

.footer a {
  color: rgba(255, 255, 255, 0.85);
  transition: color 200ms ease-out;
}

.footer a:hover {
  color: #FFFFFF;
}


/* --------------------------------------------------------------------------
   5.5 Price Tier Stepper (PLUS price visualization)
   -------------------------------------------------------------------------- */

.price-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.price-step {
  text-align: center;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background-color: var(--color-bg-alt);
  border: 2px solid transparent;
  transition: all 200ms ease-out;
  flex: 1;
  min-width: 120px;
}

.price-step.is-current {
  background-color: var(--color-accent-light);
  border-color: var(--color-accent);
}

.price-step.is-current .data-number {
  color: var(--color-accent-dark);
}

.price-step-connector {
  color: var(--color-text-muted);
  font-size: 20px;
  flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   QR code text swap helpers
   -------------------------------------------------------------------------- */

.qr-text-mobile {
  display: block;
}

.qr-text-desktop {
  display: none;
}


/* ==========================================================================
   Section 6: Responsive Rules
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tablet (768px+)
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  .section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }

  .data-bar {
    flex-wrap: nowrap;
  }

  /* Buttons side by side */
  .hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
  }

  /* Team cards: 2-column grid */
  .team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}


/* --------------------------------------------------------------------------
   Desktop (1024px+)
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {
  :root {
    --padding-page: 40px;
  }

  /* Typography scale-up */
  .display {
    font-size: 2.5rem;    /* 40px */
  }

  h1, .h1 {
    font-size: 2rem;      /* 32px */
  }

  h2, .h2 {
    font-size: 1.5rem;    /* 24px */
  }

  h3, .h3 {
    font-size: 1.25rem;   /* 20px */
  }

  .data-number {
    font-size: 3rem;      /* 48px */
  }

  /* Compare table: full width, no scroll needed */
  .compare-table {
    margin: 0;
    padding: 0;
    overflow-x: visible;
  }

  /* Team cards: wider grid */
  .team-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Pricing cards side by side */
  .pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
    align-items: start;
  }

  /* QR text swap */
  .qr-text-mobile {
    display: none;
  }

  .qr-text-desktop {
    display: block;
  }
}


/* ==========================================================================
   Section 7: Animations & Reduced Motion
   ========================================================================== */

@keyframes bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

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