/* ==================== 设计变量与基础重置 ==================== */
:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-secondary: #334155;
  --color-text-muted: #64748b;
  --color-primary-start: #047857;
  --color-primary-end: #a3e635;
  --color-accent: #10b981;
  --color-border: #e2e8f0;
  --color-focus: #0d9488;
  --font-serif: "Noto Serif SC", "Source Han Serif CN", "SimSun", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.06);
  --container-max: 1180px;
  --space-section: clamp(3rem, 6vw, 6.5rem);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--transition-base); }
button, [role="button"], a[role="button"] { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul, ol { padding-left: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }

:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: 2px; }

/* ==================== 排版系统 ==================== */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-top: 0;
  margin-bottom: 0.6em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; }
strong { font-weight: 600; }
small { font-size: 0.875em; color: var(--color-text-muted); }

/* ==================== 布局容器 ==================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.section { padding-block: var(--space-section); }
.section-header {
  max-width: 780px;
  margin-bottom: 2.5rem;
}
.section-header p {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-top: 0.75rem;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 2rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1.75rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1.5rem; }

/* ==================== 组件：按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-start), var(--color-primary-end));
  color: #fff;
  box-shadow: 0 4px 12px rgba(10, 120, 85, 0.25);
}
.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(10, 120, 85, 0.35);
}
.btn-secondary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; border-radius: var(--radius-sm); }

/* ==================== 组件：卡片 ==================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.card-body { padding: 0; }
.card-meta { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }

/* ==================== 组件：表格 ==================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
table { width: 100%; font-size: 0.95rem; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: #f8fafc; font-weight: 600; color: var(--color-text-secondary); white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* ==================== 组件：FAQ (details/summary) ==================== */
.faq details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  background: var(--color-surface);
  transition: border-color var(--transition-base);
}
.faq details[open] { border-color: #cbd5e1; }
.faq summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  transition: transform var(--transition-base);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-answer {
  padding: 0 1.25rem 1rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ==================== 页头与导航 ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand img { height: 32px; width: auto; }
.brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.1rem; color: var(--color-text); }
.main-nav ul { display: flex; gap: 1.5rem; }
.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--color-primary-start); }
.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary-start), var(--color-primary-end));
  border-radius: 1px;
}

/* ==================== 页脚 ==================== */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3.5rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-col h4 { color: #f8fafc; margin-bottom: 1rem; font-size: 1rem; }
.footer-col ul li { margin-bottom: 0.6rem; }
.footer-col a:hover { color: #e2e8f0; }
.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

/* ==================== SVG 动效系统 ==================== */
.svg-anim-group { overflow: visible; }
.contour-path {
  fill: none;
  stroke-width: 2;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.contour-flow-1 { animation: contourDraw 8s linear infinite alternate; stroke: #047857; opacity: 0.8; }
.contour-flow-2 { animation: contourDraw 10s linear infinite alternate; stroke: #10b981; opacity: 0.6; }
.contour-flow-3 { animation: contourDraw 12s linear infinite alternate; stroke: #a3e635; opacity: 0.5; }
.contour-pulse { animation: contourPulse 6s ease-in-out infinite alternate; stroke: #047857; opacity: 0.7; }

@keyframes contourDraw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes contourPulse {
  0% { stroke-width: 1.5; opacity: 0.5; }
  100% { stroke-width: 3; opacity: 0.9; }
}

@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;
  }
  .contour-path { stroke-dashoffset: 0; animation: none; }
}

/* ==================== 响应式微调 ==================== */
@media (max-width: 768px) {
  .header-inner { height: 60px; }
  .main-nav { display: none; } /* 简化：移动端隐藏主导航，实际项目可加汉堡菜单，此处保持结构完整 */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
