﻿:root {
  --bg: #f7f7f8;
  --line: #e7e7eb;
  --text: #1f232a;
  --muted: #6d717a;
  --nav: #60656f;
  --active: #34295f;
  --active-bg: #f0ecff;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 16px;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfc;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-box {
  width: 34px;
  height: 34px;
  border-radius: 2px;
  background: #090909;
  overflow: hidden;
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
}

.search-box {
  width: 280px;
  max-width: 46vw;
  height: 44px;
  border: 1px solid #d9dbe1;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  background: #fafafa;
  position: relative;
}

.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  font: inherit;
  font-size: 16px;
  color: #656973;
}

.search-icon {
  color: #8a8f9a;
  font-size: 17px;
}

.kbd {
  font-size: 13px;
  color: #737782;
  border: 1px solid #d3d6de;
  border-radius: 8px;
  padding: 1px 6px;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border: 1px solid #d6d9e1;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20, 24, 35, 0.12);
  overflow: hidden;
  z-index: 70;
}

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

.search-result-item {
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 9px 10px;
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.search-result-item:hover {
  background: #f3f5fa;
}

.search-result-item strong {
  font-size: 14px;
  color: #1f2530;
}

.search-result-item small {
  font-size: 12px;
  color: #747b89;
}

.search-result-empty {
  padding: 10px;
  font-size: 13px;
  color: #7b8190;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid #d6d8de;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 20px;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  margin-top: 64px;
  min-height: calc(100vh - 64px);
}

.left-sidebar {
  border-right: 1px solid var(--line);
  background: #f6f6f8;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  overflow: hidden;
}

.menu {
  overflow: auto;
  padding-right: 6px;
}

.menu-group-label {
  color: #555b65;
  font-size: 25px;
  margin: 10px 8px 6px;
}

.menu-item,
.submenu-item,
.parent-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--nav);
  font: inherit;
  font-size: 18px;
  padding: 8px 9px;
  cursor: pointer;
}

