/* 控制面板部分 */
.controls-panel {
    width: 320px;
    background: #ffffff;
    padding: 1.75rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* 语音选择器样式 */
.voice-selector-section {
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.language-selector {
    margin-bottom: 1.5rem;
}

.language-selector label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.language-selector select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: white;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234361ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.language-selector select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(67, 97, 238, 0.1);
}

.language-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.voice-options {
    margin-bottom: 1.5rem;
}

.voice-options label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.voice-list {
    /* 音色可达 300+ 个, 列表给高一点以便一次看到更多条目 */
    max-height: min(460px, 55vh);
    overflow-y: auto;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 12px;
}

/* 音色卡片: radio 在左, 文字在右, 压低高度 */
.voice-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    background: white;
    margin-bottom: 0.375rem;
}

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

.voice-option input[type="radio"] {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* 覆盖 .voice-options label 继承来的粗体/大间距, 卡片内文字要小而紧凑 */
.voice-option label {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.voice-option .voice-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: inherit;
    color: inherit;
}

/* 档位徽章 (仅跨语言等非默认档出现) */
.voice-badge {
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.75;
    padding: 0 0.4rem;
    border-radius: 999px;
    white-space: nowrap;
}

.voice-badge-multilingual {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.voice-note {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.voice-option:hover {
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, 0.03);
}

.voice-option.selected {
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, 0.05);
    box-shadow: 0 2px 4px rgba(67, 97, 238, 0.1);
}

.voice-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.voice-description {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

.voice-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.voice-gender, .voice-language {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 6px;
    color: var(--primary-color);
}

.voice-name {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subtitle-option {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(67, 97, 238, 0.03);
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 拆分转换的"拆分标识"输入框（勾选拆分转换后可用） */
.split-option {
    margin-top: 0.5rem;
}

.split-separator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding: 0 1rem;
}

.split-separator label {
    font-size: 0.95rem;
    color: var(--text-color);
}

.split-separator input {
    flex: 1;
    max-width: 8rem;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-color);
}

.split-separator input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.convert-button {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(67, 97, 238, 0.2);
}

.convert-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(67, 97, 238, 0.25);
}

.convert-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(67, 97, 238, 0.2);
}

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

.voice-list::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 4px;
}

.voice-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
    border: 2px solid #f8fafc;
}

.voice-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .voice-selector-section {
        padding: 1rem;
    }

    .voice-list {
        max-height: min(340px, 50vh);
    }

    .convert-button {
        padding: 0.875rem;
    }
}

.voice-error {
    padding: 1rem;
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    border-radius: 12px;
    color: #DC2626;
    text-align: center;
    font-size: 0.95rem;
}
