/* 全局语音切换器样式 */
.voice-selector-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 10000;
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

.voice-selector-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c41e3a 0%, #a01729 100%);
    border: 3px solid #ffd700;
    box-shadow: 0 4px 20px rgba(196, 30, 58, 0.4), 
                0 0 0 4px rgba(255, 215, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.voice-selector-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.voice-selector-toggle:hover::before {
    width: 100%;
    height: 100%;
}

.voice-selector-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(196, 30, 58, 0.6), 
                0 0 0 6px rgba(255, 215, 0, 0.3);
}

.voice-selector-toggle.active {
    background: linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    border-color: #c41e3a;
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6), 
                0 0 0 6px rgba(196, 30, 58, 0.3);
}

.voice-selector-toggle .voice-icon {
    font-size: 28px;
    color: #fff;
    z-index: 1;
    position: relative;
    transition: transform 0.3s ease;
}

.voice-selector-toggle:hover .voice-icon {
    transform: rotate(15deg) scale(1.1);
}

.voice-selector-panel {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 580px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15),
                0 0 0 2px rgba(196, 30, 58, 0.1);
    padding: 20px;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-height: 0;
    overflow: hidden;
}

.voice-selector-panel.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
    max-height: none;
    min-height: 200px;
}

/* 自定义滚动条样式 */
.voice-option-list::-webkit-scrollbar {
    width: 6px;
}

.voice-option-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.voice-option-list::-webkit-scrollbar-thumb {
    background: rgba(196, 30, 58, 0.3);
    border-radius: 3px;
}

.voice-option-list::-webkit-scrollbar-thumb:hover {
    background: rgba(196, 30, 58, 0.5);
}

.voice-selector-panel::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 30px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(255, 255, 255, 0.98);
    filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));
}

.voice-selector-header {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.voice-selector-header::before {
    content: '🎤';
    font-size: 18px;
}

#voice-selector-title {
    display: inline-block;
}

#voice-selector-count {
    font-size: 11px;
    color: #7f8c8d;
    font-weight: 400;
    margin-left: 8px;
}

.voice-option-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 520px;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.voice-option-item {
    margin-bottom: 0;
}

.voice-option-item:last-child {
    margin-bottom: 0;
}

.voice-option-btn {
    width: 100%;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    font-size: 13px;
    color: #2c3e50;
    position: relative;
    overflow: hidden;
    gap: 4px;
}

.voice-option-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #c41e3a 0%, #a01729 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.voice-option-btn:hover {
    background: #fff;
    border-color: #c41e3a;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.15);
}

.voice-option-btn.selected {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.1) 0%, rgba(160, 23, 41, 0.05) 100%);
    border-color: #c41e3a;
    color: #c41e3a;
    font-weight: 600;
}

.voice-option-btn.selected::before {
    transform: scaleY(1);
    background: linear-gradient(180deg, #ffd700 0%, #d4af37 100%);
}

.voice-option-icon {
    font-size: 16px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
    color: #ffd700;
    margin-top: 2px;
}

.voice-option-btn.selected .voice-option-icon {
    display: block !important;
    opacity: 1;
    transform: scale(1);
}

.voice-option-name {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
}

.voice-option-title {
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    line-height: 1.2;
}

.voice-option-subtitle {
    font-size: 10px;
    color: #7f8c8d;
    opacity: 0.8;
    text-align: center;
}

.voice-option-btn.selected .voice-option-subtitle {
    color: #c41e3a;
    opacity: 1;
}

.voice-option-desc {
    font-size: 10px;
    color: #95a5a6;
    margin-top: 2px;
}

.voice-option-btn.selected .voice-option-desc {
    color: #c41e3a;
}

.voice-option-icon {
    font-size: 16px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    font-family: 'Noto Sans SC', sans-serif;
    color: #ffd700;
    margin-top: 2px;
}

.voice-option-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.voice-option-badge.mandarin {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.voice-option-badge.cantonese {
    background: rgba(196, 30, 58, 0.15);
    color: #c41e3a;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .voice-selector-container {
        bottom: 20px;
        left: 20px;
    }

    .voice-selector-toggle {
        width: 50px;
        height: 50px;
    }

    .voice-selector-toggle .voice-icon {
        font-size: 24px;
    }

    .voice-selector-panel {
        width: 480px;
        bottom: 70px;
        padding: 16px;
    }
}

/* 动画效果 */
@keyframes voicePulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(196, 30, 58, 0.4), 
                    0 0 0 4px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 6px 30px rgba(196, 30, 58, 0.6), 
                    0 0 0 8px rgba(255, 215, 0, 0.3);
    }
}

.voice-selector-toggle.playing {
    animation: voicePulse 2s ease-in-out infinite;
}

