/* ============================================================
 * GT-Lang —— 前台多语言切换样式（Google 免费翻译）
 * 配合 gt_lang.js 使用
 * ============================================================ */

/* ---- 头部语言切换按钮（桌面端注入 .header-widget-group） ---- */
.gt-dropdown {
    position: relative;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin-left: 20px;
    z-index: 1000;
}

.gt-trigger {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: var(--text, #4f5d70);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-transition: all .25s;
    -o-transition: all .25s;
    transition: all .25s;
}

.gt-trigger:hover {
    background: rgba(13, 110, 253, .08);
    color: var(--primary, #0d6efd);
}

.gt-trigger .gt-globe {
    font-size: 16px;
    line-height: 1;
}

.gt-trigger .gt-current {
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-globe.gt-spin {
    -webkit-animation: gt-spin 1s linear infinite;
    animation: gt-spin 1s linear infinite;
}

@-webkit-keyframes gt-spin { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
@keyframes gt-spin { to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }

/* ---- 下拉菜单 ---- */
.gt-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    max-height: 380px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid #e5eaf1;
    border-radius: 10px;
    -webkit-box-shadow: 0 10px 30px rgba(20, 40, 80, .16);
    box-shadow: 0 10px 30px rgba(20, 40, 80, .16);
    z-index: 1005;
}

.gt-menu.open { display: block; }

.gt-item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    color: #334155;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    -webkit-transition: background .15s;
    -o-transition: background .15s;
    transition: background .15s;
}

.gt-item:hover { background: #f1f5fb; color: #334155; text-decoration: none; }

.gt-item.active { background: #eaf2ff; color: #1667d9; font-weight: 600; }

.gt-item .gt-flag { font-size: 16px; line-height: 1; }

.gt-item .gt-check { margin-left: auto; color: #1667d9; font-size: 13px; }

.gt-menu::-webkit-scrollbar { width: 6px; }
.gt-menu::-webkit-scrollbar-thumb { background: #cdd6e2; border-radius: 3px; }

/* ---- 移动端悬浮按钮（底部左侧，避开右下角返回顶部按钮） ---- */
.gt-fab {
    display: none;
    position: fixed;
    left: 16px;
    bottom: 20px;
    z-index: 10060;
    margin: 0;
    padding: 0;
}

.gt-fab .gt-trigger {
    width: 46px;
    height: 46px;
    padding: 0;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: var(--primary, #0d6efd);
    font-size: 18px;
    -webkit-box-shadow: 0 4px 14px rgba(20, 40, 80, .22);
    box-shadow: 0 4px 14px rgba(20, 40, 80, .22);
}

.gt-fab .gt-trigger:hover { background: var(--primary, #0d6efd); color: #fff; }
.gt-fab .gt-current { display: none; }
.gt-fab .gt-menu { right: auto; left: 0; bottom: calc(100% + 10px); top: auto; max-height: 46vh; }

/* ---- 自动切换提示条 ---- */
.gt-banner {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10070;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e3e9f2;
    border-left: 4px solid #1677ff;
    border-radius: 8px;
    -webkit-box-shadow: 0 8px 26px rgba(20, 40, 80, .18);
    box-shadow: 0 8px 26px rgba(20, 40, 80, .18);
    font-size: 13px;
    color: #334155;
    -webkit-animation: gt-fadein .3s ease;
    animation: gt-fadein .3s ease;
}

@-webkit-keyframes gt-fadein { from { opacity: 0; -webkit-transform: translateY(8px); transform: translateY(8px); } to { opacity: 1; -webkit-transform: none; transform: none; } }
@keyframes gt-fadein { from { opacity: 0; -webkit-transform: translateY(8px); transform: translateY(8px); } to { opacity: 1; -webkit-transform: none; transform: none; } }

.gt-banner .gt-banner-icon { font-size: 16px; }

.gt-banner .gt-banner-revert {
    margin-left: 4px;
    padding: 4px 10px;
    border: 1px solid #bfd6ff;
    border-radius: 5px;
    background: #eef5ff;
    color: #1667d9;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.gt-banner .gt-banner-revert:hover { background: #dceaff; }

.gt-banner .gt-banner-close {
    margin-left: auto;
    padding: 2px 6px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.gt-banner .gt-banner-close:hover { color: #e74c3c; }

/* ---- 响应式 ---- */
@media (max-width: 991px) {
    /* 桌面头部被隐藏，显示移动端悬浮按钮 */
    .gt-fab { display: -webkit-inline-flex; display: -ms-inline-flexbox; display: inline-flex; }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .gt-trigger .gt-current { display: none; }
}
