:root {
  color-scheme: light;
  --bg: #ffffff;
  --card: #ffffff;
  --card-muted: #f7f7f7;
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #000000;
  --text-soft: rgba(0, 0, 0, 0.72);
  --text-muted: rgba(0, 0, 0, 0.48);
  --text-faint: rgba(0, 0, 0, 0.28);
  --surface: rgba(0, 0, 0, 0.05);
  --surface-strong: rgba(0, 0, 0, 0.08);
  --surface-hover: rgba(0, 0, 0, 0.06);
  --surface-active: rgba(0, 0, 0, 0.08);
  --shadow: 0 0 0 rgba(0, 0, 0, 0);
  --radius-panel: 32px;
  --radius-item: 16px;
  --radius-chip: 999px;
  --shell-gap: 16px;
  --shell-padding: 16px;
  --sidebar-width: 288px;
  --content-width: 920px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --chrome-line: rgba(0, 0, 0, 0.1);
  --chrome-line-strong: rgba(0, 0, 0, 0.16);
  --chrome-fill-soft: #ffffff;
  --chrome-fill: rgba(0, 0, 0, 0.03);
  --chrome-fill-strong: rgba(0, 0, 0, 0.05);
  --chrome-icon: rgba(0, 0, 0, 0.42);
  --chrome-icon-strong: rgba(0, 0, 0, 0.68);
  --chrome-muted: rgba(0, 0, 0, 0.56);
  --search-placeholder: rgba(0, 0, 0, 0.32);
  --link-underline: rgba(0, 0, 0, 0.24);
  --link-underline-hover: rgba(0, 0, 0, 0.52);
  --blockquote-border: rgba(0, 0, 0, 0.14);
  --inline-code-bg: rgba(0, 0, 0, 0.05);
  --table-row-border: rgba(0, 0, 0, 0.08);
  --table-head-bg: rgba(0, 0, 0, 0.05);
  --admonition-bg: rgba(0, 0, 0, 0.035);
  --pagination-bg: rgba(0, 0, 0, 0.03);
  --pagination-bg-hover: rgba(0, 0, 0, 0.06);
  --scrollbar-thumb: rgba(0, 0, 0, 0.12);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.22);
}

:root.dark {
  color-scheme: dark;
  --bg: #000000;
  --card: #000000;
  --card-muted: #050505;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.48);
  --text-faint: rgba(255, 255, 255, 0.28);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-active: rgba(255, 255, 255, 0.08);
  --chrome-line: rgba(255, 255, 255, 0.1);
  --chrome-line-strong: rgba(255, 255, 255, 0.16);
  --chrome-fill-soft: #000000;
  --chrome-fill: rgba(255, 255, 255, 0.03);
  --chrome-fill-strong: rgba(255, 255, 255, 0.05);
  --chrome-icon: rgba(255, 255, 255, 0.42);
  --chrome-icon-strong: rgba(255, 255, 255, 0.68);
  --chrome-muted: rgba(255, 255, 255, 0.56);
  --search-placeholder: rgba(255, 255, 255, 0.32);
  --link-underline: rgba(255, 255, 255, 0.24);
  --link-underline-hover: rgba(255, 255, 255, 0.52);
  --blockquote-border: rgba(255, 255, 255, 0.14);
  --inline-code-bg: rgba(255, 255, 255, 0.05);
  --table-row-border: rgba(255, 255, 255, 0.08);
  --table-head-bg: rgba(255, 255, 255, 0.05);
  --admonition-bg: rgba(255, 255, 255, 0.035);
  --pagination-bg: rgba(255, 255, 255, 0.03);
  --pagination-bg-hover: rgba(255, 255, 255, 0.06);
  --scrollbar-thumb: rgba(255, 255, 255, 0.12);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

.help-shell {
  height: 100dvh;
  padding: var(--shell-padding);
  overflow: hidden;
}

.help-layout {
  display: flex;
  gap: var(--shell-gap);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.sidebar-panel,
.content-panel {
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar-panel {
  width: min(100%, var(--sidebar-width));
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-inner {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding: 14px;
}

.brand-block {
  padding: 6px 6px 16px;
}

.brand-link {
  display: inline-block;
  color: var(--text);
  font-size: clamp(1.85rem, 2.2vw, 2.15rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-group + .nav-group {
  margin-top: 6px;
}

.nav-group {
  display: block;
  border-radius: 20px;
}

.nav-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav-group-summary::-webkit-details-marker {
  display: none;
}

.nav-group-summary::marker {
  content: '';
}

.nav-group:hover .nav-group-summary {
  background: transparent;
}

.nav-group[open] .nav-group-summary {
  background: transparent;
}

.nav-group-title {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
}

.nav-group-icon {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-right: 1.5px solid var(--chrome-icon);
  border-bottom: 1.5px solid var(--chrome-icon);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.nav-group[open] .nav-group-icon {
  transform: rotate(225deg) translateY(1px);
}

.nav-group:hover .nav-group-icon,
.nav-group[open] .nav-group-icon {
  border-color: var(--chrome-icon-strong);
}

.nav-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0 0 0 8px;
}

.nav-item + .nav-item {
  margin-top: 2px;
}

.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-item);
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.is-active {
  color: var(--text);
  font-weight: 600;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
}

.sidebar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--chrome-line);
  border-radius: 14px;
  background: var(--chrome-fill);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.sidebar-control-button-language {
  min-width: 74px;
  justify-content: flex-start;
  gap: 8px;
}

.sidebar-control-button-theme {
  flex: 1;
  justify-content: flex-start;
  gap: 8px;
}

.sidebar-control-button:hover {
  background: var(--chrome-fill-strong);
  border-color: var(--chrome-line-strong);
  color: var(--text);
}

.sidebar-control-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--chrome-icon);
  transition: color 0.18s ease, opacity 0.18s ease;
}

.sidebar-control-button:hover .sidebar-control-icon {
  color: var(--chrome-icon-strong);
}

.sidebar-control-icon-theme-light {
  display: none;
}

:root.light .sidebar-control-icon-theme-dark {
  display: none;
}

:root.light .sidebar-control-icon-theme-light {
  display: block;
}

.app-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--chrome-line);
  border-radius: 16px;
  background: var(--chrome-fill);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.app-link:hover {
  background: var(--chrome-fill-strong);
  border-color: var(--chrome-line-strong);
}

.app-link-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--chrome-icon);
  transition: transform 0.18s ease, color 0.18s ease;
}

