/* 设计变量与基础设定 */
:root {
  --color-bg: #f8f9fb;
  --color-surface: #ffffff;
  --color-text: #111111;
  --color-text-secondary: #525252;
  --color-accent: #1a7f6d;
  --color-accent-hover: #14695b;
  --color-border: #e5e7eb;
  --color-sweep: rgba(255, 255, 255, 0.65);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.08);
  --max-content: 1120px;
  --header-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 排版系统 */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; text-wrap: balance; margin: 0 0 var(--space-sm); }
h1 { font-size: clamp(2.25rem, 4vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { margin: 0 0 var(--space-sm); color: var(--color-text-secondary); }
strong { font-weight: 600; color: var(--color-text); }

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}
section { padding: var(--space-xl) 0; }
.section-header { margin-bottom: var(--space-lg); text-align: center; }
.section-header p { max-width: 680px; margin: var(--space-sm) auto 0; }

/* 页头与导航 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex; align-items: center;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: var(--space-xs); text-decoration: none; color: var(--color-text); }
.brand img { height: 36px; width: auto; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 1.1rem; }
.main-nav ul { display: flex; gap: var(--space-md); list-style: none; margin: 0; padding: 0; }
.main-nav a {
  text-decoration: none; color: var(--color-text-secondary);
  font-weight: 500; font-size: 0.95rem; padding: 0.5rem 0;
  border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--color-text); border-color: var(--color-accent); }

/* 按钮组件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  text-decoration: none; border: none; transition: all 0.2s ease;
}
.btn-primary {
  background: var(--color-accent); color: #fff;
  box-shadow: 0 2px 8px rgba(26, 127, 109, 0.25);
}
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26, 127, 109, 0.3); }
.btn-secondary {
  background: transparent; color: var(--color-text); border: 1px solid var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-text); background: rgba(0,0,0,0.02); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* 卡片与网格 */
.grid-2 { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-md);
  box-shadow: var(--shadow-soft); transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elevated); }
.card-meta { font-size: 0.85rem; color: #888; margin-bottom: var(--space-xs); display: flex; align-items: center; gap: 0.5rem; }
.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--color-text); }
.card-body { font-size: 0.95rem; color: var(--color-text-secondary); margin-bottom: var(--space-sm); }

/* 表格 */
.table-wrapper { overflow-x: auto; margin: var(--space-md) 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: #fafafa; font-weight: 600; color: var(--color-text); }
td { color: var(--color-text-secondary); }
tr:last-child td { border-bottom: none; }

/* 折叠面板 (FAQ) */
.faq-list { display: flex; flex-direction: column; gap: var(--space-sm); max-width: 800px; margin: 0 auto; }
details {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md);
  transition: box-shadow 0.2s;
}
details[open] { box-shadow: var(--shadow-soft); }
summary {
  cursor: pointer; font-weight: 600; list-style: none; position: relative;
  padding-right: 1.5rem; user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; position: absolute; right: 0; top: 50%;
  width: 8px; height: 8px; border-right: 1.5px solid var(--color-text); border-bottom: 1.5px solid var(--color-text);
  transform: translateY(-60%) rotate(45deg); transition: transform 0.2s;
}
details[open] summary::after { transform: translateY(-60%) rotate(-135deg); }
.details-content { padding-top: var(--space-sm); color: var(--color-text-secondary); font-size: 0.95rem; line-height: 1.7; }

/* 链接列表 */
.related-list { list-style: none; padding: 0; margin: 0; }
.related-list li { margin-bottom: 0.75rem; }
.related-list a {
  display: flex; align-items: baseline; gap: 0.5rem;
  color: var(--color-text); text-decoration: none; font-weight: 500;
  border-bottom: 1px dashed var(--color-border); padding-bottom: 0.25rem; transition: color 0.2s, border-color 0.2s;
}
.related-list a:hover { color: var(--color-accent); border-color: var(--color-accent); }
.related-desc { font-size: 0.9rem; color: var(--color-text-secondary); }

/* SVG 动画基础 */
.svg-container { width: 100%; max-width: 600px; margin: 0 auto; aspect-ratio: 16/10; }
svg { width: 100%; height: 100%; display: block; overflow: visible; }
.wireframe { fill: none; stroke: var(--color-text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sweep-light { mix-blend-mode: screen; pointer-events: none; }
.draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes draw-line {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes sweep-across {
  0%, 100% { transform: translateX(-120%); }
  50% { transform: translateX(120%); }
}
.animate-draw { animation: draw-line 6s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate; }
.animate-sweep { animation: sweep-across 8s cubic-bezier(0.4, 0, 0.2, 1) infinite; }

@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;
  }
  .animate-draw, .animate-sweep { animation: none !important; }
}

/* 响应式适配 */
@media (max-width: 768px) {
  section { padding: var(--space-lg) 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .main-nav ul { display: none; }
  .mobile-toggle { display: block; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--color-text); }
}
@media (min-width: 769px) { .mobile-toggle { display: none; } }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
