/* ==================== 设计变量 ==================== */
:root {
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-text: #1a1d21;
  --color-text-secondary: #4b5563;
  --color-border: #e5e7eb;
  --color-accent: #25d366;
  --color-accent-hover: #1eb954;
  --color-accent-light: rgba(37, 211, 102, 0.12);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-focus: 0 0 0 3px rgba(37, 211, 102, 0.35);
  --font-main: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --container-max: 1180px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
}

/* ==================== 基础重置与排版 ==================== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -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 { padding-left: 0; list-style: none; margin: 0; }

/* 焦点样式 */
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }

/* 容器 */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-md); }

/* 排版层级 */
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; margin-bottom: var(--space-sm); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 600; margin-bottom: var(--space-xs); }
p { margin: 0 0 var(--space-sm); }
.text-muted { color: var(--color-text-secondary); }
.text-center { text-align: center; }

/* ==================== 布局组件 ==================== */
.section { padding: var(--space-xl) 0; }
.section-grid { display: grid; gap: var(--space-lg); }
@media (min-width: 768px) { .section-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .section-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

/* 页头 */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--color-border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: var(--space-xs); font-weight: 600; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav-list { display: flex; gap: var(--space-md); }
.nav-link { font-size: 0.95rem; font-weight: 500; padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); color: var(--color-text-secondary); }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--color-accent); background: var(--color-accent-light); }

/* 页脚 */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--space-lg) 0; margin-top: var(--space-xl); }
.footer-inner { display: flex; flex-direction: column; gap: var(--space-md); align-items: center; text-align: center; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-md); }
.footer-copy { font-size: 0.85rem; color: var(--color-text-secondary); }

/* ==================== 按钮与表单 ==================== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.8rem 1.8rem; font-size: 1rem; font-weight: 600; border-radius: var(--radius-md); border: none; cursor: pointer; transition: all 0.2s ease; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-light); }
.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

/* ==================== 卡片与表格 ==================== */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-md); box-shadow: var(--shadow-card); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.table-wrapper { overflow-x: auto; margin: var(--space-md) 0; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th, .data-table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
.data-table th { background: #f9fafb; font-weight: 600; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fbfcfd; }

/* ==================== FAQ (原生 Details) ==================== */
.faq-item { margin-bottom: var(--space-sm); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.faq-summary { padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 2.5rem; user-select: none; }
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::after { content: "+"; position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%); font-size: 1.2rem; font-weight: 400; color: var(--color-accent); }
.faq-item[open] .faq-summary::after { content: "−"; }
.faq-answer { padding: 0 1.25rem 1.25rem; color: var(--color-text-secondary); line-height: 1.75; }

/* ==================== SVG 动效系统 ==================== */
.svg-canvas { width: 100%; height: auto; max-width: 400px; margin: 0 auto; display: block; }
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes draw-line { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
.animate-draw { animation: draw-line 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.animate-draw.delay-1 { animation-delay: 0.6s; }
.animate-draw.delay-2 { animation-delay: 1.2s; }

.float-node { opacity: 0; }
@keyframes float-up { 0% { transform: scale(0.5); opacity: 0; } 20% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes float-pulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.animate-node { animation: float-up 1.2s ease-out forwards; animation-delay: 2.2s; }
.animate-node.floating { animation: float-pulse 3.5s ease-in-out infinite; animation-delay: 3.5s; }

@keyframes rotate-slow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.rotate-slow { animation: rotate-slow 12s linear infinite; transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  .animate-draw, .animate-node, .floating, .rotate-slow { animation: none !important; }
  .float-node { opacity: 1; transform: none; }
  svg { display: block; }
}

/* ==================== 辅助工具类 ==================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.split-layout { display: grid; gap: var(--space-lg); align-items: center; }
@media (min-width: 768px) { .split-layout.two-col { grid-template-columns: 1.2fr 0.8fr; } }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 99px; background: var(--color-accent-light); color: var(--color-accent); margin-bottom: var(--space-xs); }
.article-date { font-size: 0.8rem; color: var(--color-text-secondary); margin-bottom: 0.4rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.9rem; font-weight: 500; color: var(--color-accent); margin-top: 0.5rem; }
.link-arrow:hover { text-decoration: underline; }
