:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --panel-soft: #f3f7ff;
  --text: #121317;
  --muted: #4c5565;
  --border: #d8e2ef;
  --accent: #2f6fff;
  --accent-soft: #e7efff;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 14px 38px rgba(16, 31, 62, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Google Sans Flex", system-ui, sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.docs-topbar .inner {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1.1rem;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.docs-brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 8px;
  background: linear-gradient(140deg, #2f6fff 0%, #1fcf77 100%);
}

.docs-search {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  padding: 0.45rem 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.docs-search kbd {
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-size: 0.75rem;
  padding: 0.05rem 0.35rem;
  background: #fff;
}

.docs-theme-toggle {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: #24344d;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.docs-theme-toggle:hover {
  text-decoration: none;
  background: #e2ecff;
}

.docs-topbar-side {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-self: end;
  gap: 0.35rem;
}

.docs-topbar-side > a {
  font-size: 0.9rem;
}

.docs-layout {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 260px;
  gap: 1rem;
  padding: 1rem;
}

.docs-sidebar,
.docs-toc,
.docs-content {
  min-height: calc(100vh - 78px);
}

.docs-sidebar {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 1rem 0.85rem;
  position: sticky;
  top: 78px;
  height: calc(100vh - 94px);
  overflow: auto;
}

.docs-nav-group {
  margin-bottom: 1rem;
}

.docs-nav-title {
  margin: 0 0 0.45rem;
  padding: 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: #5d6a80;
  font-weight: 700;
}

.docs-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav-list a {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 9px;
  color: #2a3445;
  font-size: 0.93rem;
}

.docs-nav-list a:hover {
  background: var(--panel-soft);
  text-decoration: none;
}

.docs-nav-list a.is-active {
  background: var(--accent-soft);
  color: #173f9f;
  font-weight: 600;
}

.docs-content {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
}

.docs-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.84rem;
  color: var(--muted);
}

.docs-hero-title {
  margin: 0.6rem 0 0.3rem;
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  line-height: 1.15;
}

.docs-subtitle {
  margin: 0.15rem 0 1rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 74ch;
}

.docs-meta {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  color: #64738c;
  font-size: 0.83rem;
}

.docs-callout {
  border: 1px solid #c8dafd;
  background: #f3f8ff;
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  color: #27488e;
  margin: 0.8rem 0 1.1rem;
}

.docs-content h2,
.docs-content h3,
.docs-content h4 {
  scroll-margin-top: 94px;
}

.docs-content h2 {
  margin-top: 1.55rem;
  margin-bottom: 0.65rem;
  font-size: 1.35rem;
}

.docs-content h3 {
  margin-top: 1.3rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.docs-content p,
.docs-content li {
  line-height: 1.72;
  color: #263041;
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.2rem;
}

.docs-figure {
  margin: 1rem 0 1.15rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.docs-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.docs-figure figcaption {
  padding: 0.65rem 0.8rem;
  border-top: 1px solid var(--border);
  color: #536077;
  font-size: 0.86rem;
}

.docs-code {
  position: relative;
  margin: 0.8rem 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #121317;
  color: #e7ecf5;
  overflow: auto;
}

.docs-code pre {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  font-size: 0.88rem;
  line-height: 1.62;
  font-family: Consolas, "Courier New", monospace;
}

.docs-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 1px solid #46516a;
  border-radius: 8px;
  background: #1d2331;
  color: #d9e1f0;
  font-size: 0.76rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}

.docs-copy-btn:hover {
  background: #2a3448;
}

.docs-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 26, 0.58);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 1rem 1rem;
  z-index: 120;
}

.docs-search-overlay.is-open {
  display: flex;
}

.docs-search-dialog {
  width: min(860px, 100%);
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 24px 64px rgba(6, 14, 29, 0.35);
  overflow: hidden;
}

.docs-search-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.72rem;
  border-bottom: 1px solid var(--border);
}

#docs-search-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.72rem;
  font-size: 0.96rem;
  background: var(--panel-soft);
  color: var(--text);
}

.docs-search-close {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: #2b3d58;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.docs-search-results {
  max-height: min(62vh, 680px);
  overflow: auto;
  padding: 0.35rem;
}

.docs-search-item {
  display: block;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.58rem 0.65rem;
  color: inherit;
}

