.nft-language-switcher {
    position: relative;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
}

.nft-language-switcher.nft-position-top-right,
.nft-language-switcher.nft-position-top-left,
.nft-language-switcher.nft-position-bottom-right,
.nft-language-switcher.nft-position-bottom-left {
    position: fixed;
}

.nft-position-top-right {
    top: 20px;
    right: 20px;
}

.nft-position-top-left {
    top: 20px;
    left: 20px;
}

.nft-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.nft-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* 自定义位置：嵌入模式 */
.nft-language-switcher:not([class*="nft-position-"]) {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

/* 嵌入模式下的切换器样式优化 */
.nft-language-switcher:not([class*="nft-position-"]) .nft-switcher-toggle {
    padding: 6px 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 4px;
}

.nft-language-switcher:not([class*="nft-position-"]) .nft-switcher-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    box-shadow: none;
    border-color: transparent;
}

.nft-language-switcher:not([class*="nft-position-"]) .nft-lang-dropdown {
    top: calc(100% + 4px);
}

/* 包装器：包含按钮和下拉框，作为 hover 区域 */
.nft-switcher-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

.nft-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    user-select: none;
}

.nft-switcher-toggle:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #0073aa;
}

.nft-current-lang {
    font-weight: 500;
    color: #333;
}

.nft-arrow {
    transition: transform 0.2s ease;
    color: #666;
}

.nft-switcher-wrapper.open .nft-arrow {
    transform: rotate(180deg);
}

.nft-lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: -55px;
    min-width: 140px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    z-index: 1000000;
    margin-top: 2px;
}

/* 透明桥接区域，防止鼠标移动时下拉框消失 */
.nft-lang-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 0;
    right: 0;
    height: 6px;
    background: transparent;
}

.nft-position-bottom-right .nft-lang-dropdown,
.nft-position-bottom-left .nft-lang-dropdown {
    top: auto;
    bottom: calc(100% + 8px);
}

.nft-switcher-wrapper.open .nft-lang-dropdown {
    display: block;
}

.nft-lang-btn {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.nft-lang-btn:hover {
    background: #f5f5f5;
    color: #0073aa;
}

.nft-lang-btn.active {
    background: #0073aa;
    color: #ffffff;
}

.nft-lang-btn.active:hover {
    background: #005a87;
}

#nft-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
}

.nft-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: nft-spin 1s linear infinite;
}

@keyframes nft-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nft-loading-text {
    margin-top: 16px;
    color: #666;
    font-size: 14px;
}

.nft-no-translate {
    /* 标记不翻译的元素 */
}

/* 逐段翻译 - 行内转圈 */
.nft-translating {
    position: relative;
}

.nft-inline-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    vertical-align: middle;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: nft-spin 0.8s linear infinite;
}

@keyframes nft-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .nft-switcher-toggle {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .nft-lang-dropdown {
        min-width: 120px;
        left: -35px;
    }
    
    .nft-lang-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}