:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #17191d;
  --panel-2: #202329;
  --text: #f1ede4;
  --muted: #b7afa2;
  --line: #343842;
  --accent: #d5a64d;
  --accent-2: #5fb7a3;
  --danger: #d66a50;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  --pager-card-width: 24ch;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(213, 166, 77, 0.13), transparent 31rem),
    linear-gradient(145deg, #101113 0%, #171411 48%, #111719 100%);
  color: var(--text);
}

a {
  color: var(--accent-2);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.25rem;
  border-right: 1px solid var(--line);
  background: rgba(23, 25, 29, 0.94);
  backdrop-filter: blur(16px);
  overflow-y: auto;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(213, 166, 77, 0.55);
  border-radius: 8px;
  background: #241e14;
  color: var(--accent);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.search-box {
  display: block;
  margin: 1.4rem 0 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.search-box input {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.72rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111317;
  color: var(--text);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(213, 166, 77, 0.14);
}

.nav-list {
  display: grid;
  gap: 0.3rem;
}

.nav-item {
  min-width: 0;
}

.nav-row {
  display: grid;
  grid-template-columns: 1.65rem minmax(0, 1fr);
  align-items: center;
  gap: 0.15rem;
}

.nav-toggle,
.nav-toggle-spacer {
  width: 1.65rem;
  height: 1.65rem;
}

.nav-toggle {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-toggle:hover {
  background: var(--panel-2);
  color: var(--text);
}

.nav-item.expanded > .nav-row .nav-toggle {
  transform: rotate(90deg);
}

.nav-link {
  display: block;
  padding: 0.72rem 0.78rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.25;
}

.nav-link:hover,
.nav-link.active {
  background: var(--panel-2);
  color: var(--text);
}

.nav-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item.active-parent > .nav-link {
  color: var(--text);
  background: rgba(213, 166, 77, 0.08);
}

.nav-children {
  display: none;
  gap: 0.18rem;
  margin: 0.16rem 0 0.38rem 0.72rem;
  padding-left: 0.72rem;
  border-left: 1px solid var(--line);
}

.nav-item.expanded > .nav-children {
  display: grid;
}

.nav-children .nav-link {
  padding: 0.54rem 0.68rem;
  font-size: 0.9rem;
}

.nav-children .nav-children {
  margin-left: 0.45rem;
}

.content-area {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 4rem;
  padding: 0 2rem;
  border-bottom: 1px solid rgba(52, 56, 66, 0.72);
  background: rgba(16, 17, 19, 0.76);
  backdrop-filter: blur(18px);
  z-index: 10;
}

.topbar-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.icon-button {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.icon-button span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 0.23rem auto;
  background: var(--text);
}

.locale-select {
  padding: 0.48rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.doc {
  width: min(100%, 68rem);
  margin: 0 auto;
  padding: 3.2rem 2rem 5rem;
}

.doc h1 {
  margin: 0 0 1rem;
  color: #fff8eb;
  font-size: clamp(2.25rem, 4vw, 4rem);
  line-height: 0.98;
}

.doc h2 {
  margin: 2.6rem 0 1rem;
  padding-top: 0.35rem;
  color: #fff8eb;
  font-size: 1.65rem;
}

.doc h3 {
  margin: 2rem 0 0.85rem;
  color: #f6dfad;
  font-size: 1.18rem;
}

.doc p,
.doc li {
  color: var(--text);
  line-height: 1.72;
}

.doc p {
  margin: 0 0 1rem;
}

.doc ul,
.doc ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}

.doc li + li {
  margin-top: 0.28rem;
}

.table-wrap {
  margin: 1.1rem 0 1.6rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 23, 0.72);
  box-shadow: var(--shadow);
}

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

th,
td {
  padding: 0.74rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

th {
  color: #f8e6bd;
  background: rgba(213, 166, 77, 0.1);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

code {
  padding: 0.12rem 0.32rem;
  border-radius: 6px;
  background: #24262c;
  color: #f5d28a;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
}

pre {
  margin: 1.1rem 0 1.45rem;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0f12;
}

pre code {
  padding: 0;
  background: transparent;
  color: #f7e3bd;
}

.page-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.pager-slot {
  min-width: 0;
}

.pager-slot-next {
  text-align: right;
}

.pager-link {
  display: inline-grid;
  gap: 0.24rem;
  width: min(100%, var(--pager-card-width));
  min-height: 4.6rem;
  padding: 0.82rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 25, 29, 0.78);
  color: var(--text);
  text-decoration: none;
}

.pager-link:hover {
  border-color: rgba(213, 166, 77, 0.72);
  background: var(--panel-2);
}

.pager-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.pager-title {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.empty-state {
  margin-top: 3rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

@media (max-width: 860px) {
  .site-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(21rem, 86vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .icon-button {
    display: inline-block;
  }

  .topbar {
    padding: 0 1rem;
  }

  .doc {
    padding: 2rem 1rem 4rem;
  }

  .page-pager {
    grid-template-columns: 1fr;
  }

  .pager-slot-previous {
    text-align: left;
  }

  .pager-slot-next {
    text-align: right;
  }
}
