/* ===== 配音库页面样式 ===== */

/* 页面布局 */
.voice-page {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: var(--bg-darkest);
}

/* 左侧分类导航 */
.voice-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
}

.voice-sidebar .sidebar-section {
    margin-bottom: 16px;
}

.voice-sidebar .sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-sidebar .sidebar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.voice-sidebar .sidebar-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
}

.voice-sidebar .sidebar-filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.voice-sidebar .sidebar-filter-btn.active {
    background: rgba(0, 191, 165, 0.15);
    color: var(--accent);
}

/* 中间内容区 */
.voice-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.voice-content__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-darkest);
    border-bottom: 1px solid var(--border-color);
}

.voice-content__header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.voice-content__header .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 240px;
}

.voice-content__header .search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
}

.voice-content__header .search-box input::placeholder {
    color: var(--text-muted);
}

/* Tabs */
.voice-tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.voice-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-tab:hover {
    color: var(--text-primary);
}

.voice-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.voice-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--bg-input);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.voice-tab.active .voice-tab__count {
    background: var(--accent);
    color: white;
}

/* Voice Grid */
 .voice-content__main {
    flex: 1;
    overflow-y: auto;
    /* 上右下左留出额外下边距，让内容卡片与分页之间更舒适 */
    padding: 20px 24px 100px; /* 增加底部padding，避免被固定分页组件遮挡 */
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));  /* 响应式布局，与音效库一致 */
    gap: 16px;  /* 与音效库一致 */
    flex-shrink: 0;
    margin-bottom: 24px; /* 与分页组件之间留出视觉缓冲区 */
}

/* Voice Card - 与音效库卡片样式一致 */
.voice-card {
    position: relative;
    background: var(--bg-secondary, var(--bg-panel));
    border: 1px solid var(--border-color);  /* 与音效库一致 */
    border-radius: 12px;  /* 与音效库一致 */
    padding: 0;  /* 改为0，使用内部padding */
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;  /* 与音效库一致 */
    display: flex;
    flex-direction: column;
    overflow: hidden;  /* 确保圆角生效 */
}

.voice-card:not(.voice-card--create):hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);  /* 与音效库一致 */
    transform: translateY(-2px);
}

.voice-card--selected {
    border-color: var(--accent);
    background: rgba(0, 191, 165, 0.1);
}

/* 男声配音员 - 蓝色调 */
.voice-card--male {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.08) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

.voice-card--male:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.15) 100%);
    border-color: rgba(59, 130, 246, 0.5);
}

.voice-card--male .voice-card__avatar-placeholder {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.voice-card--male.voice-card--selected {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.2) 100%);
}

/* 女声配音员 - 粉色调 */
.voice-card--female {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(219, 39, 119, 0.08) 100%);
    border-color: rgba(236, 72, 153, 0.3);
}

.voice-card--female:hover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25) 0%, rgba(219, 39, 119, 0.15) 100%);
    border-color: rgba(236, 72, 153, 0.5);
}

.voice-card--female .voice-card__avatar-placeholder {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.voice-card--female.voice-card--selected {
    border-color: #ec4899;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3) 0%, rgba(219, 39, 119, 0.2) 100%);
}

/* 配音员封面区 - 优化设计 */
.voice-card__cover {
    height: 120px;  /* 增加高度，更美观 */
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.12) 0%, rgba(0, 180, 150, 0.06) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 11px 11px 0 0;
}

.voice-card--male .voice-card__cover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(37, 99, 235, 0.06) 100%);
}

.voice-card--female .voice-card__cover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(219, 39, 119, 0.06) 100%);
}

.voice-card__avatar {
    position: relative;
    width: 72px;  /* 适中的尺寸 */
    height: 72px;
    margin: 0;
    z-index: 1;
}

.voice-card__avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #00b496 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;  /* 调整为16px */
    font-weight: 700;
    color: white;
    letter-spacing: -1px;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);  /* 添加阴影效果 */
    transition: transform 0.2s ease;
}

.voice-card:hover .voice-card__avatar-placeholder {
    transform: scale(1.05);  /* 悬停时轻微放大 */
}

/* 标签 - 优化设计 */
.voice-card__badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    z-index: 2;
    flex-wrap: wrap;
    max-width: calc(100% - 80px);  /* 避免与右侧按钮重叠 */
}

.voice-card__tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;  /* 稍微增加padding */
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;  /* 更圆润 */
    background: rgba(0, 212, 170, 0.9);
    color: white;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* 标签颜色变体 */
