:root {
  --accent: #f59e0b;
  --bg-dark: #080b0f;
  --bg-sidebar: #090d11;
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f0f3f8;
  --text-muted: #8b99ad;
  --card-bg: linear-gradient(145deg, #101720, #0b1016);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
}

.docs-layout {
  display: flex;
  min-height: 100vh;
}

.docs-sidebar {
  width: 290px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 24px 8px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.brand-tag {
  font-size: 11.5px;
  color: var(--text-muted);
}

.search-box {
  margin-bottom: 20px;
  position: relative;
}

.search-input-wrap {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.search-input-wrap:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.search-input-wrap i {
  color: var(--text-muted);
  font-size: 13px;
}

.search-kbd {
  white-space: nowrap;
}

.docs-main {
  min-width: 0;
}

.sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.search-input {
  flex-grow: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font: inherit;
  font-size: 12.5px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-input-wrap:focus-within {
  border-color: var(--accent);
}

.search-empty {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 10px 10px 0;
}

[hidden] {
  display: none !important;
}

.search-kbd {
  font-size: 10.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: inherit;
}

.sidebar-nav {
  flex-grow: 1;
  overflow-y: auto;
}

.nav-group {
  margin-bottom: 24px;
}

.group-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 10px;
  padding-left: 10px;
}

.group-links {
  list-style: none;
  padding: 0 3px;
}

.group-links .nav-link {
  display: block;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.group-links .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.group-links .nav-link.active {
  color: var(--accent);
  background: #f59f0b31;
  border: 1px solid var(--accent);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent-cyan);
}

.docs-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.docs-header {
  height: 64px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-breadcrumbs .current {
  color: #fff;
  font-weight: 500;
}

.header-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.docs-content {
  padding: 40px 60px;
  max-width: 960px;
}

.category-badge {
  font-size: 12px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.article-title {
  font-size: 32px;
  font-weight: 800;
  margin: 10px 0 12px 0;
  letter-spacing: -0.02em;
}

.article-summary {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.article-divider {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin-bottom: 32px;
}

.article-prose h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 12px 0;
  color: #fff;
}

.article-prose p {
  color: #c4d0e0;
  margin-bottom: 16px;
  font-size: 14.5px;
}

.article-prose ul, .article-prose ol {
  margin: 0 0 20px 24px;
  color: #c4d0e0;
  font-size: 14.5px;
}

.article-prose li {
  margin-bottom: 8px;
}

.article-prose pre {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.article-prose code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  color: var(--accent);
}

.article-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 30px 0;
}

.article-prose th, .article-prose td {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  text-align: left;
  font-size: 14px;
}

.article-prose th {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.article-prose td {
  color: #c4d0e0;
}

.back-link:hover,
.category-badge {
  color: var(--accent);
}

.article-prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
}

.article-prose a:hover {
  border-bottom-color: var(--accent);
}

.article-prose pre code {
  color: #d6deeb;
  font-size: 13px;
  line-height: 1.6;
}

.article-prose ol ol,
.article-prose ul ul {
  margin-top: 8px;
  margin-bottom: 0;
}

.article-prose kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
}

.callout {
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 3px solid var(--accent);
  background: rgba(245, 158, 11, 0.06);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 22px;
  font-size: 14px;
  color: #c4d0e0;
}

.callout.warn {
  border-color: rgba(239, 68, 68, 0.3);
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.callout strong {
  color: #fff;
}

.article-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  min-width: 220px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.pager-link:hover {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.05);
}

.pager-link.next {
  text-align: right;
  margin-left: auto;
}

.pager-label {
  font-size: 12px;
  color: var(--text-muted);
}

.pager-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cs-lang {
  position: relative;
  display: inline-flex;
  z-index: 60;
}

.cs-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 35px;
  padding: 0 12px;
  color: #e8edf4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.cs-lang-btn:hover,
.cs-lang.open .cs-lang-btn {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.cs-lang-caret {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.2s;
}

.cs-lang.open .cs-lang-caret {
  transform: rotate(180deg);
}

.cs-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  padding: 5px;
  background: linear-gradient(145deg, #121922, #0b1016);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.cs-lang.open .cs-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.cs-lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  color: #c9d3df;
  background: none;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.cs-lang-option:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.cs-lang-option.active {
  color: var(--accent);
}

.cs-lang-code {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 20px;
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.cs-lang-check {
  margin-left: auto;
  font-size: 12px;
  opacity: 0;
}

.cs-lang-option.active .cs-lang-check {
  opacity: 1;
}

@media (max-width: 860px) {
  .docs-layout { flex-direction: column; }
  .docs-sidebar { position: static; width: 100%; height: auto; }
  .sidebar-nav { max-height: 40vh; }
  .docs-header { padding: 0 16px; }
  .header-breadcrumbs { display: none; }
  .docs-content { padding: 28px 16px; }
  .article-prose table { display: block; overflow-x: auto; }
  .article-pager { flex-direction: column; }
  .pager-link { min-width: 0; }
}
