/* 设计变量 */
:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #4a4a4a;
  --color-text-muted: #8c8c8c;
  --color-border: #e8e8e8;
  --color-accent: #25D366;
  --color-accent-hover: #128C7E;
  --color-accent-light: rgba(37, 211, 102, 0.08);
  --font-serif: "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --transition-base: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; color: var(--color-text-primary); text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.02em; margin-bottom: var(--space-md); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-top: var(--space-2xl); margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); margin-top: var(--space-sm); margin-bottom: var(--space-xs); }
p { margin-bottom: var(--space-sm); color: var(--color-text-secondary); }
a { color: var(--color-accent-hover); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: var(--transition-base); }
a:hover { color: var(--color-accent); text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: var(--space-md); margin-bottom: var(--space-sm); }
li { margin-bottom: var(--space-xs); }

/* 布局容器 */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--space-md); }
section { padding: var(--space-xl) 0; }
.section-header { text-align: center; max-width: 820px; margin: 0 auto var(--space-lg); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-md); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-md); }

/* 导航与页脚 */
header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 100; backdrop-filter: blur(8px); }
.nav-wrapper { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-text-primary); font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
nav ul { list-style: none; display: flex; gap: var(--space-md); margin: 0; padding: 0; }
nav a { text-decoration: none; color: var(--color-text-secondary); font-size: 0.95rem; padding: 6px 0; position: relative; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-text-primary); }
nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--color-accent); border-radius: 1px; }
footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--space-lg) 0; margin-top: var(--space-2xl); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: var(--space-md); text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-md); }
.footer-links a { color: var(--color-text-secondary); text-decoration: none; font-size: 0.9rem; }
.footer-meta { font-size: 0.85rem; color: var(--color-text-muted); margin-top: var(--space-sm); }

/* 组件：按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 26px; font-size: 1rem; font-weight: 500; border-radius: var(--radius-md); cursor: pointer; transition: var(--transition-base); text-decoration: none; border: 1px solid transparent; user-select: none; }
.btn-primary { background: var(--color-accent-hover); color: #fff; }
.btn-primary:hover { background: #0e7a6b; transform: translateY(-1px); box-shadow: var(--shadow-md); color: #fff; }
.btn-secondary { background: transparent; color: var(--color-text-primary); border-color: var(--color-border); }
.btn-secondary:hover { border-color: var(--color-text-secondary); background: #f6f6f6; color: var(--color-text-primary); }

/* 组件：卡片 */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-md); transition: var(--transition-base); }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #dcdcdc; }
.card-icon { width: 40px; height: 40px; margin-bottom: var(--space-sm); color: var(--color-accent-hover); }
.card-title { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; margin-bottom: var(--space-xs); }
.card-desc { font-size: 0.95rem; color: var(--color-text-secondary); line-height: 1.6; }

/* 组件：表格 */
.table-wrapper { overflow-x: auto; margin: var(--space-md) 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--color-surface); }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: #f7f7f7; font-family: var(--font-serif); font-weight: 600; color: var(--color-text-primary); white-space: nowrap; }
td { color: var(--color-text-secondary); }
tr:last-child td { border-bottom: none; }

/* 组件：FAQ */
details { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: var(--space-sm); overflow: hidden; transition: border-color 0.2s; }
details:hover { border-color: #d0d0d0; }
summary { padding: 16px 20px; cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; align-items: center; outline-offset: -2px; }
summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 20px 16px; margin-bottom: 0; color: var(--color-text-secondary); }

/* 组件：文章卡片 */
.article-card { display: flex; flex-direction: column; height: 100%; }
.article-body { flex: 1; display: flex; flex-direction: column; }
.article-date { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: var(--space-xs); }
.article-summary { flex: 1; font-size: 0.92rem; color: var(--color-text-secondary); margin-bottom: var(--space-sm); }
.article-link { align-self: flex-start; font-size: 0.9rem; text-decoration: none; }

/* 分隔与装饰 */
.divider { height: 1px; background: var(--color-border); margin: var(--space-lg) 0; }
.related-list { list-style: none; padding: 0; }
.related-item { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--color-border); }
.related-item:last-child { border-bottom: none; }
.related-item a { text-decoration: none; color: var(--color-text-primary); font-weight: 500; }
.related-item a:hover { color: var(--color-accent-hover); }
.related-item span { font-size: 0.85rem; color: var(--color-text-muted); }

/* SVG 动效系统 */
.svg-anim { width: 100%; height: auto; display: block; }
.contour-line { fill: none; stroke: var(--color-text-muted); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; pathLength: 1; }
@keyframes contour-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.animate-contour { animation: contour-flow 8s linear infinite alternate; }
.animate-contour-delay-1 { animation: contour-flow 10s linear infinite alternate-reverse; animation-delay: -3s; }
.animate-contour-delay-2 { animation: contour-flow 7s linear infinite alternate; animation-delay: -1s; }
.float-layer { animation: gentle-float 6s ease-in-out infinite; }
@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .animate-contour, .animate-contour-delay-1, .animate-contour-delay-2, .float-layer { animation: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
