:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #4a4a4a;
  --color-text-muted: #777777;
  --color-accent: #25D366;
  --color-accent-hover: #1ea852;
  --color-border: #e2e2e2;
  --color-code-bg: #f5f5f5;
  --color-highlight-bg: #eafbf1;
  --font-serif: "Noto Serif SC", "Source Han Serif CN", Georgia, serif;
  --font-sans: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --spacing-unit: 1rem;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-hover: 0 6px 16px rgba(0,0,0,0.1);
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-bottom: 0.6em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.5em; }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); margin-bottom: 0.4em; }
p { margin-bottom: 1em; color: var(--color-text-secondary); }
strong { font-weight: 600; color: var(--color-text-primary); }
small { font-size: 0.85em; color: var(--color-text-muted); }

/* Links & CTAs */
a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-base);
}
a:hover, a:focus-visible {
  color: var(--color-accent-hover);
  outline: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}
.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 4px rgba(37, 211, 102, 0.2);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
  color: #fff;
  text-decoration: none;
}

/* Layout */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--color-border);
}
section:last-of-type {
  border-bottom: none;
}
.grid {
  display: grid;
  gap: 2rem;
}
.grid-cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Header & Footer */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-text-primary);
  text-decoration: none;
}
.brand img {
  height: 32px;
  width: auto;
  object-fit: contain;
}
nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}
nav a {
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 0.25rem 0;
  position: relative;
}
nav a[aria-current="page"], nav a:hover {
  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);
}
footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 3rem 0;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.footer-links a:hover { color: var(--color-text-primary); }
.copyright {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}
.card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.card-excerpt {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
th {
  background: var(--color-code-bg);
  font-weight: 600;
  color: var(--color-text-primary);
}
tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background: rgba(0,0,0,0.015); }

/* FAQ */
details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}
details:hover { box-shadow: var(--shadow-card); }
summary {
  padding: 1rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  transition: background var(--transition-base);
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-weight: 400;
  font-size: 1.2rem;
  transition: transform 0.2s;
}
details[open] summary {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-code-bg);
}
details[open] summary::after { transform: rotate(45deg); }
details p {
  padding: 1rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* SVG Animation Utilities */
.svg-flow-container {
  position: relative;
  width: 100%;
  max-width: 580px;
  margin: 2rem auto;
  height: 140px;
  overflow: hidden;
}
.svg-flow-container svg {
  width: 100%;
  height: 100%;
  display: block;
}
.contour-line {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.5;
  opacity: 0.5;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
@keyframes contour-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.animate-contour {
  animation: contour-flow 8s linear infinite;
}
.animate-contour-alt {
  animation: contour-flow 10s linear infinite reverse;
  animation-delay: 2s;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .animate-contour, .animate-contour-alt { animation: none; }
  .btn, .card, summary { transition: none; transform: none; }
  html { scroll-behavior: auto; }
}

/* Responsive */
@media (max-width: 768px) {
  nav ul { gap: 1.2rem; }
  section { padding: 3rem 0; }
  .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
}