.voice-card__tag.tag--情感 { background: rgba(245, 158, 11, 0.9); }
.voice-card__tag.tag--磁性 { background: rgba(139, 92, 246, 0.9); }
.voice-card__tag.tag--方言 { background: rgba(236, 72, 153, 0.9); }
.voice-card__tag.tag--温柔 { background: rgba(244, 114, 182, 0.9); }
.voice-card__tag.tag--甜美 { background: rgba(251, 113, 133, 0.9); }
.voice-card__tag.tag--搞笑 { background: rgba(34, 197, 94, 0.9); }
.voice-card__tag.tag--专业 { background: rgba(59, 130, 246, 0.9); }

.voice-card__favorite {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    backdrop-filter: blur(4px);
}

.voice-card__favorite:hover {
    color: #f87171;
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.voice-card__favorite.is-favorite {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.voice-card__favorite.is-favorite svg {
    fill: #ef4444;
}

.voice-card__favorite.is-favorite:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* 卡片信息区 - 优化设计，居中显示 */
.voice-card__info {
    flex: 1;
    padding: 14px 12px 12px 12px;  /* 上边距稍大 */
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;  /* 居中显示 */
    text-align: center;  /* 文字居中 */
}

.voice-card__name {
    font-size: 15px;  /* 稍微增大 */
    font-weight: 600;
    color: white;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;  /* 居中显示 */
    line-height: 1.4;
    width: 100%;
}

.voice-card__gender-icon {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.voice-card__gender-icon--male {
    color: #3b82f6;
}

.voice-card__gender-icon--female {
    color: #ec4899;
}

.voice-card__style {
    font-size: 12px;
    color: var(--text-muted);
}

.voice-card__meta {
    display: flex;
    align-items: center;
    justify-content: center;  /* 居中显示 */
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    width: 100%;
}

.voice-card__gender {
    color: var(--text-secondary);
}

.voice-card__age {
    padding: 2px 8px;
    background: rgba(0, 212, 170, 0.2);
    color: var(--accent);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

.voice-card__desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    max-height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
    text-align: center;  /* 居中显示 */
    width: 100%;
}

/* 底部徽章区域 */
.voice-card__badges-bottom {
    display: flex;
    align-items: center;
    justify-content: center;  /* 居中显示 */
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
}

.voice-card__badges-bottom .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 8px;
    white-space: nowrap;
}

.voice-card__badges-bottom .badge--official {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.voice-card__badges-bottom .badge--cloned {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.voice-card__badges-bottom .badge--shared {
    background: rgba(6, 182, 212, 0.2);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* 播放按钮覆盖 - 与音效库一致 */
.voice-card__play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 11px 11px 0 0;
}

.voice-card:hover .voice-card__play-overlay {
    opacity: 1;
}

.voice-card__play {
    width: 48px;  /* 与音效库一致 */
    height: 48px;  /* 与音效库一致 */
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #00b496 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-card__play:hover {
    transform: scale(1.1);
}

/* 创建克隆卡片 */
.voice-card.voice-card--create {
    background: transparent;
    border: 2px dashed var(--border-color);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.voice-card.voice-card--create:hover {
    border-color: var(--accent);
    background: rgba(0, 212, 170, 0.08);
    transform: none;
}

.voice-card__create-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.voice-card__create-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #00b496 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.3s;
}

.voice-card--create:hover .voice-card__create-icon {
    transform: scale(1.1);
}

.voice-card__create-text {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
}

/* Empty State */
.voice-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    flex: 1;
    min-height: 300px;
}

.voice-empty svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.voice-empty h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.voice-empty p {
    font-size: 13px;
}

/* 右侧参数面板 */
.voice-params {
    width: 320px;
    flex-shrink: 0;
    background: var(--bg-dark);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.voice-params--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.params-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.params-empty svg {
    opacity: 0.3;
}

.params-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.params-section--voice {
    background: var(--bg-panel);
}

.params-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.params-value {
    color: var(--accent);
    font-weight: 600;
}

/* 选中的配音员 */
.selected-voice {
    display: flex;
    gap: 12px;
}

.selected-voice__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #00d4aa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.selected-voice__info {
    flex: 1;
    min-width: 0;
}

.selected-voice__info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.selected-voice__tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    margin-bottom: 8px;
}

.selected-voice__info p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 参数选项 */
.params-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.params-options--quality {
    gap: 12px;
}

.params-option {
    padding: 8px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.params-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.params-option.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* 情绪选项 */
.params-options--emotion {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.params-option--emotion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
}

.params-option--emotion .emotion-icon {
    font-size: 18px;
}

.params-option--emotion .emotion-name {
    font-size: 11px;
}

/* 滑块 */
.params-slider {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.params-slider input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-panel);
    appearance: none;
    cursor: pointer;
}

.params-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.params-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.slider-value {
    color: var(--accent);
    font-weight: 600;
}

/* 操作按钮 */
.params-actions {
    padding: 16px;
    display: flex;
    gap: 12px;
    margin-top: auto;
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
}

.params-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ===== 文本编辑器 ===== */
.text-editor {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: 0 24px 20px;
    overflow: hidden;
}

.text-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.text-editor__header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.text-editor__actions {
    display: flex;
    gap: 8px;
}

/* 模板下拉菜单 */
.template-dropdown {
    position: relative;
}

.template-dropdown:hover .template-menu {
    display: block;
}

.template-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    min-width: 150px;
    overflow: hidden;
}

.template-menu button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.template-menu button:hover {
    background: var(--bg-hover);
}

.text-editor__body {
    padding: 0;
}

.text-editor__body textarea {
    width: 100%;
    min-height: 180px;
    max-height: 300px;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    font-family: inherit;
}

.text-editor__body textarea::placeholder {
    color: var(--text-muted);
    line-height: 1.6;
}

.text-editor__body textarea:focus {
    outline: none;
}

.text-editor__body textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.text-editor__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
}

