/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--bg-base);
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.015) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-green);
  text-decoration: underline;
}

ul, ol {
  padding-left: 1.25rem;
}

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* ===== CSS Variables ===== */
:root {
  /* Brand color palette */
  --bg-base: #0B0F1A;
  --bg-panel: #111826;
  --bg-lifted: #17202E;
  --accent-green: #C6FF3A;
  --accent-green-hover: #D8FF6E;
  --accent-blue: #00E5FF;
  --accent-blue-dim: rgba(0, 229, 255, 0.1);
  --text-primary: #E6EDF6;
  --text-muted: #7A8B9F;
  --divider: #243043;
  --data-positive: #69FF9D;
  --data-warning: #FFB300;

  /* Typography */
  --font-heading: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-data: "JetBrains Mono", "Roboto Mono", "SFMono-Regular", Consolas, monospace;

  /* Layout */
  --container-width: 1200px;
  --container-gutter: 1rem;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ===== Accessibility ===== */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 10000;
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background: var(--accent-green);
  color: var(--bg-base);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9375rem;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 20px rgba(198, 255, 58, 0.3);
  text-decoration: none !important;
  transition: top 0.25s var(--ease-out);
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: rgba(198, 255, 58, 0.25);
  color: var(--text-primary);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

/* ===== Layout Utilities ===== */
.container {
  width: min(var(--container-width), 100% - 2 * var(--container-gutter));
  margin-inline: auto;
}

.container-narrow {
  width: min(820px, 100% - 2 * var(--container-gutter));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-6);
}

.section-head {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: var(--space-4);
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--divider);
}

.section-kicker {
  display: block;
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--accent-blue);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-title .title-accent {
  color: var(--accent-green);
}

.section-meta {
  margin-left: auto;
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 60ch;
}

.divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin-block: var(--space-4);
}

/* ===== Header ===== */
.site-header {
  position: relative;
  z-index: 2000;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--divider);
}

.header-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
  box-shadow: 0 0 12px rgba(198, 255, 58, 0.35), 0 0 20px rgba(0, 229, 255, 0.15);
  z-index: 10000;
  pointer-events: none;
}

.header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.375rem 1rem;
  background: var(--bg-lifted);
  border-bottom: 1px solid var(--divider);
  overflow: hidden;
  white-space: nowrap;
}

.header-meta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-blue), transparent);
}

.header-coord {
  font-family: var(--font-data);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.header-motto {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.header-version {
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--accent-green);
  letter-spacing: 0.1em;
  padding: 0.125rem 0.5rem;
  border: 1px solid rgba(198, 255, 58, 0.25);
  border-radius: 4px;
  background: rgba(198, 255, 58, 0.06);
}

.header-masthead {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.75rem 1rem 1.25rem;
  overflow: hidden;
}

.header-masthead::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  transform: skewY(-2deg) scale(1.02);
  pointer-events: none;
}

.header-masthead::after {
  content: '';
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.35), transparent);
  pointer-events: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none !important;
  position: relative;
  z-index: 1;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--accent-green);
  color: var(--bg-base);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.625rem;
  line-height: 1;
  border-radius: 8px 20px 8px 20px;
  transform: skewX(-8deg);
  box-shadow: 0 0 24px rgba(198, 255, 58, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-subtitle {
  font-family: var(--font-data);
  font-size: 0.6875rem;
  color: var(--accent-blue);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.375rem;
  white-space: nowrap;
}

/* ===== Navigation ===== */
.site-nav {
  background: var(--bg-panel);
  border-top: 1px solid var(--divider);
}

.nav-list {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  max-width: var(--container-width);
  margin-inline: auto;
  padding: 0 var(--container-gutter);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.125rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none !important;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-lifted);
  text-decoration: none !important;
}

.nav-link[aria-current="page"] {
  color: var(--accent-green);
  border-bottom-color: var(--accent-green);
  background: linear-gradient(180deg, transparent 70%, rgba(198, 255, 58, 0.08) 100%);
}

.nav-index {
  font-family: var(--font-data);
  font-size: 0.6875rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.nav-link[aria-current="page"] .nav-index {
  color: var(--accent-green);
  opacity: 1;
}

/* ===== Nav Toggle (mobile) ===== */
.nav-toggle {
  display: none;
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg-lifted);
  border: 1px solid var(--divider);
  border-radius: 10px;
  cursor: pointer;
  z-index: 20;
}

.nav-toggle-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-in-out), opacity 0.3s ease;
}

.nav-toggle-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  margin-top: auto;
  background: var(--bg-panel);
  border-top: 2px solid var(--divider);
  padding-top: var(--space-5);
}

.footer-route {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: var(--container-width);
  margin: 0 auto var(--space-4);
  padding: 0 var(--container-gutter);
}

.route-node {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(198, 255, 58, 0.4);
}

.route-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-blue), transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.9fr 1.2fr;
  gap: var(--space-5);
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-gutter) var(--space-4);
}

.footer-brand-line {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--accent-green);
  color: var(--bg-base);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.9375rem;
  border-radius: 5px 12px 5px 12px;
  transform: skewX(-8deg);
  flex-shrink: 0;
}

.footer-trust {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 46ch;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.625rem;
  position: relative;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2rem;
  height: 2px;
  background: var(--accent-green);
}

.footer-list {
  list-style: none;
  padding: 0;
}

.footer-list li + li {
  margin-top: 0.25rem;
}

