/* 设计变量与基础重置 */
:root {
  --color-bg: #f5f2ec;
  --color-surface: #ffffff;
  --color-primary: #4a3f36;
  --color-primary-hover: #3b322a;
  --color-accent: #6b8e73;
  --color-text: #2c2926;
  --color-text-muted: #6b6560;
  --color-border: #d8d2ca;
  --color-highlight: #e8e3db;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 14px rgba(74, 63, 54, 0.06);
  --shadow-hover: 0 8px 24px rgba(74, 63, 54, 0.12);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --max-width: 1180px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 排版系统 */
h1, h2, h3, h4 { line-height: 1.25; text-wrap: balance; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); margin-bottom: 1rem; color: var(--color-primary); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.75rem; color: var(--color-primary); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); margin-bottom: 0.75rem; font-weight: 600; }
p { margin-bottom: 1rem; max-width: 72ch; }
a { color: var(--color-accent); text-decoration: none; transition: color 0.2s ease; }
a:hover, a:focus-visible { color: var(--color-primary); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: 2px; }
ul, ol { padding-left: 1.25rem; margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; }

/* 布局容器 */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.section { padding: 5rem 0; }
.section-alt { background-color: var(--color-surface); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }

/* 头部导航 */
header { position: sticky; top: 0; z-index: 90; background: rgba(245, 242, 236, 0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--color-border); height: var(--header-h); display: flex; align-items: center; }
.nav-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.brand { display: flex; align-items: center; gap: 0.85rem; font-weight: 700; font-size: 1.2rem; color: var(--color-primary); text-decoration: none; }
.brand img { height: 38px; width: auto; object-fit: contain; }
nav ul { display: flex; list-style: none; gap: 1.6rem; }
nav a { color: var(--color-text); font-weight: 500; padding: 0.5rem 0; border-bottom: 2px solid transparent; transition: border-color 0.2s ease; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-primary); border-bottom-color: var(--color-accent); text-decoration: none; }
@media (max-width: 768px) { nav ul { display: none; } }

/* 页脚 */
footer { background: var(--color-primary); color: #e6e1da; padding: 3.5rem 0; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
footer h4 { color: #fff; margin-bottom: 1rem; font-size: 1.1rem; }
footer a { color: #cdc7be; }
footer a:hover { color: #fff; text-decoration: underline; }
footer small { display: block; margin-top: 1rem; opacity: 0.75; font-size: 0.85rem; line-height: 1.5; }

/* 通用组件 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.9rem 1.8rem; font-size: 1rem; font-weight: 600; border-radius: var(--radius-md); border: none; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; text-decoration: none; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); text-decoration: none; }
.btn-secondary { background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); }
.btn-secondary:hover { background: rgba(74, 63, 54, 0.06); text-decoration: none; }

.card { background: var(--color-surface); padding: 1.5rem; border-radius: var(--radius-md); border: 1px solid var(--color-border); box-shadow: var(--shadow-card); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card-icon { width: 46px; height: 46px; margin-bottom: 1rem; stroke: var(--color-accent); stroke-width: 1.5; fill: none; }

table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-border); }
th, td { padding: 1rem 1.25rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: #edeae3; font-weight: 600; color: var(--color-primary); }
tr:last-child td { border-bottom: none; }

details { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 1rem; padding: 1rem 1.25rem; transition: box-shadow 0.2s ease; }
details:hover { box-shadow: var(--shadow-card); }
summary { 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.3rem; font-weight: 400; transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 1rem; color: var(--color-text-muted); line-height: 1.6; }

/* SVG 动效基础 */
.svg-anim-wrap { width: 100%; max-width: 420px; margin: 0 auto; }
svg { width: 100%; height: auto; display: block; }
.geo-el { transform-box: fill-box; transform-origin: center; }
.spin-cw { animation: geo-spin 14s linear infinite; }
.spin-ccw { animation: geo-spin-rev 18s linear infinite; }
.trace-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: geo-draw 9s ease-in-out infinite; }
@keyframes geo-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes geo-spin-rev { 0% { transform: rotate(0deg); } 100% { transform: rotate(-360deg); } }
@keyframes geo-draw { 0%, 100% { stroke-dashoffset: 0; } 50% { stroke-dashoffset: 1; } }
@media (prefers-reduced-motion: reduce) { .spin-cw, .spin-ccw, .trace-line { animation: none !important; } }

/* 工具类 */
.text-center { text-align: center; }
.mb-xl { margin-bottom: 3rem; }
.gap-md { gap: 1rem; }
.mt-lg { margin-top: 2rem; }
.bg-light { background: #fafaf8; }
.border-top { border-top: 2px dashed var(--color-border); margin: 2rem 0; }
