:root {
  --bg-primary: #080808;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --text-primary: #ededed;
  --text-secondary: #9a9a9a;
  --text-muted: #666666;
  --accent-gold: #c4a261;
  --accent-gold-hover: #dab876;
  --accent-gold-dim: rgba(196, 162, 97, 0.15);
  --border-subtle: rgba(196, 162, 97, 0.25);
  --border-solid: #c4a261;
  --font-display: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --container-max: 1180px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --space-section: 5rem;
  --transition-fast: 0.2s ease;
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); line-height: 1.15; margin-bottom: 1.2rem; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-top: 3.5rem; margin-bottom: 1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border-subtle); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); color: var(--accent-gold); margin-bottom: 0.6rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); max-width: 68ch; }
strong { color: var(--text-primary); font-weight: 600; }

a { color: var(--accent-gold); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-gold-hover); }

/* Layout */
.container {
  width: 92%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  padding: var(--space-section) 0;
  position: relative;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.8rem;
  margin-top: 1.5rem;
}

.flex-center { display: flex; justify-content: center; align-items: center; gap: 1rem; }
.text-center { text-align: center; }
.mt-lg { margin-top: 2.5rem; }
.mb-md { margin-bottom: 1.5rem; }

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.9rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.brand img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  font-size: 0.95rem;
}

.main-nav a {
  color: var(--text-secondary);
  position: relative;
}

.main-nav a[aria-current="page"],
.main-nav a:hover {
  color: var(--accent-gold);
  text-decoration: none;
}

.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gold);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #d4b87a, #b89a5e);
  color: #0a0a0a;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e0c98f, #d4b87a);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212, 184, 122, 0.35);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-solid);
  color: var(--accent-gold);
}

.btn-outline:hover {
  background: var(--accent-gold-dim);
  text-decoration: none;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  transition: transform var(--transition-base), border-color var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  margin-top: 1.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.version-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.version-table th,
.version-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.version-table th {
  background: var(--bg-secondary);
  color: var(--accent-gold);
  font-family: var(--font-display);
  font-weight: 600;
}

.version-table tr:last-child td { border-bottom: none; }
.version-table tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

/* FAQ */
.faq-list details {
  margin-bottom: 0.8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.faq-list summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--accent-gold); font-size: 1.2rem; font-weight: 400; transition: transform var(--transition-fast); }
details[open] summary::after { transform: rotate(45deg); }

.faq-list details[open] { border-color: var(--border-solid); }
.faq-list details p { padding: 0 1.2rem 1rem; margin: 0; color: var(--text-secondary); font-size: 0.95rem; }

/* SVG Animation Base */
.svg-visual {
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.svg-visual svg {
  width: 100%;
  height: auto;
}

.geo-element {
  transform-box: fill-box;
  transform-origin: center;
}

.spin-slow { animation: geoRotate 18s linear infinite; }
.spin-reverse { animation: geoRotateRev 22s linear infinite; }
.pulse-align { animation: geoAlign 6s ease-in-out infinite alternate; }

.draw-stroke {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: strokeDraw 8s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes geoRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes geoRotateRev { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
@keyframes geoAlign { 0% { transform: scale(0.92) translateX(-4px); opacity: 0.8; } 100% { transform: scale(1) translateX(0); opacity: 1; } }
@keyframes strokeDraw { 0% { stroke-dashoffset: 1; opacity: 0.6; } 50% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: -1; opacity: 0.6; } }

/* Utilities & Focus */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 3px; }

/* Responsive */
@media (max-width: 768px) {
  .main-nav ul { gap: 1.2rem; }
  .grid-auto { grid-template-columns: 1fr; }
  section { padding: 3rem 0; }
  h1 { margin-bottom: 0.8rem; }
}

/* Page-specific tweaks */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 70% 30%, rgba(196, 162, 97, 0.08) 0%, transparent 60%),
              linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
}

.ui-mockup {
  display: flex;
  background: #1a1a1a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 0.9rem;
  margin-top: 2rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}

.ui-sidebar { width: 28%; background: #111; border-right: 1px solid var(--border-subtle); padding: 1rem; }
.ui-chat { flex: 1; background: #0d0d0d; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; }
.bubble { max-width: 75%; padding: 0.6rem 1rem; border-radius: 6px; line-height: 1.4; }
.bubble-left { background: #222; color: #ddd; align-self: flex-start; border-bottom-left-radius: 0; }
.bubble-right { background: #005c4b; color: #fff; align-self: flex-end; border-bottom-right-radius: 0; }
.ui-bar { height: 48px; border-bottom: 1px solid var(--border-subtle); background: #141414; display: flex; align-items: center; padding: 0 1rem; color: var(--text-secondary); }
