.docs-body {
    background: #050608;
}

/* 文档页主滚动条跟随深色主题，避免系统默认亮色轨道破坏页面整体感。 */
.docs-page {
    scrollbar-width: thin;
    scrollbar-color: rgba(104, 118, 140, 0.72) rgba(5, 6, 8, 0.86);
}

.docs-page::-webkit-scrollbar {
    width: 10px;
}

.docs-page::-webkit-scrollbar-track {
    background: rgba(5, 6, 8, 0.9);
}

.docs-page::-webkit-scrollbar-thumb {
    border: 2px solid rgba(5, 6, 8, 0.9);
    border-radius: 999px;
    background: rgba(104, 118, 140, 0.72);
}

.docs-page::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 200, 255, 0.58);
}

.docs-topbar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(280px, 386px) minmax(160px, 1fr);
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    background: rgba(5, 6, 8, 0.94);
}

.docs-topbar .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}

.docs-tabs {
    grid-column: 1;
    grid-row: 1;
    margin-left: 142px;
    height: 72px;
    align-items: stretch;
    justify-self: start;
}

.docs-tabs a {
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
}

.docs-tabs a.active {
    border-bottom-color: var(--text);
}

.docs-search {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 12px;
    width: min(386px, 100%);
    min-height: 38px;
    padding: 0 10px 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    color: #71798a;
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.docs-topbar .primary-button {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}

.docs-search span {
    position: relative;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    font-size: 0;
}

.docs-topbar .primary-button .windows-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    color: currentColor;
}

.docs-topbar .primary-button .windows-icon i {
    border-radius: 1px;
    background: currentColor;
}

.docs-search span::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 1px;
    width: 9px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 999px;
}

.docs-search span::after {
    content: "";
    position: absolute;
    right: 1px;
    bottom: 2px;
    width: 7px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: center;
}

.docs-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #d8dde8;
    background: transparent;
    font-size: 0.96rem;
    font-weight: 500;
}

.docs-search input::placeholder {
    color: #9aa3b5;
}

.docs-search kbd {
    min-width: 38px;
    height: 22px;
    padding: 0 7px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    color: #8b93a3;
    background: rgba(255, 255, 255, 0.075);
    font-size: 0.72rem;
    line-height: 20px;
    text-align: center;
    white-space: nowrap;
}

.static-search {
    opacity: 0.58;
}

.docs-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 860px) 280px;
    justify-content: space-between;
    gap: 32px;
    width: calc(100% - 48px);
    margin: 0 24px;
}

.docs-sidebar,
.docs-toc {
    position: sticky;
    top: 96px;
    height: calc(100vh - 112px);
    padding: 26px 0;
    overflow: auto;
    scrollbar-width: thin; /* 让 Firefox 里的目录滚动条保持轻量，不抢导航层级。 */
    scrollbar-color: rgba(154, 164, 178, 0.34) rgba(255, 255, 255, 0.035); /* 滑块贴近灰蓝文字，轨道贴近暗色背景。 */
}

/* 文档目录滚动条只在侧栏范围内定制，避免影响其它页面的系统滚动体验。 */
.docs-sidebar::-webkit-scrollbar,
.docs-toc::-webkit-scrollbar {
    width: 8px;
}

.docs-sidebar::-webkit-scrollbar-track,
.docs-toc::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.035);
}

.docs-sidebar::-webkit-scrollbar-thumb,
.docs-toc::-webkit-scrollbar-thumb {
    border: 2px solid rgba(5, 6, 8, 0.96);
    border-radius: 999px;
    background: rgba(154, 164, 178, 0.38);
}

.docs-sidebar::-webkit-scrollbar-thumb:hover,
.docs-toc::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 212, 191, 0.52);
}

.docs-sidebar {
    border-right: 1px solid var(--line-soft);
}

.docs-sidebar section {
    margin-bottom: 30px;
    padding-right: 20px;
}

.docs-sidebar h2,
.docs-toc h2 {
    margin: 0 0 12px;
    color: var(--subtle);
    font-size: 0.9rem;
    font-weight: 850;
}

.docs-sidebar a,
.docs-toc a {
    display: block;
    margin: 2px 0;
    padding: 8px 12px;
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0;
    color: var(--muted);
    font-weight: 650;
}

.docs-toc a {
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 0.94rem;
    line-height: 1.32;
}

