:root {
  --color-bg: #F7F8FA;
  --color-surface: #FFFFFF;
  --color-text-primary: #111827;
  --color-text-secondary: #4B5563;
  --color-text-muted: #6B7280;
  --color-border: #E5E7EB;
  --color-accent: #25D366;
  --color-accent-hover: #1EBE57;
  --color-accent-bg: #ECFDF5;
  --font-heading: 'Noto Serif SC', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-elevated: 0 4px 12px rgba(0,0,0,0.08);
  --max-w: 1120px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-body); background: var(--color-bg); color: var(--color-text-primary); line-height: 1.65; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-text-primary); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.15; text-wrap: balance; margin-bottom: var(--space-sm); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); line-height: 1.25; margin-bottom: var(--space-sm); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); line-height: 1.3; margin-bottom: var(--space-xs); }
p { margin-bottom: var(--space-sm); color: var(--color-text-secondary); }
small { font-size: 0.875rem; color: var(--color-text-muted); }

/* Layout */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-md); }
section { padding: var(--space-lg) 0; }
.grid-auto { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }

/* Header & Nav */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--color-border); height: var(--header-h); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; font-size: 1.125rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav-list { display: flex; gap: var(--space-md); }
.nav-list a { font-size: 0.95rem; font-weight: 500; padding: 0.25rem 0; position: relative; transition: color 0.2s; }
.nav-list a:hover, .nav-list a[aria-current="page"] { color: var(--color-accent); }
.nav-list a[aria-current="page"]::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background: var(--color-accent); border-radius: 1px; }

/* Footer */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--space-lg) 0 var(--space-md); margin-top: var(--space-xl); }
.footer-grid { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer-col h4 { font-size: 1rem; margin-bottom: var(--space-sm); }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--color-border); text-align: center; color: var(--color-text-muted); font-size: 0.875rem; }

/* Components: Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-weight: 500; font-size: 0.95rem; border: none; cursor: pointer; transition: all 0.2s ease; }
.btn-primary { background: var(--color-accent); color: #fff; box-shadow: 0 2px 4px rgba(37,211,102,0.25); }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(37,211,102,0.3); }
.btn-outline { background: transparent; border: 1px solid var(--color-border); color: var(--color-text-primary); }
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Components: Cards */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-md); box-shadow: var(--shadow-card); transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elevated); }
.card-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 0.85rem; color: var(--color-text-muted); }
.card-title { margin-bottom: 0.5rem; font-weight: 600; }
.card-link { font-size: 0.9rem; font-weight: 500; color: var(--color-accent); margin-top: var(--space-sm); display: inline-block; }

/* Components: Table */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; 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: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: #F9FAFB; font-weight: 600; font-size: 0.9rem; }
td { font-size: 0.95rem; color: var(--color-text-secondary); }
tr:last-child td { border-bottom: none; }

/* Components: FAQ */
.faq-item { border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 0.75rem; background: var(--color-surface); }
.faq-item summary { padding: 1rem; cursor: pointer; font-weight: 500; list-style: none; position: relative; 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.25rem; font-weight: 400; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-answer { padding: 0 1rem 1rem; color: var(--color-text-secondary); line-height: 1.6; }

/* Components: Related Links */
.related-list { display: flex; flex-direction: column; gap: 0.75rem; }
.related-item { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.75rem; border-radius: var(--radius-sm); transition: background 0.2s; }
.related-item:hover { background: #F3F4F6; }
.related-arrow { width: 16px; height: 16px; stroke: var(--color-accent); flex-shrink: 0; }
.related-text { font-size: 0.95rem; }
.related-desc { font-size: 0.85rem; color: var(--color-text-muted); margin-left: auto; }

/* SVG Utilities */
.svg-icon { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hero-svg-container { position: absolute; inset: 0; z-index: -1; overflow: hidden; opacity: 0.6; }
.hero-svg-container svg { width: 100%; height: 100%; }
.contour-line { fill: none; stroke: var(--color-text-secondary); stroke-width: 1.2; opacity: 0.15; }
.contour-line.animated { animation: contour-flow 12s linear infinite alternate; }
.float-anim { animation: gentle-float 7s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .contour-line.animated, .float-anim { animation: none !important; }
}
@keyframes contour-flow {
  0% { stroke-dasharray: 1; stroke-dashoffset: 0; }
  100% { stroke-dasharray: 1; stroke-dashoffset: 1; }
}
@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.focus-ring:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