.menu-item:hover,
.submenu-item:hover,
.parent-item:hover { background: #efeff3; }

.menu-item.active,
.submenu-item.active,
.parent-item.active {
  color: var(--active);
  font-weight: 700;
  background: var(--active-bg);
}

.parent-item { justify-content: space-between; }

.parent-main {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.chev {
  font-size: 18px;
  color: #8d91a0;
  transition: transform 0.2s ease;
  transform-origin: center;
}

.parent-block.open .chev {
  transform: rotate(90deg);
}

.submenu {
  margin: 2px 0 8px 12px;
  padding-left: 11px;
  border-left: 2px solid #e6e7eb;
}

.submenu.hidden { display: none; }

.submenu-item {
  font-size: 16px;
  color: #727784;
  padding: 7px 9px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 24px;
  padding: 28px 30px 52px;
}

.toc-area {
  border-left: 1px solid #ececf0;
  padding-left: 20px;
  position: sticky;
  top: 82px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow: auto;
}

.hero-banner {
  width: 100%;
  height: 180px;
  border-radius: 14px;
  background: #0f1218 url("./hero-bird.png/pngtree-picture-of-a-blue-bird-on-a-black-background-image_2937385.jpg") center/cover no-repeat;
  margin-bottom: 16px;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.page-title {
  margin: 0;
  font-size: 52px;
  line-height: 1.08;
  font-weight: 800;
}

.page-subtitle {
  font-size: 18px;
  color: #6c707a;
  margin: 8px 0 16px;
}

.copy-btn {
  border: 1px solid #d8dbe1;
  background: #fafafa;
  border-radius: 11px;
  color: #676b76;
  padding: 7px 12px;
  font: inherit;
  font-size: 15px;
}

.body-text,
.body-text p,
.body-text li {
  font-size: 17px;
  line-height: 1.5;
  color: #2e3239;
}

.body-text h2 {
  font-size: 38px;
  line-height: 1.2;
  margin: 30px 0 14px;
  color: #1f232a;
}

.body-text h3 {
  font-size: 24px;
  margin: 20px 0 10px;
}

.body-text ul {
  margin: 0;
  padding-left: 26px;
}

.body-text hr {
  border: 0;
  border-top: 1px solid #e1e2e8;
  margin: 18px 0 22px;
}

.doc-shot {
  margin: 18px 0 8px;
}

.doc-shot-image {
  display: block;
  width: 100%;
  max-width: 1100px;
  border: 1px solid #d9dde7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(26, 35, 61, 0.08);
}

.link-card {
  border: 1px solid #dddfe6;
  border-radius: 10px;
  background: #f7f7f8;
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 17px;
  color: #2f333a;
  margin: 10px 0;
  cursor: pointer;
}

.notice { color: #f13f3f; }

.toc-title {
  color: #3d2f73;
  font-size: 16px;
  font-weight: 700;
  margin: 6px 0 14px;
}

.toc-title-link {
  display: block;
  text-decoration: none;
}

.toc-title-link.active {
  color: #332a63;
}

.toc-link {
  display: block;
  color: #6f7380;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.35;
  margin-bottom: 12px;
  padding: 4px 8px;
  border-radius: 8px;
}

.toc-link.active {
  color: #332a63;
  background: #f1eefb;
  font-weight: 600;
}

.toc-section {
  scroll-margin-top: 86px;
}

.page-nav {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.page-nav.single {
  grid-template-columns: minmax(260px, 1fr);
  max-width: 540px;
}

.page-nav-btn {
  border: 1px solid #d7d9e0;
  border-radius: 8px;
  background: #f8f8fa;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.page-nav-meta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.page-nav-meta small {
  color: #777b86;
  font-size: 14px;
}

.page-nav-meta strong {
  font-size: 16px;
  color: #22262d;
  line-height: 1.2;
}

.page-nav-arrow {
  color: #8a8f9a;
  font-size: 30px;
  line-height: 1;
}

.page-updated {
  margin-top: 14px;
  color: #7b808b;
  font-size: 17px;
}

.theme-switcher {
  position: fixed;
  right: 18px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}

.theme-switcher button {
  border: 1px solid #dadce3;
  background: #f4f4f8;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 16px;
  color: #636874;
  cursor: pointer;
}

.theme-switcher button.active {
  background: #e8e3fb;
  border-color: #d1c9f5;
  color: #3d326d;
}

body[data-theme="dark"] {
  background: #15161a;
  color: #f3f4f6;
}

body[data-theme="dark"] .topbar {
  background: #17181d;
  border-bottom-color: #2a2c33;
}

body[data-theme="dark"] .shell,
body[data-theme="dark"] .left-sidebar {
  background: #17181d;
}

body[data-theme="dark"] .left-sidebar {
  border-right-color: #2a2c33;
}

body[data-theme="dark"] .menu-item,
body[data-theme="dark"] .submenu-item,
body[data-theme="dark"] .parent-item {
  color: #a9adb7;
}

body[data-theme="dark"] .menu-item:hover,
body[data-theme="dark"] .submenu-item:hover,
body[data-theme="dark"] .parent-item:hover {
  background: #21242c;
}

body[data-theme="dark"] .menu-item.active,
body[data-theme="dark"] .submenu-item.active,
body[data-theme="dark"] .parent-item.active {
  background: #252833;
  color: #e8eaf0;
}

body[data-theme="dark"] .search-box {
  background: #171a20;
  border-color: #343842;
}

body[data-theme="dark"] .search-box input,
body[data-theme="dark"] .search-icon,
body[data-theme="dark"] .kbd {
  color: #c0c4ce;
}

body[data-theme="dark"] .search-results {
  background: #1b1e25;
  border-color: #343842;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .search-result-item {
  background: #1b1e25;
}

body[data-theme="dark"] .search-result-item:hover {
  background: #252934;
}

body[data-theme="dark"] .search-result-item strong {
  color: #eef0f4;
}

body[data-theme="dark"] .search-result-item small,
body[data-theme="dark"] .search-result-empty {
  color: #a5acba;
}

body[data-theme="dark"] .main-grid,
body[data-theme="dark"] .content-area {
  background: #15161a;
}

body[data-theme="dark"] .toc-area {
  border-left-color: #2a2c33;
}

body[data-theme="dark"] .body-text,
body[data-theme="dark"] .body-text p,
body[data-theme="dark"] .body-text li,
body[data-theme="dark"] .page-title,
body[data-theme="dark"] .body-text h1,
body[data-theme="dark"] .body-text h2,
body[data-theme="dark"] .body-text h3,
body[data-theme="dark"] .body-text h4,
body[data-theme="dark"] .body-text h5,
body[data-theme="dark"] .body-text h6,
body[data-theme="dark"] .body-text strong,
body[data-theme="dark"] .body-text b,
body[data-theme="dark"] .body-text span,
body[data-theme="dark"] .link-card,
body[data-theme="dark"] .link-card span,
body[data-theme="dark"] .page-nav-btn,
body[data-theme="dark"] .page-nav-btn * {
  color: #f1f2f4;
}

body[data-theme="dark"] a {
  color: #cfc9ff;
}

body[data-theme="dark"] .page-subtitle,
body[data-theme="dark"] .toc-link,
body[data-theme="dark"] .page-updated {
  color: #a8acb6;
}

body[data-theme="dark"] .toc-title,
body[data-theme="dark"] .toc-link.active {
  color: #cfc9ff;
}

body[data-theme="dark"] .toc-link.active {
  background: #242734;
}

body[data-theme="dark"] .body-text hr {
  border-top-color: #2a2c33;
}

body[data-theme="dark"] .page-nav-btn {
  background: #1a1c23;
  border-color: #2f323a;
}

body[data-theme="dark"] .page-nav-meta small {
  color: #9fa4af;
}

body[data-theme="dark"] .page-nav-meta strong {
  color: #f0f1f3;
}

body[data-theme="dark"] .theme-switcher button {
  background: #1c1e25;
  border-color: #343741;
  color: #b0b5c0;
}

body[data-theme="dark"] .theme-switcher button.active {
  background: #2a2c37;
  border-color: #3f4350;
  color: #e6e8ee;
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 280px minmax(0, 1fr); }
  .main-grid { grid-template-columns: minmax(0, 1fr); }
  .toc-area {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 16px 0 0;
  }
}

@media (max-width: 920px) {
  .mobile-menu-btn { display: inline-flex; }
  .search-box {
    width: 220px;
    height: 42px;
  }
  .shell { grid-template-columns: 1fr; }
  .left-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    transform: translateX(-104%);
    transition: transform 0.2s ease;
    z-index: 40;
    box-shadow: 10px 0 26px rgba(19, 21, 30, 0.12);
  }
  .left-sidebar.open { transform: translateX(0); }
  .main-grid { padding: 20px 16px 56px; }
  .brand-text { font-size: 28px; }
  .page-title { font-size: 40px; }
  .page-subtitle { font-size: 18px; }
  .body-text,
  .body-text p,
  .body-text li { font-size: 18px; }
  .body-text h2 { font-size: 30px; }
  .hero-banner { height: 170px; }
  .page-nav {
    grid-template-columns: 1fr;
  }
}



