/* 导航菜单垂直居中修复 */

/* 修复导航菜单的垂直居中问题 */
nav.row.middle-xs.between-xs {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 3.5em !important; /* 与主题的导航高度一致 */
    min-height: 3.5em !important;
}

/* 导航菜单项垂直居中 */
nav .col-xs-3.col-sm-2,
nav .col-xs-6.col-sm-1 {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
}

/* 导航菜单中的h3标题垂直居中 */
nav h3 {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    line-height: 1 !important;
}

/* 导航链接垂直居中 */
nav h3 a {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    text-decoration: none !important;
    color: #2D2D30 !important;
    padding: 0.5rem 1rem !important;
}

/* 导航图片垂直居中 */
nav img {
    vertical-align: middle !important;
    max-height: 1.5em !important;
    object-fit: contain !important;
}

/* 固定导航时的垂直居中 */
.nav-fixed {
    display: flex !important;
    align-items: center !important;
    height: 3.5em !important;
}

/* 全屏导航菜单的垂直居中 */
.nav-full {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.nav-full .col-xs-12 {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
}

.nav-full h1 {
    margin: 1rem 0 !important;
    display: flex !important;
    align-items: center !important;
}

.nav-full h1 a {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

/* 响应式设计 - 移动设备 */
@media (max-width: 47.99em) { /* 768px */
    nav.row.middle-xs.between-xs {
        height: auto !important;
        min-height: 2.125em !important;
    }
    
    nav .col-xs-3.col-sm-2,
    nav .col-xs-6.col-sm-1 {
        height: 2.125em !important;
        min-height: 2.125em !important;
    }
    
    nav h3 a {
        padding: 0.3rem 0.5rem !important;
    }
}

/* 响应式设计 - 小屏幕 */
@media (max-width: 25em) { /* 400px */
    nav.row.middle-xs.between-xs {
        flex-wrap: wrap !important;
        height: auto !important;
    }
    
    nav .col-xs-3.col-sm-2,
    nav .col-xs-6.col-sm-1 {
        height: 2em !important;
        min-height: 2em !important;
    }
    
    nav h3 a {
        padding: 0.2rem 0.3rem !important;
        font-size: 0.95rem !important;
    }
}