/* ==================== 设计变量 ==================== */
:root {
  --color-bg: #F5F1EA;
  --color-surface: #FFFFFF;
  --color-primary: #2C5A4A;
  --color-primary-hover: #1F4438;
  --color-secondary: #7A5239;
  --color-accent: #D4A373;
  --color-text: #1A1A1A;
  --color-muted: #5C5C5C;
  --color-border: #E0DCD5;
  --color-header-bg: rgba(245, 241, 234, 0.85);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.06);
  --radius: 10px;
  --font-heading: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --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 { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-secondary); }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin-top: 0; font-family: var(--font-heading); font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-stretch: condensed; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-stretch: condensed; margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); font-stretch: condensed; margin-bottom: var(--space-xs); }
p { margin-bottom: 1rem; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--space-md); }

/* ==================== 布局与区块 ==================== */
.section { padding: var(--space-xl) 0; position: relative; }
.section-alt { background-color: #EFECE5; }
.section-grid { display: grid; gap: var(--space-lg); }
@media (min-width: 768px) {
  .section-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .section-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .section-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ==================== 头部与底部 ==================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: var(--space-xs); }
.brand img { height: 32px; width: auto; }
.brand span { font-weight: 600; font-size: 1.1rem; color: var(--color-text); }
.nav-list { display: flex; gap: var(--space-md); align-items: center; }
.nav-link { font-weight: 500; padding: 0.5rem 0; position: relative; }
.nav-link[aria-current="page"] { color: var(--color-primary); font-weight: 700; }
.nav-link[aria-current="page"]::after {
  content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
  background: var(--color-primary); border-radius: 2px;
}
.site-footer {
  background: var(--color-primary); color: #E8E4DE; padding: var(--space-xl) 0 var(--space-md);
  font-size: 0.9rem;
}
.footer-grid { display: grid; gap: var(--space-lg); grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-col h4 { color: #FFF; margin-bottom: var(--space-sm); }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: #D0CCC5; }
.footer-links a:hover { color: #FFF; }
.footer-bottom { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid rgba(255,255,255,0.15); text-align: center; color: #A09C97; }

/* ==================== 组件 ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer;
  transition: background 0.2s, transform 0.1s; border: none;
}
.btn-primary { background: var(--color-primary); color: #FFF; }
.btn-primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
.btn-secondary { background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); }
.btn-secondary:hover { background: rgba(44, 90, 74, 0.08); }
.card {
  background: var(--color-surface); border-radius: var(--radius); padding: var(--space-md);
  box-shadow: var(--shadow-sm); border: 1px solid var(--color-border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon { width: 48px; height: 48px; margin-bottom: var(--space-sm); color: var(--color-secondary); }
.news-card { display: flex; flex-direction: column; height: 100%; }
.news-date { font-size: 0.85rem; color: var(--color-muted); margin-bottom: 0.5rem; }
.news-excerpt { flex: 1; color: var(--color-muted); font-size: 0.95rem; margin-bottom: 1rem; }
.related-list li { margin-bottom: 0.75rem; padding-left: 1rem; position: relative; }
.related-list li::before { content: ""; position: absolute; left: 0; top: 0.4rem; width: 6px; height: 6px; background: var(--color-accent); border-radius: 50%; }

/* 表格 */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-surface); }
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: #F0EDE6; font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* FAQ */
details { margin-bottom: var(--space-sm); border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); }
summary { padding: 1rem; cursor: pointer; font-weight: 600; 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; color: var(--color-primary); }
details[open] summary::after { content: "−"; }
details > div { padding: 0 1rem 1rem; color: var(--color-muted); }

/* 步骤编号 */
.step-list { counter-reset: step; list-style: none; }
.step-list li { position: relative; padding-left: 2.5rem; margin-bottom: 1.25rem; }
.step-list li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; background: var(--color-primary); color: #FFF;
  border-radius: 50%; text-align: center; line-height: 28px; font-weight: 700; font-size: 0.9rem;
}

/* 焦点可见性 */
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* ==================== SVG 动效 ==================== */
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes draw-stroke {
  0% { stroke-dashoffset: 1; }
  40%, 100% { stroke-dashoffset: 0; }
}
.breathe-group {
  transform-origin: center;
  transform-box: fill-box;
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}
svg.animate-draw .draw-path { animation: draw-stroke 3.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
svg.animate-draw .draw-path:nth-child(odd) { animation-delay: 0.1s; }
svg.animate-draw .draw-path:nth-child(even) { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .draw-path, .breathe-group { animation: none !important; stroke-dashoffset: 0 !important; }
  html { scroll-behavior: auto; }
}
/* 修复小屏幕横向溢出与排版 */
@media (max-width: 520px) {
  .container {
    padding: 0 1rem;
  }
  table {
    min-width: 0;
    font-size: 0.85rem;
  }
  th, td {
    padding: 0.6rem 0.75rem;
  }
  .header-inner {
    flex-wrap: wrap;
  }
  .nav-list {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}
