/* =========================================
   全局设计变量与基础重置
   ========================================= */
:root {
  --color-bg: #f7f9f7;
  --color-surface: #ffffff;
  --color-primary-dark: #0a5c36;
  --color-primary-mid: #168a52;
  --color-accent-lime: #b5e373;
  --color-text-main: #1a202c;
  --color-text-muted: #4a5568;
  --color-border: #e2e8e8;
  --color-hover: #0d7a48;
  --shadow-sm: 0 2px 8px rgba(10, 92, 54, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 92, 54, 0.08);
  --radius-base: 12px;
  --radius-lg: 20px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", Consolas, "Liberation Mono", Menlo, monospace;
  --spacing-unit: 8px;
  --max-width: 1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--color-text-main);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
button, input, select, textarea { font: inherit; color: inherit; }

/* =========================================
   排版与流体字号
   ========================================= */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 calc(var(--spacing-unit) * 4);
}
.section {
  padding: calc(var(--spacing-unit) * 10) 0;
  position: relative;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-mid);
  margin-bottom: calc(var(--spacing-unit) * 2);
  display: inline-block;
}
h1, h2, h3 {
  text-wrap: balance;
  color: var(--color-primary-dark);
  line-height: 1.2;
}
h1 { font-size: clamp(2.2rem, 5vw + 0.5rem, 3.5rem); font-weight: 700; margin-bottom: calc(var(--spacing-unit) * 3); }
h2 { font-size: clamp(1.6rem, 3vw + 0.2rem, 2.4rem); font-weight: 600; margin-bottom: calc(var(--spacing-unit) * 2); }
h3 { font-size: clamp(1.2rem, 2vw + 0.1rem, 1.5rem); font-weight: 600; margin-bottom: calc(var(--spacing-unit) * 1.5); }
p { margin-bottom: calc(var(--spacing-unit) * 2); color: var(--color-text-muted); }
.text-mono { font-family: var(--font-mono); font-size: 0.85rem; color: var(--color-text-muted); }

/* =========================================
   页头与导航
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 249, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 32px; width: auto; object-fit: contain; }
.brand-name { font-weight: 700; color: var(--color-primary-dark); letter-spacing: -0.02em; }
.nav { display: flex; gap: calc(var(--spacing-unit) * 4); }
.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-primary-mid); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 2px;
  background: var(--color-accent-lime);
  border-radius: 2px;
}
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; }

/* =========================================
   通用组件：按钮、卡片、表格
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 99px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: none;
  text-decoration: none;
}
.btn:focus-visible { outline: 3px solid var(--color-accent-lime); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-mid));
  color: #fff;
  box-shadow: 0 4px 12px rgba(10, 92, 54, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(10, 92, 54, 0.35); }
.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-primary-mid);
  color: var(--color-primary-mid);
}
.btn-secondary:hover { background: rgba(22, 138, 82, 0.08); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  padding: calc(var(--spacing-unit) * 3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.card-content { display: flex; flex-direction: column; gap: 12px; }
.card-title { font-weight: 600; color: var(--color-primary-dark); }
.card-meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--color-text-muted); }

.table-wrapper { overflow-x: auto; border-radius: var(--radius-base); border: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; background: var(--color-surface); min-width: 600px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: rgba(22, 138, 82, 0.06); font-weight: 600; color: var(--color-primary-dark); white-space: nowrap; }
td { color: var(--color-text-muted); }
tr:last-child td { border-bottom: none; }

/* =========================================
   FAQ 交互样式
   ========================================= */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
details[open] { border-color: var(--color-primary-mid); }
summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary-dark);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-primary-mid);
  transition: transform 0.2s ease;
}
details[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 20px 20px; color: var(--color-text-muted); line-height: 1.6; }
.faq-answer p { margin: 0; }

/* =========================================
   SVG 动效核心逻辑
   ========================================= */
.svg-anim { overflow: visible; }
.flow-path {
  fill: none;
  stroke: var(--color-primary-mid);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowDraw 6s ease-in-out infinite alternate;
}
.flow-dot {
  fill: var(--color-accent-lime);
  opacity: 0;
  animation: dotFlow 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.data-node {
  fill: var(--color-primary-dark);
  opacity: 0.85;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.node-active { animation: nodePulse 3s ease-in-out infinite alternate; }

@keyframes flowDraw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes dotFlow {
  0% { offset-distance: 0%; opacity: 0; transform: translateX(0); }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; transform: translateX(10px); }
}
@keyframes nodePulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 1; }
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  .flow-path, .flow-dot, .data-node, .node-active { animation: none !important; }
}

/* =========================================
   响应式适配
   ========================================= */
@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-menu-btn { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .section { padding: calc(var(--spacing-unit) * 6) 0; }
}
