:root {
    --page: #ffffff;
    --surface: #f7f9fc;
    --soft: #f0f5ff;
    --text: #25344a;
    --muted: #5e7089;
    --border: #e1e8f1;
    --accent: #3268db;
    --accent-soft: #eaf0ff;
    --code-bg: #f7f9fc;
    --code-text: #354b66;
    --header-height: 74px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --page: #111925;
    --surface: #162131;
    --soft: #172941;
    --text: #dce7f7;
    --muted: #a4b5ce;
    --border: #2c3c53;
    --accent: #9abeff;
    --accent-soft: #1d3151;
    --code-bg: #121f31;
    --code-text: #c3d4ec;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font: 16px/1.85 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

h1, h2, h3, h4, p, figure {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover, button:hover {
    color: var(--accent);
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: .65;
}

a, button, summary, input {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

main:focus, [tabindex="-1"]:focus {
    outline: none;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.icon {
    display: inline-block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.icon-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    color: var(--muted);
    flex-shrink: 0;
}

.icon-button:hover {
    background: var(--surface);
}

.skip-link {
    position: fixed;
    top: -120px;
    left: 16px;
    z-index: 100;
    padding: 10px 15px;
    border: 1px solid var(--border);
    background: var(--page);
}

.skip-link:focus {
    top: 10px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.docs-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: var(--header-height);
    padding: 12px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--page);
}

.docs-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    max-width: 320px;
}

.docs-brand strong {
    font-size: 22px;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.brand-mark, .brand-logo {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 7px;
}

.brand-logo {
    object-fit: contain;
}

.brand-mark {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #3268db;
    color: #ffffff;
    box-shadow: 0 4px 10px #2869d521;
}

.brand-mark .icon {
    width: 26px;
    height: 26px;
}

.brand-divider {
    width: 1px;
    height: 18px;
    flex-shrink: 0;
    background: var(--border);
}

.docs-brand small {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    flex: 1;
    min-width: 0;
    position: relative;
}

.document-nav-item {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 4px;
}

.document-nav-item > a {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 5px 0;
    color: var(--muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.document-nav-item > a.active, .document-nav-item > a:hover {
    color: var(--accent);
}

.document-menu > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 32px;
    list-style: none;
    color: var(--muted);
    cursor: pointer;
}

.document-menu > summary::-webkit-details-marker {
    display: none;
}

.document-menu > summary .icon {
    width: 12px;
    height: 12px;
    transform: rotate(90deg);
}

.document-menu[open] > summary .icon {
    transform: rotate(-90deg);
}

.document-menu-panel {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--page);
}

.header-nav > .document-nav-item > .document-menu > .document-menu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 0;
    max-height: 65dvh;
    overflow: auto;
    box-shadow: 0 12px 25px #14325918;
}

.document-menu-panel .document-nav-item {
    display: block;
    position: relative;
    padding-right: 30px;
}

.document-menu-panel .document-menu > summary {
    position: absolute;
    right: 0;
    top: 2px;
}

.document-menu-panel .document-menu-panel {
    margin: 5px 0;
    border-right: 0;
    border-top: 0;
    border-bottom: 0;
    border-radius: 0;
    padding: 4px 0 4px 12px;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
    flex-shrink: 0;
}

.search-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 216px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.search-trigger kbd {
    margin-left: auto;
    padding: 3px 5px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--page);
    font: 11px/1.3 system-ui, sans-serif;
}

.sidebar-toggle, .sidebar-heading .icon-button, .sidebar-mobile-nav {
    display: none;
}

.docs-layout {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    max-width: 1500px;
    margin: 0 auto;
}

.sidebar {
    position: sticky;
    top: var(--header-offset, var(--header-height));
    align-self: start;
    min-width: 0;
    height: calc(100dvh - var(--header-offset, var(--header-height)));
    overflow: auto;
    padding: 27px 18px 30px;
    border-right: 1px solid var(--border);
    background: var(--page);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 8px 20px;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 1px;
}

.directory-home {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px;
    margin: 3px 0;
    border-radius: 5px;
    font-size: 14px;
}

.document-group {
    margin: 16px 0;
}

.directory-group-heading {
    display: flex;
    align-items: center;
    gap: 2px;
}

.directory-group-heading > a, .directory-group-heading > span {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    padding: 7px 8px;
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.directory-group-heading .icon {
    width: 16px;
    height: 16px;
    color: var(--muted);
}

.group-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 4px;
}

.group-toggle:hover {
    background: var(--surface);
}

.group-toggle .icon {
    width: 12px;
    height: 12px;
}

.group-toggle[aria-expanded="true"] .icon {
    transform: rotate(90deg);
}

.directory-children {
    padding-left: 10px;
    margin-left: 8px;
    border-left: 1px solid var(--border);
}

.directory-children .directory-children {
    padding-left: 5px;
    margin-left: 2px;
}

.directory-children .document-group {
    margin: 5px 0;
}

.directory-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    position: relative;
    margin: 3px 0;
    padding: 7px 9px;
    border-radius: 5px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.directory-entry > span:first-child {
    min-width: 0;
}

.directory-entry:hover {
    background: var(--surface);
}

.directory-entry.active, .directory-home.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.directory-entry.active::before {
    content: "";
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.in-current-path > .directory-group-heading > a, .directory-group-heading > a.active {
    color: var(--accent);
}

.entry-lock .icon {
    width: 13px;
    height: 13px;
}

.directory-empty {
    margin: 10px 8px;
    color: var(--muted);
    font-size: 13px;
}

.sidebar-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 28px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    font-size: 14px;
}

.sidebar-note > .icon {
    margin-top: 4px;
    color: var(--accent);
}

.sidebar-note small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.docs-main {
    min-width: 0;
    max-width: 100%;
    padding: 32px clamp(24px, 4vw, 60px) 24px;
}

.article-toolbar {
    margin-bottom: 29px;
}

.breadcrumb, .breadcrumb > a {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.breadcrumb {
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.breadcrumb > .icon {
    width: 11px;
    height: 11px;
}

.breadcrumb > span:last-child {
    color: var(--text);
}

.doc-content {
    min-width: 0;
    overflow-wrap: anywhere;
}

.page-eyebrow {
    display: block;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.doc-content h1 {
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.5;
    font-weight: 650;
    margin: 8px 0 18px;
}

.doc-content h2 {
    font-size: 24px;
    line-height: 1.65;
    margin: 32px 0 14px;
}

.doc-content h3 {
    font-size: 20px;
    margin: 24px 0 10px;
}

.doc-content p {
    margin: 14px 0;
}

.doc-content h1, .doc-content h2, .doc-content h3, .doc-content h4 {
    scroll-margin-top: calc(var(--header-offset, var(--header-height)) + 20px);
}

.page-heading {
    margin-bottom: 28px;
}

.doc-lead {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.95;
}

.doc-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    align-items: center;
    position: relative;
    min-height: 292px;
    margin: 5px 0 28px;
    padding: 30px 34px;
    overflow: hidden;
    border: 1px solid #dce7fa;
    border-radius: 10px;
    background: linear-gradient(120deg, #f7faff, #edf3ff);
}

.doc-intro h1 {
    color: #263e67;
    margin: 13px 0 14px;
}

.doc-intro p {
    color: #526986;
    margin: 0;
    font-size: 16px;
    line-height: 1.95;
}

.primary-link, .search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 9px 16px;
    border-radius: 5px;
    background: var(--accent);
    color: var(--page);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.primary-link {
    margin-top: 22px;
}

.primary-link:hover, .search-submit:hover {
    color: var(--page);
    filter: brightness(.92);
}

.doc-visual {
    position: relative;
    isolation: isolate;
    width: 190px;
    height: 215px;
    justify-self: end;
}

.doc-halo {
    position: absolute;
    top: 30px;
    left: 0;
    width: 190px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(ellipse, #b6ccfd77, transparent 70%);
    transform: rotate(-15deg);
}

.doc-sheet {
    display: flex;
    flex-direction: column;
    gap: 9px;
    position: absolute;
    border-radius: 7px;
    transform: skewY(-12deg) rotate(10deg);
    box-shadow: 9px 13px 18px #5588d218;
}

.sheet-back {
    top: 16px;
    right: -4px;
    width: 95px;
    height: 135px;
    padding: 28px 12px;
    background: linear-gradient(140deg, #90b5fb, #769bdd);
}

.sheet-back i {
    width: 65px;
    height: 5px;
    border-radius: 2px;
    background: #bbd2ff;
}

.sheet-back i:nth-child(2) {
    width: 45px;
}

.sheet-mid {
    top: 36px;
    right: 24px;
    width: 99px;
    height: 138px;
    padding: 17px 12px;
    background: linear-gradient(140deg, #b7d3ff, #92baf6);
}

.sheet-mid .icon {
    width: 21px;
    height: 21px;
    color: #f0f5ff;
}

.sheet-mid i {
    width: 62px;
    height: 5px;
    border-radius: 2px;
    background: #cee0ff;
}

.sheet-mid i:last-child {
    width: 43px;
}

.sheet-front {
    top: 51px;
    right: 48px;
    width: 117px;
    height: 157px;
    padding: 19px 16px;
    border: 1px solid #dce9ff;
    background: linear-gradient(130deg, #fff, #f5f8ff);
}

.sheet-front > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-bottom: 9px;
    border-radius: 6px;
    background: #e1ecff;
}

.sheet-front .icon {
    width: 17px;
    height: 17px;
    color: #709cdf;
}

.sheet-front i {
    width: 76px;
    height: 5px;
    border-radius: 2px;
    background: #c3d6f9;
}

.sheet-front i:nth-of-type(2) {
    width: 50px;
}

.sheet-front i:nth-of-type(3) {
    width: 67px;
}

.sheet-front b {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: -9px;
    bottom: -9px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #729fe8;
    box-shadow: 0 4px 9px #749fdf44;
}

.sheet-front b .icon {
    color: #fff;
    width: 14px;
    height: 14px;
}

.doc-orbit-dot {
    position: absolute;
    border-radius: 50%;
    background: #a8c4f7;
}

.dot-one {
    width: 8px;
    height: 8px;
    top: 26px;
    left: 4px;
}

.dot-two {
    width: 5px;
    height: 5px;
    right: 2px;
    bottom: 8px;
    background: #91cfc5;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 15px;
}

.section-heading h2, .section-heading p {
    margin: 0;
}

.section-heading h2 {
    font-size: 21px;
}

.section-heading > a, .section-heading > p {
    color: var(--muted);
    font-size: 14px;
}

.quick-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0 34px;
}

.doc-card {
    display: block;
    position: relative;
    min-width: 0;
    padding: 20px 18px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--page);
    transition: border-color .2s, transform .2s;
}

.doc-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    color: var(--text);
}

.doc-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--soft);
    color: var(--accent);
}

.doc-card:nth-child(3n + 2) .doc-card-icon {
    color: #7668b0;
    background: #f0eefb;
}

.doc-card:nth-child(3n) .doc-card-icon {
    color: #467c63;
    background: #eef8f3;
}

.doc-card > strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.doc-card > p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.85;
    margin: 7px 0 0;
    overflow-wrap: anywhere;
}

.card-arrow {
    position: absolute;
    top: 26px;
    right: 17px;
    color: var(--muted);
}

.card-arrow .icon {
    width: 15px;
    height: 15px;
}

.filter-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 23px;
}

