/**
 * 文件路径: /home/ubuntu/talktalk_backend/public/css/voice-selector.css
 * 功能用途: Minimax音色选择器和参数控制样式（优化版v4.5）
 * 版本: 4.5
 * 修改日期: 2025-11-27
 * 修改内容: 
 * 1. 修复音色简介文本过长被遮挡的问题，添加垂直滚动条
 * 2. 移除文本行数限制，优化长文本显示体验
 */

/* ===== 音色选择容器 ===== */
.voice-options {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ===== 筛选按钮 ===== */
.voice-filter-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
    border: none;
    border-radius: var(--border-radius-sm, 8px);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    align-self: flex-start;
}

.voice-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.voice-filter-btn i {
    font-size: 13px;
}

/* ===== 筛选对话框 ===== */
.voice-filter-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-filter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.voice-filter-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: var(--bg-secondary, #ffffff);
    border-radius: var(--border-radius-md, 16px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.voice-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border-color, rgba(102, 126, 234, 0.1));
}

.voice-filter-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #333333);
    display: flex;
    align-items: center;
    gap: 10px;
}

.voice-filter-header h3 i {
    color: var(--primary-color, #667eea);
    font-size: 20px;
}

.voice-filter-close {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    color: var(--text-secondary, #666);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-filter-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary, #333);
}

.voice-filter-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* ===== 搜索框样式 ===== */
.voice-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-sm, 8px);
    font-size: 14px;
    color: var(--text-primary, #333333);
    transition: all 0.3s ease;
    background: var(--bg-secondary, white);
    box-sizing: border-box;
}

.voice-search-input:focus {
    outline: none;
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.voice-search-input::placeholder {
    color: var(--text-secondary, #999999);
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section > label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #333333);
    margin-bottom: 10px;
}

.filter-section > label i {
    color: var(--primary-color, #667eea);
    font-size: 16px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.filter-options::-webkit-scrollbar {
    width: 6px;
}

.filter-options::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 3px;
}

.filter-options::-webkit-scrollbar-thumb {
    background: var(--primary-color, #667eea);
    border-radius: 3px;
}

.filter-options::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color, #764ba2);
}

.filter-option-btn {
    padding: 6px 14px;
    background: var(--bg-secondary, white);
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 20px;
    color: var(--text-primary, #333333);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-option-btn:hover {
    border-color: var(--primary-color, #667eea);
    background: rgba(102, 126, 234, 0.05);
}

.filter-option-btn.active {
    background: linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
    border-color: var(--primary-color, #667eea);
    color: white;
}

.voice-filter-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 2px solid var(--border-color, rgba(102, 126, 234, 0.1));
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
    border: none;
    border-radius: var(--border-radius-sm, 8px);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary i {
    font-size: 13px;
}

/* ===== AI助手卡片容器（下半部分） ===== */
.voice-cards-container {
    position: relative;
    width: 100%;
    margin-top: 0;
}

.voice-cards-wrapper {
    overflow-x: auto;
    width: 100%;
    padding: 10px 5px;
    background: transparent;
    border-radius: 0;
    border: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.voice-cards-wrapper::-webkit-scrollbar {
    height: 6px;
}

.voice-cards-wrapper::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 3px;
}

.voice-cards-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color, #667eea);
    border-radius: 3px;
}

.voice-cards-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color, #764ba2);
}

.voice-cards-track {
    display: flex;
    gap: 12px; /* Reduced from 20px */
    padding: 5px;
}

/* ===== AI助手卡片 ===== */
.voice-card {
    min-width: 340px;
    max-width: 340px;
    flex-shrink: 0;
    padding: 16px;
    background: var(--bg-secondary, #ffffff);
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-sm, 12px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.voice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
    transform: scaleX(0);
    transition: transform 0.3s ease;
    z-index: 1;
}

.voice-card input[type="radio"] {
    display: none;
}

.voice-card:hover {
    border-color: var(--primary-color, #667eea);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.voice-card.selected {
    border-color: var(--primary-color, #667eea);
    background: var(--bg-secondary, #ffffff);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1), 0 8px 24px rgba(102, 126, 234, 0.1);
}

.voice-card.selected::before {
    transform: scaleX(1);
}

/* 中文注释：选中状态的勾选标记 */
.voice-card.selected .voice-card-checkmark {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.voice-card-checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--success-color, #2ed573), #20bf6b);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(46, 213, 115, 0.4);
    opacity: 0;
    transform: scale(0) rotate(-45deg);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2;
}

/* ===== 新增：左右布局容器 ===== */
.voice-card-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    height: 100%;
}

/* ===== 新增：左侧区域 (名称、图标、性别) ===== */
.voice-card-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    flex-shrink: 0;
    padding-right: 12px;
    border-right: 1px solid var(--border-color, rgba(0,0,0,0.05));
}

/* ===== 新增：右侧区域 (描述信息) ===== */
.voice-card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0; /* 确保文本截断生效 */
}

/* 中文注释：AI助手图标 */
.voice-card-icon {
    width: 54px;
    height: 54px;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
    border-radius: 50%;
    font-size: 26px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* 中文注释：不同性别的图标颜色 */
.voice-card-icon.male {
    background: linear-gradient(135deg, #4facfe, #00f2fe); /* 蓝色 */
}

.voice-card-icon.female {
    background: linear-gradient(135deg, #FFB75E, #ED8F03); /* 橘色 */
}

.voice-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #333333);
    margin-bottom: 6px;
    text-align: center;
    line-height: 1.3;
}

.voice-gender {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 12px;
    font-size: 11px;
    color: var(--primary-color, #667eea);
    font-weight: 600;
}

.voice-gender.male {
    color: #00f2fe;
    background: rgba(0, 242, 254, 0.08);
}

.voice-gender.female {
    color: #FFB75E;
    background: rgba(255, 183, 94, 0.08);
}

/* ===== 新增：右侧信息项样式 ===== */
.voice-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary, #999);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-label i {
    font-size: 10px;
    color: var(--primary-color, #667eea);
}

.info-text {
    font-size: 13px;
    color: var(--text-secondary, #555);
    line-height: 1.5;
    /* 2025-11-27: 改为滚动显示，防止内容被截断 */
    max-height: 72px; /* 约3-4行高度 */
    overflow-y: auto;
    padding-right: 2px; /* 给滚动条留点空间 */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

/* 自定义滚动条样式 */
.info-text::-webkit-scrollbar {
    width: 4px;
}

.info-text::-webkit-scrollbar-track {
    background: transparent;
}

.info-text::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.15);
    border-radius: 2px;
}

.info-text::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0,0,0,0.25);
}

/* 个性简介样式微调 */
.voice-personality .info-text {
    font-style: italic;
    color: var(--text-primary, #333);
    background: var(--bg-tertiary, rgba(0,0,0,0.02));
    padding: 6px 8px;
    border-radius: 6px;
    border-left: 2px solid var(--primary-color, #667eea);
}

/* 移除旧的样式 */
.voice-card-header,
.voice-tone-description,
.voice-personality {
    /* 保留空样式以防JS引用报错，但实际样式已迁移 */
}

/* ===== 滑动按钮样式已移除 ===== */
.voice-nav-btn {
    display: none;
}

/* ===== 空状态 ===== */
.empty-voices {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #999999);
}

.empty-voices i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.3;
}


/* ===== 音色参数控制样式 ===== */

.voice-param-control {
    margin-bottom: 16px; /* Reduced from 20px */
    padding: 14px; /* Reduced from 18px */
    background: var(--bg-secondary, rgba(255, 255, 255, 0.95));
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-sm, 8px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.voice-param-control:hover {
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.voice-param-control > label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #333333);
}

.voice-param-control > label i {
    margin-right: 8px;
    color: var(--primary-color, #667eea);
    font-size: 16px;
}

.param-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 2px 10px;
    background: linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
    color: #ffffff;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.voice-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(102, 126, 234, 0.2);
    outline: none;
    margin: 10px 0;
    cursor: pointer;
}

.voice-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.voice-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.6),
                0 0 0 6px rgba(102, 126, 234, 0.2);
}

.voice-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.voice-slider::-moz-range-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.6);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary, #666666);
    margin-top: 4px;
}

.slider-labels span:first-child {
    text-align: left;
}

.slider-labels span:last-child {
    text-align: right;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.9));
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-sm, 8px);
    color: var(--text-primary, #333333);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.05);
    border-color: var(--primary-color, #667eea);
    color: var(--primary-color, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.btn-secondary i {
    font-size: 13px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .voice-card {
        min-width: calc(50% - 8px);
        max-width: calc(50% - 8px);
    }
}

@media (max-width: 768px) {
    .voice-filter-content {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
    }
    
    .filter-options {
        max-height: 200px;
    }
    
    .voice-cards-wrapper {
        padding: 10px 20px;
    }
    
    .voice-card {
        min-width: calc(100% - 0px);
        max-width: calc(100% - 0px);
        padding: 16px;
    }
    
    .voice-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .voice-card-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .voice-name {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .voice-filter-header {
        padding: 14px 16px;
    }
    
    .voice-filter-body {
        padding: 16px;
    }
    
    .voice-filter-footer {
        padding: 12px 16px;
    }
    
    .filter-options {
        max-height: 150px;
        gap: 6px;
    }
    
    .filter-option-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .voice-cards-wrapper {
        padding: 10px 10px;
    }
    
    .voice-nav-btn {
        width: 32px;
        height: 32px;
    }
    
    .voice-nav-btn i {
        font-size: 14px;
    }
}

/* ===== 音色设置按钮样式（聊天输入区）===== */
.btn-voice-settings {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.btn-voice-settings:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-voice-settings:active {
    transform: scale(0.95);
}

/* ===== 音色设置弹窗样式 ===== */
.voice-settings-modal-content {
    max-width: 480px;
    width: 90%;
}

.voice-settings-form {
    padding: 10px 0;
}

.voice-settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.voice-settings-actions .btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color, #667eea), var(--secondary-color, #764ba2));
    border: none;
    border-radius: var(--border-radius-sm, 8px);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.voice-settings-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.voice-settings-actions .btn-secondary {
    padding: 10px 20px;
}

/* ===== 情感选择下拉框样式 ===== */
.voice-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: var(--border-radius-sm, 8px);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #333333);
    background: var(--bg-secondary, white);
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.voice-select:hover {
    border-color: var(--primary-color, #667eea);
}

.voice-select:focus {
    outline: none;
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.voice-select option {
    padding: 10px;
    font-weight: 500;
    background: var(--bg-secondary, white);
    color: var(--text-primary, #333);
}

/* ===== 弹窗响应式 ===== */
@media (max-width: 480px) {
    .voice-settings-modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .voice-settings-actions {
        flex-direction: column;
    }
    
    .voice-settings-actions .btn-primary,
    .voice-settings-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
