@charset "utf-8";

/* ==========================================
   1. Header 整体容器
   ========================================== */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: #fff;
    z-index: 999;
    box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.15);
}

.header .inner {
    width: 95%;
    max-width: 1640px;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
}

.header .inner:after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================
   2. Logo
   ========================================== */
.logo {
    float: left;
    padding: 15px 0;
    width: 180px;
}
.logo a {
    display: block;
    background: no-repeat left center;
    background-size: contain;
    position: relative;
    overflow: hidden;
    padding-bottom: 23.684211%;
}
.logo i {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    text-indent: -9999em;
}

/* ==========================================
   3. 顶部搜索与移动端按钮
   ========================================== */
.topBtn {
    float: right;
    height: 75px;
    display: flex;
    align-items: center;
    padding: 0;
    margin-left: 15px;
}
.topBtn .btn {
    width: 25px;
    height: 21px;
    float: left;
    cursor: pointer;
}
.schBtn {
    background: url(../images/icon_search.png) no-repeat center center;
    background-size: contain;
}
.navBtn {
    position: relative;
    display: none;
    margin-left: 20px;
}
.navBtn span {
    width: 100%;
    height: 2px;
    background-color: #555;
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: -2px;
}
.navBtn span:before,
.navBtn span:after {
    width: 100%;
    height: 2px;
    background-color: #555;
    content: '';
    display: block;
    position: absolute;
    left: 0;
    transition: all 0.3s;
}
.navBtn span:before { top: -8px; }
.navBtn span:after { bottom: -8px; }
.navBtn.open span { height: 0; }
.navBtn.open span:before { transform: rotate(45deg); top: 0; }
.navBtn.open span:after { transform: rotate(-45deg); bottom: auto; top: 0; }

.searchForm {
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    display: none;
}
.searchForm .inner { margin-top: 2px; }
.searchForm form {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #fff;
    border-radius: 4px;
    width: 300px;
    float: right;
    overflow: hidden;
    padding: 8px;
}
.searchForm .submit {
    display: block;
    float: right;
    width: 35px;
    height: 35px;
    background: url(../images/icon_search.png) no-repeat center center;
    background-size: 20px auto;
    cursor: pointer;
}
.searchForm .input { margin-right: 45px; }
.searchForm .text {
    background-color: #fff;
    height: 25px;
    line-height: 25px;
    padding: 5px 0;
    text-indent: 5px;
    width: 100%;
    font-size: 14px;
    color: #353535;
}

/* ==========================================
   4. 多语言切换组件
   ========================================== */
.language-switcher {
    position: relative;
    float: right;
    height: 75px;
    display: flex;
    align-items: center;
    padding: 0 10px;
}
.language-btn {
    display: flex;
    align-items: center;
    border-radius: 4px;
    cursor: pointer;
    gap: 5px;
    font-size: 15px;
    color: #333;
}
.language-btn .globe-icon { font-size: 16px; }
.language-btn .arrow-icon {
    margin-left: 5px;
    transition: transform 0.3s;
}
.language-list .hidden { display: none; }

