/* =========================================
   全局设计变量与基础重置
   ========================================= */
:root {
  --color-bg: #f5f8f6;
  --color-surface: #ffffff;
  --color-text-primary: #263230;
  --color-text-secondary: #52635f;
  --color-text-tertiary: #7a8b87;
  --color-accent: #6a9e96;
  --color-accent-hover: #588a82;
  --color-accent-light: #e3eeeb;
  --color-border: #d4deda;
  --color-muted: #e8ede9;
  --color-success: #5a8a6d;
  
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --shadow-card: 0 6px 20px rgba(38, 50, 48, 0.06);
  --shadow-hover: 0 10px 28px rgba(38, 50, 48, 0.1);
  --shadow-focus: 0 0 0 3px rgba(106, 158, 150, 0.35);
  
  --container-max: 1140px;
  --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; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: 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 var(--transition-base); }
ul, ol { list-style: none; }

/* =========================================
 排版与流体字号
========================================= */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-md); }
.section { padding: var(--space-lg) 0; position: relative; }
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-wrap: balance;
  margin-bottom: var(--space-md);
  color: var(--color-text-primary);
}
.section-desc {
  font-size: clamp(1rem, 1.2vw + 0.2rem, 1.125rem);
  color: var(--color-text-secondary);
  max-width: 80ch;
  margin-bottom: var(--space-lg);
}
.text-balance { text-wrap: balance; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 2rem; border-radius: var(--radius-md); font-weight: 500;
  cursor: pointer; border: none; transition: all var(--transition-base);
  font-size: 1rem; text-wrap: nowrap;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text-primary); }
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn:active { transform: translateY(0); }

/* 卡片网格 */
.grid-auto { display: grid; gap: var(--space-md); }
@media (min-width: 768px) { .grid-auto.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-auto.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid-auto.cols-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.card-icon { width: 48px; height: 48px; margin-bottom: var(--space-sm); color: var(--color-accent); }
.card-title { font-family: var(--font-serif); font-size: 1.25rem; margin-bottom: var(--space-xs); }
.card-body { color: var(--color-text-secondary); font-size: 0.95rem; }

/* 表格 */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--space-md) 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; background: var(--color-surface); min-width: 600px; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--color-border); vertical-align: top; }
th { background: var(--color-muted); font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
td { font-size: 0.95rem; color: var(--color-text-secondary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(106, 158, 150, 0.04); }

/* 导航 */
.header { position: sticky; top: 0; z-index: 100; background: rgba(245, 248, 246, 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; }
.logo-group { display: flex; align-items: center; gap: 12px; }
.logo-img { width: 36px; height: 36px; object-fit: contain; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.1rem; color: var(--color-text-primary); }
.nav-links { display: flex; gap: 24px; }
.nav-link { font-size: 0.95rem; color: var(--color-text-secondary); padding: 6px 0; position: relative; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--color-accent); }
.nav-link::after { content: ""; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--color-accent); transition: width var(--transition-base); }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { width: 100%; }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }

/* 页脚 */
.footer { background: var(--color-text-primary); color: #b0bab7; padding: var(--space-lg) 0 var(--space-md); font-size: 0.9rem; }
.footer-grid { display: grid; gap: var(--space-md); margin-bottom: var(--space-md); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-col h4 { color: #fff; font-family: var(--font-serif); margin-bottom: var(--space-sm); font-size: 1rem; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom { border-top: 1px solid #3a4a45; padding-top: var(--space-sm); display: flex; flex-direction: column; gap: 8px; text-align: center; }
@media (min-width: 768px) { .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; } }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; transition: box-shadow var(--transition-base); }
.faq-item[open] { box-shadow: var(--shadow-card); }
.summary { padding: 1.25rem; cursor: pointer; font-weight: 500; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.summary::marker { content: ""; }
.summary::before { content: "+"; font-weight: 400; font-size: 1.2rem; color: var(--color-accent); transition: transform var(--transition-base); }
.faq-item[open] .summary::before { transform: rotate(45deg); }
.faq-answer { padding: 0 1.25rem 1.25rem; color: var(--color-text-secondary); line-height: 1.7; }

/* 新闻卡片 */
.news-card { display: flex; flex-direction: column; height: 100%; }
.news-date { font-size: 0.85rem; color: var(--color-text-tertiary); margin-bottom: 8px; }
.news-title { font-weight: 600; margin-bottom: 10px; font-size: 1.05rem; }
.news-summary { flex-grow: 1; color: var(--color-text-secondary); font-size: 0.92rem; margin-bottom: 16px; }
.link-btn { align-self: flex-start; font-size: 0.9rem; color: var(--color-accent); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover { text-decoration: underline; }

/* 相关链接 */
.related-list { display: flex; flex-direction: column; gap: 12px; }
.related-item { display: flex; align-items: baseline; gap: 12px; padding: 12px; border: 1px solid transparent; border-radius: var(--radius-sm); transition: background var(--transition-base); }
.related-item:hover { background: var(--color-surface); border-color: var(--color-border); }
.related-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent); flex-shrink: 0; margin-top: 10px; }
.related-text h4 { font-size: 0.95rem; font-weight: 500; margin-bottom: 4px; }
.related-text p { font-size: 0.85rem; color: var(--color-text-tertiary); }

/* 焦点样式 */
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: none; }

/* =========================================
 SVG 动效系统
========================================= */
.svg-canvas { width: 100%; height: auto; display: block; }
.flow-path {
  fill: none; stroke: var(--color-accent); stroke-width: 2;
  pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0;
  opacity: 0.6;
}
.node-circle { fill: var(--color-accent); opacity: 0.8; }
.animate-flow {
  animation: drawLine 5s linear infinite;
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.pulse-node {
  animation: pulseScale 3s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes pulseScale {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.1); opacity: 1; }
}
.drift-point {
  animation: driftFlow 6s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes driftFlow {
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* 减少动画偏好 */
@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;
  }
  .animate-flow, .drift-point { animation: none !important; }
  .flow-path { stroke-dasharray: none; stroke-dashoffset: 0; }
}

@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    flex-direction: column;
    gap: 16px;
  }
  .nav-links.show { display: flex !important; }
  .sync-demo { flex-direction: column; }
  .mock-device { min-width: 0; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
