/* =========================================
   1. Design Tokens & Variables
   ========================================= */
:root {
  /* Color Palette */
  --color-dark-surface: #121531;
  --color-paper: #E8E9EA;
  --color-text-body: #151723;
  --color-brand: #142CEB;
  --color-accent: #ED7D6E;

  /* Semantic Colors - Paper Surface (Default) */
  --text-primary: var(--color-text-body);
  --text-secondary: #4a4d5c;
  --link-color: var(--color-brand);
  --highlight-color: var(--color-brand);
  
  /* Semantic Colors - Dark Surface */
  .dark-surface {
    --text-primary: var(--color-paper);
    --text-secondary: #b0b3c3;
    --link-color: var(--color-accent);
    --highlight-color: var(--color-accent);
  }

  /* Structural Tokens */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  
  --font-stack: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

/* =========================================
   2. Reset & Base Typography
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--color-paper);
  overflow-x: hidden;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

/* =========================================
   3. Layout & Containers
   ========================================= */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.dark-surface {
  background-color: var(--color-dark-surface);
  color: var(--text-primary);
}

/* =========================================
   4. Typography System
   ========================================= */
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.25rem;
  max-width: 38em;
}

/* Badge / Label */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--link-color);
}

.dark-surface .badge {
  color: var(--highlight-color);
}

/* Highlight Keyword */
.hl {
  color: var(--highlight-color);
}

/* =========================================
   5. Components: Buttons
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-surface);
  border: none;
}

.btn-primary:hover {
  opacity: 1;
  background-color: #e06b5c;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid currentColor;
}

.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(0,0,0,0.05);
}

.dark-surface .btn-secondary:hover {
  background-color: rgba(255,255,255,0.1);
}

/* =========================================
   6. Components: Cards & Panels
   ========================================= */
.card {
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-card);
  padding: 24px;
  /* No shadow, no border as per design tokens */
  box-shadow: var(--card-shadow);
  border: var(--card-border);
}

.dark-surface .card {
  background-color: rgba(255, 255, 255, 0.05);
}

.panel {
  background-color: var(--color-dark-surface);
  border-radius: var(--radius-card);
  padding: 32px;
  color: var(--color-paper);
  position: relative;
  overflow: hidden;
}

/* =========================================
   7. Components: Tables & Lists
   ========================================= */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-card);
  background-color: rgba(255, 255, 255, 0.6);
}

.dark-surface .table-wrapper {
  background-color: rgba(255, 255, 255, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.dark-surface th, 
.dark-surface td {
  border-bottom-color: rgba(255,255,255,0.05);
}

th {
  font-weight: 600;
  color: var(--text-primary);
}

.dark-surface th {
  color: var(--color-paper);
}

tr:last-child td {
  border-bottom: none;
}

dl.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

dt {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

dd {
  color: var(--text-secondary);
  line-height: 1.6;
}

.dark-surface dt {
  color: var(--color-paper);
}

/* =========================================
   8. Components: FAQ (Details/Summary)
   ========================================= */
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: 16px 0;
}

.dark-surface .faq-item {
  border-bottom-color: rgba(255,255,255,0.1);
}

summary {
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
}

.dark-surface summary {
  color: var(--color-paper);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--link-color);
}

details[open] summary::after {
  content: "-";
}

details p {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.dark-surface details p {
  color: var(--text-secondary);
}

/* =========================================
   9. SVG Animation Keyframes
   ========================================= */
/* Draw Effect */
@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  50%, 100% { stroke-dashoffset: 0; }
}

/* Breathing Effect */
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Float Effect */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Fade In Up */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Apply Classes */
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 3s ease-out forwards;
}

.anim-breathe {
  transform-box: fill-box;
  transform-origin: center;
  animation: breathe 6s ease-in-out infinite;
}

.anim-float {
  animation: float 5s ease-in-out infinite;
}

.anim-fade-in {
  animation: fade-in-up 1s ease-out forwards;
}

/* Staggered Delays for SVG elements */
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.5s; }
.delay-3 { animation-delay: 0.8s; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .anim-draw { stroke-dashoffset: 0; }
}

/* =========================================
   10. Responsive Adjustments
   ========================================= */
@media (max-width: 768px) {
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.8rem; }
  
  .hero-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-visual {
    order: -1; /* Image on top for mobile if desired, or keep below text */
    margin-bottom: 2rem;
  }
  
  .people-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
