/* 设计变量：莫兰迪低饱和色系 + 大面积留白 */
:root {
  --color-bg: #F6F4F1;
  --color-surface: #FFFFFF;
  --color-surface-alt: #EFECE8;
  --color-text: #2C2C2C;
  --color-text-secondary: #5A5A5A;
  --color-primary: #7A9A8D;
  --color-primary-hover: #638576;
  --color-accent: #C9BFB1;
  --color-border: #E2DED9;
  --color-success: #8CB89C;
  
  --font-heading: "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body: "Inter", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
  
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  
  --max-width: 1120px;
  --header-height: 64px;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.3; text-wrap: balance; color: var(--color-text); }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.125rem, 2vw, 1.375rem); margin-bottom: var(--space-xs); }
p { margin-bottom: var(--space-sm); color: var(--color-text-secondary); }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }
code {
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: break-word;
}
img, svg { display: block; max-width: 100%; height: auto; }

/* 布局容器 */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-md); }
.section { padding: var(--space-xl) 0; position: relative; }
.section--alt { background-color: var(--color-surface-alt); }
.grid { display: grid; gap: var(--space-md); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* 页头与导航 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 244, 241, 0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border); height: var(--header-height);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: var(--space-xs); font-family: var(--font-heading); font-weight: 600; font-size: 1.1rem; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.nav { display: flex; gap: var(--space-md); }
.nav a { font-size: 0.95rem; font-weight: 500; color: var(--color-text-secondary); padding: 0.5rem 0; position: relative; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-primary); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--color-primary); border-radius: 2px; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }

/* 按钮 */
.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: 500; font-size: 1rem;
  border: none; cursor: pointer; transition: all 0.2s ease; text-decoration: none;
}
.btn--primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn--outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn--lg { padding: 1rem 2rem; font-size: 1.1rem; border-radius: var(--radius-lg); }

/* 卡片与组件 */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-md); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.feature-card { display: flex; flex-direction: column; gap: var(--space-xs); }
.feature-icon { width: 40px; height: 40px; color: var(--color-primary); margin-bottom: var(--space-xs); }
.badge { display: inline-block; padding: 0.25rem 0.6rem; background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: 99px; font-size: 0.8rem; font-weight: 500; color: var(--color-text-secondary); margin-bottom: var(--space-xs); }

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-surface-alt); font-weight: 600; font-family: var(--font-heading); white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item:last-child { border-bottom: none; }
.summary { padding: 1rem 0; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.summary::-webkit-details-marker { display: none; }
.summary::after { content: "+"; font-size: 1.25rem; font-weight: 400; transition: transform 0.2s; }
details[open] .summary::after { transform: rotate(45deg); }
.details-content { padding: 0 0 1rem 0; color: var(--color-text-secondary); }

/* 更新卡片 */
.update-card { padding: var(--space-md); }
.update-date { font-size: 0.8rem; color: var(--color-text-secondary); margin-bottom: 0.5rem; display: block; }
.update-title { font-family: var(--font-heading); font-weight: 600; margin-bottom: 0.5rem; }
.update-summary { font-size: 0.9rem; margin-bottom: var(--space-sm); }
.link-arrow { font-size: 0.9rem; font-weight: 500; color: var(--color-primary); display: inline-flex; align-items: center; gap: 0.25rem; }

/* 相关阅读 */
.related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-sm); }
.related-item { display: flex; flex-direction: column; gap: 0.25rem; }
.related-item strong { font-weight: 500; font-size: 0.95rem; }
.related-item span { font-size: 0.85rem; color: var(--color-text-secondary); }

/* 页脚 */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--space-lg) 0 var(--space-md); margin-top: var(--space-xl); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-lg); margin-bottom: var(--space-lg); }
.footer-col h4 { font-size: 1rem; margin-bottom: var(--space-sm); }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { font-size: 0.9rem; color: var(--color-text-secondary); }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom { text-align: center; font-size: 0.85rem; color: var(--color-text-secondary); border-top: 1px solid var(--color-border); padding-top: var(--space-md); }

/* SVG 动效基础 */
.svg-anim { width: 100%; height: auto; overflow: visible; }
.svg-anim path, .svg-anim circle, .svg-anim rect { transition: transform 0.3s ease; }
.flow-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawFlow 6s linear infinite; }
.pulse-dot { animation: pulseMove 4s ease-in-out infinite alternate; }
.float-shape { animation: gentleFloat 8s ease-in-out infinite; }

@keyframes drawFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pulseMove {
  0% { transform: translateX(-15px); opacity: 0.3; }
  100% { transform: translateX(15px); opacity: 1; }
}
@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 旋转/缩放 SVG 子元素中心对齐 */
.svg-anim [class*="anim-rotate"], .svg-anim [class*="anim-scale"] {
  transform-box: fill-box; transform-origin: center;
}

/* 无障碍与焦点 */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }
@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; }
  .flow-line, .pulse-dot, .float-shape { animation: none !important; }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-menu-btn { display: block; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .section { padding: var(--space-lg) 0; }
  h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
}
