:root {
  --color-bg: #f4f6f7;
  --color-surface: #ffffff;
  --color-text-primary: #2d3748;
  --color-text-secondary: #5a6b7c;
  --color-text-muted: #8a9bae;
  --color-accent: #7c9aa0;
  --color-accent-hover: #63858b;
  --color-border: #e2e8ed;
  --color-focus: #a3c4c8;
  --font-serif: "Noto Serif SC", "Source Han Serif CN", Georgia, serif;
  --font-sans: "Inter", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --shadow-soft: 0 8px 30px rgba(45, 55, 72, 0.08);
  --shadow-hover: 0 12px 40px rgba(45, 55, 72, 0.12);
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: clamp(3rem, 6vw, 6rem);
  --container-max: 1200px;
  --header-height: 72px;
}

*, *::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-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 1.5rem; }
section { padding: var(--spacing-xl) 0; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--color-text-primary); line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-bottom: var(--spacing-md); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: var(--spacing-md); position: relative; padding-bottom: 0.8rem; }
h2::after { content: ""; position: absolute; bottom: 0; left: 0; width: 48px; height: 3px; background: var(--color-accent); border-radius: 2px; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: var(--spacing-sm); }
p { margin-bottom: 1rem; color: var(--color-text-secondary); }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); font-size: 0.95rem; }

/* Header & Footer */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex; align-items: center;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 0.8rem; font-family: var(--font-serif); font-weight: 600; font-size: 1.1rem; }
.brand img { height: 36px; width: auto; }
.nav ul { display: flex; gap: var(--spacing-md); }
.nav a { font-size: 0.95rem; color: var(--color-text-secondary); font-weight: 500; padding: 0.5rem 0; position: relative; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-accent); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--color-accent); }

.footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--spacing-lg) 0 var(--spacing-md); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--spacing-md); margin-bottom: var(--spacing-lg); }
.footer-col h4 { font-size: 1rem; margin-bottom: 1rem; color: var(--color-text-primary); }
.footer-col ul li { margin-bottom: 0.6rem; }
.footer-col a { font-size: 0.9rem; color: var(--color-text-secondary); }
.footer-col a:hover { color: var(--color-accent); }
.copyright { text-align: center; font-size: 0.85rem; color: var(--color-text-muted); border-top: 1px solid var(--color-border); padding-top: var(--spacing-md); }

/* Components: Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.85rem 1.8rem; border-radius: var(--radius-md); font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: all 0.25s ease; border: none; text-align: center; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--color-accent-hover); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(124, 154, 160, 0.35); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-accent); color: var(--color-accent); }
.btn-outline:hover, .btn-outline:focus-visible { background: rgba(124, 154, 160, 0.08); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* Components: Cards */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--spacing-md); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-title { font-family: var(--font-serif); font-size: 1.15rem; margin-bottom: 0.6rem; color: var(--color-text-primary); }
.card-meta { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.5rem; }
.card-desc { font-size: 0.95rem; color: var(--color-text-secondary); line-height: 1.6; }
.card-link { display: inline-block; margin-top: 0.8rem; font-size: 0.9rem; color: var(--color-accent); font-weight: 500; }
.card-link:hover { text-decoration: underline; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--spacing-md); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--spacing-md); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--spacing-md); }

/* Components: Table */
.table-wrapper { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 1rem 1.2rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: rgba(124, 154, 160, 0.06); font-weight: 600; color: var(--color-text-primary); }
td { color: var(--color-text-secondary); }
tr:last-child td { border-bottom: none; }

/* Components: FAQ */
.faq-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 1rem; overflow: hidden; }
.faq-item summary { padding: 1.2rem 1.4rem; cursor: pointer; font-weight: 600; color: var(--color-text-primary); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; color: var(--color-accent); transition: transform 0.2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 1.4rem 1.4rem; color: var(--color-text-secondary); line-height: 1.7; }

/* Components: Steps & Lists */
.step-list { counter-reset: step; }
.step-list li { counter-increment: step; position: relative; padding-left: 3rem; margin-bottom: 1.5rem; }
.step-list li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; background: var(--color-accent); color: #fff; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 0.9rem; }
.link-list li { margin-bottom: 0.8rem; padding-left: 1.2rem; position: relative; }
.link-list li::before { content: "–"; position: absolute; left: 0; color: var(--color-accent); }
.link-list a:hover { color: var(--color-accent); text-decoration: underline; }

/* SVG Animation Utilities */
.svg-canvas { width: 100%; height: auto; max-width: 100%; overflow: visible; }
.flow-path { fill: none; stroke: var(--color-accent); stroke-width: 2; opacity: 0.4; }
.flow-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; stroke: var(--color-accent); stroke-width: 1.5; opacity: 0.6; }
.flow-dot { fill: var(--color-accent); opacity: 0.8; }
.animate-draw { animation: drawPath 8s linear infinite; }
.animate-drift { animation: driftAlong 10s linear infinite; }
.transform-origin-center { transform-box: fill-box; transform-origin: center; }

@keyframes drawPath {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes driftAlong {
  0% { transform: translate(0, 0); }
  25% { transform: translate(180px, -40px); }
  50% { transform: translate(360px, 10px); }
  75% { transform: translate(540px, -30px); }
  100% { transform: translate(720px, 0); }
}
@keyframes pulseOpacity {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .nav { display: none; } /* Simplified for single-file constraint, relies on native scroll */
  h1 { font-size: 2rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
