/* ==================== 全局变量与设计基础 ==================== */
:root {
  /* 品牌色 - 深绿到青柠渐变基调 */
  --color-primary: #059669;
  --color-primary-light: #34d399;
  --color-primary-dark: #047857;
  --color-accent: #a7f3d0;

  /* 中性色 */
  --color-bg: #ffffff;
  --color-bg-secondary: #f0fdf4;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-heading: #111827;

  /* 排版 */
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* 间距与尺寸 */
  --spacing-unit: 1rem;
  --container-width: 1200px;
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.75rem;
  --border-radius-lg: 1rem;
  
  /* 阴影 */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* ==================== 重置与基础排版 ==================== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; margin: 0; list-style: none; }

h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  font-weight: 700;
  text-wrap: balance;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1rem; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 65ch; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==================== 通用组件 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 1rem;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background-color: var(--color-bg-secondary);
}

.icon-link svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 0.5rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 卡片 */
.card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 600px;
}
th, td {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}
th {
  background-color: var(--color-bg-secondary);
  font-weight: 600;
  color: var(--color-heading);
}
tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background-color: #fafafa; }

/* FAQ 手风琴 */
details {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
summary {
  padding: 1rem;
  background: var(--color-bg);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-primary);
}
details[open] summary::after { content: "-"; }
details[open] summary {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}
details .faq-content {
  padding: 1rem;
  color: var(--color-text-muted);
  background: white;
}

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-logo img {
  height: 40px;
  width: auto;
}
nav ul {
  display: flex;
  gap: 1.5rem;
}
nav a {
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.2s;
}
nav a:hover, nav a[aria-current="page"] {
  color: var(--color-primary);
}

.site-footer {
  background: var(--color-bg-secondary);
  padding: 3rem 0;
  margin-top: 4rem;
  border-top: 1px solid var(--color-border);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-heading);
}
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--color-text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--color-primary); }
.copyright {
  text-align: center;
  margin-top: 2rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
}

/* SVG 动效基础 */
svg.anim-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  pathLength: 1;
}
@keyframes flowDash {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes flowFlow {
  0% { transform: translateX(0); opacity: 0.3; }
  50% { opacity: 1; }
  100% { transform: translateX(var(--tx, 20px)); opacity: 0.3; }
}
.flow-animate {
  animation: flowDash 2s linear infinite;
}
.dot-animate {
  animation: flowFlow 3s ease-in-out infinite alternate;
}

/* 响应式与无障碍 */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 1rem; }
  nav ul { gap: 1rem; font-size: 0.9rem; }
  h1 { text-align: center; }
  p { text-align: center; margin-left: auto; margin-right: auto; }
}

@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;
  }
}
