/* ===== 统一主蓝：#169BD5 ===== */
:root {
    --brand-blue: #169BD5;
    --brand-blue-rgb: 22,155,213;
    --brand-blue-hover: #138ac0;
    --brand-blue-active: #117dad;
    /* 固定导航高度（JS 会覆盖为真实高度） */
    --nav-h: 56px;
    /* 首页产品卡比例：高:宽（例如 9/16 / 3/4 / 1/1） */
    --product-ratio: 1/2;
}

/* ===== 按钮 & 链接配色 ===== */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand-blue);
    --bs-btn-border-color: var(--brand-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-blue-hover);
    --bs-btn-hover-border-color: var(--brand-blue-hover);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-blue-active);
    --bs-btn-active-border-color: var(--brand-blue-active);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-blue);
    --bs-btn-border-color: var(--brand-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-blue);
    --bs-btn-hover-border-color: var(--brand-blue);
}

.text-primary {
    color: var(--brand-blue) !important;
}

a, .link-primary {
    color: var(--brand-blue);
}

    a:hover, .link-primary:hover {
        color: var(--brand-blue-hover);
    }

/* ===== 导航栏颜色（仅着色） ===== */
.navbar .navbar-brand,
.navbar .nav-link {
    color: var(--brand-blue) !important;
}

    .navbar .nav-link:hover,
    .navbar .nav-link:focus {
        color: var(--brand-blue-hover) !important;
    }

/* ===== 基础布局 & 粘底页脚 ===== */
html {
    font-size: 14px;
    height: 100%;
}

html, body {
    height: 100%;
}

@media (min-width:768px) {
    html {
        font-size: 16px;
    }
}

/* body 作为顶层：但真正托底的是 .site-wrapper/.site-main */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding-top: 0 !important; /* 导航避让交给 sticky 计算 */
}

/* 整页容器（包住导航 + 主体 + 页脚） */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* 关键：至少占满视口 */
}

/* 主体生长，托住页脚 */
.site-main {
    flex: 1 0 auto;
}

/* 页脚不被压缩（有 .site-main 托底即可） */
.footer {
    flex-shrink: 0;
}

/* 焦点高亮 */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 .1rem #fff, 0 0 0 .25rem var(--brand-blue);
}

/* 顶部导航小样式 */
.brand-logo {
    height: 24px;
    width: auto;
    display: block;
}

.brand-text {
    color: var(--brand-blue) !important;
}

.search-input {
    width: 200px;
}

@media (max-width:992px) {
    .search-input {
        width: 160px;
    }
}

/* 外层内容卡片壳 */
.page-shell {
    padding: 18px;
}

/* ===== 正文排版 ===== */
.prose, .article {
    line-height: 1.9;
    font-size: 1rem;
    text-align: justify;
    text-justify: inter-ideograph;
    word-break: break-word;
}

    .prose p, .article p {
        text-indent: 2em;
        margin: 0 0 1em;
    }

    .prose ul, .prose ol, .article ul, .article ol {
        margin: .5em 0 0;
        padding-left: 1.2em;
    }

    .prose li, .article li {
        line-height: 1.9;
        margin: .25em 0;
        color: #212529;
    }

        .prose li p, .article li p {
            text-indent: 0;
            margin: 0;
        }

    .prose p + ul, .prose p + ol {
        margin-top: .5em;
    }

@media (max-width:360px) {
    .prose p {
        margin: 0 0 .8em;
    }
}

.prose li::marker {
    color: var(--brand-blue);
}

.feature-label {
    color: var(--brand-blue);
    font-weight: 600;
}

/* ===== 两栏布局（左侧目录/历史 + 右侧正文） ===== */
.page.two-col {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.sidebar {
    flex: 0 0 260px;
    max-width: 260px;
    border-right: 1px solid #e7e7e7;
    padding-right: 12px;
    background: #fff;
}

.content {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width:992px) {
    .page.two-col {
        flex-direction: column;
    }

    .sidebar {
        flex: 1 1 auto;
        max-width: none;
        border-right: 0;
        border-bottom: 1px solid #e7e7e7;
        padding-right: 0;
        padding-bottom: 12px;
    }

    .content {
        padding-left: 0;
        padding-top: 12px;
    }
}

/* 左侧列表（目录/历史版本） */
.side-list {
    max-height: 420px;
    overflow: auto;
    margin-top: 8px;
    padding-left: 0;
}

.side-item {
    list-style: none;
    border-radius: 6px;
    position: relative;
}

.side-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 6px 8px 12px;
    text-decoration: none;
    color: inherit;
}

