/* ==========================================================================
   ZAI 智能体平台操作手册 - 文档中心样式
   延续站点浅色内容页规范（与 FAQ / 法律条款页一致），
   在单列正文基础上增加左侧目录树的两栏布局。
   ========================================================================== */

/* 文档页：左侧导航 fixed 固定，页面整体滚动，滚动条位于屏幕最右侧 */
body.docs-body {
    overflow-x: hidden;
}

.docs-page {
    background: #ffffff;
    min-height: 100vh;
    padding: 120px 0 60px;
}

.docs-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

/* ---------- 左侧目录树 ---------- */
.docs-sidebar {
    position: fixed;
    top: 96px;
    left: max(24px, calc((100vw - 1200px) / 2 + 24px));
    width: 260px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 1rem;
    box-sizing: border-box;
}

.docs-sidebar-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #9aa3b2;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.docs-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid #eceff4;
}

.docs-sidebar-list li {
    margin: 0;
}

.docs-sidebar-list a {
    display: block;
    padding: 0.5rem 0 0.5rem 1rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: #666666;
    font-size: 0.92rem;
    text-decoration: none;
    line-height: 1.5;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.docs-sidebar-list a:hover {
    color: #0d1b2a;
}

.docs-sidebar-list a.active {
    color: #0d6efd;
    border-left-color: #0d6efd;
    font-weight: 500;
}

/* ---------- 右侧正文 ---------- */
.docs-content {
    max-width: 820px;
    margin-left: 308px;
    padding: 2rem 0 3rem;
    line-height: 1.75;
}

.docs-content .docs-breadcrumb {
    color: #8a93a3;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.docs-content .docs-breadcrumb a {
    color: #8a93a3;
    text-decoration: none;
}

.docs-content .docs-breadcrumb a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.docs-content h1 {
    color: #1a1f2b;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

.docs-content .last-updated {
    color: #8a93a3;
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.docs-content h2 {
    color: #1a1f2b;
    font-size: 1.35rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eceff4;
}

.docs-content h3 {
    color: #1a1f2b;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
}

.docs-content p {
    color: #444c59;
    font-size: 0.96rem;
    line-height: 1.85;
    margin: 0 0 1rem;
}

.docs-content ul,
.docs-content ol {
    color: #444c59;
    font-size: 0.96rem;
    line-height: 1.85;
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.docs-content li {
    margin-bottom: 0.4rem;
}

.docs-content li > ul,
.docs-content li > ol {
    margin: 0.4rem 0 0.4rem;
}

.docs-content a {
    color: #0d6efd;
    text-decoration: none;
}

.docs-content a:hover {
    text-decoration: underline;
}

.docs-content strong {
    color: #1a1f2b;
    font-weight: 600;
}

/* ---------- 行内代码与代码块 ---------- */
.docs-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.88em;
    background: #f4f6f9;
    color: #0d1b2a;
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

.docs-content pre {
    background: #0d1b2a;
    color: #dbe4f0;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0 0 1.25rem;
    line-height: 1.6;
}

.docs-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: 0.88rem;
}

/* ---------- 提示框 ---------- */
.docs-callout {
    margin: 0 0 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border-left: 3px solid;
    font-size: 0.93rem;
    line-height: 1.7;
    color: #444c59;
}

.docs-callout .docs-callout-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.docs-callout-info {
    background: #f0f6ff;
    border-left-color: #0d6efd;
}

.docs-callout-info .docs-callout-title {
    color: #0d6efd;
}

.docs-callout-tip {
    background: #f0fbf7;
    border-left-color: #12b76a;
}

.docs-callout-tip .docs-callout-title {
    color: #0e9453;
}

.docs-callout-warning {
    background: #fff8ed;
    border-left-color: #f59e0b;
}

.docs-callout-warning .docs-callout-title {
    color: #b45309;
}

/* ---------- 表格 ---------- */
.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.5rem;
    font-size: 0.92rem;
}

.docs-content th,
.docs-content td {
    text-align: left;
    padding: 0.7rem 0.9rem;
    border: 1px solid #e8ebf0;
    color: #444c59;
    vertical-align: top;
}

.docs-content th {
    background: #f7f8fa;
    color: #1a1f2b;
    font-weight: 600;
}

/* ---------- 首页章节卡片 ---------- */
.docs-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin: 1.5rem 0 0;
}

.docs-card {
    display: block;
    padding: 1.25rem 1.5rem;
    border: 1px solid #e8ebf0;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.docs-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 6px 20px rgba(13, 27, 42, 0.06);
    text-decoration: none;
}

.docs-card .docs-card-title {
    display: block;
    color: #1a1f2b;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.docs-card .docs-card-desc {
    display: block;
    color: #6b7380;
    font-size: 0.88rem;
    line-height: 1.65;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .docs-page {
        padding: 100px 0 60px;
    }

    .docs-sidebar {
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
        padding: 0 0 1rem;
        border-bottom: 1px solid #eceff4;
    }

    .docs-sidebar-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 1rem;
        border-left: none;
    }

    .docs-sidebar-list a {
        display: inline-block;
        padding: 0.35rem 0;
        margin-left: 0;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .docs-sidebar-list a.active {
        border-bottom-color: #0d6efd;
        border-left: none;
    }

    .docs-content {
        margin-left: 0;
        max-width: none;
        padding: 2rem 0;
    }
}

@media (max-width: 768px) {
    .docs-page {
        padding: 100px 0 40px;
    }

    .docs-content h1 {
        font-size: 1.7rem;
    }

    .docs-content h2 {
        font-size: 1.2rem;
    }

    .docs-card-grid {
        grid-template-columns: 1fr;
    }
}