.docs-toc a.toc-level-3 {
    padding-left: 24px;
    color: var(--subtle);
    font-size: 0.84rem;
    font-weight: 600;
}

.docs-sidebar a:hover,
.docs-sidebar a.active,
.docs-toc a:hover,
.docs-toc a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(45, 212, 191, 0.08);
}

.docs-content {
    min-width: 0;
    padding: 76px 0 120px;
}

.doc-meta {
    color: var(--subtle);
    font-weight: 800;
}

.docs-content h1 {
    margin: 18px 0 28px;
    font-size: clamp(2rem, 3.6vw, 3rem);
    line-height: 1.05;
    letter-spacing: 0;
}

.docs-content h2 {
    margin: 64px 0 18px;
    padding-top: 10px;
    font-size: 1.75rem;
    line-height: 1.2;
}

.docs-content h3 {
    margin: 34px 0 10px;
    color: var(--text);
    font-size: 1.18rem;
}

.docs-content p,
.docs-content li {
    color: var(--muted);
    font-size: 1.02rem;
}

.docs-content p {
    margin: 0 0 18px;
}

.docs-content ul,
.docs-content ol {
    margin: 0 0 24px;
    padding-left: 1.3rem;
}

.docs-content li {
    margin: 8px 0;
}

.docs-content li::marker {
    color: var(--section-label, #00c8ff);
}

.docs-content strong {
    color: var(--text);
}

.docs-content p > strong,
.docs-content li > strong {
    color: var(--section-label, #00c8ff);
}

.docs-content code {
    padding: 0.08em 0.34em;
    border: 1px solid #2d2d30;
    border-radius: 4px;
    color: #d4d4d4;
    background: #1e1e1e;
    font-family: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, "Microsoft YaHei Mono", monospace; /* 正文内联代码跟随代码面板字体，避免函数名像独立标签。 */
    font-size: 0.9em;
    line-height: 1.4;
    white-space: nowrap;
}

/* 协议速查区把选择建议压缩成可扫描的小面板，降低正文段落阅读成本。 */
.protocol-matrix {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 26px 0 34px;
}

.protocol-matrix div {
    min-height: 96px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.protocol-matrix strong {
    display: block;
    margin-bottom: 6px;
    color: var(--section-label, #00c8ff);
    font-size: 0.98rem;
}

.protocol-matrix span {
    color: var(--muted);
    font-size: 0.94rem;
}

/* 协议示例代码区模拟轻量 IDE 面板，方便用户按语言复制粘贴。 */
.doc-code {
    margin: 24px 0 34px;
    overflow: hidden;
    border: 1px solid #2d2d30;
    border-radius: 14px;
    background: #1e1e1e;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.doc-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 0 18px;
    border-bottom: 1px solid #2d2d30;
    background: #252526;
}

.doc-code-tabs {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.doc-code-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 58px;
    color: #cccccc;
    font-size: 0.92rem;
    font-weight: 760;
    white-space: nowrap;
}

.doc-code-tab::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 9px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 18px rgba(45, 212, 191, 0.38);
    transform: rotate(45deg);
}

.doc-code-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
}

.doc-code-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.doc-code-language {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #3c3c3c;
    border-radius: 8px;
    color: #cccccc;
    background: #1e1e1e;
    font-size: 0.85rem;
    font-weight: 760;
}

.doc-code-copy {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: 8px;
    color: #cccccc;
    background: #2d2d30;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 780;
}

.doc-code-copy:hover {
    color: #ffffff;
    background: #37373d;
}

.doc-code pre {
    margin: 0;
    padding: 22px 0;
    overflow-x: auto;
}

.doc-code-scroll {
    overflow: auto hidden;
    scrollbar-width: thin; /* 代码区横向滚动条保持低存在感，避免盖过示例内容。 */
    scrollbar-color: #6a6a6a #1e1e1e; /* 代码区滚动条贴近 VS Code 暗色编辑器。 */
}

.doc-code-scroll::-webkit-scrollbar {
    height: 12px;
}

.doc-code-scroll::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.doc-code-scroll::-webkit-scrollbar-thumb {
    border: 3px solid #1e1e1e;
    border-radius: 999px;
    background: #6a6a6a;
}

.doc-code-lines {
    min-width: max-content;
    margin: 0;
    padding: 14px 0;
    counter-reset: code-line;
    color: #d4d4d4;
    font-family: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, "Microsoft YaHei Mono", monospace;
    font-size: 0.875rem;
    line-height: 1.48;
    tab-size: 4;
}

.doc-code-lines li {
    display: grid;
    grid-template-columns: 56px max-content;
    min-height: 20px;
    margin: 0;
    padding: 0 22px 0 0;
    counter-increment: code-line;
    color: #d4d4d4;
    font-size: 0.875rem;
}

.doc-code-lines li::before {
    content: counter(code-line);
    padding-right: 16px;
    color: #858585;
    text-align: right;
    user-select: none;
}

.doc-code-lines li.is-highlighted {
    background: rgba(38, 79, 120, 0.32);
    box-shadow: inset 3px 0 0 #007acc;
}

.doc-code-lines code {
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
}

.code-keyword {
    color: #569cd6;
}

.code-type {
    color: #4ec9b0;
}

.code-preprocessor {
    color: #c586c0;
}

.code-function {
    color: #dcdcaa;
}

.code-string {
    color: #ce9178;
}

.code-number {
    color: #b5cea8;
}

.code-comment {
    color: #6a9955;
}

.doc-figure {
    margin: 34px 0;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
}

.doc-figure img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 640px;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
}

.doc-figure figcaption {
    padding: 14px 18px 18px;
    color: var(--muted);
    font-size: 0.92rem;
}

.doc-callout {
    display: grid;
    gap: 6px;
    margin: 24px 0;
    padding: 18px;
    border: 1px solid rgba(45, 212, 191, 0.26);
    border-radius: 16px;
    background: rgba(45, 212, 191, 0.09);
}

.doc-callout span {
    color: var(--muted);
}

.doc-table-wrap {
    margin: 24px 0 34px;
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.doc-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.doc-table th,
.doc-table td {
    padding: 13px 15px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.55;
    text-align: left;
    vertical-align: top;
}

.doc-table th {
    color: var(--section-label, #00c8ff);
    background: rgba(0, 200, 255, 0.08);
    font-weight: 850;
}

.doc-table tr:last-child td {
    border-bottom: 0;
}

/* 个人工作台的操作说明保持普通列表形态，避免帮助文档读起来像功能卡片墙。 */
.workspace-plain-list {
    margin-top: 18px;
    margin-bottom: 28px;
}

.workspace-plain-list strong {
    color: var(--section-label, #00c8ff);
}

/* 绘图控件的逐项功能名使用主页“产品能力”同款强调色，和普通正文加粗区分开。 */
.docs-content .plot-feature-details p > strong,
.docs-content .plot-feature-details li > strong {
    color: var(--section-label, #00c8ff);
}

.plot-performance-banner {
    margin: 20px 0 28px;
    padding: 16px 18px;
    border: 1px solid rgba(0, 200, 255, 0.28);
    border-left: 3px solid var(--section-label, #00c8ff);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.12), rgba(45, 212, 191, 0.035) 46%, rgba(255, 255, 255, 0.025));
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.2);
}

.plot-performance-copy {
    display: grid;
    gap: 12px;
}

.plot-performance-copy p {
    display: grid;
    gap: 5px;
    margin: 0;
}

.docs-content .plot-performance-copy p > strong {
    color: var(--section-label, #00c8ff);
    font-size: 0.98rem;
}

.plot-performance-copy span {
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.62;
}

.serial-performance-banner {
    margin-top: 18px;
}

.workspace-shot {
    margin: 24px 0 34px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.workspace-shot-media {
    position: relative;
    display: grid;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    place-items: center;
    background: radial-gradient(circle at 20% 18%, rgba(45, 212, 191, 0.12), transparent 34%), #080b10;
}

.workspace-shot-media img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 640px;
    object-fit: contain;
    object-position: center;
}

.workspace-shot-placeholder {
    min-height: 260px;
    color: #7f8a9d;
    font-size: 0.96rem;
    font-weight: 760;
    letter-spacing: 0;
}

.workspace-shot-placeholder::before {
    content: attr(data-shot-name);
}

.workspace-shot figcaption {
    padding: 13px 16px 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

.doc-image-zoom-button {
    position: absolute;
    right: 14px;
    bottom: 14px;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(5, 6, 8, 0.74);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 780;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.workspace-shot-media:hover .doc-image-zoom-button,
.doc-image-zoom-button:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.doc-image-zoom-button:hover {
    border-color: rgba(45, 212, 191, 0.52);
}

.doc-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: rgba(0, 0, 0, 0.82);
}

.doc-image-lightbox.is-open {
    display: flex;
}

.doc-image-lightbox img {
    max-width: min(1180px, 92vw);
    max-height: 82vh;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.doc-image-lightbox p {
    position: fixed;
    left: 50%;
    bottom: 24px;
    margin: 0;
    color: #d8dde8;
    font-size: 0.94rem;
    transform: translateX(-50%);
}

.doc-image-lightbox-close {
    position: fixed;
    top: 22px;
    right: 24px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}

.doc-image-lightbox-close:hover {
    border-color: rgba(45, 212, 191, 0.52);
}

.docs-toc {
    border-left: 1px solid var(--line-soft);
    padding-left: 22px;
}

.copy-doc {
    width: 100%;
    min-height: 42px;
    margin-bottom: 28px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
    font-weight: 750;
}

.copy-doc:hover {
    color: var(--text);
    border-color: rgba(45, 212, 191, 0.35);
}

.release-page {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
    padding: 82px 0 120px;
}

.release-hero {
    max-width: 780px;
    margin-bottom: 48px;
}

.release-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 3.8vw, 3.2rem);
    line-height: 1.05;
}

.release-hero p:last-child {
    color: var(--muted);
    font-size: 1.1rem;
}

.release-list {
    display: grid;
    gap: 18px;
}

.release-card {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 28px;
    padding: 28px;
    border: 1px solid var(--line-soft);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.045);
}

.release-version span {
    color: var(--accent);
    font-weight: 850;
}

.release-version h2 {
    margin: 8px 0 0;
    font-size: 2.4rem;
}

.release-version h2 a {
    color: inherit;
    text-decoration: none;
}

.release-version h2 a:hover {
    color: #00c8ff;
}

.release-content h3 {
    margin: 0 0 16px;
    font-size: 1.35rem;
}

.release-content ul {
    margin: 0;
    padding-left: 1.2rem;
}

.release-content li {
    margin: 8px 0;
    color: var(--muted);
}

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

@media (max-width: 1180px) {
    .docs-layout {
        grid-template-columns: 240px minmax(0, 1fr);
        justify-content: stretch;
        width: min(100% - 40px, 1040px);
        margin: 0 auto;
    }

    .docs-toc {
        display: none;
    }
}

@media (max-width: 820px) {
    .docs-topbar {
        grid-template-columns: 1fr auto;
        gap: 14px;
        padding: 12px 16px;
    }

    .docs-topbar .brand {
        grid-column: 1;
        grid-row: 1;
    }

    .docs-topbar .primary-button {
        grid-column: 2;
        grid-row: 1;
    }

    .docs-tabs {
        order: 3;
        grid-column: 1 / -1;
        grid-row: 2;
        margin-left: 0;
        height: auto;
        border-top: 1px solid var(--line-soft);
        padding-top: 10px;
    }

    .docs-search {
        order: 4;
        grid-column: 1 / -1;
        grid-row: 3;
        width: 100%;
    }

    .docs-layout {
        display: block;
        width: min(100% - 32px, 760px);
    }

    .docs-sidebar {
        position: static;
        height: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        padding: 22px 0 0;
        border-right: 0;
        border-bottom: 1px solid var(--line-soft);
    }

    .docs-sidebar section {
        margin-bottom: 18px;
        padding-right: 0;
    }

    .docs-content {
        padding-top: 46px;
    }

    .protocol-matrix {
        grid-template-columns: 1fr;
    }

    .release-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .docs-sidebar {
        grid-template-columns: 1fr;
    }

    .doc-code-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 12px 14px;
    }

    .doc-code-tab {
        min-height: 34px;
    }

    .doc-code-tab::after {
        display: none;
    }

    .doc-code-actions {
        width: 100%;
        justify-content: space-between;
    }

    .doc-code-lines {
        font-size: 0.86rem;
    }

    .doc-code-lines li {
        grid-template-columns: 44px max-content;
        font-size: 0.86rem;
    }

    .workspace-shot-media {
        min-height: 0;
    }

    .workspace-shot-placeholder {
        min-height: 190px;
    }

    .workspace-shot-media img {
        max-height: 420px;
    }

    .plot-performance-banner {
        padding: 18px;
    }

    .doc-image-lightbox {
        padding: 20px;
    }

    .doc-image-lightbox p {
        width: calc(100% - 40px);
        text-align: center;
    }
}
