/* 设计变量 */
:root {
  --color-bg: #F9F7F2;
  --color-surface: #FFFFFF;
  --color-text-primary: #1A1A1A;
  --color-text-secondary: #555555;
  --color-accent: #00A884;
  --color-accent-hover: #008C6F;
  --color-border: #E2DFD8;
  --color-highlight: #FFF8E7;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 16px rgba(26,26,26,0.06);
  --shadow-button: 0 2px 8px rgba(0,168,132,0.25);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --space-section: clamp(3rem, 6vw, 6rem);
  --container-max: 1120px;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.65;
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.25; text-wrap: balance; color: var(--color-text-primary); }
h1 { font-size: clamp(2rem, 1.6rem + 2.5vw, 3.2rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.8vw, 2.2rem); margin-bottom: 1.5rem; position: relative; padding-bottom: 0.5rem; }
h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 48px; height: 3px; background: var(--color-accent); border-radius: 2px; }
h3 { font-size: clamp(1.1rem, 1rem + 0.8vw, 1.35rem); margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; color: var(--color-text-secondary); max-width: 100%; overflow-wrap: break-word; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.5rem; }
img { max-width: 100%; height: auto; display: block; }

/* 布局容器 */
.container { width: 92%; max-width: var(--container-max); margin: 0 auto; }
section { padding: var(--space-section) 0; }
.grid-2 { display: grid; gap: 2rem; }
.grid-3 { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* 修复窄屏下网格项溢出 */
.grid-2 > *, .grid-3 > * { min-width: 0; }

/* 导航与页头页脚 */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(249,247,242,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: 64px; }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand img { height: 32px; width: auto; }
.brand-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; }
.nav-list { display: flex; gap: 1rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
@media (min-width: 768px) { .nav-list { flex-wrap: nowrap; } }
.nav-list a { font-size: 0.95rem; font-weight: 500; color: var(--color-text-secondary); transition: color 0.2s; }
.nav-list a:hover, .nav-list a[aria-current="page"] { color: var(--color-text-primary); }
.nav-list a[aria-current="page"] { border-bottom: 2px solid var(--color-accent); }
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 3rem 0 2rem; margin-top: 2rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 2fr repeat(3, 1fr); }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links a { color: var(--color-text-secondary); font-size: 0.9rem; }
.footer-links a:hover { color: var(--color-accent); text-decoration: underline; }
.footer-bottom { text-align: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); color: var(--color-text-secondary); font-size: 0.85rem; }

/* 组件：按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-weight: 600; cursor: pointer;
  border: none; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s;
  font-size: 0.95rem; outline-offset: 2px;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.btn-primary { background: var(--color-accent); color: #fff; box-shadow: var(--shadow-button); }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.btn-secondary { background: transparent; border: 1.5px solid var(--color-text-primary); color: var(--color-text-primary); }
.btn-secondary:hover { background: var(--color-text-primary); color: #fff; }

/* 组件：卡片 */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.5rem; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.card-meta { font-size: 0.8rem; color: var(--color-text-secondary); margin-bottom: 0.75rem; display: block; }
.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.card-btn { font-size: 0.9rem; color: var(--color-accent); font-weight: 500; display: inline-block; margin-top: 0.5rem; }
.card-btn:hover { text-decoration: underline; }

/* 组件：表格 */
.table-wrapper { overflow-x: auto; margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-surface); font-weight: 600; color: var(--color-text-primary); }
td { color: var(--color-text-secondary); }
tr:last-child td { border-bottom: none; }

/* 组件：FAQ */
.faq-item { margin-bottom: 1rem; 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; user-select: none; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::after { content: "+"; font-size: 1.2rem; transition: transform 0.2s; }
.faq-item[open] .faq-summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 1.25rem 1.25rem; color: var(--color-text-secondary); border-top: 1px dashed var(--color-border); padding-top: 1rem; }

/* 组件：链接列表 */
.related-link { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.75rem 0; border-bottom: 1px solid var(--color-border); }
.related-link:last-child { border-bottom: none; }
.related-title { font-weight: 600; color: var(--color-text-primary); }
.related-desc { font-size: 0.9rem; color: var(--color-text-secondary); }

/* SVG 动效基础 */
.svg-container { width: 100%; max-width: 480px; margin: 0 auto; }
.svg-container svg { width: 100%; height: auto; }
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; fill: none; stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.node-dot { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; fill: var(--color-text-primary); stroke: none; }

@keyframes drawStroke { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes glowNode { 0%, 100% { opacity: 0.2; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); fill: var(--color-accent); } }

.anim-draw { animation: drawStroke 2.5s ease-in-out infinite alternate; }
.anim-node { animation: glowNode 4s ease-in-out infinite; }
.anim-node-delay-1 { animation-delay: 0.6s; }
.anim-node-delay-2 { animation-delay: 1.2s; }
.anim-node-delay-3 { animation-delay: 1.8s; }
.anim-node-delay-4 { animation-delay: 2.4s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .anim-draw, .anim-node { animation: none !important; }
}
