/* ================= 公共变量 ================= */
:root {
    --primary: #2e62ae;
    --primary-dark: #FFFFFF;
    --accent: #f08200;
    --footer-bg: #243144;
}

/* ================= 基础 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 16px;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ================= 头部基础 ================= */
.header-top { background: #fff; padding: 18px 0; }
.header-top .container { padding:0 65px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-top .logo img { height: 46px; display: block; }

.search-box { display: flex; height: 38px; }
.search-box input {
    width: 200px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 2px 0 0 2px;
    outline: none;
    font-size: 16px;
}
.search-box button {
    padding: 0 18px;
    background: #1a3a8a;
    color: #fff;
    border: none;
    border-radius: 0 2px 2px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}
.search-box button:hover { background: #15306e; }

/* ================= 导航（PC：均匀分布） ================= */
.nav-wrap { background: #1a3a8a; }
.nav-wrap .container { display: flex; justify-content: center; }

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 1400px;
    justify-content: space-between;
}
.nav-list > li {
    position: relative;
    flex: 1;
    text-align: center;
}
.nav-list > li > a {
    display: block;
    padding: 16px 10px;
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    transition: background 0.3s;
}
.nav-list > li > a:hover,
.nav-list > li.active > a { background: #fff; color:#2e62ae; }

/* ===== 二级菜单 ===== */
.sub-menu {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 170px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 50;
    border-top: 3px solid #2e60a9;
    white-space: nowrap;
}
/* 顶部小三角 */
.sub-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 8px solid #3363b5;
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.06));
}
.nav-list > li.has-sub:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.sub-menu li a {
    display: block;
    padding: 10px 22px;
    color: #333;
    font-size: 16px;
    text-decoration: none;
    text-align: center;
    transition: background 0.25s, color 0.25s;
    border-bottom: 1px solid #f0f0f0;
}
.sub-menu li:last-child a { border-bottom: none; }
.sub-menu li a:hover { background: #f2f5fb; color: #1a3a8a; }

/* ================= 汉堡按钮 ================= */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1200;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1a3a8a;
    border-radius: 2px;
    margin: 0 auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================= 移动菜单：默认彻底隐藏 ================= */
.mobile-menu,
.mobile-menu-mask { display: none; }

@media (max-width: 992px) {
    .nav-wrap { display: none; }
    .hamburger { display: flex; }
    .search-box { display: none; }

    /* 遮罩：收起时彻底不参与布局和事件 */
    .mobile-menu-mask {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.35s ease, visibility 0.35s ease;
    }
    .mobile-menu-mask.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* 抽屉：收起时彻底不参与布局和事件 */
    .mobile-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0; right: 0;
        width: 80%;
        max-width: 320px;
        height: 100%;
        background: #fff;
        z-index: 1100;
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.35s ease, visibility 0.35s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-menu.open {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 18px;
        border-bottom: 1px solid #eee;
    }
    .mobile-menu-header .logo img { height: 40px; display: block; }
    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 28px;
        line-height: 1;
        color: #999;
        cursor: pointer;
        padding: 0 6px;
    }

    .mobile-menu-search {
        display: flex;
        padding: 14px 18px;
        border-bottom: 1px solid #eee;
    }
    .mobile-menu-search input {
        flex: 1;
        min-width: 0;
        height: 38px;
        padding: 0 12px;
        border: 1px solid #ddd;
        border-right: none;
        border-radius: 2px 0 0 2px;
        outline: none;
        font-size: 14px;
    }
    .mobile-menu-search button {
        padding: 0 16px;
        background: #1a3a8a;
        color: #fff;
        border: none;
        border-radius: 0 2px 2px 0;
        font-size: 14px;
    }

    .mobile-nav-list { list-style: none; margin: 0; padding: 0; }
    .mobile-nav-list > li { border-bottom: 1px solid #f2f2f2; }
    .mobile-nav-list > li > a {
        display: block;
        padding: 14px 18px;
        color: #333;
        font-size: 15px;
        text-decoration: none;
        position: relative;
    }
    .mobile-nav-list > li.active > a { color: #1a3a8a; font-weight: bold; }

    /* 有子菜单的箭头 */
    .mobile-nav-list > li.has-sub > a::after {
        content: '';
        position: absolute;
        right: 20px;
        top: 50%;
        width: 8px;
        height: 8px;
        border-right: 2px solid #999;
        border-bottom: 2px solid #999;
        transform: translateY(-70%) rotate(45deg);
        transition: transform 0.3s;
    }
    .mobile-nav-list > li.has-sub.open > a::after {
        transform: translateY(-30%) rotate(-135deg);
    }

    /* 子菜单：收起高度 0，展开给足高度 */
    .mobile-sub-menu {
        list-style: none;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        background: #f9fafc;
        transition: max-height 0.35s ease;
    }
    .mobile-nav-list > li.has-sub.open .mobile-sub-menu { max-height: 600px; }

    .mobile-sub-menu li a {
        display: block;
        padding: 12px 18px 12px 34px;
        color: #666;
        font-size: 14px;
        text-decoration: none;
    }
    .mobile-sub-menu li a:hover { color: #1a3a8a; }
}

/* ================= 尾部 ================= */
footer {
    background-color: var(--footer-bg);
    color: #fff;
    padding: 40px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.footer-left .logo img { height: 36px; margin-bottom: 20px; }
.footer-left p {
    font-size: 16px;
    color: #b0b8c8;
    margin-bottom: 8px;
}
.footer-right { display: flex; }
.footer-right h4 { font-size: 16px; margin-bottom: 15px; }
.footer-right ul li {
    font-size: 16px;
    color: #b0b8c8;
    margin-bottom: 8px;
}
.footer-right ul li a { color: #b0b8c8; }
.footer-right ul li a:hover { color: #fff; }
.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    background: #485162;
    font-size: 16px;
    color: #FFF;
}

/* ================= 响应式 ================= */
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .nav-list > li > a { font-size: 14px; padding: 15px 6px; }
}

@media (max-width: 768px) {
    .header-top { padding: 12px 0; }
    .header-top .container {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .header-top .search-box { display: none; }
    .hamburger {
        display: flex;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }
    .nav-wrap { display: none; }
}

/* ================= 全局兜底：Loading 收起后彻底不挡 ================= */
#pageLoader.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}