/* ================= 设计变量 ================= */
:root {
  --color-bg: #FAFAF7;
  --color-fg: #111111;
  --color-text-secondary: #4A4A4A;
  --color-border: #E5E5E0;
  --color-card: #FFFFFF;
  --color-accent: #2A8B5E;
  --color-accent-light: #E8F5EF;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --container-max: 1120px;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= 基础重置与排版 ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--transition-base); }
ul, ol { list-style: none; }

/* 流体排版 */
h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin-bottom: var(--space-sm); text-wrap: balance; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 600; margin-bottom: var(--space-xs); text-wrap: balance; }
p { color: var(--color-text-secondary); margin-bottom: var(--space-sm); }
.container { max-width: var(--container-max); margin-inline: auto; padding-inline: var(--space-md); }
.section { padding-block: var(--space-lg); position: relative; }
.section-header { max-width: 720px; margin-bottom: var(--space-md); }

/* ================= 通用组件 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-weight: 600; cursor: pointer;
  transition: all var(--transition-base); border: none; font-size: 1rem;
}
.btn-primary { background: var(--color-fg); color: var(--color-bg); }
.btn-primary:hover { background: #333; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-fg); }
.btn-outline:hover { border-color: var(--color-fg); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.card {
  background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-md); transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }

/* 表格样式 */
.table-wrapper { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-card); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: #F4F4F0; font-weight: 600; color: var(--color-fg); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAF8; }

/* FAQ / Details */
details { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-card); margin-bottom: var(--space-sm); transition: background var(--transition-base); }
details[open] { background: #F9F9F7; }
summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 0.75rem; }
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; }
summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--color-fg); border-bottom: 2px solid var(--color-fg); transform: rotate(45deg); transition: transform var(--transition-base); flex-shrink: 0; }
details[open] summary::after { transform: rotate(-135deg); margin-top: 2px; }
.details-content { padding: 0 1rem 1rem; color: var(--color-text-secondary); }
.details-content p { margin-bottom: 0; }

/* 页头页脚 */
.site-header { border-bottom: 1px solid var(--color-border); background: rgba(250, 250, 247, 0.9); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo { width: 32px; height: 32px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.main-nav { display: flex; gap: var(--space-md); }
.main-nav a { font-weight: 500; font-size: 0.95rem; padding: 0.5rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current="page"] { border-bottom-color: var(--color-fg); }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.mobile-menu-btn svg { width: 24px; height: 24px; stroke: currentColor; }

.site-footer { border-top: 1px solid var(--color-border); background: var(--color-card); padding-block: var(--space-md); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); }
.footer-col h4 { margin-bottom: var(--space-sm); font-size: 0.95rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul a { color: var(--color-text-secondary); font-size: 0.9rem; }
.footer-col ul a:hover { color: var(--color-fg); }
.copyright { text-align: center; margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--color-border); color: var(--color-text-secondary); font-size: 0.85rem; }

/* ================= 布局辅助 ================= */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-md); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-accent { color: var(--color-accent); }
.bg-alt { background: #F4F4F0; }

/* ================= SVG 动效系统 ================= */
.svg-grid-container { position: relative; width: 100%; max-width: 400px; aspect-ratio: 1/1; }
.grid-node { fill: var(--color-accent); opacity: 0.2; transform: scale(0.8); transition: transform 0.3s ease; }
@keyframes nodePulse {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}
.stagger-1 { animation: nodePulse 3s ease-in-out infinite 0s; }
.stagger-2 { animation: nodePulse 3s ease-in-out infinite 0.2s; }
.stagger-3 { animation: nodePulse 3s ease-in-out infinite 0.4s; }
.stagger-4 { animation: nodePulse 3s ease-in-out infinite 0.6s; }
.stagger-5 { animation: nodePulse 3s ease-in-out infinite 0.8s; }

/* 线条绘制动效 */
.draw-path { fill: none; stroke: var(--color-fg); stroke-width: 2; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  30%, 70% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
.animate-draw { animation: drawLine 4s cubic-bezier(0.4, 0, 0.2, 1) infinite; transform-box: fill-box; transform-origin: center; }

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .svg-grid-container .grid-node { opacity: 0.5; transform: scale(1); }
  .draw-path { stroke-dashoffset: 0; }
}

/* ================= 响应式 ================= */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: block; }
  .section { padding-block: var(--space-md); }
  h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
}
