/* 确保整个头部有正确的高度和布局 */
#headTitle .row {
    display: flex !important;
    align-items: center !important;  /* 确保垂直居中 */
    justify-content: space-between !important;
    height: 70px !important;  /* 固定头部高度 */
    min-height: 70px !important;
    max-height: 70px !important;
}

/* 确保网站Logo容器有正确的高度 */
#siteTitle {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

/* 确保Logo图片高度正确 */
#siteLogo img {
    height: 40px !important;  /* 调整为您需要的Logo高度 */
    width: auto !important;
    display: block !important;
}

/* 导航容器 - 确保垂直居中 */
#navbarWrapper {
    display: flex !important;
    align-items: center !important;  /* 垂直居中 */
    height: 100% !important;  /* 继承父容器高度 */
    margin-left: auto !important;
    position: relative;
}

/* 桌面端导航容器 */
.nav-container {
    display: flex !important;
    align-items: center !important;  /* 垂直居中 */
    gap: 30px !important;
    margin-left: auto !important;
    height: 100% !important;  /* 继承父容器高度 */
}

/* 主导航链接 */
.main-nav {
    display: flex !important;
    align-items: center !important;  /* 垂直居中 */
    gap: 20px !important;
    height: 100% !important;  /* 继承父容器高度 */
}

/* 导航链接样式 - 调整高度和行高 */
.nav-link {
    font-size: 15px !important;
    color: #0c2243 !important;
    font-weight: 500 !important;
    padding: 0 12px !important;  /* 上下padding改为0，由容器控制 */
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    line-height: normal !important;
    display: flex !important;
    align-items: center !important;  /* 垂直居中 */
    height: 100% !important;  /* 占满父容器高度 */
    box-sizing: border-box !important;
}

.nav-link:hover {
    color: #e62340 !important;
    background: rgba(230, 35, 64, 0.1) !important;
}

.nav-link.active {
    color: #e62340 !important;
    font-weight: 600 !important;
    position: relative !important;
}

.nav-link.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 12px !important;
    right: 12px !important;
    height: 2px !important;
    background: #e62340 !important;
    border-radius: 1px !important;
}

/* 导航操作按钮 */
.nav-actions {
    display: flex !important;
    align-items: center !important;  /* 垂直居中 */
    gap: 15px !important;
    height: 100% !important;  /* 继承父容器高度 */
}

/* 调整按钮的垂直居中 */
.demo-btn,
.download-btn {
    display: inline-flex !important;
    align-items: center !important;  /* 垂直居中 */
    justify-content: center !important;  /* 水平居中 */
    height: 36px !important;  /* 固定按钮高度 */
    line-height: 36px !important;  /* 行高等于高度 */
    padding: 0 20px !important;  /* 调整padding */
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
}

.demo-btn {
    color: #e62340 !important;
    background: transparent !important;
    border: 1px solid #e62340 !important;
}

.demo-btn:hover {
    background: #e62340 !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(230, 35, 64, 0.2) !important;
}

.download-btn {
    color: white !important;
    background: linear-gradient(135deg, #e62340, #ff6b6b) !important;
    border: none !important;
}

.download-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(230, 35, 64, 0.3) !important;
}

/* 汉堡菜单按钮 */
.navbar-toggle {
    display: none !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    margin-left: auto !important;
    height: 24px !important;
    width: 24px !important;
    align-items: center !important;
    justify-content: center !important;
}

.icon-bar {
    display: block !important;
    width: 20px !important;
    height: 2px !important;
    background: #0c2243 !important;
    margin: 4px 0 !important;
    transition: all 0.3s ease !important;
}

/* 移动端菜单 */
.mobile-nav {
    display: none !important;
    position: fixed !important;
    top: 70px !important;  /* 匹配头部高度 */
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1) !important;
    padding: 20px !important;
    z-index: 998 !important;
}

.mobile-nav.open {
    display: block !important;
}

.mobile-nav-link {
    display: block !important;
    padding: 12px 0 !important;
    font-size: 16px !important;
    color: #0c2243 !important;
    border-bottom: 1px solid #e6ecf8 !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.mobile-nav-link:last-child {
    border-bottom: none !important;
}

.mobile-nav-link:hover {
    color: #e62340 !important;
    padding-left: 10px !important;
}

.mobile-nav-link.active {
    color: #e62340 !important;
    font-weight: 600 !important;
}

.mobile-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-top: 20px !important;
}

/* 隐藏旧的导航结构 */
#navbar, 
#siteNav,
#searchbar > form {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #headTitle .row {
        height: 60px !important;  /* 移动端调整高度 */
        min-height: 60px !important;
        max-height: 60px !important;
    }
    
    .navbar-toggle {
        display: flex !important;  /* 显示汉堡菜单 */
    }
    
    .nav-container {
        display: none !important;  /* 隐藏桌面端导航 */
    }
    
    .mobile-nav {
        top: 60px !important;  /* 匹配移动端头部高度 */
    }
    
    .mobile-nav.open {
        display: block !important;
    }
    
    /* 移动端调整Logo大小 */
    #siteLogo img {
        height: 35px !important;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }
    
    .navbar-toggle {
        display: none !important;  /* 桌面端隐藏汉堡菜单 */
    }
}