/* ================= 设计变量 ================= */
:root {
  --color-bg: #f5f3ee;
  --color-surface: #ffffff;
  --color-text: #2a2926;
  --color-text-muted: #6b6861;
  --color-primary: #4a6741;
  --color-primary-hover: #3a5234;
  --color-accent: #a39e8f;
  --color-border: #e2dfd8;
  --font-heading: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --spacing-container: clamp(1rem, 5vw, 4rem);
  --radius-sm: 6px;
  --radius-md: 12px;
  --shadow-card: 0 4px 20px rgba(42, 41, 38, 0.06);
  --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; }
body { font-family: var(--font-body); background: var(--color-bg); color: var(--color-text); line-height: 1.7; font-size: 16px; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-base); }
a:hover, a:focus-visible { color: var(--color-primary-hover); }
a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.15; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); margin-bottom: 1rem; }
p { margin-bottom: 1rem; max-width: 75ch; }
ol, ul { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; }

/* ================= 布局容器 ================= */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--spacing-container); }
section { padding: clamp(3rem, 6vw, 5rem) 0; }

/* ================= 页头与页脚 ================= */
header, footer { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { font-weight: 500; color: var(--color-text-muted); }
.nav-links a[aria-current="page"], .nav-links a:hover { color: var(--color-text); }
footer { border-top: 1px solid var(--color-border); border-bottom: none; padding: 2rem 0; text-align: center; color: var(--color-text-muted); font-size: 0.9rem; }

/* ================= 通用组件 ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem 1.8rem; background: var(--color-primary); color: #fff; font-weight: 600; border-radius: var(--radius-sm); transition: background var(--transition-base), transform var(--transition-base); cursor: pointer; border: none; font-size: 1rem; text-decoration: none; }
.btn:hover, .btn:focus-visible { background: var(--color-primary-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--outline { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn--outline:hover { border-color: var(--color-text); }

.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.8rem; box-shadow: var(--shadow-card); transition: transform var(--transition-base), box-shadow var(--transition-base); }
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(42, 41, 38, 0.1); }
.card time { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; display: block; }

table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
th, td { padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--color-border); text-align: left; }
th { font-weight: 600; background: rgba(163, 158, 143, 0.1); }
tr:last-child td { border-bottom: none; }

details { border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-bottom: 0.8rem; background: var(--color-surface); }
summary { padding: 1rem 1.2rem; 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.2rem; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding: 0 1.2rem 1rem; color: var(--color-text-muted); }

/* ================= SVG 动效体系 ================= */
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes breathe { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.02); } }

.svg-draw path, .svg-draw line, .svg-draw circle, .svg-draw rect { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 4s ease-out forwards; }
.svg-breathe { animation: breathe 6s infinite ease-in-out; transform-box: fill-box; transform-origin: center; }

@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; }
}
