/* ===== SLAM 导航文档页 (260819.2) =====
   版式: 顶栏(沿用 style.css) + 左侧目录树 + 正文 + 右侧本页锚点
   配色沿用 style.css 变量: --accent-color / --text-dark / --text-gray */

.doc-body {
    background: #fff;
}

.doc-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 190px;
    gap: 0;
    max-width: 1560px;
    margin: 0 auto;
    align-items: start;
}

/* ---------- 左侧目录树 ---------- */
.doc-sidebar {
    position: sticky;
    top: 70px;
    align-self: start;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 28px 20px 40px 24px;
    border-right: 1px solid #eaecef;
}

.doc-sidebar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.5;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #eaecef;
}

.doc-tree a {
    display: block;
    padding: 7px 10px;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text-gray);
    border-radius: 6px;
    transition: var(--transition);
}

.doc-tree a:hover {
    background: #f4f6f9;
    color: var(--text-dark);
}

/* 可折叠章节 */
.doc-chap {
    margin-bottom: 2px;
}

.doc-chap > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 22px;
    position: relative;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
    border-radius: 6px;
    cursor: pointer;
    list-style: none;
    transition: var(--transition);
}

.doc-chap > summary::-webkit-details-marker {
    display: none;
}

/* 展开箭头 */
.doc-chap > summary::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -4px;
    border-right: 1.6px solid #9aa3ad;
    border-bottom: 1.6px solid #9aa3ad;
    transform: rotate(-45deg);
    transition: transform .2s;
}

.doc-chap[open] > summary::before {
    transform: rotate(45deg);
    margin-top: -5px;
}

.doc-chap > summary:hover {
    background: #f4f6f9;
}

.doc-chap[open] > summary .doc-chap-name {
    color: var(--accent-color);
}

.doc-chap-name {
    flex: 1;
}

.doc-badge {
    flex: 0 0 auto;
    min-width: 19px;
    height: 19px;
    line-height: 19px;
    padding: 0 5px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #8a929b;
    background: #eef0f3;
    border-radius: 4px;
}

.doc-tree-sub {
    margin: 2px 0 10px 10px;
    padding-left: 10px;
    border-left: 1px solid #eaecef;
}

.doc-tree-sub a {
    font-size: 14px;
    padding: 6px 10px;
}

.doc-tree-sub a.active {
    color: var(--accent-color);
    background: #f0f5ff;
    font-weight: 600;
}

/* ---------- 正文 ---------- */
.doc-main {
    padding: 28px 48px 60px;
    min-width: 0;
    color: var(--text-color);
}

.doc-crumb {
    font-size: 13.5px;
    color: #9aa3ad;
    margin-bottom: 14px;
}

.doc-h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.35;
    margin-bottom: 10px;
}

.doc-meta {
    font-size: 13.5px;
    color: #9aa3ad;
}

.doc-hr {
    margin: 22px 0 34px;
    border: none;
    border-top: 1px solid #eaecef;
}

/* 大章分隔 */
.doc-chap-hr {
    margin: 70px 0 40px;
    border: none;
    border-top: 3px solid #eef0f3;
}

.doc-main .doc-h1 {
    scroll-margin-top: 90px;
}

.doc-main h2 {
    font-size: 23px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin: 46px 0 18px;
    padding: 10px 16px;
    background: #f4f7fb;
    border-left: 4px solid var(--accent-color);
    border-radius: 0 8px 8px 0;
    scroll-margin-top: 96px;
}

.doc-main h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
    margin: 28px 0 12px;
}

.doc-main p {
    font-size: 15.5px;
    line-height: 2;
    color: var(--text-color);
    margin: 0 0 14px;
    text-indent: 2em;
}

.doc-main h3 + p {
    text-indent: 2em;
}

.doc-main strong {
    color: var(--accent-color);
    font-weight: 600;
}

/* 列表 */
.doc-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}

.doc-list li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 9px;
    font-size: 15.5px;
    line-height: 1.95;
    color: var(--text-color);
}

.doc-list li::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 14px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #b9c0c8;
}

.doc-warn li::before,
.doc-ok li::before {
    content: none;
}

.doc-warn li {
    padding-left: 26px;
}

.doc-warn li::after {
    content: '!';
    position: absolute;
    left: 0;
    top: 7px;
    width: 17px;
    height: 17px;
    line-height: 17px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #e8a33d;
    border-radius: 4px;
}

.doc-ok li {
    padding-left: 26px;
}

.doc-ok li::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 12px;
    width: 10px;
    height: 5px;
    border-left: 2px solid #34a853;
    border-bottom: 2px solid #34a853;
    transform: rotate(-45deg);
}

/* 表格 */
.doc-table-wrap {
    overflow-x: auto;
    margin: 0 0 20px;
    border: 1px solid #eaecef;
    border-radius: 8px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    line-height: 1.7;
    background: #fff;
}

.doc-table th {
    background: #f7f8fa;
    color: var(--text-dark);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid #eaecef;
    white-space: nowrap;
}

.doc-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #f1f2f4;
    border-right: 1px solid #f1f2f4;
    color: var(--text-gray);
    vertical-align: top;
}

.doc-table td:last-child {
    border-right: none;
}

.doc-table tbody tr:last-child td {
    border-bottom: none;
}

.doc-table td:first-child {
    color: var(--text-dark);
    font-weight: 600;
    background: #fafbfc;
    white-space: nowrap;
    width: 108px;
}

.doc-table td:nth-child(2) {
    color: var(--text-dark);
    width: 190px;
}

