/* ==================== 1. 全局导航栏样式 ==================== */
/* 导航栏核心样式 - 全新重构 */
.header {
    padding: 12px 0;
    border-bottom: 1px solid #e8f0ff;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 99;
    box-shadow: 0 2px 8px rgba(0,90,156,0.08);
    transition: all 0.3s ease;
}
.header.scroll {
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0,90,156,0.12);
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Logo+公司名称+热线区域 */
.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}
.company-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.company-name {
    font-size: 32px;
    font-weight: bold;
    color: #005A9C;
    line-height: 1.2;
}
.company-subtitle {
    color: #333;
    font-size: 16px;
    font-weight: normal;
}
/* 修改1：PC端隐藏公司名称下的联系方式 */
.company-tel {
    color: #005A9C;
    font-size: 16px;
    font-weight: 500;
    margin-top: 4px;
    display: none; /* PC端默认隐藏 */
}

/* 移动端汉堡按钮（右上角） */
.nav-toggle {
    display: none;
    padding: 8px 12px;
    background: #005A9C;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    z-index: 100; /* 确保按钮在最上层 */
}

/* PC端导航菜单 */
.nav {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 20px;
}
.nav-menu {
    display: flex;
    list-style: none;
    gap: 22px; /* 缩小间距避免换行 */
    align-items: center;
}
.nav-menu > li {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-menu > li > a {
    font-size: 15px; /* 缩小字体避免换行 */
    color: #333;
    padding: 4px 0;
    position: relative;
    white-space: nowrap;
}
.nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #005A9C;
    transition: width 0.3s ease;
}
.nav-menu > li:hover > a::after,
.nav-menu > li.active > a::after {
    width: 100%;
}
.nav-menu > li:hover > a,
.nav-menu > li.active > a {
    color: #005A9C;
    font-weight: 500;
}
.icon-down {
    font-size: 11px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}
.nav-menu > li:hover .icon-down {
    transform: rotate(180deg);
}
.drop-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,90,156,0.15);
    border: 1px solid #f0f5ff;
    padding: 8px 0;
    display: none;
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}
.nav-menu > li:hover .drop-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.drop-menu > li {
    list-style: none;
}
.drop-menu > li > a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: #666;
}
.drop-menu > li > a:hover {
    background: #f0f5ff;
    color: #005A9C;
    padding-left: 20px;
}

/* PC端右侧热线 */
.header-tel {
    color: #005A9C;
    font-weight: 500;
    font-size: 16px;
    white-space: nowrap;
}

/* 导航栏响应式适配 */
@media (max-width: 1200px) {
    .nav-menu {
        gap: 16px;
    }
    .nav-menu > li > a {
        font-size: 14px;
    }
    .company-name {
        font-size: 20px;
    }
}

/* ========== 移动端导航核心样式（复用可生效的逻辑） ========== */
@media (max-width: 992px) {
    /* 隐藏PC导航和热线 */
    .nav, .header-tel {
        display: none !important;
    }
    /* 显示汉堡按钮 */
    .nav-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 26px;
        cursor: pointer;
        color: #333;
        z-index: 9999 !important; /* 按钮层级最高 */
    }
    /* 移动端激活的菜单样式（核心：复用mobile-active类） */
    .nav.mobile-active {
        display: block !important; /* 强制显示 */
        position: fixed !important;
        top: 70px !important; /* 避开header高度 */
        left: 0 !important;
        width: 100% !important;
        height: calc(100vh - 70px) !important;
        background: #fff !important;
        overflow-y: auto !important;
        z-index: 9998 !important; /* 菜单层级仅次于按钮 */
        padding: 20px !important;
    }
    /* 移动端菜单列表排版 */
    .nav.mobile-active .nav-menu {
        flex-direction: column !important;
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .nav.mobile-active .nav-menu > li {
        margin: 0 !important;
        padding: 12px 0 !important;
        border-bottom: 1px solid #f2f2f2 !important;
        position: relative !important;
    }
    /* 移动端下拉菜单调整（避免错位） */
    .nav.mobile-active .drop-menu {
        position: static !important;
        box-shadow: none !important;
        padding-left: 16px !important;
        margin-top: 8px !important;
        display: none !important;
    }
    /* 移动端logo区域适配 */
    .logo-img {
        height: 42px !important;
    }
    .company-name {
        font-size: 15px !important;
    }
    .company-subtitle, .company-tel {
        display: none !important;
    }
}

/* PC端样式兜底（避免移动端样式污染） */
@media (min-width: 993px) {
    .nav.mobile-active {
        display: flex !important;
        position: static !important;
        height: auto !important;
        background: transparent !important;
        padding: 0 !important;
    }
    .nav-toggle {
        display: none !important;
    }
}

/* 新增：确保PC端导航正常显示（避免影响PC端） */
@media (min-width: 993px) {
    .nav {
        display: flex !important;
    }
    .nav-toggle {
        display: none !important;
    }
    .header .nav-menu {
        display: flex !important;
        position: static !important;
        width: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        flex-direction: row !important;
        padding: 0 !important;
        border: none !important;
    }
}
@media (min-width: 993px) {
    .nav {
        display: flex !important; /* 强制显示PC端导航 */
    }
    .nav-toggle {
        display: none !important; /* 隐藏移动端汉堡按钮 */
    }
    #header .nav-menu {
        display: flex !important; /* PC端菜单默认横向显示 */
        position: static !important;
        width: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        flex-direction: row !important;
        padding: 0 !important;
        border: none !important;
    }
}

@media (max-width: 768px) {
    .logo-group {
        gap: 8px;
    }
    .logo-img {
        width: 40px;
        height: 40px;
    }
    .company-name {
        font-size: 18px;
    }
    .company-subtitle {
        font-size: 14px;
    }
    .company-tel {
        font-size: 14px;
    }
    .nav-toggle {
        padding: 6px 10px;
        font-size: 16px;
    }
}