.text-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.text-stats strong {
    color: var(--text-primary);
    font-weight: 600;
}

.text-editor__generate {
    display: flex;
    gap: 8px;
}

.text-editor__generate .btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn--success {
    background: #22c55e;
    color: white;
}

.btn--success:hover {
    background: #16a34a;
}

.btn--success:disabled {
    background: #4ade80;
    opacity: 0.5;
}

/* 旋转动画 */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 生成结果提示 */
.generation-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.1);
    border-top: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    font-size: 13px;
}

.generation-result span {
    flex: 1;
}

/* ===== 右侧面板新增样式 ===== */
.params-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.params-title svg {
    margin-right: 6px;
    opacity: 0.7;
}

.params-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

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

.params-item label {
    font-size: 12px;
    color: var(--text-secondary);
}

.params-hint {
    color: var(--text-muted);
    font-size: 10px;
}

.params-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.params-input-group input {
    width: 70px;
    padding: 6px 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    text-align: right;
}

.params-input-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.params-unit {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 24px;
}

.params-options--format {
    gap: 6px;
}

.params-option--small {
    padding: 4px 12px;
    font-size: 11px;
}

.params-select {
    flex: 1;
    max-width: 160px;
    padding: 6px 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
}

.params-select:focus {
    outline: none;
    border-color: var(--accent);
}

.params-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* 按钮样式补充 */
.btn--ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn--ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn--ghost:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ===== 配音生成模态框 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal--voice {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal__header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.modal__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal--voice .modal__body {
    display: flex !important;
    flex-direction: row !important;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    padding: 0 !important;
    max-height: none !important;
}

/* 左侧：配音员信息和参数 */
.modal--voice .voice-modal__left {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px;
    display: block;
}

.voice-modal__voice {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.voice-modal__avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.voice-modal__info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.voice-modal__tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    font-size: 11px;
    border-radius: 10px;
    margin-bottom: 6px;
}

.voice-modal__info p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 参数设置 */
.voice-modal__params {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.param-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.param-row label {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.param-value {
    color: var(--accent);
    font-weight: 600;
}

.param-hint {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 400;
    opacity: 0.7;
}

.param-options {
    display: flex;
    gap: 6px;
}

.param-options--emotion {
    flex-wrap: wrap;
}

.param-options--emotion-text {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.param-options--emotion-text .param-btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* 参数区块样式 */
.param-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.param-section-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
}

.param-section .param-row {
    margin-bottom: 12px;
}

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

.param-btn {
    padding: 6px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.param-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.param-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.param-btn--emotion {
    padding: 6px 10px;
    font-size: 16px;
}

.param-btn--sm {
    padding: 4px 10px;
    font-size: 11px;
}

.param-row input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-dark);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    /* 确保滑块可以正常拖动 */
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.param-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0, 212, 170, 0.4);
    transition: transform 0.15s ease;
}

.param-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.param-row input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.15);
}

.param-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: grab;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 212, 170, 0.4);
}

.param-row input[type="range"]::-moz-range-track {
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
}


