:root {
  --doc-hero-bg: linear-gradient(180deg, rgba(10, 122, 140, 0.1) 0%, rgba(255, 255, 255, 0.74) 100%);
  --doc-card-bg: rgba(255, 255, 255, 0.72);
  --doc-callout-bg: rgba(10, 122, 140, 0.08);
}

html {
  scroll-padding-top: 88px;
}

main.doc-page {
  padding-bottom: 64px;
}

.doc-hero {
  background: var(--doc-hero-bg);
  border-bottom: 1px solid rgba(196, 188, 171, 0.72);
  padding: 56px 0 44px;
  position: relative;
}

.doc-hero::before {
  background:
    linear-gradient(90deg, rgba(10, 122, 140, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(10, 122, 140, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  content: "";
  inset: 0;
  opacity: 0.55;
  pointer-events: none;
  position: absolute;
}

.doc-hero .container {
  position: relative;
  z-index: 1;
}

.breadcrumb {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 10px;
  margin-bottom: 18px;
}

.breadcrumb span {
  color: var(--line);
}

.doc-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.06em;
  line-height: 0.94;
  margin-bottom: 14px;
  max-width: 14ch;
}

.doc-hero p {
  color: var(--muted);
  max-width: 70ch;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.doc-layout {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 0.76fr) minmax(230px, 0.24fr);
  padding-top: 40px;
}

.doc-main {
  display: grid;
  gap: 24px;
}

.doc-toc {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 92px;
}

.toc-card,
.doc-section,
.doc-note,
.stat-card,
.doc-image-frame {
  background: var(--doc-card-bg);
  border: 1px solid rgba(196, 188, 171, 0.9);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.toc-card,
.doc-note {
  padding: 20px;
}

.toc-card h2,
.doc-section h2,
.doc-note h3,
.stat-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.toc-list,
.feature-list,
.compact-list,
.section-list {
  color: var(--muted);
  display: grid;
  gap: 10px;
  list-style: none;
}

.toc-list a:hover,
.section-list a:hover {
  color: var(--ink);
}

.doc-section {
  padding: 28px;
}

.doc-section > p,
.doc-section > li,
.doc-section td,
.doc-section th,
.doc-section figcaption,
.doc-section .section-intro,
.doc-note p,
.stat-card p {
  color: var(--muted);
}

.doc-section h2 {
  font-size: clamp(1.45rem, 2.8vw, 2.2rem);
  letter-spacing: -0.05em;
  line-height: 1.02;
  margin-bottom: 12px;
}

.doc-section h3 {
  font-size: 1rem;
  margin: 22px 0 10px;
}

.doc-section h4 {
  font-size: 0.94rem;
  margin: 18px 0 8px;
}

.doc-section > * + * {
  margin-top: 14px;
}

.section-kicker {
  color: var(--accent-strong);
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.stat-grid,
.docs-grid,
.split-grid,
.mini-grid {
  display: grid;
  gap: 18px;
}

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

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

.split-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
}

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

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  font-size: 1.6rem;
  letter-spacing: -0.06em;
  margin-bottom: 8px;
}

.feature-list li,
.compact-list li,
.section-list li {
  padding-left: 18px;
  position: relative;
}

.feature-list li::before,
.compact-list li::before,
.section-list li::before {
  color: var(--accent-strong);
  content: ">";
  left: 0;
  position: absolute;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 100%;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid rgba(196, 188, 171, 0.72);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  font-size: 0.84rem;
}

td {
  font-size: 0.9rem;
}

pre {
  background: var(--terminal-bg);
  border: 1px solid rgba(228, 240, 255, 0.14);
  border-radius: 16px;
  color: var(--terminal-ink);
  overflow-x: auto;
  padding: 18px;
}

pre code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
}

code.inline-quiet {
  background: rgba(23, 23, 23, 0.04);
  border-color: rgba(23, 23, 23, 0.08);
}

kbd {
  background: rgba(23, 23, 23, 0.08);
  border: 1px solid rgba(23, 23, 23, 0.14);
  border-radius: 6px;
  box-shadow: inset 0 -1px 0 rgba(23, 23, 23, 0.12);
  font-size: 0.85em;
  padding: 0.08rem 0.4rem;
}

.callout {
  background: var(--doc-callout-bg);
  border: 1px solid rgba(10, 122, 140, 0.18);
  border-radius: 16px;
  padding: 18px 20px;
}

.callout strong {
  display: block;
  margin-bottom: 8px;
}

.doc-image-frame {
  padding: 16px;
}

.doc-image-frame img {
  border: 1px solid rgba(196, 188, 171, 0.9);
  border-radius: 12px;
  width: 100%;
}

.doc-image-frame figcaption {
  font-size: 0.84rem;
  margin-top: 12px;
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.link-list a {
  border-bottom: 1px solid rgba(10, 122, 140, 0.24);
  color: var(--accent-strong);
}

.link-list a:hover {
  border-bottom-color: var(--accent-strong);
}

.doc-note {
  background: linear-gradient(180deg, rgba(10, 122, 140, 0.08) 0%, rgba(255, 255, 255, 0.72) 100%);
}

.section-divider {
  border-top: 1px solid rgba(196, 188, 171, 0.62);
  margin-top: 18px;
  padding-top: 18px;
}

.doc-section [id],
.doc-note [id] {
  scroll-margin-top: 92px;
}

@media (max-width: 1120px) {
  .doc-layout,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .doc-toc {
    position: static;
  }

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

@media (max-width: 760px) {
  .docs-grid,
  .mini-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .doc-hero {
    padding-top: 42px;
  }

  .doc-section,
  .toc-card,
  .doc-note {
    padding: 22px;
  }
}