/* --------------------------
           全局 CSS 变量（统一维护）
        -------------------------- */
:root {
    --transition-all: all 0.2s ease;
    --color-black: #000;
    --color-muted: #6c757d;
    --border-base: #f1f1f1;
}

/* --------------------------
   全局重置（标准化）
-------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background-color: #fff;
    line-height: 1.6;
    font-weight: 340;
    color: var(--color-black);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-all);
}

img {
    max-width: 100%;
    vertical-align: middle;
}

ul, ol {
    list-style: none;
}

button {
    border: none;
    background: transparent;
    cursor: pointer;
}

/* --------------------------
   顶部占位条
-------------------------- */
.page-top-bar {
    height: 36px;
    background-color: #fff;
    width: 100%;
}

/* --------------------------
   桌面端侧边栏
-------------------------- */
.sidebar {
    position: fixed;
    top: 36px;
    left: 0;
    bottom: 0;
    width: 300px;
    background-color: #fff;
    z-index: 99;
}

.sidebar-inner {
    padding-left: 72px;
    padding-top: 72px;
}


.sidebar-bottom-text {
    position: absolute; /* 开启绝对定位 */
    bottom: 0; /* 距离父容器底部0px，实现贴底 */
    left: 0; /* 距离父容器左侧0px，对齐侧边栏 */
    width: 100%; /* 文字宽度占满侧边栏，避免换行错乱 */
    text-align: center; /* 可选，文字居中 */
    padding-left: 72px;; /* 可选，调整上下内边距 */
}

/* --------------------------
   导航交互效果
-------------------------- */
.nav-link-hover {
    transition: var(--transition-all);
}

.nav-link-hover:hover {
    font-weight: 600;
    transform: translateX(2px);
    opacity: 1;
}

/* --------------------------
主内容区域（固定侧栏 300px：用剩余宽度，避免 max-width:70% + margin-left 在窄桌面端与侧栏重叠）
-------------------------- */
.main-content {
    margin-left: 300px;
    min-height: 100vh;
    padding: 90px 20px 20px 20px;
    width: calc(100% - 300px);
    max-width: none;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* --------------------------
移动端响应式
-------------------------- */
@media (max-width: 991.98px) {

    .main-content {
        margin-left: 0;
        padding: 20px;
        width: 100%;
        max-width: 100%;
    }

    body {
        padding-top: 70px;
    }
    .navbar {
        padding-left: 20px;
        padding-right: 20px;
    }

    .sticky-mobile-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background-color: #fff;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }

    .sticky-mobile-nav.show {
        transform: translateY(0);
    }

    /* 汉堡按钮 */
    .fp-hamburger {
        width: 24px;
        height: 24px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        border: none;
        background: transparent;
        padding: 0;
        cursor: pointer;
    }
    .fp-hamburger span {
        width: 100%;
        height: 2px;
        background-color: #000;
        transition: all 0.3s ease;
    }
    #navbarMobileMenu .nav-link {
        padding-top: 16px;
    }
}

/* 正文内联盟推广披露块（作者在 HTML 中使用 class="nbs-affiliate-note"） */
.post-content .nbs-affiliate-note {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #6c757d;
    border-left: 3px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    margin: 1rem 0;
    background: #f8f9fa;
}

.post-content .nbs-affiliate-note a {
    color: #495057;
    text-decoration: underline;
}

/* --------------------------
   全站表单焦点：聚焦时边框与阴影与默认态一致（无线框变粗/变色）
   依赖 Bootstrap 的 .form-control / .form-select / .form-check-input / .btn
-------------------------- */
.form-control:focus,
.form-control:focus-visible {
    outline: none;
    box-shadow: none;
    border-color: #dee2e6;
}

.form-control.field-error {
    border-color: #adb5bd !important;
    box-shadow: none !important;
}

.form-control.field-error:focus,
.form-control.field-error:focus-visible {
    border-color: #adb5bd !important;
    box-shadow: none !important;
    outline: none;
}

.form-select:focus,
.form-select:focus-visible {
    outline: none;
    box-shadow: none;
    border-color: #dee2e6;
}

.form-check-input:focus,
.form-check-input:focus-visible {
    outline: none;
    box-shadow: none;
    border-color: #dee2e6;
}

.btn:focus,
.btn:focus-visible {
    outline: none;
    box-shadow: none;
}

/* --------------------------
   全站居中弹窗（ui_modal.js，与 ui_tokens 变量兼容，无 ui_tokens 时回退为同色值）
-------------------------- */
body.ui-site-modal-open {
    overflow: hidden;
}

.ui-site-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--ui-space-4, 16px);
    box-sizing: border-box;
}

.ui-site-modal.is-open {
    display: flex;
}

.ui-site-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
}

.ui-site-modal__dialog {
    position: relative;
    width: 100%;
    max-width: min(420px, 100%);
    max-height: min(80vh, 640px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    background: var(--ui-bg, #ffffff);
    color: var(--ui-text, #111111);
    border: 1px solid var(--ui-border, #e5e7eb);
    border-radius: var(--ui-radius-md, 10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.ui-site-modal__header {
    padding: var(--ui-space-4, 16px) var(--ui-space-4, 16px) 0;
}

.ui-site-modal__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.35;
}

.ui-site-modal__body {
    padding: var(--ui-space-3, 12px) var(--ui-space-4, 16px);
    flex: 1;
    min-height: 0;
}

.ui-site-modal__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.ui-site-modal__footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--ui-space-2, 8px);
    padding: var(--ui-space-3, 12px) var(--ui-space-4, 16px) var(--ui-space-4, 16px);
    border-top: 1px solid var(--ui-border, #e5e7eb);
}

.ui-site-modal__footer .btn {
    border-radius: var(--ui-radius-sm, 6px);
    min-width: 88px;
}