﻿.header {
    width: 100%;
    background-color: #fff;
    height: 0.8rem;
    box-shadow: 0 0 30px rgba(0,0,0,0.15);
    border-bottom: none;
    z-index: 99;
}

.nav {
    display: flex;
    align-items: center;
    width: 80%;
    margin: 0 auto;
}

.nav .logo {
    width: 1rem;
    height: 0.5rem;
}

.nav-content {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif !important;
}

.dropdown {
    position: relative;
    text-align: center;
    height: 100%;
    margin: 0 0.09rem;
    box-sizing: border-box; 
    padding: 0 0.2rem;
}

.dropdown .language {
    display: block;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0.26rem;
    height: 0.26rem;
}


.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0px 0.08rem 0.16rem 0px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

    .dropdown-content a {
        color: #4F4D49;
        white-space: nowrap;
        display: block;
        font-size: 0.18rem;
        padding: 0 5px;
    }

.dropdown-content a:hover {
    color: #47A159
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:not(:last-child):hover {
    border-bottom: 2px solid #47A159;
}

.dropdown.active {
    border-bottom: 2px solid #47A159;
}

.scrolling{
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 0 0 30px rgba(0,0,0,0.15);
    border-bottom: none;
    z-index: 99;
}

.dropdown-p {
    display: none;
    color: #4F4D49;
    position: absolute;
    white-space: nowrap;
    background: #fff;
    top: 0;
    padding: 0 .3rem;
    font-size: 0.16rem;
    margin-left: 1.2rem;
}

.header .dropdown-a:hover + .dropdown-p {
    display: block;
}

.dropdown-p:hover {
    display: block;
}

.tel {
    position: relative;
    text-align: center;
    height: 100%;
    margin: 0 0.09rem;
    box-sizing: border-box;
    float: left;
    display: inline-block;
    text-decoration: none;
    padding: 0 0.3rem;
}

/* ===== 汉堡按钮（PC端隐藏） ===== */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    margin: 5px 0;
    transition: all 0.3s;
}
.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== 移动端适配（仅 <=768px 生效，不影响PC） ===== */
@media (max-width: 768px) {
    /* 防止页面固定宽度元素撑出水平滚动条 */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .header {
        height: 56px !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 999 !important;
        background-color: #fff !important;
        box-shadow: 0 0 10px rgba(0,0,0,0.1) !important;
    }

    .nav {
        width: 92% !important;
        height: 56px !important;
        line-height: normal !important;
        display: flex !important;
        align-items: center !important;
        position: relative !important;
        float: none !important;
    }

    .nav .logo {
        width: 120px !important;
        height: auto !important;
        float: none !important;
    }

    /* 汉堡按钮：用ID选择器+fixed定位确保任何页面都可见 */
    #nav-toggle {
        display: block !important;
        position: fixed !important;
        right: 4% !important;
        top: 14px !important;
        z-index: 1001 !important;
        background: none !important;
        border: none !important;
        padding: 8px !important;
    }

    #nav-toggle span {
        display: block !important;
        width: 24px !important;
        height: 2px !important;
        background: #333 !important;
        margin: 5px 0 !important;
    }

    /* 导航菜单默认隐藏 */
    .nav-content {
        display: none !important;
        flex-direction: row;
        flex-wrap: wrap;
        position: fixed !important;
        top: 56px !important;
        left: 0 !important;
        width: 100% !important;
        background: #fff !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
        padding: 8px 0 !important;
        z-index: 1000 !important;
        float: none !important;
    }

    /* 展开状态 */
    .nav-content.mobile-open {
        display: flex !important;
    }

    /* 每个菜单项 */
    .nav-content .dropdown {
        width: 50% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        border-bottom: none !important;
        text-align: center !important;
        float: none !important;
        height: auto !important;
    }

    .nav-content .dropdown .dropbtn,
    .nav-content .dropdown > span {
        display: block !important;
        font-size: 14px !important;
        line-height: 1.2 !important;
        padding: 12px 8px !important;
        color: #333 !important;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-content .dropdown .dropbtn:active {
        background: #f0f0f0;
    }

    .nav-content .dropdown.active {
        border-bottom: none !important;
    }

    .nav-content .dropdown.active .dropbtn {
        color: #47A159 !important;
    }

    /* 子菜单默认隐藏 */
    .nav-content .dropdown-content {
        display: none;
        position: static !important;
        box-shadow: none !important;
        background: #f9f9f9 !important;
        width: 100% !important;
    }

    /* 移动端hover不触发子菜单，通过JS控制 */
    .nav-content .dropdown:hover .dropdown-content {
        display: none;
    }

    /* JS展开时显示子菜单 */
    .nav-content .dropdown.expanded .dropdown-content {
        display: block !important;
    }

    .nav-content .dropdown-content a {
        font-size: 13px !important;
        padding: 10px 16px !important;
        white-space: normal !important;
        height: auto !important;
        line-height: 1.4 !important;
    }

    .nav-content .dropdown-p {
        display: none !important;
    }

    /* body增加顶部间距避免header遮挡内容 */
    body {
        padding-top: 56px !important;
    }
}