/* =========================================
   设计变量与基础重置
   ========================================= */
:root {
  --color-bg: #fdfbf9;
  --color-surface: #ffffff;
  --color-surface-alt: #f5f3f0;
  --color-text: #1a1a1b;
  --color-text-secondary: #5a5a5e;
  --color-text-muted: #8e8e93;
  --color-primary: #0b8a4c;
  --color-primary-hover: #076e3d;
  --color-accent: #25d366;
  --gradient-warm: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  --gradient-soft-light: radial-gradient(circle at 20% 80%, rgba(255, 182, 159, 0.15) 0%, transparent 60%),
                       radial-gradient(circle at 80% 20%, rgba(37, 211, 102, 0.08) 0%, transparent 50%);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.05);
  --shadow-elevated: 0 12px 40px rgba(0, 0, 0, 0.08);
  --container-max: 1160px;
  --space-section: clamp(4rem, 8vw, 7rem);
  --space-block: 2.5rem;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { padding-left: 0; list-style: none; margin: 0; }
a { color: inherit; text-decoration: none; transition: color var(--transition-base); }
button, input, select, textarea { font: inherit; color: inherit; }

/* 排版系统 */
.container {
  width: min(92%, var(--container-max));
  margin-inline: auto;
}
h1, h2, h3, h4 { letter-spacing: -0.02em; text-wrap: balance; margin: 0 0 0.6em; }
h1 { font-size: clamp(2.4rem, 5vw + 1rem, 3.8rem); font-weight: 700; line-height: 1.15; }
h2 { font-size: clamp(1.8rem, 3.5vw + 0.5rem, 2.6rem); font-weight: 600; line-height: 1.2; }
h3 { font-size: clamp(1.25rem, 2vw + 0.5rem, 1.6rem); font-weight: 600; line-height: 1.3; }
p { margin: 0 0 1.2em; }
.text-secondary { color: var(--color-text-secondary); }
.mono { font-family: var(--font-mono); letter-spacing: -0.03em; }
.text-lead { font-size: clamp(1.05rem, 1.5vw + 0.5rem, 1.25rem); line-height: 1.6; max-width: 68ch; }

/* 页头页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253, 251, 249, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0.8rem 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; font-size: 1.1rem; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
nav ul { display: flex; gap: 1.5rem; flex-wrap: wrap; }
nav a { font-size: 0.95rem; font-weight: 500; padding: 0.4rem 0; border-radius: 4px; }
nav a:hover { color: var(--color-primary); }
nav a[aria-current="page"] { color: var(--color-primary); border-bottom: 2px solid var(--color-primary); }

.site-footer {
  background: var(--color-surface-alt);
  border-top: 1px solid rgba(0,0,0,0.05);
  padding: 3rem 0 2rem;
  margin-top: var(--space-section);
  font-size: 0.9rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { font-size: 0.95rem; margin-bottom: 0.8rem; color: var(--color-text); }
.footer-col a { display: block; padding: 0.3rem 0; color: var(--color-text-secondary); }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom { text-align: center; color: var(--color-text-muted); padding-top: 1.5rem; border-top: 1px solid rgba(0,0,0,0.05); }

/* 通用组件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  border: none; transition: all var(--transition-base);
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary); color: #fff;
  box-shadow: 0 4px 12px rgba(11, 138, 76, 0.25);
}
.btn-primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(11, 138, 76, 0.3); }
.btn-secondary { background: var(--color-surface-alt); color: var(--color-text); border: 1px solid rgba(0,0,0,0.08); }
.btn-secondary:hover { background: #ecebe9; }

.card {
  background: var(--color-surface); border-radius: var(--radius-md);
  padding: 1.8rem; box-shadow: var(--shadow-card);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elevated); }
.card-icon { width: 44px; height: 44px; margin-bottom: 1rem; color: var(--color-primary); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.06); }
th { font-weight: 600; background: var(--color-surface-alt); }
td { color: var(--color-text-secondary); }
tr:last-child td { border-bottom: none; }

/* FAQ / Details */
details {
  background: var(--color-surface); border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-md); margin-bottom: 0.8rem; overflow: hidden;
  transition: box-shadow var(--transition-base);
}
details[open] { box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
summary {
  padding: 1.1rem 1.4rem; font-weight: 600; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; font-size: 1.4rem; color: var(--color-text-muted); transition: transform var(--transition-base); }
details[open] summary::after { content: "−"; }
details > div { padding: 0 1.4rem 1.2rem; color: var(--color-text-secondary); line-height: 1.65; }

/* 区块布局 */
.section { padding: var(--space-section) 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.8rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.bg-alt { background: var(--color-surface-alt); }
.soft-glow { background: var(--gradient-soft-light); border-radius: var(--radius-lg); padding: 3rem; }

/* SVG 动效基础 */
.svg-anim-container { position: relative; width: 100%; max-width: 600px; margin: 0 auto; }
svg.contour-svg { width: 100%; height: auto; display: block; }
svg.contour-svg path {
  fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0;
}
.animate-flow-1 { animation: contourFlow 6s ease-in-out infinite alternate; }
.animate-flow-2 { animation: contourFlow 8s ease-in-out infinite alternate-reverse; }
.animate-flow-3 { animation: contourFlow 5s ease-in-out infinite alternate; }

@keyframes contourFlow {
  0% { stroke-dashoffset: 1; opacity: 0.3; }
  40% { opacity: 0.9; }
  100% { stroke-dashoffset: 0; opacity: 0.5; }
}
.rotate-center { transform-box: fill-box; transform-origin: center; animation: gentleRotate 12s linear infinite; }
@keyframes gentleRotate { from { rotate: 0deg; } to { rotate: 360deg; } }

@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;
  }
  svg.contour-svg path { animation: none !important; }
  .rotate-center { animation: none !important; }
}

/* 焦点可见性 */
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible { outline-offset: 4px; }
a:focus-visible { outline-offset: 4px; }

/* 响应式微调 */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  nav ul { gap: 1rem; }
  .soft-glow { padding: 1.5rem; }
}
