/**
 * au_translate 中英文切换 - 样式
 *
 * 定位说明：
 *   外层 .au-translate-widget 由 JS 设置 position:fixed 与四个边距中的两个
 *   （纵向 top/bottom、横向 left/right），CSS 只负责按钮圆角与下拉方向。
 */

.au-translate-widget {
    position: fixed;
    z-index: 99999;
    font-size: 14px;
    line-height: 1;
    /* 触屏下避免长按/双击触发浏览器默认手势（选中、缩放） */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ---------- 悬浮按钮 ---------- */

.au-translate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 45px;
    padding: 8px 12px;
    border: none;
    outline: none;
    cursor: pointer;
    color: #fff;
    background: rgba(10, 10, 10, .4);
    transition: background .2s ease;
    /* 让浏览器把触摸手势交给 JS 处理，避免点按时触发页面滚动/缩放 */
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
}

.au-translate-btn:hover {
    background: rgba(10, 10, 10, .65);
}

/* 贴边一侧做圆角，贴近屏幕边缘的一侧保持直角 */
.au-translate-widget.au-translate-h-right .au-translate-btn {
    border-radius: 100px 0 0 100px;
}

.au-translate-widget.au-translate-h-left .au-translate-btn {
    border-radius: 0 100px 100px 0;
}

/* 按钮图标：圆形国旗徽标 */
.au-translate-btn img {
    width: 26px;
    height: 26px;
    vertical-align: middle;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, .9);
}

.au-translate-btn-text {
    white-space: nowrap;
    font-size: 13px;
}

/* ---------- 语言下拉列表 ---------- */

.au-translate-list {
    display: none;
    position: absolute;
    min-width: 130px;
    padding: 5px 0;
    background: rgba(10, 10, 10, .6);
    border-radius: 4px;
}

/* 横向对齐：与按钮贴边一侧对齐 */
.au-translate-widget.au-translate-h-right .au-translate-list {
    right: 0;
}

.au-translate-widget.au-translate-h-left .au-translate-list {
    left: 0;
}

/* 纵向方向：按钮在上方时列表向下展开，反之向上展开 */
.au-translate-widget.au-translate-v-top .au-translate-list {
    top: 50px;
}

.au-translate-widget.au-translate-v-bottom .au-translate-list {
    bottom: 50px;
}

.au-translate-list a {
    display: block;
    padding: 8px 12px;
    color: #fff !important;
    text-decoration: none !important;
    white-space: nowrap;
}

.au-translate-list a:hover,
.au-translate-list a.is-active {
    background-color: rgba(255, 255, 255, .18);
}

/* 下拉列表国旗：与按钮图标保持同一种圆形徽标风格 */
.au-translate-list img {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: text-bottom;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, .9);
}

/* ---------- 小屏幕适配 ---------- */

@media (max-width: 480px) {
    .au-translate-btn {
        /* 触屏建议最小点按区域 44px，这里保持 44px 以保证可点性 */
        height: 44px;
        padding: 8px 12px;
    }

    .au-translate-btn img {
        width: 24px;
        height: 24px;
    }

    /* 移动端下拉项加高，便于手指点按 */
    .au-translate-list a {
        padding: 12px 14px;
    }

    .au-translate-list img {
        width: 20px;
        height: 20px;
    }

    .au-translate-widget.au-translate-v-top .au-translate-list {
        top: 48px;
    }

    .au-translate-widget.au-translate-v-bottom .au-translate-list {
        bottom: 48px;
    }
}