.filter-chips a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 4px 11px;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.filter-chips a.active, .filter-chips a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.tags .icon {
    width: 13px;
    height: 13px;
}

.document-list {
    border-top: 1px solid var(--border);
}

.document-list-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 23px 0;
    border-bottom: 1px solid var(--border);
}

.entry-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 38px;
    flex-shrink: 0;
    margin-top: 3px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--accent);
}

.entry-body {
    min-width: 0;
    flex: 1;
}

.entry-body h2, .entry-body h3 {
    margin: 0;
    font-size: 19px;
    line-height: 1.7;
}

.entry-body p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.85;
    margin: 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.entry-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 16px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

.entry-meta .icon {
    width: 14px;
    height: 14px;
}

.entry-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 40px;
    flex-shrink: 0;
    color: var(--muted);
}

.empty-state {
    padding: 36px 15px;
    text-align: center;
    color: var(--muted);
}

.empty-state h2 {
    margin: 0 0 10px;
    font-size: 20px;
    color: var(--text);
}

.empty-state a {
    color: var(--accent);
}

.pagination {
    margin: 28px 0;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
}

.page-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 38px;
    padding: 0 7px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 14px;
}

.page-button.current {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent);
}

.page-ellipsis {
    align-self: center;
}

.pagination-meta {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.markdown-fallback {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.markdown-body {
    min-width: 0;
    line-height: 1.95;
}

.markdown-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.markdown-body img {
    height: auto;
    margin: 18px 0;
    border-radius: 6px;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 26px;
    margin: 16px 0;
}

.markdown-body li + li {
    margin-top: 6px;
}

.markdown-body blockquote {
    margin: 22px 0;
    padding: 10px 20px;
    border-left: 3px solid var(--accent);
    background: var(--soft);
    color: var(--muted);
}

.markdown-body hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}

.markdown-body code, .markdown-body kbd {
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: .9em;
}

.markdown-body :not(pre) > code, .markdown-body kbd {
    padding: 2px 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--code-text);
    overflow-wrap: anywhere;
}

