:root {
  --bg: #08111f;
  --panel: rgba(11, 19, 35, 0.88);
  --panel-strong: #101b31;
  --line: rgba(148, 163, 184, 0.14);
  --text: #e5edf8;
  --muted: #95a6c6;
  --accent: #64d2ff;
  --accent-2: #8b5cf6;
  --success: #22c55e;
  --warning: #f59e0b;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(100, 210, 255, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.16), transparent 28%),
    linear-gradient(180deg, #07101d 0%, #0b1426 100%);
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 24px 20px;
  border-right: 1px solid var(--line);
  background: rgba(7, 13, 25, 0.82);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101e;
  box-shadow: 0 16px 38px rgba(100, 210, 255, 0.22);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
}

.brand h1,
.hero h2,
.doc-section h3,
.panel h4 {
  margin: 0;
}

.sidebar-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.search span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.search input:focus {
  border-color: rgba(100, 210, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(100, 210, 255, 0.12);
}

.ghost-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 14px;
  cursor: pointer;
}

.toc {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-right: 4px;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 10px;
  transition: 0.18s ease;
}

.toc a:hover,
.toc a.active {
  color: var(--text);
  background: rgba(100, 210, 255, 0.1);
}

.content {
  padding: 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-bottom: 24px;
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  padding: 28px;
}

.lede {
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.72;
}

.hero-meta {
  display: grid;
  gap: 12px;
}

.meta-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.doc-section {
  margin-bottom: 18px;
}

.doc-section > h3 {
  margin-bottom: 14px;
  font-size: 1.35rem;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  padding: 20px;
}

.panel p,
.panel li {
  color: var(--muted);
  line-height: 1.68;
}

.panel ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.panel.warning {
  border-color: rgba(245, 158, 11, 0.28);
}

.panel.success {
  border-color: rgba(34, 197, 94, 0.28);
}

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.flow-node,
.flow-arrow {
  border-radius: 14px;
  padding: 12px 14px;
}

.flow-node {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.flow-arrow {
  color: var(--accent);
  font-weight: 800;
}

.code-block {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #09111f;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  color: #cce4ff;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.simple-table th,
.simple-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.simple-table th {
  color: var(--text);
}

.hidden-by-search {
  display: none;
}

@media (max-width: 1120px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .toc {
    max-height: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .content {
    padding: 18px;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .hero,
  .panel {
    border-radius: 20px;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 0;
  }

  .hero,
  .panel {
    background: #fff;
    color: #000;
    border: 1px solid #ccc;
    box-shadow: none;
  }

  .panel p,
  .panel li,
  .lede,
  .meta-card span {
    color: #222;
  }
}
