/* === 设计变量 === */
:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-text-primary: #1a1d21;
  --color-text-secondary: #5f6b7a;
  --color-text-muted: #8b949e;
  --color-brand: #25D366;
  --color-brand-hover: #1daa54;
  --color-border: #e6eaed;
  --color-accent-bg: #f0fafa;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.08);
  
  --font-main: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3.5rem;
  --space-xl: 5rem;
  
  --container-max: 1080px;
  --header-height: 72px;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* 流体字号 */
h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; margin-bottom: var(--space-sm); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); letter-spacing: -0.01em; line-height: 1.3; text-wrap: balance; margin-bottom: var(--space-md); color: var(--color-text-primary); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.4; margin-bottom: var(--space-xs); }
p { margin-bottom: 1rem; color: var(--color-text-secondary); }
strong { color: var(--color-text-primary); font-weight: 600; }

/* === 布局工具 === */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-sm); }
.section { padding: var(--space-xl) 0; position: relative; }
.section-alt { background-color: var(--color-surface); }
.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); }
.text-center { text-align: center; }

/* === 页头页脚 === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 248, 250, 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; width: 100%; }
.brand-logo { display: flex; align-items: center; gap: var(--space-xs); font-weight: 600; font-size: 1.1rem; color: var(--color-text-primary); }
.brand-logo img { width: 32px; height: 32px; object-fit: contain; }
.main-nav { display: flex; gap: var(--space-md); }
.main-nav a { font-size: 0.95rem; color: var(--color-text-secondary); font-weight: 500; padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); transition: all 0.2s ease; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--color-brand); background: var(--color-accent-bg); }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; }

.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--space-lg) 0 var(--space-md); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-md); }
.footer-col h4 { font-size: 1rem; margin-bottom: var(--space-sm); color: var(--color-text-primary); }
.footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { color: var(--color-text-secondary); font-size: 0.95rem; }
.footer-col a:hover { color: var(--color-brand); }
.footer-bottom { border-top: 1px solid var(--color-border); padding-top: var(--space-sm); text-align: center; color: var(--color-text-muted); font-size: 0.85rem; }

/* === 组件：按钮 === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0.85rem 1.6rem; border-radius: var(--radius-md);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: all 0.2s ease; border: none; outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.4); }
.btn-primary { background: var(--color-brand); color: #fff; }
.btn-primary:hover { background: var(--color-brand-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text-primary); }
.btn-outline:hover { border-color: var(--color-brand); color: var(--color-brand); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* === 组件：卡片 === */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card-icon { width: 40px; height: 40px; background: var(--color-accent-bg); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-sm); color: var(--color-brand); }
.card-body { flex: 1; }
.card-meta { margin-top: auto; padding-top: var(--space-sm); font-size: 0.85rem; color: var(--color-text-muted); display: flex; justify-content: space-between; align-items: center; }

/* === 组件：表格 === */
.table-wrapper { 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%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 0.95rem; }
th { background: #f9fafb; font-weight: 600; color: var(--color-text-primary); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 500; }

/* === 组件：FAQ === */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item summary {
  padding: 1.2rem 0; cursor: pointer; font-weight: 600; color: var(--color-text-primary);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--color-text-muted); transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding-bottom: 1.2rem; margin: 0; font-size: 0.95rem; line-height: 1.7; color: var(--color-text-secondary); }

/* === SVG 动效系统 === */
.svg-container { width: 100%; max-width: 420px; margin: 0 auto; }
.svg-draw path, .svg-draw circle, .svg-draw rect, .svg-draw line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.svg-node {
  transform-box: fill-box;
  transform-origin: center;
  animation: float-node 6s ease-in-out infinite;
}
@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes float-node {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .svg-draw path, .svg-draw circle, .svg-draw rect, .svg-draw line,
  .svg-node { animation: none !important; }
}

/* === 响应式调整 === */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: block; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
