/* docs.css — 文档页面侧边栏样式 */

* { box-sizing: border-box; }

.docs-layout {
    display: flex;
    align-items: flex-start;
    width: 100%;
    min-height: calc(100vh - 120px);
}

/* ── 侧边栏 ── */

.docs-sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: #d2d2d2;
    border-right: 1px solid #808080;
    padding: 0;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
    position: sticky;
    top: 0;
}

.docs-sidebar-title {
    font-weight: bold;
    padding: 8px 12px;
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #fff;
    font-size: 1rem;
    margin: 0;
}

#docs-search {
    width: 100%;
    padding: 6px 10px;
    border: none;
    border-bottom: 1px solid #808080;
    font-size: 0.85rem;
    outline: none;
    background: #fff;
}

#docs-search:focus {
    background: #ffffee;
}

.docs-sidebar .tree-view {
    margin: 0;
    padding: 4px 0;
    font-size: 0.85rem;
}

.docs-sidebar .tree-view li {
    list-style: none;
}

.docs-sidebar .tree-view details {
    margin: 0;
}

.docs-sidebar .tree-view summary {
    cursor: pointer;
    padding: 4px 8px 4px 12px;
    font-weight: bold;
    color: #000;
    user-select: none;
    word-break: break-all;
}

.docs-sidebar .tree-view summary:hover {
    background: #b0c4de;
}

.docs-sidebar .tree-view summary.active-section {
    color: #000080;
}

.docs-sidebar .tree-view ul {
    margin: 0;
    padding: 0 0 0 16px;
}

.docs-sidebar .tree-view ul li {
    list-style: none;
}

.docs-sidebar .tree-view ul li a {
    display: block;
    padding: 3px 12px;
    color: #000;
    text-decoration: none;
    font-size: 0.82rem;
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.docs-sidebar .tree-view ul li a:hover {
    background: #b0c4de;
    color: #000;
}

.docs-sidebar .tree-view ul li a.active {
    background: #000080;
    color: #fff;
    font-weight: bold;
}

/* ── 内容区 ── */

.docs-content {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 280px);
    overflow-wrap: break-word;
    word-break: break-word;
}

.docs-content .single {
    padding: 1rem 1.5rem;
}

.docs-content .single pre {
    overflow-x: auto;
    max-width: 100%;
}

.docs-content .single table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
}

.docs-toc {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #808080;
}

.docs-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-toc ul li {
    margin: 0.3rem 0;
}

.docs-toc ul li a {
    color: #0000ee;
    text-decoration: none;
    font-size: 1rem;
}

.docs-toc ul li a:hover {
    text-decoration: underline;
}

/* ── 移动端 ── */

@media (max-width: 900px) {
    .docs-layout {
        flex-direction: column;
    }

    .docs-sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        max-height: 40vh;
        position: static;
        border-right: none;
        border-bottom: 2px solid #808080;
    }

    .docs-content {
        max-width: 100%;
        width: 100%;
    }
}