.side-item:hover {
    background: #f4f7ff;
}

    .side-item:hover::before, .side-item.active::before {
        content: "";
        position: absolute;
        left: 0;
        top: 6px;
        bottom: 6px;
        width: 4px;
        border-radius: 4px;
        background: var(--brand-blue);
    }

    .side-item:hover .side-link, .side-item.active .side-link {
        color: var(--brand-blue);
    }

/* 图片/表格不溢出 */
.prose img, .content img {
    max-width: 100%;
    height: auto;
}

.prose table, .content table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

/* 画廊（如用到） */
.gallery .card-img-top {
    aspect-ratio: 1.4 / 1.5;
    object-fit: cover;
    width: 100%;
    height: auto;
}

/* 表格更美观 */
.table th, .table td {
    vertical-align: middle;
}

/* 登录问候色 */
.navbar .nav-greeting.nav-link {
    color: #aaa !important;
    cursor: default;
}

    .navbar .nav-greeting.nav-link:hover,
    .navbar .nav-greeting.nav-link:focus {
        color: #aaa !important;
        text-decoration: none;
    }

/* 徽章色 */
.badge.bg-success, .badge.text-bg-success {
    background-color: var(--brand-blue) !important;
    color: #fff !important;
    border-color: var(--brand-blue) !important;
}

.badge.bg-secondary, .badge.text-bg-secondary {
    background-color: #aaaaaa !important;
    border-color: #aaaaaa !important;
    color: #fff !important;
}

/* 搜索框 */
.search-box {
    width: 220px;
}

@media (max-width:992px) {
    .search-box {
        width: 180px;
    }
}

.search-box .input-group-text {
    padding: .25rem .5rem;
    border-color: #ced4da;
}

.search-box .search-icon {
    fill: #aaaaaa;
}

.search-box .form-control {
    padding-left: 0;
    border-color: #ced4da;
}

    .search-box .form-control:focus {
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 .2rem rgba(22,155,213,.15);
    }

.search-box .input-group-text + .form-control {
    border-left: 0;
}

/* 目录（首页） */
.toc-list {
    margin: 0;
    padding-left: .25rem;
}

    .toc-list > li {
        margin: .25rem 0;
    }

.toc-link {
    display: block;
    padding: .25rem .5rem;
    text-decoration: none;
}

    .toc-link:hover {
        text-decoration: underline;
    }

#toc .active {
    font-weight: 600;
}

.prose p {
    line-height: 1.75;
}

.prose h4, .prose h5 {
    margin-top: 1rem;
}

.citation-title {
    color: #169BD5;
}

/* 首页产品卡（固定比例：--product-ratio） */
.product-card {
    position: relative;
    border-radius: .25rem;
    overflow: hidden;
}

    .product-card .product-thumb {
        position: relative;
        width: 100%;
        overflow: hidden;
        border-bottom: 1px solid rgba(0,0,0,.05);
        background: #fff;
    }

    .product-card .ratio-1x2 {
        padding-top: 50%;
    }
    /* 高:宽=1:2 */
    .product-card .product-thumb-img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        border-radius: .25rem .25rem 0 0;
    }

    .product-card .card-body {
        text-align: left;
    }

/* 首页“产品 / 插件”下拉卡片 */
.product-dropdown .dropdown-toggle::after {
    margin-left: .25rem;
}

.product-dropdown .dropdown-menu.product-menu {
    width: 420px;
    padding: 12px;
    border-radius: 12px;
}

.product-dropdown .product-menu-item a {
    padding: 8px 6px;
    border-radius: 8px;
    color: inherit;
    display: flex;
    gap: .75rem;
    align-items: center;
}

    .product-dropdown .product-menu-item a:hover {
        background: rgba(0,0,0,.03);
    }
/* 下拉里的产品小图标：统一尺寸、无边框 */
.product-logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* ===== 吸顶行为（保持原样式，仅定位） ===== */
.sticky-col {
    position: sticky;
    top: calc(var(--nav-h) + 12px);
    align-self: flex-start;
    max-height: calc(100vh - var(--nav-h) - 16px);
    overflow: auto;
}
/* 移动端不吸顶 */
@media (max-width:991.98px) {
    .sticky-col {
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
    }
}
/* 确保 fixed-top 导航叠在最上层（不改变外观） */
.navbar.fixed-top {
    z-index: 1050;
}

.navbar-frame {
    position: sticky;
    top: 12px;
    z-index: 1050;
}

/* 返回链接样式（详情页左上角） */
.back-link {
    color: #6c757d;
}

    .back-link:hover {
        color: var(--brand-blue);
        text-decoration: underline;
    }
.card-img-bordered {
    border: 8px solid #fff;
    border-radius: 8px;
    box-sizing: border-box;
    /* 可选：加点阴影更有层次感 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}