.footer-list a {
  display: inline-block;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none !important;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-list a:hover {
  color: var(--accent-blue);
  padding-left: 0.375rem;
}

.footer-contact-line {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding: 0.25rem 0;
  word-break: break-all;
}

.footer-bottom {
  border-top: 1px solid var(--divider);
  margin-top: var(--space-2);
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 1rem var(--container-gutter);
}

.footer-copyright {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-icp {
  font-family: var(--font-data);
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.footer-note {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 1rem var(--container-gutter) 3rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ===== Return Top ===== */
.return-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-lifted);
  border: 1px solid var(--accent-green);
  border-radius: 50%;
  color: var(--accent-green);
  font-family: var(--font-data);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.2s ease;
  z-index: 999;
}

.return-top:hover {
  background: rgba(198, 255, 58, 0.1);
  border-color: var(--accent-green);
}

.return-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== Shared Components ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--accent-green);
  color: var(--bg-base) !important;
  border-color: var(--accent-green);
  box-shadow: 0 4px 16px rgba(198, 255, 58, 0.18);
}

.btn-primary:hover {
  background: var(--accent-green-hover);
  box-shadow: 0 6px 24px rgba(198, 255, 58, 0.3);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-blue) !important;
  border-color: var(--accent-blue);
}

.btn-secondary:hover {
  background: var(--accent-blue-dim);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary) !important;
  border-color: var(--divider);
}

.btn-ghost:hover {
  background: var(--bg-lifted);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.0625rem;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 229, 255, 0.05);
  transform: translateY(-4px);
}

.card[data-accent="green"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-green), transparent);
}

.card[data-accent="blue"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), transparent);
}

.card[data-accent="warning"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--data-warning), transparent);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  background: var(--bg-lifted);
  border: 1px solid var(--divider);
  color: var(--text-primary);
  white-space: nowrap;
}

.tag-warning {
  background: rgba(255, 179, 0, 0.12);
  border-color: rgba(255, 179, 0, 0.4);
  color: var(--data-warning);
}

.tag-live {
  background: rgba(105, 255, 157, 0.1);
  border-color: rgba(105, 255, 157, 0.4);
  color: var(--data-positive);
}

.tag-featured {
  background: rgba(198, 255, 58, 0.1);
  border-color: rgba(198, 255, 58, 0.4);
  color: var(--accent-green);
}

.data-label {
  display: block;
  font-family: var(--font-data);
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

.data-value {
  display: block;
  font-family: var(--font-data);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  padding: 0.875rem 1.125rem;
  background: var(--bg-panel);
  border: 1px solid var(--divider);
  border-radius: 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--divider);
  flex-shrink: 0;
}

.legend-dot[data-color="green"] { background: var(--accent-green); }
.legend-dot[data-color="blue"] { background: var(--accent-blue); }
.legend-dot[data-color="warning"] { background: var(--data-warning); }
.legend-dot[data-color="positive"] { background: var(--data-positive); }

.coord-index {
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--accent-blue);
  letter-spacing: 0.1em;
}

/* ===== Grid ===== */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-7-5 { grid-template-columns: 7fr 5fr; }

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 1rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.breadcrumb li + li::before {
  content: '/';
  margin-right: 0.5rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.breadcrumb a {
  color: var(--accent-blue);
}

.breadcrumb [aria-current="page"] {
  color: var(--text-primary);
}

/* ===== TOC / Chapter ===== */
.toc {
  background: var(--bg-panel);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 1.25rem;
  position: sticky;
  top: 1.5rem;
}

.toc-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--divider);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0;
}

.toc-link {
  display: block;
  padding: 0.375rem 0.625rem;
  border-left: 2px solid var(--divider);
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-decoration: none !important;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.toc-link:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-lifted);
}

.toc-link[aria-current="true"] {
  color: var(--accent-green);
  border-color: var(--accent-green);
  background: rgba(198, 255, 58, 0.05);
}

[data-chapter] {
  scroll-margin-top: 2rem;
}

/* ===== Image Placeholder ===== */
.img-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-lifted) 0%, var(--bg-panel) 50%, var(--bg-lifted) 100%);
  border: 1px solid var(--divider);
  border-radius: 14px;
  min-height: 180px;
}

.img-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.img-frame[data-ratio="16:9"] { aspect-ratio: 16 / 9; }
.img-frame[data-ratio="4:3"] { aspect-ratio: 4 / 3; }
.img-frame[data-ratio="1:1"] { aspect-ratio: 1 / 1; }

.img-caption {
  position: relative;
  z-index: 1;
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(11, 15, 26, 0.75);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
}

/* ===== Responsive: Tablet & Mobile ===== */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-7-5 { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .section {
    padding-block: var(--space-5);
  }

  .header-meta {
    justify-content: center;
    padding: 0.3125rem 0.75rem;
  }

  .header-coord,
  .header-motto {
    display: none;
  }

  .header-version {
    font-size: 0.6875rem;
  }

  .header-masthead {
    justify-content: flex-start;
    padding: 1rem 3.5rem 1rem 1rem;
  }

  .brand-mark {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.25rem;
  }

  .brand-name {
    font-size: 1.625rem;
  }

  .brand-subtitle {
    font-size: 0.625rem;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: var(--bg-panel);
    border-top: 1px solid var(--divider);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  }

  .site-nav[data-open] {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem var(--container-gutter) 1rem;
    gap: 0;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    display: flex;
    width: 100%;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(36, 48, 67, 0.5);
    border-radius: 8px;
    font-size: 0.9375rem;
  }

  .nav-link[aria-current="page"] {
    background: rgba(198, 255, 58, 0.06);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .footer-brand + .footer-nav,
  .footer-brand + .footer-legal,
  .footer-brand + .footer-contact {
    margin-top: var(--space-3);
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .return-top {
    right: 1rem;
    bottom: 1rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-wrap: wrap;
  }

  .section-meta {
    margin-left: 0;
    width: 100%;
  }
}
