/* 语言外层容器 */
.head_right {
    max-width: 150px;
    z-index: 9999;
    position: relative;
    margin-left: 10px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media screen and (max-width: 990px) {
    .head_right {
        position: inherit;
        display: inline;
    }
}
.prisna-wp-translate-seo {
    display: none;
    font-family: Arial, Helvetica, sans-serif;
}
.change-language .prisna-wp-translate-seo,
.mobile-head-language .prisna-wp-translate-seo {
    display: block;
}

/* ========== 核心：语言触发按钮 垂直水平对齐修复 ========== */
.change-language .change-language-title,
.change-language .change-language-title a {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    /* 弹性布局统一居中，解决icon+文字+箭头错位 */
    display: flex;
    align-items: center;
    gap: 6px; /* 元素之间统一间距，替代padding-left */
    padding: 0;
    height: 32px; /* 固定统一容器高度，所有元素垂直基准一致 */
}

/* 下拉箭头优化，居中不偏移 */
.change-language .change-language-title a:after {
    font-family: fontawesome;
    content: "\f0d7";
    font-size: 12px;
    line-height: 1; /* 消除字体自带行高留白 */
    transition: transform 0.3s ease;
}
.change-language:hover .change-language-title a:after {
    transform: rotate(-180deg);
}

/* 下拉弹窗容器 */
.change-language .change-language-cont {
    position: absolute;
    top: 100%;
    right: -15px;
    width: 200px;
    background: #fff;
    padding: 15px;
    transform: scale3d(.9, .9, 1);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    transition: all .4s ease-in-out;
    border: 1px solid #eee;
    border-radius: 5px;
    overflow-y: scroll;
    max-height: 80vh;
}
.change-language:hover .change-language-cont {
    transform: scale3d(1, 1, 1);
    opacity: 1;
    visibility: visible;
}

.change-language .change-language-cont .lang-item-hide {
    display: none !important;
}
.change-language .change-language-cont .lang-more {
    position: relative;
    display: block;
    text-align: center;
    cursor: pointer;
    line-height: 30px;
}
.change-language .change-language-cont .more-active {
    font-size: 20px;
}

/* 语言列表项 国旗+文字居中修复 */
.change-language .change-language-cont li {
    width: 100%;
    margin: 0 2% 10px;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}
.change-language .change-language-cont li:hover {
    background: #f8f8f8;
}
.change-language .change-language-cont li a {
    display: flex;
    align-items: center;
    gap: 8px; /* 国旗与文字间距，垂直居中 */
}
.change-language .change-language-cont li a:hover span {
    color: #09f;
}

/* 国旗图标统一样式，合并重复代码 */
.country-flag {
    display: inline-flex; /* flex保证图片居中 */
    align-items: center;
    flex-shrink: 0; /* 国旗不压缩 */
}
.country-flag img {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}
li.language-flag a:hover .country-flag img {
    transform: scale(1.05);
}

/* 滚动条统一样式 */
.change-language ::-webkit-scrollbar,
.language-list::-webkit-scrollbar {
    width: 6px;
}
.change-language ::-webkit-scrollbar-track,
.language-list::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}
.change-language ::-webkit-scrollbar-thumb,
.language-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, .3);
    border-radius: 3px;
}
.language-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ========== 第二套语言切换按钮（language-switcher）对齐修复 ========== */
.language-switcher {
    position: relative;
    display: inline-block;
    float: right;
    padding: 0;
}
/* 语言切换按钮核心居中修复 */
.language-btn {
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    /* 弹性居中，地球icon+文字+箭头完美对齐 */
    display: flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 8px;
}
.language-btn .globe-icon {
    font-size: 16px;
    line-height: 1; /* icon消除自带上下边距 */
    flex-shrink: 0;
}
.language-btn .arrow-icon {
    margin-left: 0; /* 替换margin-left，改用gap统一间距 */
    transition: transform 0.3s;
    line-height: 1;
    flex-shrink: 0;
}

/* 下拉框容器 */
.language-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    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;
}

/* 语言网格列表 */
.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-list .hidden {
    display: none;
}

/* 网格内语言项 国旗文字居中 */
.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;
    display: flex;
    align-items: center;
    gap: 5px;
}
.language-item:hover {
    background: #f5f5f5;
}
.language-item img {
    width: 16px;
    height: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

/* 更多语言按钮 */
.more-languages {
    text-align: center;
    padding: 8px;
    border-top: 1px solid #eee;
    cursor: pointer;
    color: #666;
    font-size: 13px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.more-languages:hover {
    color: #333;
    background: #f5f5f5;
}

.mobile-head-item .main-content-wrap .content-wrap a:hover span {
    color: #09f;
}

/* ========== 移动端适配，修复小屏对齐错乱 ========== */

@media screen and (max-width: 800px) {
    .language-switcher{ position:absolute !important; right:40px; top:13px; padding:0 !important; width:32%; text-align:right;white-space:nowrap;text-overflow:ellipsis;}
    .language-dropdown{ width:280% !important; right:-60px !important; top:37px !important}
    .current-lang{display:inline-grid; max-width: 59%; white-space: nowrap;  overflow: hidden; text-overflow: ellipsis;}