.app-link:hover .app-link-icon {
  color: var(--chrome-icon-strong);
  transform: translate(1px, -1px);
}

.content-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.content-scroll {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 16px 16px;
}

.content-inner {
  width: 100%;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.page-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 0;
  margin-bottom: 16px;
}

.page-title {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-size: clamp(1.45rem, 2.2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.doc-search {
  position: relative;
  width: min(100%, 320px);
  flex-shrink: 0;
}

.doc-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  transition: background-color 0.18s ease;
}

.doc-search-field:hover,
.doc-search-field:focus-within {
  background: var(--surface-strong);
}

.doc-search-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--chrome-icon);
}

.doc-search-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  outline: none;
}

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

.doc-search-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 30;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
  overflow: hidden;
}

.doc-search-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.doc-search-result {
  display: block;
  padding: 10px 12px;
  border-radius: 16px;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.doc-search-result:hover {
  background: var(--surface);
}

.doc-search-result + .doc-search-result {
  margin-top: 2px;
}

.doc-search-result-meta {
  color: var(--chrome-icon);
  font-size: 0.74rem;
  line-height: 1.35;
}

.doc-search-result-title {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
}

.doc-search-result-snippet {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.doc-search-result-snippet mark {
  padding: 0;
  background: transparent;
  color: var(--text);
  font-weight: 500;
}

.doc-content {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.72;
}

.doc-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--chrome-line);
  border-radius: 32px;
  background: var(--chrome-fill-soft);
}

.doc-main {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 0 0 0 16px;
}

.doc-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  scroll-padding-top: 18px;
  scroll-padding-bottom: 18px;
}

.doc-content > :first-child {
  margin-top: 0;
}

.doc-content > :last-child {
  margin-bottom: 0;
}

.doc-article-title {
  margin: 0 0 1.15rem;
  color: var(--text);
  font-size: clamp(1.9rem, 3vw, 2.35rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.doc-empty {
  padding: 2px 0;
}

.doc-empty-title {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.doc-empty p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
}

.doc-sidepanel {
  width: 340px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 18px 18px;
}

.doc-sidepanel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 1px;
  background: var(--chrome-line);
}

.doc-side-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 2px;
}

