button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
/* ========== 全局容器 ========== */
.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ========== 顶部信息条 top-bar ========== */
.top-bar {
    background-color: var(--primary-blue);
    color: var(--pure-white);
    font-size: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.top-bar-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* ========== Header PC基础样式 ========== */
header {
    background: var(--pure-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    max-width: 100%;
    padding: 0 12%;
    margin: 0 auto;
    background: #fff;
}
.logo-area img {
    height: 55px;
    object-fit: contain;
}

/* 主菜单PC横向布局 */
.main-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}
.menu-item {
    position: relative;
}
.menu-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.menu-link {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-charcoal);
    padding: 8px 4px;
    letter-spacing: 0.5px;
}
.menu-link:hover,
.menu-link.active {
    color: var(--hover-blue);
    background-color: var(--hover-bg);
    border-bottom: 6px solid var(--hover-blue);
}
.arrow-btn {
    font-size: 12px;
    color: var(--dark-charcoal);
    padding: 4px 6px;
    transition: transform 0.2s ease;
    will-change: transform;
}
/* 箭头旋转动画 */
.menu-item.has-sub.open-desktop .arrow-btn,
.menu-item.has-sub.open-mobile .arrow-btn {
    transform: rotate(180deg) translateZ(0);
}
/* PC端下拉菜单 垂直列 */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) translateZ(0);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    z-index: 999;
    will-change: transform, opacity;
}
.submenu li a {
    display: block;
    padding: 12px 20px;
    font-weight: 500;
    white-space: nowrap;
}
.submenu li a:hover {
    background: var(--hover-bg);
    color: var(--hover-blue);
}
/* PC悬浮显示下拉 */
.menu-item.has-sub:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateZ(0);
}

/* ========== 汉堡菜单 PC隐藏 提升z-index防止遮挡 ========== */
.menu-toggle {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--dark-charcoal);
    padding: 8px;
    flex-shrink: 0;
    z-index: 1001;
    position: relative;
}

/* ========== 移动端768px响应式 ========== */
@media(max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    .header-flex {
        position: relative;
        flex-wrap: wrap;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        height: auto;
        /* 改为固定左右内边距，不再百分比，适配所有手机 */
        padding: 15px 16px;
    }
    .menu-toggle {
        display: block;
        order: 2;
        z-index: 99; /* 汉堡按钮置顶，防止被导航遮挡 */
    }
    .logo-area {
        order: 1;
    }

    /* 移动端导航容器核心修复：不使用absolute脱离文档流，改用相对占位 */
    header nav#mainNav {
        width: 100%;
        /* 取消absolute，防止遮挡首页内容、布局塌陷 */
        position: relative;
        left: auto;
        top: auto;
        background: #fff;
        box-shadow: 0 8px 15px rgba(0,0,0,0.08);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
        order: 3;
        will-change: max-height;
        /* 增加层级，避免被首页轮播/内容覆盖 */
        z-index: 98;
    }
    header nav#mainNav.open {
        /* 适配超长菜单，首页多栏目也不会截断 */
        max-height: 2000px;
    }

    /* 主菜单改为垂直单列 */
    .main-menu {
        flex-direction: column;
        padding: 15px 20px;
        gap: 8px !important;
        align-items: stretch;
    }
    .menu-row {
        justify-content: center;
        width: 100%;
    }
    .menu-link {
        padding: 10px 0;
        flex: 1;
        text-align: center;
        /* 增加点击热区，首页多链接更好点击 */
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 移动端下拉菜单优化，全站通用 */
    .menu-item.has-sub {
        position: relative;
    }
    .submenu {
        position: static;
        box-shadow: none;
        background: #f8fafc;
        margin-top: 6px;
        border-left: 3px solid var(--hover-blue);
        min-width: unset;
        max-height: 0;
        overflow: hidden;
        opacity: 0; /* 隐藏初始状态，优化体验 */
        visibility: hidden;
        transform: none;
        transition: max-height 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
        will-change: max-height, opacity;
    }
    .menu-item.has-sub.open-mobile .submenu {
        max-height: 400px;
        opacity: 1;
        visibility: visible;
    }
    .submenu li a {
        text-align: center;
        padding: 10px 0;
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 顶部通栏移动端 */
    .top-bar-flex {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 10px 16px;
    }

    /* 彻底禁用移动端hover下拉，解决首页触摸误触发 */
    .menu-item.has-sub:hover .submenu {
        opacity: 0 !important;
        visibility: hidden !important;
        max-height: 0 !important;
    }
}