/* ===== 页面主体 ===== */
.api-docs-section {
    padding: 40px 0 60px;
    background: #f8faff;
    min-height: calc(100vh - 56px - 460px);
}

/* ===== 标题区域 ===== */
.page-header {
    margin-bottom: 2.5rem;
}
.page-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
    justify-content: flex-start;
}
.page-header .breadcrumb-item a {
    color: #006ACD;
    text-decoration: none;
}
.page-header .breadcrumb-item.active {
    color: #6c7a8a;
}
.page-header .title-wrapper {
    text-align: center;
}
.page-title {
    font-weight: 700;
    color: #0b1a33;
    font-size: 2.2rem;
    letter-spacing: -0.3px;
}
.page-title i {
    color: #006ACD;
    margin-right: 0.6rem;
}
.page-sub {
    color: #6c7a8a;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== 左侧树形分类导航 ===== */
.docs-sidebar {
    position: sticky;
    top: 80px;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 1.2rem 0.5rem;
}
.docs-sidebar .sidebar-heading {
    font-weight: 700;
    color: #0b1a33;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e9edf4;
    margin-bottom: 0.8rem;
}
/* 一级分类 */
.docs-sidebar .category-toggle {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #1e293b;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
}
.docs-sidebar .category-toggle:hover {
    background: rgba(0, 106, 205, 0.06);
    color: #006ACD;
}
.docs-sidebar .category-toggle i:first-child {
    margin-right: 0.6rem;
    color: #6c7a8a;
}
.docs-sidebar .category-toggle .chevron {
    margin-left: auto;
    transition: transform 0.25s;
}
.docs-sidebar .category-toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}
/* 二级 API 列表 */
.docs-sidebar .category-content {
    padding-left: 1.2rem;
}
.docs-sidebar .category-content .nav-link {
    border-radius: 0.6rem;
    padding: 0.4rem 1rem 0.4rem 1.8rem;
    color: #4b5a6a;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    position: relative;
}
.docs-sidebar .category-content .nav-link::before {
    content: '—';
    position: absolute;
    left: 0.4rem;
    color: #dde2eb;
}
.docs-sidebar .category-content .nav-link i {
    margin-right: 0.6rem;
    color: #6c7a8a;
    font-size: 0.8rem;
}
.docs-sidebar .category-content .nav-link.active {
    background: #006ACD;
    color: #ffffff;
}
.docs-sidebar .category-content .nav-link.active::before {
    color: #ffffff;
}
.docs-sidebar .category-content .nav-link.active i {
    color: #ffffff;
}
.docs-sidebar .category-content .nav-link:hover:not(.active) {
    background: rgba(0, 106, 205, 0.06);
    color: #006ACD;
}
.docs-sidebar .category-content .nav-link:hover:not(.active) i {
    color: #006ACD;
}

/* ===== 右侧 API 内容 ===== */
.api-content .tab-pane {
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.api-card {
    background: #ffffff;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 1.5rem 1.8rem;
    transition: box-shadow 0.2s;
}
.api-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.api-card .api-method {
    display: inline-block;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    color: #fff;
    margin-right: 0.6rem;
}
.method-get { background: #22c55e; }
.method-post { background: #3b82f6; }
.method-put { background: #f59e0b; }
.method-delete { background: #ef4444; }

.api-card .api-path {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #0b1a33;
}
.api-card .api-desc {
    color: #6c7a8a;
    font-size: 0.95rem;
    margin-top: 0.3rem;
}
.api-card .api-params {
    margin-top: 0.8rem;
    background: #f8faff;
    border-radius: 0.6rem;
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
}
.api-card .api-params .param-item {
    display: flex;
    gap: 1rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid #eef2f7;
}
.api-card .api-params .param-item:last-child {
    border-bottom: none;
}
.api-card .api-params .param-name {
    font-weight: 600;
    color: #1e293b;
    width: 100px;
    flex-shrink: 0;
}
.api-card .api-params .param-type {
    color: #6c7a8a;
    width: 80px;
    flex-shrink: 0;
}
.api-card .api-params .param-desc {
    color: #6c7a8a;
}
.api-card .api-response {
    margin-top: 0.8rem;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 0.6rem;
    padding: 0.8rem 1.2rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.api-card .api-response .label {
    color: #80c8f0;
    font-weight: 600;
}

/* 右侧顶部返回提示 */
.api-breadcrumb {
    font-size: 0.85rem;
    color: #6c7a8a;
    margin-bottom: 1rem;
}
.api-breadcrumb .sep {
    margin: 0 6px;
    color: #dde2eb;
}
.api-breadcrumb .current-api {
    font-weight: 600;
    color: #0b1a33;
}

/* ===== 响应式 ===== */
@media (max-width: 991.98px) {
    .docs-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
    .docs-sidebar .category-toggle {
        padding: 0.4rem 0.8rem;
    }
    .docs-sidebar .category-content .nav-link {
        padding: 0.3rem 0.8rem 0.3rem 1.5rem;
    }
}
@media (max-width: 767.98px) {
    .api-docs-section { padding: 30px 0 50px; }
    .page-title { font-size: 1.6rem; }
    .api-card { padding: 1.2rem; }
    .api-card .api-params .param-item { flex-wrap: wrap; gap: 0.2rem; }
    .api-card .api-params .param-name { width: auto; }
    .api-card .api-params .param-type { width: auto; }
}
@media (max-width: 575.98px) {
    .page-title { font-size: 1.4rem; }
}