/**
 * WHMCS IP Auto Translate - 前端样式
 * 语言切换按钮（右下角悬浮）与译文标记样式
 */

/* 悬浮切换器容器 */
#ipat-switcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

/* 通用按钮样式 */
#ipat-switcher .ipat-btn {
    border: none;
    cursor: pointer;
    border-radius: 999px;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    transition: opacity .2s, transform .2s;
}

#ipat-switcher .ipat-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
}

/* 主切换按钮 */
#ipat-switcher .ipat-btn-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #1a4f8b;
    color: #fff;
}

#ipat-switcher .ipat-globe {
    font-size: 16px;
}

/* 关闭按钮（停止自动翻译） */
#ipat-switcher .ipat-btn-off {
    width: 28px;
    height: 28px;
    padding: 0;
    background: #fff;
    color: #888;
    font-size: 18px;
    line-height: 26px;
    text-align: center;
}

#ipat-switcher .ipat-btn-off:hover {
    color: #d9534f;
}

/* 译文包裹节点：轻微过渡，避免页面闪跳 */
html[data-ipat-active="1"] .ipat-t {
    animation: ipat-fadein .25s ease-in;
}

/* google_web 模式：隐藏谷歌自带顶部横幅与工具条
   （以下 class 仅在谷歌翻译激活时才存在，不会误伤正常页面） */
body {
    top: 0 !important;
}

.goog-te-banner-frame,
iframe.skiptranslate,
.goog-logo-link,
.goog-te-gadget,
#goog-gt-tt,
.goog-tooltip,
.goog-te-balloon-frame {
    display: none !important;
    height: 0 !important;
}

/* 去掉谷歌翻译给选中文字加的黄色高亮背景 */
.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
}

@keyframes ipat-fadein {
    from { opacity: .4; }
    to   { opacity: 1; }
}

/* 移动端适配 */
@media (max-width: 767px) {
    #ipat-switcher {
        right: 12px;
        bottom: 12px;
    }

    #ipat-switcher .ipat-btn-main {
        padding: 8px 14px;
        font-size: 13px;
    }
}