.markdown-body details {
    margin: 16px 0;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.markdown-body summary {
    cursor: pointer;
    font-weight: 600;
}

.code-block {
    max-width: 100%;
    min-width: 0;
    margin: 22px 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--code-bg);
}

.code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 15px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
}

.code-toolbar > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.code-copy {
    flex-shrink: 0;
    padding: 3px;
    font-size: 12px;
}

.markdown-body pre {
    max-width: 100%;
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    background: var(--code-bg);
    color: var(--code-text);
    font: 14px/1.85 ui-monospace, "SFMono-Regular", Consolas, monospace;
    tab-size: 4;
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
    scrollbar-width: thin;
}

.markdown-body pre code {
    font: inherit;
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
}

.table-wrap {
    max-width: 100%;
    margin: 22px 0;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 7px;
}

.markdown-body table {
    width: 100%;
    min-width: 440px;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.markdown-body th, .markdown-body td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.markdown-body th {
    background: var(--surface);
    font-weight: 600;
}

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

.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-title {
    color: #345caa;
}

.hljs-string, .hljs-attr, .hljs-addition {
    color: #337452;
}

.hljs-number, .hljs-symbol, .hljs-deletion {
    color: #9c4f30;
}

.hljs-comment, .hljs-quote {
    color: #65758d;
}

.password-form {
    margin: 24px 0;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.password-form h2 {
    margin-top: 0;
}

.password-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.password-fields {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.password-fields input {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 180px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--page);
}

.form-error {
    color: #b32737;
}

.page-neighbors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 40px 0 35px;
}

.page-neighbors > a {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.page-neighbors > a:hover {
    background: var(--surface);
    border-color: var(--accent);
}

.page-neighbors small {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.page-neighbors strong {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.page-neighbors .next-page {
    grid-column: 2;
    justify-content: flex-end;
    text-align: right;
}

.page-neighbors > a > span {
    min-width: 0;
}

.docs-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: 36px;
    padding: 23px 0 5px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.docs-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.search-modal {
    width: min(675px, calc(100% - 28px));
    max-height: 80dvh;
    margin: 12vh auto 0;
    padding: 0;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--page);
    color: var(--text);
    box-shadow: 0 25px 120px #17315e26;
}

.search-modal::backdrop {
    background: #18294488;
    backdrop-filter: blur(4px);
}

.search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
}

.search-form > .icon {
    color: var(--accent);
}

.search-form input {
    min-width: 0;
    flex: 1;
    padding: 9px 3px;
    border: 0;
    background: none;
    font-size: 16px;
}

.esc-button {
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
}

.search-modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
}

.page-search {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
}

.search-open, .sidebar-open {
    overflow: hidden;
}

.toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    z-index: 100;
    width: max-content;
    max-width: calc(100vw - 30px);
    padding: 11px 17px;
    border-radius: 7px;
    background: #253b57;
    color: #fff;
    box-shadow: 0 6px 28px #12345620;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 20px);
    transition: opacity .2s, transform .2s;
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

:root[data-theme="dark"] .doc-intro {
    background: linear-gradient(120deg, #162338, #1c3150);
    border-color: #304869;
}

:root[data-theme="dark"] .doc-intro h1 {
    color: #d7e8ff;
}

:root[data-theme="dark"] .doc-intro p {
    color: #aec3e0;
}

:root[data-theme="dark"] .doc-visual {
    filter: brightness(.85);
}

:root[data-theme="dark"] .doc-card:nth-child(3n + 2) .doc-card-icon {
    background: #312d4d;
    color: #c1b5ef;
}

:root[data-theme="dark"] .doc-card:nth-child(3n) .doc-card-icon {
    background: #243a34;
    color: #a0d4b8;
}

:root[data-theme="dark"] .hljs-keyword, :root[data-theme="dark"] .hljs-selector-tag,
:root[data-theme="dark"] .hljs-literal, :root[data-theme="dark"] .hljs-title {
    color: #a2c5ff;
}

:root[data-theme="dark"] .hljs-string, :root[data-theme="dark"] .hljs-attr, :root[data-theme="dark"] .hljs-addition {
    color: #a0d6b6;
}

:root[data-theme="dark"] .hljs-number, :root[data-theme="dark"] .hljs-symbol, :root[data-theme="dark"] .hljs-deletion {
    color: #e6b599;
}

:root[data-theme="dark"] .hljs-comment, :root[data-theme="dark"] .hljs-quote {
    color: #9cabbe;
}

:root[data-theme="dark"] .form-error {
    color: #ff9da9;
}

@media (min-width: 1550px) {
    .docs-header {
        padding-left: max(32px, calc((100vw - 1500px) / 2));
        padding-right: max(32px, calc((100vw - 1500px) / 2));
    }
}

@media (max-width: 1200px) {
    .docs-header {
        gap: 20px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .brand-divider, .docs-brand small {
        display: none;
    }

    .docs-brand {
        max-width: 230px;
    }

    .search-trigger {
        width: 178px;
    }

    .docs-layout {
        grid-template-columns: 244px minmax(0, 1fr);
    }

    .docs-main {
        padding: 30px;
    }

    .doc-intro {
        padding: 27px;
        grid-template-columns: minmax(0, 1fr) 165px;
    }

    .doc-visual {
        transform: scale(.85);
        transform-origin: right center;
    }
}

@media (max-width: 1000px) {
    :root {
        --header-height: 66px;
    }

    .docs-header {
        gap: 16px;
        padding: 10px 22px;
    }

    .header-nav {
        display: none;
    }

    .docs-brand {
        max-width: none;
        flex: 1;
    }

    .docs-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .docs-main {
        width: 100%;
        margin: 0;
        padding: 30px 36px;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .document-enhanced .sidebar {
        position: fixed;
        top: var(--header-offset, var(--header-height));
        left: 0;
        bottom: 0;
        z-index: 60;
        width: min(320px, 90vw);
        height: auto;
        visibility: hidden;
        transform: translateX(-105%);
        transition: transform .2s;
        box-shadow: 15px 0 40px #162d5020;
    }

    .sidebar-open .sidebar {
        visibility: visible;
        transform: translateX(0);
    }

    .sidebar-toggle, .sidebar-heading .icon-button {
        display: flex;
    }

    .sidebar-mobile-nav {
        display: block;
        margin-bottom: 20px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-mobile-nav > .document-nav-item {
        display: block;
        position: relative;
        padding-right: 30px;
    }

    .sidebar-mobile-nav .document-nav-item > a {
        padding: 8px;
    }

    .sidebar-mobile-nav > .document-nav-item > .document-menu > summary {
        position: absolute;
        top: 5px;
        right: 0;
    }

    .sidebar-mobile-nav .document-menu-panel {
        padding: 4px 0 4px 10px;
        border-right: 0;
        border-top: 0;
        border-bottom: 0;
        border-radius: 0;
    }

    .nav-scrim {
        position: fixed;
        inset: var(--header-offset, var(--header-height)) 0 0;
        z-index: 50;
        width: 100%;
        height: calc(100dvh - var(--header-offset, var(--header-height)));
        background: #15304c77;
        backdrop-filter: blur(2px);
    }

    .directory-entry, .directory-group-heading > a {
        padding-top: 9px;
        padding-bottom: 9px;
    }
}

@media (max-width: 600px) {
    :root {
        --header-height: 64px;
    }

    .docs-header {
        padding: 10px 14px;
        gap: 7px;
    }

    .docs-brand {
        gap: 8px;
    }

    .docs-brand strong {
        font-size: 19px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .brand-mark, .brand-logo {
        width: 30px;
        height: 32px;
    }

    .header-tools {
        gap: 2px;
    }

    .search-trigger {
        width: 36px;
        height: 38px;
        justify-content: center;
        padding: 0;
        border: 0;
        background: none;
    }

    .search-trigger > span, .search-trigger kbd {
        display: none;
    }

    .icon-button {
        width: 36px;
        height: 38px;
    }

    .docs-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .docs-main {
        padding: 24px 18px;
    }

    .article-toolbar {
        margin-bottom: 22px;
    }

    .doc-intro {
        display: block;
        padding: 25px 22px;
        min-height: 240px;
    }

    .doc-intro > div:first-child {
        position: relative;
        z-index: 2;
    }

    .doc-intro p {
        font-size: 15px;
    }

    .doc-visual {
        position: absolute;
        top: 55px;
        right: -60px;
        opacity: .18;
        transform: scale(.82);
        pointer-events: none;
    }

    .quick-cards {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .doc-card {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 4px 12px;
        padding: 16px 34px 16px 16px;
    }

    .doc-card-icon {
        grid-row: 1 / 3;
        margin: 3px 0 0;
    }

    .doc-card > strong, .doc-card > p {
        grid-column: 2;
        margin: 0;
    }

    .card-arrow {
        top: 22px;
        right: 12px;
    }

    .document-list-item {
        gap: 10px;
        padding: 20px 0;
    }

    .entry-symbol {
        width: 30px;
        height: 34px;
    }

    .entry-arrow {
        width: 24px;
    }

    .entry-body h2, .entry-body h3 {
        font-size: 18px;
    }

    .doc-content h2 {
        font-size: 22px;
    }

    .entry-body h2 {
        font-size: 18px;
    }

    .markdown-body pre {
        padding: 16px 13px;
        font-size: 13px;
    }

    .password-form {
        padding: 20px 16px;
    }

    .page-neighbors {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .page-neighbors .next-page {
        grid-column: 1;
    }

    .search-form {
        flex-wrap: wrap;
        padding: 14px 12px;
        gap: 8px;
    }

    .search-form > .icon {
        display: none;
    }

    .search-form input {
        flex-basis: 100%;
    }

    .search-form .esc-button {
        margin-left: auto;
    }

    .page-search input {
        flex-basis: 120px;
    }

    .search-modal-footer {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}
