/* ========================================
   花絮 (Huaxu) — Global Styles
   Lightweight dark theme
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #050505;
  --bg-secondary: #0c0c0c;
  --bg-card: #111111;
  --bg-card-hover: #181818;
  --border: #1a1a1a;
  --border-light: #2a2a2a;
  --text-primary: #f0f0f0;
  --text-secondary: #777777;
  --text-tertiary: #555555;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --gradient: linear-gradient(135deg, #6366f1, #a78bfa);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --max-width: 1200px;
}

/* Light theme - Refined & Sophisticated */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fa;
  --border: #e9ecef;
  --border-light: #dee2e6;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-tertiary: #adb5bd;
  --accent: #4f46e5;
  --accent-light: #6366f1;
  --gradient: linear-gradient(135deg, #4f46e5, #7c3aed);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 48px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo .dot {
  width: 8px;
  height: 8px;
  background: var(--gradient);
  border-radius: 50%;
  display: inline-block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-controls button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-controls button:hover {
  color: var(--text-primary);
  background: rgba(128, 128, 128, 0.1);
}

[data-theme="light"] .nav-controls button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-controls button svg {
  width: 18px;
  height: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: var(--gradient);
  border-radius: 1px;
}

/* --- Mobile Menu --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.15s ease;
}

/* --- Section Layout --- */
.section {
  padding: 120px 48px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-light);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 48px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
  pointer-events: none;
}

[data-theme="light"] .hero::before {
  background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

[data-theme="light"] .hero-badge {
  background: var(--bg-secondary);
  border-color: var(--border);
}

.hero-badge .pulse {
  width: 6px;
  height: 6px;
  background: #34d399;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 24px;
  max-width: 800px;
}

.hero h1 .gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 48px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-primary {
  padding: 14px 32px;
  background: var(--gradient);
  color: white;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  opacity: 0.92;
}

[data-theme="light"] .btn-primary {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .btn-primary:hover {
  box-shadow: var(--shadow-md);
  opacity: 1;
}

.btn-secondary {
  padding: 14px 32px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--text-tertiary);
}

[data-theme="light"] .btn-secondary {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .btn-secondary:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Scroll Indicator --- */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: scrollBounce 2s ease-in-out infinite;
  opacity: 0.7;
}

.scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.scroll-label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.scroll-mouse {
  width: 36px;
  height: 56px;
  border: 2px solid var(--text-secondary);
  border-radius: 18px;
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.scroll-dot {
  width: 5px;
  height: 11px;
  background: var(--text-primary);
  border-radius: 2.5px;
  animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

@keyframes scrollDot {
  0% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.3; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* --- Product Grid --- */
.products-showcase {
  padding: 80px 48px 120px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  border-color: var(--border-light);
}

[data-theme="light"] .product-card {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .product-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.product-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

[data-theme="light"] .product-icon {
  background: var(--bg-secondary);
  border-color: var(--border);
}

.product-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.product-tagline {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.product-tag {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  color: var(--text-tertiary);
}

.product-tag.status-live {
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
}

.product-tag.status-beta {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

/* --- Stats Bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: var(--max-width);
  margin: 0 auto 80px;
}

[data-theme="light"] .stats-bar {
  box-shadow: var(--shadow-md);
}

.stat-item {
  background: var(--bg-card);
  padding: 40px 32px;
  text-align: center;
}

[data-theme="light"] .stat-item {
  background: var(--bg-card);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- Products Page --- */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.filter-btn.active {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

[data-theme="light"] .filter-btn {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .filter-btn:hover {
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .filter-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="light"] .modal-overlay {
  background: rgba(0, 0, 0, 0.4);
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  padding: 48px;
  position: relative;
}

[data-theme="light"] .modal {
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.125rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

[data-theme="light"] .modal-close {
  background: var(--bg-secondary);
}

.modal-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

[data-theme="light"] .modal-icon {
  background: var(--bg-secondary);
}

.modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.modal-tagline {
  font-size: 1rem;
  color: var(--accent-light);
  margin-bottom: 20px;
}

.modal-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 28px;
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.modal-info-row:last-child {
  border-bottom: none;
}

.modal-info-label {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.modal-info-value {
  font-size: 0.875rem;
  font-weight: 500;
}

/* --- Contact Page --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 48px;
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea,
[data-theme="light"] .form-group select {
  background: var(--bg-secondary);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group textarea:focus,
[data-theme="light"] .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.contact-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-card:hover {
  border-color: var(--border-light);
}

[data-theme="light"] .contact-card {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .contact-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.contact-card-icon {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.contact-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Footer --- */
.footer {
  padding: 48px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-left .dot {
  width: 6px;
  height: 6px;
  background: var(--gradient);
  border-radius: 50%;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-primary);
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  border-left: 3px solid #34d399;
}

[data-theme="light"] .toast {
  box-shadow: var(--shadow-lg);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav {
    padding: 0 24px;
  }

  .nav-right {
    gap: 12px;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: #0a0a0a;
    flex-direction: column;
    padding: 24px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.15s ease, opacity 0.15s ease;
  }

  [data-theme="light"] .nav-links {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    width: 100%;
    padding: 12px 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .section {
    padding: 80px 24px;
  }

  .hero {
    padding: 100px 24px 60px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero p {
    font-size: 1.0625rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
    text-align: center;
  }

  .products-showcase {
    padding: 40px 24px 80px;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    margin: 0 24px 60px;
  }

  .scroll-indicator {
    bottom: 24px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .modal {
    padding: 32px 24px;
  }

  .footer {
    flex-direction: column;
    gap: 20px;
    padding: 32px 24px;
    text-align: center;
  }
}