.param-row--compact {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.param-row--compact label {
    flex: 1;
}

.param-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.param-input input {
    width: 60px;
    padding: 4px 6px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 11px;
    text-align: right;
}

.param-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.param-input span {
    font-size: 10px;
    color: var(--text-muted);
}

.param-select {
    padding: 4px 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
}

.param-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* 右侧：文本输入 */
.modal--voice .voice-modal__right {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-width: 0;
}

.text-editor-modal {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.text-editor-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.text-editor-modal__actions {
    display: flex;
    gap: 6px;
}

.text-editor-modal textarea {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.8;
    resize: none;
    min-height: 300px;
}

.text-editor-modal textarea:focus {
    outline: none;
}

.text-editor-modal textarea::placeholder {
    color: var(--text-muted);
}

.text-editor-modal__footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
}

.text-stats-modal {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.text-stats-modal strong {
    color: var(--text-primary);
}

.generation-result-modal {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-md);
    color: #22c55e;
    font-size: 12px;
}

.generation-result-modal span {
    flex: 1;
}

/* 模态框底部 */
.modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.modal__footer-right {
    display: flex;
    gap: 10px;
}

.modal__footer .btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 响应式 */
@media (max-width: 1400px) {
    .modal--voice {
        width: 95vw;
        max-width: 1100px;
    }
}

@media (max-width: 1200px) {
    .voice-params {
        width: 280px;
    }
    
    .params-options--emotion {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .modal--voice {
        width: 98vw;
        max-width: 95vw;
    }
    
    .voice-modal__left {
        width: 280px;
    }
}

@media (max-width: 900px) {
    .voice-sidebar {
        width: 220px;
    }
    
    .voice-params {
        display: none;
    }
    
    .modal--voice {
        height: 95vh;
    }
    
    .modal--voice .modal__body {
        flex-direction: column;
    }
    
    .voice-modal__left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 40vh;
    }
    
    .voice-modal__right {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .voice-sidebar {
        display: none;
    }
    
    .modal-overlay {
        padding: 10px;
    }
    
    .modal--voice {
        height: 98vh;
    }
}

/* ===== 克隆声音相关样式 ===== */

/* 创建克隆按钮 - 扁平化设计 */
.voice-tab--create {
    background: transparent !important;
    color: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.voice-tab--create:hover {
    background: rgba(var(--accent-rgb), 0.1) !important;
    transform: none;
    box-shadow: none;
}

.voice-tab--create:active {
    background: rgba(var(--accent-rgb), 0.15) !important;
}

/* 克隆声音卡片样式 */
.voice-card--cloned {
    border: 2px solid rgba(139, 92, 246, 0.5);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.1), transparent);
}

/* 删除按钮 - 放在左上角避免和收藏按钮重叠 */
.voice-card__delete {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    z-index: 6;
    backdrop-filter: blur(4px);
}

.voice-card:hover .voice-card__delete {
    opacity: 1;
}

.voice-card__delete:hover {
    background: #ef4444;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* 徽章样式 */
.badge--cloned {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    font-size: 10px;
}

.badge--shared {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    font-size: 10px;
}

/* 克隆模态框 */
.modal--clone {
    width: 500px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal--clone .modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.clone-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.clone-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.clone-form label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.clone-form .required {
    color: #ef4444;
}

.clone-form input[type="text"],
.clone-form textarea {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.clone-form input[type="text"]:focus,
.clone-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.clone-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* 性别选择 */
.gender-options {
    display: flex;
    gap: 12px;
}

.gender-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gender-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.gender-btn.active {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* 音频上传 */
.audio-upload__dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-dark);
}

.audio-upload__dropzone:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

/* 拖拽状态 */
.audio-upload__dropzone--dragover {
    border-color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.15) !important;
    border-style: solid !important;
    transform: scale(1.02);
}

.audio-upload__dropzone--dragover p {
    color: var(--accent) !important;
}

.audio-upload__dropzone--dragover svg {
    color: var(--accent) !important;
}

.audio-upload__dropzone p {
    color: var(--text-primary);
    font-size: 14px;
    margin: 12px 0 4px;
}

.audio-upload__dropzone span {
    color: var(--text-muted);
    font-size: 12px;
}

.audio-upload__dropzone svg {
    color: var(--text-muted);
}

.audio-upload__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.audio-upload__selected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(var(--accent-rgb), 0.1);
    border-radius: 8px;
}

.audio-upload__selected span {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-upload__selected svg {
    color: var(--accent);
}

.audio-upload__remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: none;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.audio-upload__remove:hover {
    background: #ef4444;
    color: white;
}

.audio-upload__hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* 模态框底部按钮 */
.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn--secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn--secondary:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.btn--primary {
    background: var(--accent);
    border: none;
    color: white;
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.4);
}

.btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 旋转动画 */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