.doc-side-heading {
  color: var(--chrome-muted);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.doc-side-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-side-link {
  display: block;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.35;
  text-decoration: none;
}

.doc-side-link:hover {
  color: var(--text);
}

.doc-content h2,
.doc-content h3,
.doc-content h4 {
  margin: 2.25rem 0 0.95rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.04em;
  scroll-margin-top: 18px;
}

.doc-content h2 {
  font-size: clamp(1.4rem, 2.2vw, 1.7rem);
}

.doc-section-body h3:first-child,
.doc-section-body h4:first-child {
  margin-top: 0;
}

.doc-content h3 {
  font-size: 1.05rem;
}

.doc-content h4 {
  font-size: 0.95rem;
}

.doc-content p,
.doc-content ul,
.doc-content ol,
.doc-content table,
.doc-content blockquote,
.doc-content pre,
.doc-content .admonition {
  margin: 0 0 0.95rem;
}

.doc-content ul,
.doc-content ol {
  padding-left: 1.4rem;
}

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

.doc-content p,
.doc-content li,
.doc-content td,
.doc-content th {
  font-size: 0.95rem;
}

.doc-content strong {
  color: var(--text);
}

.doc-content a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 3px;
}

.doc-content a:hover {
  text-decoration-color: var(--link-underline-hover);
}

.doc-content blockquote {
  padding: 0 0 0 16px;
  border-left: 3px solid var(--blockquote-border);
  color: var(--text-soft);
}

.doc-content pre {
  overflow-x: auto;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card-muted);
}

.doc-content code {
  padding: 0.18rem 0.42rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--inline-code-bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.92em;
}

.doc-content pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
}

.doc-content th,
.doc-content td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--table-row-border);
}

.doc-content th {
  color: var(--text);
  background: var(--table-head-bg);
  font-weight: 600;
}

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

.admonition {
  padding: 16px 16px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--admonition-bg);
}

.admonition-title {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.admonition p:last-child,
.admonition ul:last-child,
.admonition ol:last-child {
  margin-bottom: 0;
}

.doc-pagination {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 16px 0 0;
}

.doc-pagination.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.pagination-link {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--chrome-line);
  border-radius: 20px;
  background: transparent;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.pagination-link:hover {
  background: var(--chrome-fill);
  border-color: var(--chrome-line-strong);
}

.pagination-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.pagination-title {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.doc-pagination .pagination-link,
.doc-pagination .pagination-link:hover,
.doc-pagination .pagination-link:focus-visible,
.doc-pagination .pagination-link .pagination-label,
.doc-pagination .pagination-link .pagination-title {
  text-decoration: none;
}

.doc-content::-webkit-scrollbar,
.doc-search-results::-webkit-scrollbar,
.doc-sidepanel::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  width: 10px;
}

.doc-content::-webkit-scrollbar-track,
.doc-search-results::-webkit-scrollbar-track,
.doc-sidepanel::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.doc-content::-webkit-scrollbar-thumb,
.doc-search-results::-webkit-scrollbar-thumb,
.doc-sidepanel::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
}

.doc-content::-webkit-scrollbar-thumb:hover,
.doc-search-results::-webkit-scrollbar-thumb:hover,
.doc-sidepanel::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

@media (max-width: 960px) {
  body {
    overflow: auto;
  }

  .help-layout {
    height: auto;
    min-height: calc(100dvh - (var(--shell-padding) * 2));
    flex-direction: column;
    overflow: visible;
  }

  .sidebar-panel {
    width: 100%;
  }

  .sidebar-nav {
    overflow: visible;
  }

  .sidebar-controls {
    width: 100%;
  }

  .content-scroll {
    flex: initial;
    overflow: visible;
    padding: 0;
  }

  .content-inner,
  .doc-content,
  .doc-workspace,
  .doc-main,
  .doc-sidepanel {
    min-height: auto;
    overflow: visible;
  }

  .doc-workspace {
    flex-direction: column;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .doc-search {
    width: 100%;
  }

  .doc-main {
    padding: 0;
  }

  .doc-sidepanel {
    width: 100%;
    padding: 0 18px 18px;
  }

  .doc-sidepanel::before {
    left: 18px;
    right: 18px;
    top: 0;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .doc-pagination,
  .doc-pagination.is-single {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .help-shell {
    height: auto;
    min-height: 100dvh;
    padding: 10px;
  }

  .help-layout {
    gap: 10px;
    min-height: calc(100dvh - 20px);
  }

  .sidebar-inner {
    padding: 14px;
  }

  .sidebar-controls {
    flex-wrap: wrap;
  }

  .sidebar-control-button-language,
  .sidebar-control-button-theme {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .content-scroll {
    padding: 0;
  }

  .page-header {
    padding: 14px 0 0;
    margin-bottom: 8px;
  }

  .doc-main {
    padding: 0;
  }

  .doc-sidepanel {
    padding: 0 16px 16px;
  }

  .doc-sidepanel::before {
    left: 16px;
    right: 16px;
  }

  .page-title {
    font-size: 1.75rem;
  }
}