/* 文章内容区图片自适应宽度，避免裁剪 */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
    border-radius: 6px;
    background: #f5f7fa;
}

/* 文章卡片封面图片，减少CLS */
.cover-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    border-radius: 6px;
    box-shadow: 0 2px 8px #eee;
    background-color: #f5f7fa;
}

@supports (aspect-ratio: 1/1) {
    /* 响应式方案可选 */
    /* .cover-img { height: auto; aspect-ratio: 16/9; } */
}

.sidebar ul li a {
    display: inline-block;
    transition: transform 0.2s, background 0.3s, color 0.2s, box-shadow 0.2s;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.sidebar ul li a:hover {
    transform: scale(1.12);
    background: linear-gradient(90deg, #6c7ae0 0%, #3c50b4 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(60, 80, 180, 0.12);
}

/* 搜索关键词高亮 */
.hl-keyword {
    position: relative;
    padding: 0 2px;
    font-weight: 600;
    color: #222;
    background: linear-gradient(120deg, rgba(255, 230, 120, 0.9) 0%, rgba(255, 210, 90, 0.9) 100%);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 顶部 Logo 小人手臂挥动动画（替换 SMIL） */
#arm {
    transform-origin: 27px 29.5px;
    /* 与原 SMIL 旋转中心一致 */
    animation: arm-wave 0.6s ease-in-out infinite;
}

@keyframes arm-wave {
    0% {
        transform: rotate(0deg);
    }

    45% {
        transform: rotate(22deg);
    }

    55% {
        transform: rotate(18deg);
    }

    /* 轻微回摆 */
    100% {
        transform: rotate(0deg);
    }
}

/* 炫酷首页背景 */
body {
    background: linear-gradient(120deg, #f8fafc 0%, #e3e6f3 100%);
}

/* 卡片悬浮炫酷阴影 */
.card {
    transition: box-shadow 0.3s, transform 0.3s;
}

.card:hover {
    box-shadow: 0 8px 32px rgba(60, 80, 180, 0.18), 0 1.5px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px) scale(1.03);
    background: rgba(255, 255, 255, 0.98);
}

/* 侧边栏炫酷渐变 */
.sidebar {
    background: linear-gradient(120deg, #f5f7fa 0%, #e3e6f3 100%);
    box-shadow: 0 2px 16px rgba(60, 80, 180, 0.08);
    border-radius: 1rem;
}

/* 超链接悬停动画 */
a {
    transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
    color: #3c50b4;
    text-shadow: 0 2px 8px #b3c6ff;
}

/* 导航栏悬停高亮 */
.navbar-nav .nav-link:hover {
    color: #3c50b4;
    background: rgba(60, 80, 180, 0.08);
    border-radius: 8px;
}

/* 分类标题炫酷效果 */
.sidebar h2 {
    background: #3c50b4 !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    -webkit-user-select: none;
    user-select: none;
}

.sidebar h2:hover {
    background: linear-gradient(90deg, #6c7ae0 0%, #3c50b4 100%);
}

/* 按钮炫酷效果 */
.btn-primary {
    background: linear-gradient(90deg, #3c50b4 0%, #6c7ae0 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(60, 80, 180, 0.12);
    transition: background 0.3s, transform 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #6c7ae0 0%, #3c50b4 100%);
    transform: scale(1.08);
}

/* 顶部固定导航栏：给主体增加上边距避免遮挡 */
.custom-navbar {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.92) !important;
}

body {
    padding-top: 96px;
    /* 粘底页脚基础布局：纵向 Flex，视口最小高度 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 普通底部版权（不固定） */
.site-footer {
    /* 当页面内容不足一屏时，自动将页脚推到底部 */
    margin-top: auto;
    background: #f8f9fa;
    text-align: center;
    font-size: 1rem;
    color: #666;
    padding: 24px 0 40px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.03);
}

/* 首页自定义样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 2rem;
    letter-spacing: 2px;
    color: #222;
}

.navbar-nav .nav-link {
    padding: 0 50px;
    color: #222;
    font-weight: bold;
    font-size: 1.15rem;
}

.navbar-nav {
    gap: 50px;
    position: relative;
    left: 80px;
    /* 可微调 */
}

/* 子页面（使用 fixed-top 的 .custom-navbar）收紧导航间距，避免最右侧文字被裁切 */
.custom-navbar .navbar-nav {
    gap: 16px;
    left: 0;
}

.custom-navbar .navbar-nav .nav-link {
    padding: 0 16px;
    font-size: 1.05rem;
}

.btn-search {
    width: 38px;
    height: 38px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.container {
    margin-top: 3rem;
}

/* 主内容容器占据剩余空间，推动页脚 */
.main-container {
    flex: 1 0 auto;
}

.home-title {
    font-size: 2.8rem;
    letter-spacing: 2px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1.5rem;
}

.home-desc {
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
}

.sidebar {
    max-width: 200px;
    padding-top: 0;
    padding: 2rem;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.sidebar h4 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 3rem;
}


.sidebar ul {
    font-size: 1.25rem;
    list-style: none;
    padding-left: 0;
}

.sidebar li {
    margin-bottom: 3rem;
}

.sidebar a {
    color: #222;
    font-weight: bold;
    text-decoration: none;
}

.card {
    box-shadow: none;
    border-radius: 0;
    border: none;
    background: transparent;
}

.card-title {
    font-weight: bold;
}

.card-text {
    min-height: 48px;
    color: #666;
}

.badge {
    background: #6c757d;
}

.col-lg-3,
.col-md-4 {
    padding-top: 10px;
    margin-top: 8px;
}

/* 移除旧 footer-fixed 保留占位留档（不再使用） */
/* .footer-fixed { deprecated } */

/* ========= 移动端响应式增强 ========= */
@media (max-width: 992px) {
    body {
        padding-top: 76px;
    }

    .navbar-brand svg {
        width: 54px;
        height: 54px;
    }

    .navbar-nav {
        gap: 8px;
        left: 0;
    }

    .navbar-nav .nav-link {
        padding: 0 12px;
        font-size: 1rem;
    }

    .btn-search {
        width: 36px;
        height: 36px;
    }

    .home-title {
        font-size: 2rem;
    }

    .home-desc {
        font-size: 1.1rem;
    }

    .sidebar {
        max-width: 100%;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {

    .container,
    .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    .navbar-brand svg {
        width: 44px;
        height: 44px;
    }

    .home-title {
        font-size: 1.6rem;
    }

    .home-desc {
        font-size: 1rem;
    }

    .card-text {
        min-height: auto;
    }

    .sidebar ul {
        font-size: 1rem;
    }

    .sidebar li {
        margin-bottom: 1rem;
    }
}

/* 文章内容内的表格在小屏自动横向滚动 */
.article-content table {
    width: 100%;
}

.article-content {
    overflow-wrap: anywhere;
}

.table-responsive {
    overflow-x: auto;
}

.beian a {
    color: #666;
    text-decoration: none;
}

#contact-email {
    color: #FF9F43 !important;
    /* 柔和的橙色 */
    text-decoration: none;
}