.doc-table td.hl {
    color: var(--accent-color);
    font-weight: 600;
}

.doc-table-compat td:first-child,
.doc-table-compat td:nth-child(2) {
    width: 50%;
    background: #fff;
    font-weight: 500;
    color: var(--text-color);
    white-space: normal;
}

/* ---- 界面配图 ---- */
.doc-fig {
    margin: 22px 0 26px;
}

.doc-fig img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #e6e8eb;
    border-radius: 8px;
    background: #fff;
}

.doc-fig figcaption {
    margin-top: 10px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-gray);
    text-align: center;
}

/* 两图并排 */
.doc-fig-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 22px 0 26px;
}

.doc-fig-row .doc-fig {
    margin: 0;
}

.doc-fig-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

/* 三张面板原始高度不一, 统一显示高度, 内容等比缩放居中 */
.doc-fig-row-3 img {
    height: 280px;
    width: 100%;
    object-fit: contain;
    object-position: center top;
}

@media (max-width: 760px) {
    .doc-fig-row-3 {
        grid-template-columns: 1fr;
    }
}

.doc-fig-row figcaption {
    font-size: 13px;
}

.doc-note {
    font-size: 14px !important;
    line-height: 1.85 !important;
    color: var(--text-gray) !important;
    text-indent: 0 !important;
    margin-bottom: 8px !important;
}

/* 底部按钮 */
.doc-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 50px 0 0;
    padding-top: 34px;
    border-top: 1px solid #eaecef;
}

.doc-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 8px;
    font-size: 15.5px;
    transition: var(--transition);
}

.doc-btn:hover {
    background: #0052cc;
}

.doc-btn-ghost {
    background: #fff;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.doc-btn-ghost:hover {
    background: #f0f5ff;
    color: var(--accent-color);
}

/* ---------- 右侧本页锚点 ---------- */
.doc-toc {
    position: sticky;
    top: 70px;
    align-self: start;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 34px 20px 40px 0;
}

.doc-toc-title {
    font-size: 13px;
    font-weight: 600;
    color: #9aa3ad;
    margin-bottom: 10px;
    padding-left: 12px;
}

.doc-toc a {
    display: block;
    padding: 6px 12px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-gray);
    border-left: 2px solid #eaecef;
    transition: var(--transition);
}

.doc-toc a:hover {
    color: var(--text-dark);
}

.doc-toc a.active {
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    font-weight: 600;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
    .doc-layout {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .doc-toc {
        display: none;
    }

    .doc-main {
        padding: 28px 32px 60px;
    }
}

@media (max-width: 992px) {
    .doc-layout {
        grid-template-columns: 1fr;
    }

    .doc-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        border-right: none;
        border-bottom: 1px solid #eaecef;
        padding: 18px 18px 14px;
    }

    .doc-sidebar-title {
        font-size: 15.5px;
        padding-bottom: 10px;
        margin-bottom: 8px;
    }

    .doc-tree-sub {
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
        margin-left: 0;
        padding-left: 0;
        border-left: none;
    }

    .doc-tree-sub a {
        padding: 5px 10px;
        font-size: 13.5px;
        background: #f4f6f9;
        border-radius: 999px;
    }

    .doc-main {
        padding: 22px 18px 46px;
    }

    .doc-h1 {
        font-size: 24px;
    }

    .doc-main h2 {
        font-size: 19.5px;
        margin: 34px 0 14px;
        scroll-margin-top: 70px;
    }

    .doc-main h3 {
        font-size: 16px;
        margin: 22px 0 10px;
    }

    .doc-main p,
    .doc-list li {
        font-size: 15px;
        line-height: 1.9;
    }

    .doc-table {
        font-size: 13.5px;
    }

    .doc-table th,
    .doc-table td {
        padding: 9px 12px;
    }

    .doc-table td:first-child {
        width: auto;
    }

    .doc-table td:nth-child(2) {
        width: auto;
    }

    .doc-fig-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .doc-fig {
        margin: 18px 0 20px;
    }

    .doc-fig figcaption {
        font-size: 13px;
        text-align: left;
    }

    .doc-cta {
        margin-top: 36px;
        padding-top: 26px;
    }

    .doc-btn {
        flex: 1 1 auto;
        text-align: center;
        padding: 11px 20px;
        font-size: 15px;
    }
}


/* ---------- 分章显示 ---------- */
/* 默认全展开(无 JS 时的降级)，JS 起效后由 .js-paged 收成单章 */
.js-paged .doc-chapter {
    display: none;
}

.js-paged .doc-chapter.is-active {
    display: block;
    animation: docFade .18s ease-out;
}

@keyframes docFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* 章末翻页 */
.doc-pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid #eaecef;
}

.doc-pager-blank {
    flex: 0 0 auto;
}

.doc-pager-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 46%;
    padding: 14px 20px;
    border: 1px solid #e4e7eb;
    border-radius: 10px;
    background: #fff;
    transition: var(--transition);
}

.doc-pager-next {
    margin-left: auto;
    text-align: right;
}

.doc-pager-btn:hover {
    border-color: var(--accent-color);
    background: #f7faff;
}

.doc-pager-dir {
    font-size: 12.5px;
    color: #9aa3ad;
}

.doc-pager-btn:hover .doc-pager-dir {
    color: var(--accent-color);
}

.doc-pager-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
}

@media (max-width: 640px) {
    .doc-pager-btn {
        max-width: 48%;
        padding: 12px 14px;
    }

    .doc-pager-name {
        font-size: 13.5px;
    }
}