.docs-search-item strong {
  display: block;
  color: #183a8e;
  margin-bottom: 0.2rem;
}

.docs-search-item span {
  display: block;
  color: #506179;
  font-size: 0.9rem;
}

.docs-search-item mark {
  background: #ffe7a3;
  color: #4a3600;
  border-radius: 4px;
  padding: 0 0.12rem;
}

.docs-content mark.docs-inline-hit {
  background: #ffe7a3;
  color: #3a2d00;
  border-radius: 4px;
  padding: 0 0.08rem;
}

.docs-search-item:hover {
  text-decoration: none;
  border-color: #cad6eb;
  background: #f1f6ff;
}

.docs-search-empty {
  margin: 0;
  padding: 1rem 0.75rem;
  color: #5a6b84;
}

body.docs-dark {
  --bg: #0d1118;
  --panel: #131a24;
  --panel-soft: #1a2332;
  --text: #e6edf9;
  --muted: #9fb0cb;
  --border: #2a3950;
  --accent: #7fb0ff;
  --accent-soft: #1b2a41;
  --shadow: 0 16px 38px rgba(2, 7, 16, 0.5);
}

body.docs-dark .docs-topbar {
  background: rgba(13, 17, 24, 0.9);
}

body.docs-dark .docs-search kbd {
  background: #1a2332;
}

body.docs-dark .docs-nav-list a {
  color: #d7e2f5;
}

body.docs-dark .docs-nav-title {
  color: #8ea1bf;
}

body.docs-dark .docs-content p,
body.docs-dark .docs-content li {
  color: #cfdbef;
}

body.docs-dark .docs-callout {
  background: #16253a;
  border-color: #2b466f;
  color: #a9c8ff;
}

body.docs-dark .docs-figure {
  background: #0d141f;
}

body.docs-dark .docs-bottom-nav a {
  color: #cde0ff;
}

body.docs-dark .docs-toc nav a.is-active {
  color: #8fb6ff;
  border-left-color: #7fb0ff;
  background: #192a43;
}

body.docs-dark .docs-copy-btn {
  border-color: #5b6e8f;
  background: #222e44;
  color: #e2ebf8;
}

body.docs-dark .docs-search-overlay {
  background: rgba(2, 5, 10, 0.7);
}

body.docs-dark .docs-search-item strong {
  color: #9ec0ff;
}

body.docs-dark .docs-search-item span,
body.docs-dark .docs-search-empty {
  color: #b2c3de;
}

body.docs-dark .docs-search-item mark {
  background: #7f6222;
  color: #ffefc7;
}

body.docs-dark .docs-content mark.docs-inline-hit {
  background: #6f581e;
  color: #ffefc7;
}

body.docs-dark .docs-search-item:hover {
  border-color: #344a6a;
  background: #1a2638;
}

.docs-bottom-nav {
  margin-top: 1.35rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.docs-bottom-nav a {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  padding: 0.62rem 0.78rem;
  border-radius: 10px;
  color: #1d335f;
  font-weight: 600;
}

.docs-toc {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 0.95rem 0.9rem;
  position: sticky;
  top: 78px;
  height: calc(100vh - 94px);
  overflow: auto;
}

.docs-toc h4 {
  margin: 0 0 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #607089;
  font-size: 0.72rem;
}

.docs-toc nav a {
  display: block;
  font-size: 0.9rem;
  color: #405069;
  border-left: 2px solid transparent;
  padding: 0.35rem 0.45rem;
}

.docs-toc nav a:hover {
  text-decoration: none;
  background: var(--panel-soft);
  border-radius: 8px;
}

.docs-toc nav a.is-active {
  color: #1540a7;
  border-left-color: #2f6fff;
  background: #eef4ff;
}

.docs-footer-links {
  margin-top: 1.2rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.docs-footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-footer-links li {
  margin-bottom: 0.35rem;
}

@media (max-width: 1240px) {
  .docs-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 980px) {
  .docs-topbar .inner {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .docs-topbar-side {
    align-items: flex-start;
    justify-self: start;
  }

  .docs-layout {
    grid-template-columns: 1fr;
    padding: 0.85rem;
  }

  .docs-sidebar,
  .docs-content {
    position: static;
    height: auto;
    min-height: auto;
  }

  .docs-sidebar {
    order: 1;
  }

  .docs-content {
    order: 2;
  }
}
