:root {
  --color-bg: #0B132B;
  --color-surface: #1A2744;
  --color-surface-hover: #223256;
  --color-surface-light: #2C3B55;
  --color-text: #E2E8F0;
  --color-text-muted: #94A3B8;
  --color-accent: #F59E0B;
  --color-accent-hover: #D97706;
  --color-border: #334155;
  --color-success: #34D399;
  --font-main: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.45);
  --max-width: 1200px;
  --header-height: 72px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: var(--color-accent-hover);
}

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.1; margin-bottom: var(--space-sm); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); margin-bottom: var(--space-xs); }
p { margin-bottom: var(--space-sm); color: var(--color-text-muted); }
p strong { color: var(--color-text); }

.section {
  padding: var(--space-xl) 0;
  position: relative;
}

.section-divider {
  width: 60px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
  margin-bottom: var(--space-md);
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 19, 43, 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 {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}

.nav {
  display: flex;
  gap: var(--space-md);
}

.nav a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  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;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: var(--color-accent);
  color: #0B132B;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: var(--color-surface-light);
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-md); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-md); }

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-surface-light);
  font-weight: 600;
  color: var(--color-text);
}

td { color: var(--color-text-muted); }
tr:last-child td { border-bottom: none; }

/* FAQ Details */
details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
  transition: border-color 0.2s ease;
}

details[open] {
  border-color: var(--color-accent);
}

summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker { display: none; }
summary::after {
  content: '+';
  font-weight: bold;
  color: var(--color-accent);
}

details[open] summary::after { content: '−'; }

details p {
  padding: 0 1.25rem 1rem 1.25rem;
  margin: 0;
  font-size: 0.95rem;
}

/* Update Cards */
.update-card .meta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.update-card .time {
  font-family: var(--font-mono);
}

.update-card .actions {
  margin-top: var(--space-sm);
}

/* Related Links */
.related-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-sm);
}

.related-list li a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: all 0.2s ease;
}

.related-list li a:hover {
  border-color: var(--color-accent);
  background: var(--color-surface-hover);
}

.related-title { font-weight: 600; color: var(--color-text); }
.related-desc { font-size: 0.9rem; color: var(--color-text-muted); }

/* 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;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.footer-col h4 { color: var(--color-text); margin-bottom: var(--space-sm); font-size: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--color-text-muted); font-size: 0.9rem; }
.footer-col a:hover { color: var(--color-accent); }

.copyright {
  text-align: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-family: var(--font-mono);
}

/* SVG Animations */
.svg-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.float-card {
  animation: floatUp 6s ease-in-out infinite;
  transform-origin: center;
}

.float-card:nth-child(2) { animation-delay: -2s; animation-duration: 7s; }
.float-card:nth-child(3) { animation-delay: -4s; animation-duration: 5s; }

@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 4s ease forwards;
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

.pulse-opacity {
  animation: pulseOpacity 5s ease-in-out infinite;
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none;
  }
  .float-card, .draw-path, .pulse-opacity { animation: none !important; }
}

/* Responsive */
@media (max-width: 768px) {
  .nav { display: none; }
  h1 { font-size: 2rem; }
  .section { padding: var(--space-lg) 0; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