.language-dropdown {
    position: absolute;
    top: calc(100% - 10px);
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
    width: 400px;
}
.language-dropdown.active {
    display: block;
    background: white;
}
.language-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 10px;
    max-height: 230px;
    overflow-y: auto;
}
.language-list.show-all {
    max-height: 400px;
}
.language-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    gap: 5px;
    font-size: 13px;
    color: #333;
    height: 30px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.language-item a {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.language-item:hover {
    background: #f5f5f5;
}
.language-item img {
    width: 16px;
    height: 12px;
    object-fit: cover;
}
.more-languages {
    text-align: center;
    padding: 8px;
    border-top: 1px solid #eee;
    cursor: pointer;
    color: #666;
    font-size: 13px;
    height: 40px;
    line-height: 40px;
}
.more-languages:hover {
    color: #333;
    background: #f5f5f5;
}
.language-list::-webkit-scrollbar { width: 6px; }
.language-list::-webkit-scrollbar-track { background: #f1f1f1; }
.language-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.language-list::-webkit-scrollbar-thumb:hover { background: #999; }

/* ==========================================
   5. 主导航栏与下拉菜单（宽度自适应长文本）
   ========================================== */
.nav {
    float: right;
    margin: 0 15px 0 0;
}
.nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* 一级主菜单项 */
.nav > ul > li {
    float: left;
    font-size: 16px;
    line-height: 75px;
    width: auto;
    position: relative;
    padding: 0 16px;
    text-align: center;
}
.nav > ul > li > a {
    color: #333;
    display: block;
    position: relative;
    transition: color .3s;
    white-space: nowrap;
}
.nav > ul > li > a:after {
    width: 0;
    height: 2px;
    position: absolute;
    left: 0;
    bottom: 0;
    content: '';
    display: block;
    background-color: #9a0e0e;
    transition: width .3s;
}
.nav > ul > li.on > a,
.nav > ul > li.cur > a,
.nav > ul > li:hover > a {
    color: #9a0e0e;
}
.nav > ul > li.on > a:after,
.nav > ul > li.cur > a:after {
    width: 100%;
}

/* 导航内所有未触发的子菜单全部强制隐藏 */
.nav li ul {
    display: none !important;
}

/* 二级菜单主面板 */
.nav > ul > li > ul {
    position: absolute !important;
    left: 0 !important;
    top: 100% !important;
    min-width: 200px !important;
    width: max-content !important;
    max-width: 320px !important;
    background-color: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 0 0 4px 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    padding: 6px 0 !important;
    margin: 0 !important;
    z-index: 1000 !important;
    box-sizing: border-box !important;
}

.nav > ul > li:hover > ul {
    display: block !important;
}

/* 二级菜单项：作为三级绝对定位的标尺 */
.nav > ul > li > ul > li {
    float: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: normal !important;
    text-align: left !important;
    position: relative !important;
}

.nav > ul > li > ul > li > a {
    padding: 10px 35px 10px 16px !important; /* 右侧预留箭头呼吸空间 */
    font-size: 14px !important;
    color: #444 !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 20px !important;
    height: 20px !important;
    box-sizing: content-box !important;
    position: relative !important;
}
.nav > ul > li > ul > li > a:after {
    display: none !important;
}

/* 纯 CSS 绘制向右小箭头（>） */
.nav > ul > li > ul > li > a .arrow-right {
    position: absolute;
    right: 14px;
    top: 50%;
    margin-top: -4px;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid #999;
    border-right: 1.5px solid #999;
    transform: rotate(45deg);
    transition: all 0.2s;
    pointer-events: none;
}

/* 三级菜单主面板：根据文本长短自适应宽度，彻底解决文字溢出卡片外 */
.nav > ul > li > ul > li > ul,
.nav .sub-nav3 {
    position: absolute !important;
    top: 0px !important;
    left: 100% !important;
    width: max-content !important;          /* 核心：自动撑开包裹最长文字 */
    min-width: 220px !important;            /* 最低宽度底线 */
    max-width: 400px !important;            /* 保护最大宽度 */
    background-color: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 0 4px 4px 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    padding: 6px 0 !important;
    margin: 0 !important;
    z-index: 1010 !important;
    box-sizing: border-box !important;
}

/* 鼠标悬停在二级菜单项时展开三级 */
.nav > ul > li > ul > li:hover > ul,
.nav > ul > li > ul > li:hover > .sub-nav3 {
    display: block !important;
}

/* 三级菜单项 */
.nav > ul > li > ul > li > ul > li,
.nav .sub-nav3 li {
    float: none !important;
    width: 100% !important;
    text-align: left !important;
    line-height: normal !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 三级菜单链接：提供充裕的左右边距 */
.nav > ul > li > ul > li > ul > li > a,
.nav .sub-nav3 li a {
    display: block !important;
    padding: 10px 20px !important;          /* 左右留出 20px 缓冲空间 */
    font-size: 14px !important;
    color: #444 !important;
    white-space: nowrap !important;
    line-height: 20px !important;
    height: 20px !important;
    box-sizing: content-box !important;
}

/* 下拉菜单项悬停颜色与箭头联动 */
.nav > ul > li > ul > li:hover > a,
.nav > ul > li > ul > li > ul > li:hover > a,
.nav .sub-nav3 li:hover > a {
    color: #9a0e0e !important;
    background-color: #f7f7f7 !important;
}
.nav > ul > li > ul > li:hover > a .arrow-right {
    border-color: #9a0e0e !important;
}

/* ==========================================
   6. 响应式与移动端适配
   ========================================== */
@media only screen and (max-width: 1366px) {
    .nav > ul > li { padding: 0 10px; font-size: 15px; }
}

@media only screen and (max-width: 1280px) {
    .logo { width: 148px; }
    .nav > ul > li { line-height: 65px; padding: 0 8px; font-size: 14px; }
    .topBtn, .language-switcher { height: 65px; }
}

@media only screen and (max-width: 1024px) {
    .header .inner { width: 100%; padding: 0 15px; }
    .logo { padding: 12px 0; width: 127px; }
    .topBtn { height: auto; padding: 16.5px 0; }
    .language-switcher { height: auto; padding: 16.5px 10px; }
    .navBtn { display: block; }
    .nav {
        position: fixed;
        top: 55px;
        right: -220px;
        background-color: rgba(255, 255, 255, 0.98);
        height: 100%;
        width: 220px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: right .3s;
        z-index: 5;
        border-left: 1px solid #fff;
        margin: 0;
        float: none;
    }
    .nav.open { right: 0; }
    .nav ul { float: none; padding: 10px 0 55px; }
    .nav li { float: none; width: 100% !important; line-height: 25px; position: relative; padding: 0; text-align: left; }
    .nav li a { padding: 10px 45px 10px 1.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #222; height: auto !important; }
    .nav li em { position: absolute; right: 0; top: 0; width: 45px; height: 45px; z-index: 2; display: block; cursor: pointer; }
    .nav li em:after {
        content: '';
        display: block;
        width: 8px;
        height: 8px;
        border-right: 1px solid #010101;
        border-bottom: 1px solid #010101;
        transform: rotate(45deg);
        position: absolute;
        left: 50%;
        top: 50%;
        margin: -6.3px 0 0 -6.3px;
        transition: all .3s;
    }
    .nav li em.open:after { transform: rotate(-135deg); margin-top: -2.5px; }
    
    .nav li ul,
    .nav .sub-nav3 { 
        position: static !important; 
        left: auto !important; 
        top: auto !important; 
        padding: 0 !important; 
        margin: 0 !important; 
        width: auto !important; 
        background-color: transparent !important; 
        border: none !important; 
        box-shadow: none !important; 
        display: block !important; 
    }
    .nav > ul > li > ul > li > a { padding: 8px 1.5em 8px 2.5em !important; height: auto !important; }
    .nav > ul > li > ul > li > ul > li > a,
    .nav .sub-nav3 li a { padding: 8px 1.5em 8px 3.5em !important; height: auto !important; }
}

@media only screen and (max-width: 768px) {
    .language-dropdown { width: 280px !important; right: -50px !important; }
    .language-item { padding: 0 !important; }
    .nav { width: 100%; right: -100%; background-color: #fff; top: 54px; border-top: 1px solid #e4e4e4; }
    .nav ul { padding-bottom: 54px; padding-top: 0; }
    .nav li { border-bottom: 1px solid #eee; }
    .nav li li { border-top: 1px solid #eee; border-bottom: none; }
    .searchForm form { float: none; width: auto; padding: 5px; }
    .searchForm .input { margin-right: 40px; }
}