:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --primary-border: #bfdbfe;
    --text: #111827;
    --text-secondary: #5f6b7a;
    --text-muted: #7b8796;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --success: #15803d;
    --warning: #b45309;
    --danger: #b91c1c;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.10);
    --header-height: 68px;
    --radius: 8px;
    --z-header: 40;
    --z-drawer: 80;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    color: var(--text);
    background: var(--surface);
    line-height: 1.6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }
body { margin: 0; min-width: 320px; background: var(--surface); color: var(--text); }
body.is-drawer-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { touch-action: manipulation; }
img { max-width: 100%; height: auto; }
svg { width: 20px; height: 20px; stroke-width: 1.8; flex: 0 0 auto; }

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

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1000;
    padding: 10px 14px;
    color: #fff;
    background: var(--primary);
    border-radius: 6px;
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    width: min(1440px, 100%);
    height: 100%;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 28px;
}
.site-brand { display: inline-flex; align-items: center; gap: 11px; min-width: max-content; font-weight: 700; }
.site-brand__mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--primary);
    border-radius: 8px;
}
.site-brand__mark svg { width: 21px; height: 21px; }
.site-brand__text { font-size: 18px; }
.channel-tabs { min-width: 0; display: flex; flex: 1 1 auto; align-self: stretch; gap: 24px; overflow-x: auto; scrollbar-width: none; }
.channel-tabs::-webkit-scrollbar { display: none; }
.channel-tab {
    position: relative;
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}
.channel-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: transparent;
}
.channel-tab:hover { color: var(--primary); }
.channel-tab.is-active { color: var(--primary); font-weight: 700; }
.channel-tab.is-active::after { background: var(--primary); }
.header-search {
    width: min(360px, 30vw);
    height: 42px;
    margin-left: auto;
    display: grid;
    grid-template-columns: 20px 1fr 36px;
    align-items: center;
    gap: 8px;
    padding: 0 6px 0 12px;
    color: var(--text-muted);
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-shrink: 0;
}
.header-search:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.header-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.header-search button, .icon-button {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.header-search button { width: 34px; height: 34px; }
.header-search button:hover, .icon-button:hover { color: var(--primary); background: var(--primary-soft); }
.mobile-nav-toggle { display: none; }
.mobile-channel-nav { padding: 8px 16px 14px; background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.mobile-channel-nav a { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 6px; }
.mobile-channel-nav a.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 700; }

.button {
    min-height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}
.button--primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.button--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button--secondary { color: var(--text); background: #fff; border-color: var(--border-strong); }
.button--secondary:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

.search-hero { background: var(--primary-soft); border-bottom: 1px solid var(--primary-border); }
.search-hero__inner { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 54px; text-align: center; }
.search-hero__eyebrow, .eyebrow { margin: 0 0 6px; color: var(--primary); font-size: 13px; font-weight: 700; }
.search-hero h1 { margin: 0; font-size: 36px; line-height: 1.25; }
.search-hero__inner > p:not(.search-hero__eyebrow) { margin: 10px 0 0; color: var(--text-secondary); font-size: 16px; }
.hero-search {
    width: min(720px, 100%);
    min-height: 58px;
    margin: 28px auto 0;
    padding: 6px 6px 6px 18px;
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    background: #fff;
    border: 1px solid var(--primary-border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}
.hero-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13), var(--shadow-md); }
.hero-search input { min-width: 0; height: 44px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; }

.home-content { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 72px; }
.content-section + .content-section { margin-top: 56px; padding-top: 48px; border-top: 1px solid var(--border); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading > div { display: flex; align-items: center; gap: 14px; }
.section-heading h2 { margin: 0; font-size: 24px; line-height: 1.35; }
.section-heading p { margin: 3px 0 0; color: var(--text-secondary); }
.section-icon, .category-card__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    border-radius: 8px;
}
.text-link, .text-button { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; }
.text-link svg, .text-button svg { width: 17px; height: 17px; }
.text-button { min-height: 40px; padding: 0 8px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; }
.text-link:hover, .text-button:hover { color: var(--primary-hover); }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.category-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: #fff; transition: border-color 180ms ease, box-shadow 180ms ease; }
.category-card:hover { border-color: var(--primary-border); box-shadow: var(--shadow-sm); }
.category-card__title { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 11px; font-weight: 700; }
.category-card__title > svg { width: 17px; height: 17px; color: var(--text-muted); }
.category-card__icon { width: 38px; height: 38px; }
.category-card__icon svg { width: 19px; height: 19px; }
.category-card p { margin: 10px 0 0 49px; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.document-link-list { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; border-top: 1px solid var(--border); }
.document-link-list a { min-width: 0; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.document-link-list a > span { min-width: 0; display: flex; align-items: center; gap: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-link-list a svg { width: 17px; height: 17px; }
.document-link-list a:hover { color: var(--primary); }

.compact-search-band, .search-results-header {
    min-height: 146px;
    padding: 30px max(32px, calc((100% - 1180px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border);
}
.compact-search-band p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.compact-search-band h1, .search-results-header h1 { margin: 2px 0 0; font-size: 28px; line-height: 1.35; }
.compact-search {
    width: min(480px, 45vw);
    height: 48px;
    padding: 0 14px;
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
}
.compact-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.compact-search input { border: 0; outline: 0; min-width: 0; }

.docs-layout {
    width: min(1440px, 100%);
    min-height: calc(100vh - var(--header-height));
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 280px minmax(0, 830px) 210px;
    justify-content: center;
    gap: 36px;
}
.docs-layout--list { grid-template-columns: 250px minmax(0, 900px); padding-top: 34px; padding-bottom: 72px; }
.directory-sidebar {
    align-self: start;
    position: sticky;
    top: calc(var(--header-height) + 24px);
    max-height: calc(100vh - var(--header-height) - 48px);
    padding: 18px 10px 18px 0;
    overflow: auto;
}
.directory-sidebar__heading { min-height: 40px; padding: 0 10px 8px; display: flex; align-items: center; justify-content: space-between; color: var(--text); font-size: 13px; font-weight: 700; }
.directory-close { display: none; }
.directory-sidebar nav { display: grid; gap: 2px; }
.directory-link {
    min-height: 42px;
    padding: 8px 10px 8px calc(10px + var(--depth, 0) * 16px);
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 14px;
}
.directory-link svg { width: 17px; height: 17px; }
.directory-link:hover { color: var(--primary); background: var(--surface-subtle); }
.directory-link.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.document-page .directory-sidebar { padding-right: 18px; border-right: 1px solid var(--border); }
.document-tree { display: grid; gap: 3px; }
.document-tree__group { min-width: 0; }
.document-tree__category-row {
    min-width: 0;
    padding-left: calc(var(--depth, 0) * 14px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: center;
}
.document-tree__category {
    min-width: 0;
    min-height: 44px;
    padding: 8px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}
.document-tree__category:only-child { grid-column: 1 / -1; }
.document-tree__category svg,
.document-tree__document svg { width: 16px; height: 16px; }
.document-tree__category span,
.document-tree__document span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-tree__category:hover { color: var(--primary); background: var(--surface-subtle); }
.document-tree__category.is-current { color: var(--primary); }
.document-tree__toggle {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    border-radius: 6px;
}
.document-tree__toggle:hover { color: var(--primary); background: var(--surface-subtle); }
.document-tree__toggle svg { width: 16px; height: 16px; transition: transform 180ms ease; }
.document-tree__group:not(.is-expanded) .document-tree__toggle svg { transform: rotate(-90deg); }
.document-tree__documents {
    margin: 2px 0 7px calc(16px + var(--depth, 0) * 14px);
    padding-left: 10px;
    display: grid;
    gap: 2px;
    border-left: 1px solid var(--border);
}
.document-tree__document {
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 14px;
}
.document-tree__document:hover { color: var(--primary); background: var(--surface-subtle); }
.document-tree__document.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.mobile-directory-button { display: none; }

.document-list-panel { min-width: 0; }
.list-heading { min-height: 72px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--border); }
.list-heading h2 { margin: 0; font-size: 24px; }
.result-count { color: var(--text-muted); font-size: 13px; }
.document-list { display: grid; }
.document-list__item { min-width: 0; min-height: 116px; padding: 20px 4px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 20px; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); }
.document-list__item > svg { color: var(--text-muted); }
.document-list__item:hover .document-list__title { color: var(--primary); }
.document-list__icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 8px; }
.document-list__body { min-width: 0; display: grid; gap: 4px; }
.document-list__title { font-size: 17px; font-weight: 700; }
.document-list__summary { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-list__meta { color: var(--text-muted); font-size: 12px; }

.document-page { background: #fff; }
.article-panel { min-width: 0; padding: 30px 0 80px; }
.breadcrumb { min-height: 36px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--text-muted); font-size: 13px; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb svg { width: 14px; height: 14px; }
.article-header { padding: 22px 0 26px; border-bottom: 1px solid var(--border); }
.article-header h1 { margin: 0; font-size: 32px; line-height: 1.35; overflow-wrap: anywhere; }
.article-summary { margin: 12px 0 0; color: var(--text-secondary); font-size: 16px; }
.article-meta { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--text-muted); font-size: 13px; }
.article-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta svg { width: 16px; height: 16px; }
.article-body { padding-top: 28px; color: #273142; font-size: 16px; line-height: 1.78; overflow-wrap: anywhere; }
.article-body > h1:first-child { display: none; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4 { color: var(--text); line-height: 1.4; scroll-margin-top: calc(var(--header-height) + 24px); }
.article-body h2 { margin: 38px 0 14px; padding-bottom: 9px; border-bottom: 1px solid var(--border); font-size: 24px; }
.article-body h3 { margin: 30px 0 10px; font-size: 20px; }
.article-body h4 { margin: 24px 0 8px; font-size: 17px; }
.article-body p { margin: 12px 0; }
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article-body ul, .article-body ol { padding-left: 26px; }
.article-body li + li { margin-top: 5px; }
.article-body blockquote { margin: 20px 0; padding: 12px 16px; color: var(--text-secondary); background: var(--primary-soft); border-left: 4px solid var(--primary); }
.article-body code { padding: 2px 5px; color: #be123c; background: #f8fafc; border: 1px solid var(--border); border-radius: 4px; font-family: Consolas, "Courier New", monospace; font-size: 0.9em; }
.article-body pre { margin: 20px 0; padding: 18px; overflow: auto; color: #e5e7eb; background: #111827; border-radius: 8px; }
.article-body pre code { padding: 0; color: inherit; background: transparent; border: 0; }
.article-body table { width: 100%; margin: 20px 0; border-collapse: collapse; display: block; overflow-x: auto; }
.article-body th, .article-body td { min-width: 120px; padding: 10px 12px; text-align: left; border: 1px solid var(--border); }
.article-body th { background: var(--surface-subtle); color: var(--text); }
.article-body img { display: block; margin: 24px auto; border: 1px solid var(--border); border-radius: 6px; }
.related-documents { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.related-documents h2 { margin: 0 0 12px; font-size: 20px; }
.related-documents a { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.related-documents a:hover { color: var(--primary); }
.related-documents svg { width: 17px; height: 17px; }
.article-toc { align-self: start; position: sticky; top: calc(var(--header-height) + 30px); padding: 24px 0; font-size: 13px; }
.article-toc > p { margin: 0 0 10px; color: var(--text); font-weight: 700; }
.article-toc nav { display: grid; border-left: 1px solid var(--border); }
.article-toc a { padding: 5px 0 5px 12px; color: var(--text-muted); line-height: 1.45; }
.article-toc a[data-level="1"] { color: var(--text-secondary); font-weight: 600; }
.article-toc a[data-level="3"] { padding-left: 24px; }
.article-toc a:hover, .article-toc a.is-active { color: var(--primary); border-left: 2px solid var(--primary); margin-left: -1px; }

.search-results-header { display: block; }
.search-results-header > div, .result-search-form, .search-results { width: min(980px, 100%); margin-left: auto; margin-right: auto; }
.result-search-form { min-height: 50px; margin-top: 20px; display: grid; grid-template-columns: 20px minmax(0, 1fr) 160px auto; align-items: center; gap: 10px; padding: 4px 5px 4px 14px; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; }
.result-search-form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.result-search-form input, .result-search-form select { min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; }
.result-search-form select { border-left: 1px solid var(--border); padding-left: 12px; }
.search-results { padding: 38px 0 72px; }
.search-results__meta { margin-bottom: 10px; color: var(--text-muted); font-size: 13px; }
.search-result-list { display: grid; }
.search-result { padding: 22px 0; border-bottom: 1px solid var(--border); }
.search-result__path, .search-result__meta { color: var(--text-muted); font-size: 12px; }
.search-result h2 { margin: 5px 0 7px; font-size: 20px; }
.search-result p { margin: 0 0 9px; color: var(--text-secondary); }
.search-result__meta { display: flex; align-items: center; justify-content: space-between; }
.search-result:hover h2 { color: var(--primary); }
mark { padding: 0 2px; color: inherit; background: #fef3c7; border-radius: 2px; }

.empty-state { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--text-secondary); }
.empty-state > svg { width: 42px; height: 42px; color: var(--primary); }
.empty-state h2, .empty-state h3 { margin: 14px 0 4px; color: var(--text); }
.empty-state p { margin: 0; }
.empty-state__actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.not-found-page { min-height: calc(100vh - var(--header-height) - 80px); padding: 80px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.not-found-code { color: var(--primary); font-size: 64px; font-weight: 800; line-height: 1; }
.not-found-page h1 { margin: 20px 0 6px; font-size: 28px; }
.not-found-page p { margin: 0; color: var(--text-secondary); }
.not-found-actions { margin-top: 24px; display: flex; gap: 10px; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface-subtle); }
.site-footer__inner { width: min(1180px, calc(100% - 48px)); min-height: 72px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--text-muted); font-size: 13px; }
.drawer-scrim { position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: rgba(15, 23, 42, 0.48); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 120; max-width: min(360px, calc(100vw - 32px)); padding: 12px 16px; color: #fff; background: #111827; border-radius: 7px; box-shadow: var(--shadow-md); }
.preview-page { background: var(--surface-subtle); }
.preview-banner { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #92400e; background: #fffbeb; border-bottom: 1px solid #fde68a; font-weight: 600; }
.preview-document { width: min(900px, calc(100% - 40px)); margin: 24px auto 60px; }
.preview-document .article-panel { padding: 28px 48px 64px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }

@media (max-width: 1180px) {
    .docs-layout { grid-template-columns: 260px minmax(0, 820px); gap: 28px; }
    .article-toc { display: none; }
    .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .site-header__inner { padding: 0 20px; gap: 16px; }
    .channel-tabs { display: none; }
    .mobile-nav-toggle { display: inline-grid; }
    .header-search { margin-left: auto; width: min(420px, 52vw); }
    .compact-search-band { min-height: 170px; padding: 24px; align-items: stretch; flex-direction: column; gap: 18px; }
    .compact-search { width: 100%; }
    .docs-layout, .docs-layout--list { width: 100%; display: block; padding: 24px 20px 60px; }
    .mobile-directory-button { min-height: 44px; margin-bottom: 16px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; color: var(--primary); background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: 7px; font-weight: 700; }
    .directory-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: var(--z-drawer);
        width: min(320px, 88vw);
        max-height: none;
        padding: 18px 14px;
        border-right: 0;
        background: #fff;
        box-shadow: var(--shadow-md);
        transform: translateX(-105%);
        transition: transform 220ms ease;
    }
    .directory-sidebar.is-open { transform: translateX(0); }
    .directory-sidebar__heading { min-height: 48px; font-size: 16px; }
    .directory-close { display: inline-grid; }
    .article-panel { padding-top: 10px; }
    .search-results-header { padding: 30px 24px; }
    .search-results { width: calc(100% - 40px); }
}

@media (max-width: 640px) {
    .site-header__inner { padding: 0 14px; }
    .site-brand__text { font-size: 16px; }
    .header-search { display: none; }
    .search-hero__inner { width: calc(100% - 28px); padding: 40px 0 38px; }
    .search-hero h1 { font-size: 30px; }
    .hero-search { min-height: 56px; grid-template-columns: 20px 1fr 46px; padding-right: 5px; }
    .hero-search .button { width: 44px; padding: 0; }
    .hero-search .button span { display: none; }
    .home-content { width: calc(100% - 28px); padding: 34px 0 54px; }
    .section-heading { align-items: flex-start; }
    .section-heading > div { align-items: flex-start; }
    .section-heading .text-link { min-height: 44px; }
    .section-heading p { display: none; }
    .category-grid, .document-link-list { grid-template-columns: 1fr; }
    .category-card { padding: 16px; }
    .document-list__item { min-height: 108px; grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 12px; }
    .document-list__summary { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .article-header h1 { font-size: 27px; }
    .article-meta { align-items: flex-start; flex-direction: column; gap: 8px; }
    .result-search-form { grid-template-columns: 20px 1fr 44px; }
    .result-search-form select { grid-column: 1 / -1; width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; }
    .result-search-form .button { width: 44px; padding: 0; }
    .result-search-form .button span { display: none; }
    .empty-state__actions, .not-found-actions { width: 100%; flex-direction: column; }
    .site-footer__inner { width: calc(100% - 28px); align-items: flex-start; flex-direction: column; justify-content: center; gap: 2px; }
    .preview-document { width: calc(100% - 24px); }
    .preview-document .article-panel { padding: 22px 18px 48px; }
}

/* Apifox-style document reader. These rules are scoped so the help-center home page stays unchanged. */
.docs-reading-mode {
    --primary: #3972f6;
    --primary-hover: #245de0;
    --primary-soft: #edf3ff;
    --primary-border: #c9d8ff;
    --docs-header-height: 114px;
    --docs-background: #ffffff;
    --docs-background-soft: #f7f9fc;
    --docs-text: #344054;
    --docs-text-secondary: #475467;
    --docs-text-muted: #667085;
    --docs-border: #eaecf0;
    min-height: 100vh;
    color: var(--docs-text);
    background: var(--docs-background);
}

html.docs-theme-dark body.docs-reading-mode,
.docs-reading-mode.is-dark {
    --primary: #78a2ff;
    --primary-hover: #9bb8ff;
    --primary-soft: #243458;
    --primary-border: #385184;
    --docs-background: #171923;
    --docs-background-soft: #20232f;
    --docs-text: #f1f4f9;
    --docs-text-secondary: #d1d7e2;
    --docs-text-muted: #9ba6b8;
    --docs-border: #303543;
}

.docs-reading-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    height: var(--docs-header-height);
    color: var(--docs-text);
    background: rgba(248, 250, 255, 0.96);
    border-bottom: 1px solid var(--docs-border);
    backdrop-filter: blur(14px);
}
html.docs-theme-dark .docs-reading-header { background: rgba(23, 25, 35, 0.96); }
.docs-reading-header__top { height: 64px; border-bottom: 1px solid rgba(234, 236, 240, 0.5); }
.docs-reading-header__nav { height: 50px; }
.docs-reading-header__inner {
    width: min(1560px, 100%);
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(360px, 570px) minmax(220px, 1fr);
    align-items: center;
    gap: 24px;
}
.docs-reading-brand {
    min-width: 0;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}
.docs-reading-brand__mark {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--primary);
    border-radius: 8px;
}
.docs-reading-brand__mark svg { width: 17px; height: 17px; stroke-width: 2; }
.docs-reading-search {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: center;
    gap: 8px;
}
.docs-reading-search__field {
    height: 40px;
    padding: 0 11px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    color: var(--docs-text-muted);
    background: var(--docs-background);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}
.docs-reading-search__field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(57, 114, 246, 0.12); }
.docs-reading-search__field svg { width: 16px; height: 16px; }
.docs-reading-search__field input { min-width: 0; border: 0; outline: 0; color: var(--docs-text); background: transparent; font-size: 14px; }
.docs-reading-search__field input::placeholder { color: var(--docs-text-muted); }
.docs-reading-search__field kbd {
    color: var(--docs-text-muted);
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 12px;
    white-space: nowrap;
}
.docs-reading-search__submit,
.docs-theme-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    color: var(--docs-text-secondary);
    background: var(--docs-background);
    border: 1px solid var(--docs-border);
    border-radius: 9px;
    cursor: pointer;
}
.docs-reading-search__submit:hover,
.docs-theme-toggle:hover { color: var(--primary); background: var(--primary-soft); border-color: var(--primary-border); }
.docs-reading-search__submit svg,
.docs-theme-toggle svg { width: 17px; height: 17px; }
.docs-theme-toggle { justify-self: end; border-color: transparent; background: transparent; }
.docs-theme-toggle__dark { display: none; }
html.docs-theme-dark .docs-theme-toggle__light { display: none; }
html.docs-theme-dark .docs-theme-toggle__dark { display: block; }
.docs-reading-header__nav .docs-reading-header__inner { display: flex; align-items: stretch; }
.docs-reading-tabs { min-width: 0; max-width: 100%; display: flex; align-items: stretch; gap: 28px; overflow-x: auto; scrollbar-width: none; }
.docs-reading-tabs::-webkit-scrollbar { display: none; }
.docs-reading-tab {
    position: relative;
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    color: var(--docs-text-muted);
    font-size: 14px;
    font-weight: 500;
}
.docs-reading-tab::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: transparent;
}
.docs-reading-tab:hover { color: var(--primary); }
.docs-reading-tab.is-active { color: var(--docs-text); font-weight: 700; }
.docs-reading-tab.is-active::after { background: var(--primary); }
.docs-reading-mobile-row { display: none; }

.docs-reading-mode .document-page {
    position: relative;
    min-height: calc(100vh - var(--docs-header-height));
    overflow: hidden;
    color: var(--docs-text);
    background: var(--docs-background);
}
.docs-page-background {
    position: absolute;
    top: 0;
    right: 0;
    left: max(340px, calc((100% - 1560px) / 2 + 340px));
    z-index: 0;
    height: 620px;
    pointer-events: none;
    background-image:
        radial-gradient(50% 58% at 60% -8%, rgba(57, 114, 246, 0.1) 0%, rgba(255, 255, 255, 0) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='48' viewBox='0 0 84 48'%3E%3Cpath d='M21 1h42l20 23-20 23H21L1 24 21 1Z' fill='none' stroke='%233972f6' stroke-opacity='.035'/%3E%3C/svg%3E");
    background-position: center top, center top;
    background-repeat: no-repeat, repeat;
    background-size: auto, 84px 48px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.8) 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.8) 55%, transparent 100%);
}
html.docs-theme-dark .docs-page-background { opacity: 0.55; }
.docs-reading-mode .docs-layout {
    position: relative;
    z-index: 1;
    width: min(1560px, 100%);
    min-height: calc(100vh - var(--docs-header-height));
    margin: 0 auto;
    padding: 0;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr) 270px;
    justify-content: stretch;
    gap: 40px;
}
.docs-reading-mode .directory-sidebar {
    align-self: start;
    position: fixed;
    top: var(--docs-header-height);
    left: max(0px, calc((100% - 1560px) / 2));
    width: 340px;
    height: calc(100vh - var(--docs-header-height));
    max-height: none;
    margin: 0;
    padding: 22px 20px 40px;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--docs-text-secondary);
    background: transparent;
    border: 0;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
.docs-reading-mode .directory-sidebar:hover { scrollbar-color: rgba(102, 112, 133, 0.35) transparent; }
.docs-reading-mode .directory-sidebar__heading { display: none; }
.docs-reading-mode .document-tree { display: block; }
.docs-reading-mode .document-tree__root,
.docs-reading-mode .document-tree__category,
.docs-reading-mode .document-tree__document {
    width: 100%;
    min-height: 36px;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    color: var(--docs-text-secondary);
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    text-align: left;
}
.docs-reading-mode .document-tree__root { margin-bottom: 1px; }
.docs-reading-mode .document-tree__group {
    min-width: 0;
    padding-left: calc(var(--depth, 0) * 20px);
}
.docs-reading-mode .document-tree__group[hidden] { display: none !important; }
.docs-reading-mode .document-tree__category {
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 1px;
    cursor: pointer;
}
.docs-reading-mode .document-tree__category span,
.docs-reading-mode .document-tree__document span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-reading-mode .document-tree__category svg { width: 16px; height: 16px; color: var(--docs-text-muted); transition: transform 180ms ease; }
.docs-reading-mode .document-tree__group:not(.is-expanded) .document-tree__category svg { transform: rotate(-90deg); }
.docs-reading-mode .document-tree__root:hover,
.docs-reading-mode .document-tree__category:hover,
.docs-reading-mode .document-tree__document:hover { color: var(--docs-text-secondary); background: var(--docs-background-soft); }
.docs-reading-mode .document-tree__documents {
    margin: 0 0 1px 12px;
    padding: 0 0 0 8px;
    display: block;
    border-left: 1px solid var(--docs-border);
}
.docs-reading-mode .document-tree__documents[hidden] { display: none !important; }
.docs-reading-mode .document-tree__document { margin-bottom: 1px; }
.docs-reading-mode .document-tree__document.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 600;
}

.docs-reading-mode .article-panel { grid-column: 2; min-width: 0; padding: 28px 0 80px; }
.docs-reading-mode .article-toolbar {
    min-height: 30px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.docs-reading-mode .breadcrumb { min-height: auto; color: var(--docs-text-muted); font-size: 14px; line-height: 22px; }
.page-copy { position: relative; display: inline-flex; align-items: center; color: var(--docs-text-secondary); }
.page-copy__main,
.page-copy__toggle {
    height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: inherit;
    background: var(--docs-background);
    border: 1px solid var(--docs-border);
    font-size: 13px;
    cursor: pointer;
}
.page-copy__main { border-radius: 6px 0 0 6px; }
.page-copy__toggle { width: 30px; padding: 0; margin-left: -1px; border-radius: 0 6px 6px 0; }
.page-copy__main:hover,
.page-copy__toggle:hover,
.page-copy.is-open .page-copy__toggle { color: var(--primary); background: var(--primary-soft); border-color: var(--primary-border); }
.page-copy__main svg { width: 13px; height: 13px; }
.page-copy__toggle svg { width: 14px; height: 14px; }
.page-copy__menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 20;
    width: 176px;
    padding: 5px;
    background: var(--docs-background);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
}
.page-copy__menu button {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--docs-text-secondary);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.page-copy__menu button:hover { color: var(--primary); background: var(--primary-soft); }
.page-copy__menu svg { width: 15px; height: 15px; }
.docs-reading-mode .article-header { margin: 0 0 16px; padding: 0; border: 0; }
.docs-reading-mode .article-header h1 {
    margin: 0;
    color: var(--docs-text);
    font-size: 32px;
    font-weight: 600;
    line-height: 40px;
    overflow-wrap: anywhere;
    letter-spacing: 0;
    scroll-margin-top: calc(var(--docs-header-height) + 24px);
}
.docs-reading-mode .article-body {
    padding: 0;
    color: var(--docs-text-secondary);
    font-size: 16px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}
.docs-reading-mode .article-body > h1:first-child { display: none; }
.docs-reading-mode .article-body h1,
.docs-reading-mode .article-body h2,
.docs-reading-mode .article-body h3,
.docs-reading-mode .article-body h4 { color: var(--docs-text); scroll-margin-top: calc(var(--docs-header-height) + 24px); }
.docs-reading-mode .article-body h2 { margin: 40px 0 16px; padding: 0; border: 0; font-size: 24px; font-weight: 600; line-height: 1.5; }
.docs-reading-mode .article-body h3 { margin: 32px 0 12px; font-size: 20px; font-weight: 600; }
.docs-reading-mode .article-body h4 { margin: 26px 0 10px; font-size: 17px; font-weight: 600; }
.docs-reading-mode .article-body p { margin: 0 0 18px; }
.docs-reading-mode .article-body strong { color: var(--docs-text); font-weight: 600; }
.docs-reading-mode .article-body a { color: var(--primary); text-decoration: none; }
.docs-reading-mode .article-body a:hover { text-decoration: underline; text-underline-offset: 3px; }
.docs-reading-mode .article-body ul,
.docs-reading-mode .article-body ol { margin: 16px 0 20px; padding-left: 26px; }
.docs-reading-mode .article-body blockquote { color: var(--docs-text-secondary); background: var(--primary-soft); border-left-color: var(--primary); }
.docs-reading-mode .article-body code { color: #c02655; background: var(--docs-background-soft); border-color: var(--docs-border); }
.docs-reading-mode .article-body pre { color: #e5e7eb; background: #18202f; }
.docs-reading-mode .article-body th,
.docs-reading-mode .article-body td { border-color: var(--docs-border); }
.docs-reading-mode .article-body th { color: var(--docs-text); background: var(--docs-background-soft); }
.docs-reading-mode .article-body img {
    margin: 32px auto;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 10px 34px rgba(16, 24, 40, 0.08);
}
.article-pagination {
    margin-top: 64px;
    padding-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    border-top: 1px solid var(--docs-border);
}
.article-pagination__item {
    min-width: 0;
    min-height: 78px;
    padding: 13px 15px;
    display: grid;
    align-content: center;
    gap: 4px;
    color: var(--docs-text-secondary);
    background: var(--docs-background);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
}
.article-pagination__item--next { text-align: right; }
.article-pagination__item span { display: flex; align-items: center; gap: 5px; color: var(--docs-text-muted); font-size: 12px; }
.article-pagination__item--next span { justify-content: flex-end; }
.article-pagination__item svg { width: 14px; height: 14px; }
.article-pagination__item strong { overflow: hidden; color: var(--docs-text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.article-pagination__item:hover { color: var(--primary); background: var(--primary-soft); border-color: var(--primary-border); }
.article-pagination__item:hover strong { color: var(--primary); }

.docs-reading-mode .article-toc {
    align-self: start;
    position: fixed;
    top: calc(var(--docs-header-height) + 28px);
    right: max(0px, calc((100% - 1560px) / 2));
    width: 270px;
    margin: 0;
    padding: 0 20px 40px 0;
    color: var(--docs-text-secondary);
    font-size: 14px;
}
.docs-reading-mode .article-toc > p {
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--docs-text-secondary);
    font-size: 14px;
    font-weight: 500;
}
.docs-reading-mode .article-toc > p svg { width: 15px; height: 15px; }
.docs-reading-mode .article-toc nav { display: grid; border: 0; }
.docs-reading-mode .article-toc a {
    padding: 5px 0;
    color: var(--docs-text-secondary);
    font-size: 14px;
    line-height: 22px;
}
.docs-reading-mode .article-toc a[data-level="3"] { padding-left: 16px; }
.docs-reading-mode .article-toc a:hover,
.docs-reading-mode .article-toc a.is-active { margin-left: 0; color: var(--primary); border: 0; }
.docs-reading-mode .article-toc.is-empty nav { display: none; }
.docs-reading-mode .site-footer { display: none; }

@media (max-width: 1399px) {
    .docs-reading-mode .docs-layout { grid-template-columns: 300px minmax(0, 1fr); gap: 32px; padding-right: 24px; }
    .docs-reading-mode .directory-sidebar { left: 0; width: 300px; }
    .docs-reading-mode .article-toc { display: none; }
    .docs-page-background { left: 300px; }
}

@media (max-width: 980px) {
    .docs-reading-header__top .docs-reading-header__inner { grid-template-columns: minmax(0, 1fr) 40px; gap: 12px; }
    .docs-reading-search { display: none; }
}

@media (max-width: 860px) {
    .docs-reading-header__inner {
        padding: 0 20px;
        grid-template-columns: minmax(0, 1fr) 40px;
        gap: 12px;
    }
    .docs-reading-search { display: none; }
    .docs-reading-header__nav .docs-reading-header__inner { display: block; padding: 0; }
    .docs-reading-tabs { display: none; }
    .docs-reading-mobile-row {
        height: 50px;
        padding: 0 20px;
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        align-items: center;
        gap: 8px;
        color: var(--docs-text-secondary);
        font-size: 14px;
    }
    .docs-reading-mobile-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .docs-reading-mobile-row button {
        width: 34px;
        height: 34px;
        padding: 0;
        display: grid;
        place-items: center;
        color: var(--docs-text-secondary);
        background: transparent;
        border: 0;
        border-radius: 6px;
        cursor: pointer;
    }
    .docs-reading-mobile-row button:hover { color: var(--primary); background: var(--primary-soft); }
    .docs-reading-mobile-row svg { width: 18px; height: 18px; }
    .docs-reading-mode .docs-layout { z-index: auto; width: 100%; display: block; padding: 0 20px 60px; }
    .docs-reading-mode .directory-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: var(--z-drawer);
        width: min(340px, 90vw);
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        margin: 0;
        padding: 16px 14px 28px;
        overscroll-behavior: contain;
        background: var(--docs-background);
        box-shadow: 16px 0 38px rgba(16, 24, 40, 0.18);
        transform: translateX(-105%);
        transition: transform 220ms ease;
    }
    .docs-reading-mode .directory-sidebar.is-open { transform: translateX(0); }
    .docs-reading-mode .directory-sidebar__heading {
        min-height: 48px;
        margin-bottom: 8px;
        padding: 0 6px 8px 12px;
        display: flex;
        color: var(--docs-text);
        font-size: 16px;
    }
    .docs-reading-mode .directory-close { display: inline-grid; }
    .docs-reading-mode .directory-close:hover { color: var(--primary); background: var(--primary-soft); }
    .docs-reading-mode .article-panel { position: relative; z-index: 1; grid-column: auto; padding: 28px 0 40px; }
    .docs-reading-mode .article-toolbar { display: none; }
    .docs-reading-mode .article-header { margin-bottom: 16px; }
    .docs-reading-mode .article-header h1 { font-size: 32px; line-height: 40px; }
    .docs-reading-mode .article-toc { display: none; }
    .docs-page-background { left: 0; height: 560px; }
}

@media (max-width: 640px) {
    .docs-reading-header__inner,
    .docs-reading-mobile-row { padding-right: 20px; padding-left: 20px; }
    .docs-reading-brand { font-size: 16px; }
    .docs-reading-mode .docs-layout { padding-right: 20px; padding-left: 20px; }
    .docs-reading-mode .article-header h1 { font-size: 30px; line-height: 39px; }
    .docs-reading-mode .article-body { font-size: 16px; line-height: 1.78; }
    .article-pagination { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
