/* 导航栏核心样式 - 相对定位，确保层级正确 */
#navbar {
    position: relative !important; /* 相对定位，确保子元素的absolute定位基于此 */
    width: 100% !important;
    height: 90px !important; /* 导航栏高度调整为90px */
    z-index: 1000 !important; /* 提高层级，确保在最上层 */
    transition: 
        background 0.5s ease, 
        box-shadow 0.5s ease,
        padding 0.3s ease !important; /* 仅过渡变化属性 */
    background: #c6c6c6 !important; /* 灰色背景 */
    box-shadow: none !important; /* 初始无阴影 */
    padding: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border: none !important;
    line-height: 1 !important;
    font-size: 16px !important;
}

/* 滚动后样式（静态定位下不生效，保留以备后续使用） */
#navbar.nav-fixed {
    background-color: #c6c6c6 !important; /* 背景保持灰色 */
    box-shadow: var(--shadow-light) !important; /* 轻微阴影 */
    height: 90px !important; /* 保持高度一致 */
}

/* 容器样式 - 用于包裹导航内容 */
#navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    height: 100%;
}

/* 导航内容容器 */
.nav-content {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Logo和电话容器 */
.nav-left {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    align-items: center;
    gap: 40px;
}

/* Logo 样式：固定尺寸，防止变形 */
.logo {
    display: block;
    width: 157px;
    height: 80px;
    flex-shrink: 0;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 电话号码样式 - 初始白色，滚动后黑色（平滑过渡） */
.phone-number {
    color:  #000  !important;
    font-size: 24px;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.3s ease !important;
}
#navbar.nav-fixed .phone-number {
    color: #000 !important;
}

/* 导航菜单容器 */
.nav-right {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    align-items: center;
}

/* 桌面端导航菜单 - 初始白色，滚动后黑色 */
.desktop-nav {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.desktop-nav li a {
    color: #000  !important;
    text-decoration: none;
    transition: all 0.3s ease !important;
    font-size: 18px;
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
}

/* 滚动后菜单文字变黑 */
#navbar.nav-fixed .desktop-nav li a {
    color: #000 !important;
}

/* 当前页下划线（主色） */
.desktop-nav li a.active {
    color: var(--primary-color) !important;
}

.desktop-nav li a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

/* hover下划线（主色） */
.desktop-nav li a:not(.active):hover {
    color: var(--primary-color) !important;
}
.desktop-nav li a:not(.active):hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

/* 移动端菜单按钮 - 初始白色，滚动后黑色 */
.menu-btn {
    display: none;
    font-size: 28px;
    color: #fff !important;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease !important;
    padding: 5px;
}
#navbar.nav-fixed .menu-btn {
    color: #000 !important;
}

.menu-btn:hover {
    color: var(--primary-color) !important;
}

/* 移动端导航菜单（避免闪现） */
.mobile-nav {
    display: none;
    background: rgba(255, 255, 255, 0.98) !important;
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-shadow: var(--shadow-light);
    box-sizing: border-box;
    z-index: 9999;
}

.mobile-nav.show {
    display: block;
    padding: 15px;
}

.mobile-nav li {
    margin: 0;
    padding: 0;
}

.mobile-nav li a {
    display: block;
    padding: 12px 8px;
    color: #000 !important;
    text-decoration: none;
    font-size: 17px;
    position: relative;
    transition: all 0.3s ease;
}

/* 移动端当前页样式 */
.mobile-nav li a.active {
    color: var(--primary-color) !important;
}

.mobile-nav li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--primary-color);
}

/* 移动端hover效果 */
.mobile-nav li a:not(.active):hover {
    color: var(--primary-color) !important;
    background: #c6c6c6;
    border-radius: 4px;
}

/* 移动端联系方式 */
.mobile-contact {
    display: none;
    padding: 15px;
    margin: 0;
    border-top: 1px solid #eee;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-color);
    background: var(--white);
    position: absolute;
    top: calc(100% + 180px);
    left: 0;
    width: 100%;
    box-shadow: var(--shadow-light);
    box-sizing: border-box;
    z-index: 9998;
}

.mobile-contact span {
    display: block;
    margin: 5px 0;
}

.mobile-nav.show + .mobile-contact {
    display: block;
}

/* 响应式适配 - 平板端 */
@media (max-width: 992px) {
    .desktop-nav {
        gap: 20px;
    }
    .phone-number {
        font-size: 22px;
    }
    .nav-left {
        gap: 30px;
    }
}

/* 响应式适配 - 移动端 */
@media (max-width: 768px) {
    #navbar {
        height: 80px !important;
    }
    
    .nav-content {
        padding: 0 15px;
    }
    
    .nav-left {
        gap: 10px;
        flex: none;
    }
    
    .logo {
        width: 130px;
        height: 65px;
    }
    
    .phone-number {
        font-size: 16px;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .menu-btn {
        display: block;
    }
    
    .mobile-nav.show + .mobile-contact {
        top: calc(100% + 160px);
    }
}

/* 小屏幕手机优化 */
@media (max-width: 576px) {
    #navbar {
        height: 70px !important;
    }
    
    .phone-number {
        font-size: 18px;
    }
    
    .logo {
        width: 110px;
        height: 55px;
    }
    
    .nav-left {
        gap: 15px;
    }
}

/* 修复关于朗芯模块布局（配合轮播图绝对定位）- 已在carousel.css中定义 */
/* 注意：关于朗芯的margin-top在carousel.css中统一控制 */

/* 强制消除渲染闪烁（兜底） */
#navbar * {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}