:root {
  --color-bg: #070b08;
  --color-surface: #0f1510;
  --color-surface-hover: #161f18;
  --color-border: #1e2b22;
  --color-text: #e2ece6;
  --color-text-muted: #8fa396;
  --color-brand-dark: #004b23;
  --color-brand-mid: #0e7a3e;
  --color-brand-lime: #25d366;
  --color-accent: #7af9a8;
  --color-overlay: rgba(10, 15, 12, 0.65);

  --font-base: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-base);
  
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --text-body: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-heading-1: clamp(2.5rem, 4.5vw + 0.5rem, 4rem);
  --text-heading-2: clamp(1.75rem, 3vw + 0.25rem, 2.5rem);
  --text-heading-3: clamp(1.25rem, 1.5vw + 0.1rem, 1.5rem);

  --container-max: 1200px;
  --header-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-base);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
button { cursor: pointer; font: inherit; background: none; border: none; color: inherit; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

/* Typography */
.display { font-size: var(--text-heading-1); line-height: 1.08; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.heading-1 { font-size: var(--text-heading-2); line-height: 1.15; font-weight: 600; text-wrap: balance; margin-bottom: var(--space-sm); }
.heading-2 { font-size: var(--text-heading-3); line-height: 1.2; font-weight: 600; margin-bottom: var(--space-xs); }
.text-muted { color: var(--color-text-muted); }

/* Layout Sections */
section { padding-block: var(--space-xl); position: relative; }
.section-alt { background-color: var(--color-surface); }
.section-grid { display: grid; gap: var(--space-lg); align-items: center; }
@media (min-width: 900px) { .section-grid { grid-template-columns: 1fr 1fr; } }

/* Header & Footer */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 11, 8, 0.85); 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-logo { display: flex; align-items: center; gap: var(--space-xs); font-weight: 600; font-size: 1.1rem; }
.brand-logo img { height: 32px; width: auto; }
.nav-desktop { display: none; gap: var(--space-md); }
@media (min-width: 768px) { .nav-desktop { display: flex; } }
.nav-link { font-size: 0.95rem; font-weight: 500; padding-block: 0.5rem; position: relative; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--color-brand-lime); }
.nav-link[aria-current="page"]::after {
  content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--color-brand-dark), var(--color-brand-lime));
}
.footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding-block: var(--space-lg); }
.footer-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.footer-col h3 { font-size: 1rem; margin-bottom: var(--space-xs); color: var(--color-accent); }
.footer-col a { display: block; margin-block: 0.4rem; font-size: 0.95rem; color: var(--color-text-muted); }
.footer-col a:hover { color: var(--color-brand-lime); }
.copyright { text-align: center; margin-top: var(--space-lg); font-size: 0.85rem; color: var(--color-text-muted); border-top: 1px solid var(--color-border); padding-top: var(--space-md); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem; border-radius: var(--radius-md); font-weight: 600; font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:focus-visible { outline: 2px solid var(--color-brand-lime); outline-offset: 3px; }
.btn-primary {
  background: linear-gradient(135deg, var(--color-brand-dark), var(--color-brand-mid));
  color: #fff; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35); }
.btn-secondary {
  border: 1px solid var(--color-brand-lime); color: var(--color-brand-lime); background: transparent;
}
.btn-secondary:hover { background: rgba(37, 211, 102, 0.1); }

/* Cards & Components */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-md); transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--color-brand-mid); transform: translateY(-4px); }
.card-icon { width: 48px; height: 48px; margin-bottom: var(--space-sm); color: var(--color-brand-lime); }
.feature-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.use-case-list li { position: relative; padding-left: 1.5rem; margin-bottom: 0.75rem; }
.use-case-list li::before {
  content: ""; position: absolute; left: 0; top: 0.5rem; width: 8px; height: 8px;
  background: var(--color-brand-lime); border-radius: 50%;
}
.steps-grid { counter-reset: step; display: grid; gap: var(--space-md); }
.step-item { counter-increment: step; background: var(--color-surface); padding: var(--space-md); border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.step-item::before {
  content: counter(step); display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; background: var(--color-brand-dark); color: var(--color-accent);
  border-radius: 50%; font-weight: 700; font-size: 0.9rem; margin-right: 0.75rem; vertical-align: middle;
}

/* Table */
.table-wrapper { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-surface-hover); font-weight: 600; color: var(--color-accent); }
td { background: var(--color-surface); }
tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-list { display: grid; gap: var(--space-sm); }
details { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.25rem; color: var(--color-brand-lime); transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 0.75rem; color: var(--color-text-muted); }

/* Updates & Related */
.update-card { display: flex; flex-direction: column; height: 100%; }
.update-meta { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.related-list { display: grid; gap: 0.75rem; }
.related-item { display: flex; justify-content: space-between; align-items: baseline; padding: 0.75rem; border-bottom: 1px dashed var(--color-border); }
.related-item:hover { color: var(--color-brand-lime); }
.related-desc { font-size: 0.9rem; color: var(--color-text-muted); display: block; margin-top: 0.25rem; }

/* Focus & Accessibility */
:focus-visible { outline: 2px solid var(--color-brand-lime); outline-offset: 2px; }

/* SVG Animation Base */
.anim-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.anim-pulse { animation: pulse 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-spin { animation: spin 16s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-flow { animation: flow 6s ease-in-out infinite alternate; }

@keyframes drawAnim {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes flow {
  0% { stroke-dashoffset: 0.2; }
  100% { stroke-dashoffset: -0.2; }
}
.anim-draw { animation: drawAnim 3s ease-out forwards; }

@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;
  }
  .anim-path, .anim-pulse, .anim-spin, .anim-flow, .anim-draw {
    animation: none !important;
    stroke-dashoffset: 0 !important;
  }
}
