:root {
    --primary-color: #4a90e2;
    --secondary-color: #357abf;
    --background-color: #f6f9fc;
    --card-color: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --input-focus-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 5px;
}

header .subtitle {
    color: #666;
    font-size: 1.1em;
}

section {
    background-color: var(--card-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

section h2 {
    color: #2c3e50;
    margin: 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    font-size: 1.5em;
}

section h3 {
    color: #34495e;
    margin: 15px 0;
}

section h4 {
    color: #7f8c8d;
    margin: 10px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--input-focus-shadow);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.parameters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.parameters-grid .form-group {
    margin-bottom: 0;
}

.parameters-grid .form-group label {
    font-size: 0.9em;
    margin-bottom: 2px;
}

.parameters-grid .form-group input[type="number"],
.parameters-grid .form-group input[type="text"],
.parameters-grid .form-group select {
    padding: 4px 8px;
    font-size: 0.9em;
}

.parameters-grid .form-group .help-text {
    font-size: 0.8em;
    margin-top: 2px;
}

input[type="range"] {
    width: 100%;
    margin-top: 5px;
}

input[type="range"] + span {
    display: inline-block;
    margin-left: 8px;
    font-weight: 500;
    color: var(--primary-color);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

button {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
}

.primary-button:hover {
    background-color: var(--secondary-color);
}

.action-button {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.action-button:hover {
    background-color: #e2e8f0;
}

button:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

#generation-result,
#upload-result {
    margin-top: 30px;
    padding: 20px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
}

#generation-result.hidden,
#upload-result.hidden {
    display: none;
}

#audio-preview-container {
    margin: 30px 0 0 0;
    padding: 15px;
    background-color: #f1f5f9;
    border-radius: 4px;
    position: relative;
    z-index: 5;
}

.audio-preview-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.audio-preview-content audio {
    width: 100%;
    margin-top: 10px;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(74,144,226,0.10);
    border: 1.5px solid #4a90e2;
    min-height: 44px;
    opacity: 1;
    z-index: 10;
    display: block;
}

/* 增强播放器控件的样式 */
.audio-preview-content audio::-webkit-media-controls-panel {
    background-color: #f0f8ff;
}

.audio-preview-content audio::-webkit-media-controls-play-button {
    background-color: rgba(74, 144, 226, 0.8);
    border-radius: 50%;
    transform: scale(1.2);
}

.audio-preview-content audio::-webkit-media-controls-timeline {
    background-color: #e1ebfa;
    border-radius: 5px;
    height: 8px;
}

.audio-preview-content audio::-webkit-media-controls-current-time-display,
.audio-preview-content audio::-webkit-media-controls-time-remaining-display {
    color: #333;
    font-size: 13px;
}

.waveform-container {
    width: 100%;
    height: 100px;
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
}

#waveform {
    width: 100%;
    height: 100%;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#audio-player {
    display: none;
}

.preview-button {
    background-color: var(--success-color);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.preview-button:hover {
    background-color: #27ae60;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    background-color: white;
    flex-wrap: wrap;
}

.result-label {
    word-break: break-all;
    font-size: 16px;
    color: #222;
}

.button-container {
    display: flex;
    gap: 10px;
}

.download-button {
    background-color: var(--primary-color);
    color: white;
}

.download-button:hover {
    background-color: var(--secondary-color);
}

.delete-button {
    background-color: var(--error-color);
    color: white;
}

.delete-button:hover {
    background-color: #c0392b;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease-out forwards;
    max-width: 400px;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 添加API检查等重要通知的特殊样式 */
.notification[data-important="true"] {
    z-index: 1001; /* 确保重要通知显示在最上层 */
    border-left: 4px solid rgba(255, 255, 255, 0.7);
}

.notification.success {
    background-color: var(--success-color);
}

.notification.error {
    background-color: var(--error-color);
}

.notification.info {
    background-color: var(--info-color);
}

.notification.warning {
    background-color: var(--warning-color);
}

@keyframes slideIn {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.help-text {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
}

.voice-upload-info {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
}

.voice-upload-info h4 {
    margin-bottom: 10px;
    color: #475569;
}

.voice-upload-info ul {
    padding-left: 20px;
}

.voice-upload-info li {
    margin-bottom: 5px;
    color: #64748b;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tab-button {
    flex: 1;
    padding: 15px;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s;
}

.tab-button:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
}

.tab-button.active {
    background-color: white;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#voice-list {
    margin-top: 20px;
}

.voice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: white;
}

.voice-info {
    flex: 1;
}

.voice-name {
    font-weight: 500;
    color: #334155;
    margin-bottom: 5px;
}

.voice-id-cell {
    /* 增大音色ID列宽 */
    min-width: 150px; /* 调整最小宽度 */
    max-width: 250px; /* 调整最大宽度 */
    word-break: normal; /* 防止在中部断开 */
    font-size: 11px; /* 缩小字体 */
}

.voice-id {
    font-family: monospace;
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    display: block; /* 改为块级元素 */
    color: #555; /* 调整颜色 */
    font-size: 11px; /* 缩小字体 */
    width: 100%;
    overflow: hidden; /* 隐藏溢出 */
    white-space: nowrap; /* 不换行 */
    text-overflow: ellipsis; /* 显示省略号 */
    cursor: pointer; /* 提示可交互 */
    transition: background-color 0.2s;
}

.voice-id:hover {
    background-color: #e0e0e0;
}

.voice-name-cell {
    font-weight: 500;
    min-width: 150px;
}

/* 参考文本列 */
.voice-text-cell {
    font-size: 0.85em; /* 缩小字体 */
    color: #666;
    max-width: 200px; /* 限制最大宽度 */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-right: 15px; /* 增加右边距防止靠近按钮 */
}

/* 模型列 */
.voice-model-cell {
    font-size: 0.9em;
    color: #555;
    min-width: 100px;
}

.voice-actions {
    display: flex;
    gap: 10px; /* 增大按钮间距 */
    align-items: center; /* 垂直居中按钮 */
}

.voice-action-cell button {
    padding: 8px 14px; /* 增大按钮内边距 */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px; /* 保持字体大小 */
    font-weight: 500; /* 加粗 */
    white-space: nowrap; /* 防止按钮文字换行 */
    transition: background-color 0.2s, transform 0.1s;
}

.voice-action-cell button:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* 调整特定按钮样式 */
.voice-action-cell .copy-button {
    background-color: #e8eaf6; /* 淡紫色背景 */
    color: #3f51b5; /* 深紫色文字 */
}
.voice-action-cell .copy-button:hover {
    background-color: #c5cae9;
}

.voice-action-cell .preview-button {
    background-color: #e7f5ff; /* 保持淡蓝色 */
    color: #1c7ed6;
}
.voice-action-cell .preview-button:hover {
    background-color: #d0ebff;
}

.voice-action-cell .use-button {
    background-color: #e8f5e9; /* 淡绿色 */
    color: #2e7d32;
}
.voice-action-cell .use-button:hover {
    background-color: #c8e6c9;
}

.voice-action-cell .delete-button {
    background-color: #fff0f0; /* 淡红色 */
    color: #c62828;
}
.voice-action-cell .delete-button:hover {
    background-color: #ffcdd2;
}

.section-desc {
    color: #64748b;
    margin-bottom: 20px;
}

.loading-message {
    text-align: center;
    padding: 20px;
    color: #64748b;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.api-key-section {
    margin-bottom: 30px;
}

.api-key-container {
    max-width: 1200px;
    margin: 0 auto;
}

.api-key-row {
    display: flex;
    gap: 10px;
}

.api-key-input-group {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0 10px;
    background-color: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.api-key-input-group:focus-within {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--input-focus-shadow);
}

.api-key-input-group input[type="password"],
.api-key-input-group input[type="text"] {
    flex-grow: 1;
    border: none;
    padding: 10px 0;
    outline: none;
    background: transparent;
    font-family: monospace;
}

.eye-icon {
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s;
}

.eye-icon:hover {
    opacity: 1;
}

.icon-button {
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
}

.api-key-help {
    margin-top: 10px;
    text-align: left;
}

.text-link {
    color: var(--primary-color);
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    section {
        padding: 15px;
    }
    
    .parameters-grid {
        grid-template-columns: 1fr;
    }
    
    .api-key-row {
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .button-container {
        margin-top: 10px;
        width: 100%;
    }
    
    .button-container button {
        flex: 1;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .voice-item {
        flex-direction: column;
    }
    
    .voice-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
    }
}

/* 音色管理页面增强样式 */
.voice-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.search-container {
    position: relative;
    flex: 1;
    margin-right: 15px;
}

#voice-search {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.refresh-button {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.refresh-button:hover {
    background-color: #e0e0e0;
}

/* 音色表格样式 */
.voice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.voice-table th {
    background-color: #f2f2f2;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.voice-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.voice-row:hover {
    background-color: #f9f9f9;
}

.voice-name-cell {
    font-weight: 500;
}

.voice-time-cell {
    color: #666;
    font-size: 0.9em;
}

.voice-action-cell {
    display: flex;
    gap: 10px; /* 增大按钮间距 */
    align-items: center; /* 垂直居中按钮 */
}

.voice-action-cell button {
    padding: 8px 14px; /* 增大按钮内边距 */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px; /* 保持字体大小 */
    font-weight: 500; /* 加粗 */
    white-space: nowrap; /* 防止按钮文字换行 */
    transition: background-color 0.2s, transform 0.1s;
}

.voice-action-cell button:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* 调整特定按钮样式 */
.voice-action-cell .copy-button {
    background-color: #e8eaf6; /* 淡紫色背景 */
    color: #3f51b5; /* 深紫色文字 */
}
.voice-action-cell .copy-button:hover {
    background-color: #c5cae9;
}

.voice-action-cell .preview-button {
    background-color: #e7f5ff; /* 保持淡蓝色 */
    color: #1c7ed6;
}
.voice-action-cell .preview-button:hover {
    background-color: #d0ebff;
}

.voice-action-cell .use-button {
    background-color: #e8f5e9; /* 淡绿色 */
    color: #2e7d32;
}
.voice-action-cell .use-button:hover {
    background-color: #c8e6c9;
}

.voice-action-cell .delete-button {
    background-color: #fff0f0; /* 淡红色 */
    color: #c62828;
}
.voice-action-cell .delete-button:hover {
    background-color: #ffcdd2;
}

/* 音色预览容器 */
.voice-preview-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px;
    z-index: 1000;
}

#voice-preview-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 500;
}

#voice-preview-player {
    width: 100%;
    margin-top: 10px;
}

.close-button {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.close-button:hover {
    color: #333;
}

/* 错误和空状态 */
.error-state, .empty-state {
    text-align: center;
    padding: 30px;
    background-color: #f8f8f8;
    border-radius: 8px;
    margin-top: 20px;
}

.error-state .error-text {
    color: #e03131;
    font-weight: 500;
    margin-bottom: 10px;
}

.help-text {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* 加载指示器 */
.loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* 适配移动设备 */
@media (max-width: 768px) {
    .voice-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-container {
        width: 100%;
        margin-right: 0;
    }
    
    .refresh-button {
        width: 100%;
    }
    
    .voice-table th:nth-child(2),
    .voice-table td:nth-child(2) {
        display: none; /* 在移动设备上隐藏创建时间列 */
    }
    
    .voice-action-cell {
        flex-direction: column;
        gap: 5px;
    }
    
    .voice-preview-container {
        width: 90%;
        left: 5%;
        right: 5%;
    }
}

/* 进度条样式 */
.progress-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.progress-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #4dabf7;
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* 统计信息样式 */
.stats-container {
    margin-top: 20px;
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4dabf7;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #cce5ff;
}

.stats-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.stats-label {
    font-weight: 500;
    color: #555;
}

.stats-value {
    font-family: monospace;
    color: #333;
}

.voice-id-cell {
    /* 增大音色ID列宽 */
    min-width: 150px; /* 调整最小宽度 */
    max-width: 250px; /* 调整最大宽度 */
    word-break: normal; /* 防止在中部断开 */
    font-size: 11px; /* 缩小字体 */
}

.voice-id {
    font-family: monospace;
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    display: block; /* 改为块级元素 */
    color: #555; /* 调整颜色 */
    font-size: 11px; /* 缩小字体 */
    width: 100%;
    overflow: hidden; /* 隐藏溢出 */
    white-space: nowrap; /* 不换行 */
    text-overflow: ellipsis; /* 显示省略号 */
    cursor: pointer; /* 提示可交互 */
    transition: background-color 0.2s;
}

.voice-id:hover {
    background-color: #e0e0e0;
}

.voice-name-cell {
    font-weight: 500;
    min-width: 150px;
}

.voice-name-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background-color: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    transition: border-color 0.2s, background-color 0.2s;
}

.voice-name-input:hover {
    border-color: #ddd;
    background-color: #f9f9f9;
}

.voice-name-input:focus {
    border-color: var(--primary-color);
    background-color: white;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.voice-time-cell {
    color: #666;
    font-size: 0.9em;
    min-width: 120px;
}

/* 字幕设置标签页样式 */
#subtitle-settings .form-group {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

#subtitle-settings input[type="number"] {
    width: 100px;
    padding: 5px;
    margin-right: 10px;
}

#subtitle-settings input[type="checkbox"] {
    margin-right: 10px;
}

#subtitle-settings .help-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

.audio-player-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.audio-play-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.audio-play-btn:hover {
    background: var(--secondary-color);
}

#audio-current-time, #audio-duration {
    font-family: monospace;
    font-size: 14px;
    color: #333;
}

#audio-duration {
    margin-left: 10px;
}

#audio-progress-bar {
    cursor: pointer;
}

/* 统计信息头部flex布局 */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.stats-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #34495e;
}
.stats-download-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 1px 3px rgba(74,144,226,0.08);
    margin-left: 10px;
    min-width: 80px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stats-download-btn:hover {
    background-color: var(--secondary-color);
}

.srt-preview {
    position: relative;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-top: 10px;
    padding: 16px 32px 16px 16px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.srt-preview pre {
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    font-size: 14px;
    font-family: inherit;
}
.srt-preview .close-preview-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.srt-preview .close-preview-btn:hover {
    background: #e74c3c;
    color: #fff;
}

.audio-preview-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    z-index: 9999;
    padding: 32px 32px 24px 32px;
    min-width: 320px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.audio-preview-popup .close-audio-preview-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.audio-preview-popup .close-audio-preview-btn:hover {
    background: #e74c3c;
    color: #fff;
}
.audio-preview-popup audio {
    width: 100%;
    max-width: 480px;
    margin-top: 16px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(74,144,226,0.10);
    border: 1.5px solid #4a90e2;
}

.audio-player-row {
    width: 100%;
    margin-bottom: 0;
    padding: 12px 0 0 0;
    display: flex;
    align-items: center;
    background: none;
}
.audio-player-row audio {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(74,144,226,0.10);
    border: 1.5px solid #e0e0e0;
}

.API-title, .parameters-title, .audio-generation-title {
    color: #2c3e50;
    margin: 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    font-size: 1.5em;
}

/* 字幕设置标签页样式 */
.subtitle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px 32px;
    margin-top: 10px;
    margin-bottom: 20px;
}

#subtitle-settings .subtitle-grid .form-group {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(74,144,226,0.07);
    padding: 24px 20px 18px 20px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: box-shadow 0.2s;
    border: 1px solid #f0f4fa;
}

#subtitle-settings .subtitle-grid .form-group:hover {
    box-shadow: 0 4px 16px rgba(74,144,226,0.13);
    border-color: #b3d0f7;
}

#subtitle-settings .subtitle-grid .form-group label {
    font-size: 1.05em;
    font-weight: 500;
    margin-bottom: 8px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 6px;
}

#subtitle-settings .subtitle-grid .form-group input[type="number"] {
    width: 120px;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1.5px solid #e0e7ef;
    font-size: 1em;
    margin-bottom: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#subtitle-settings .subtitle-grid .form-group input[type="number"]:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px #b3d0f7;
    outline: none;
}

#subtitle-settings .subtitle-grid .form-group input[type="checkbox"] {
    accent-color: #4a90e2;
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

#subtitle-settings .subtitle-grid .form-group .help-text {
    font-size: 0.92em;
    color: #64748b;
    margin-top: 4px;
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .subtitle-grid {
        grid-template-columns: 1fr;
    }
}

<div class="form-group">
    <label for="reference-audio">参考音频:</label>
    <input type="file" id="reference-audio" accept=".mp3,.wav,.opus,.pcm">
    <p class="help-text">
        仅限单一说话人，吐字清晰；音量、音调和情绪稳定；简短停顿（建议0.5秒）；无背景噪音，专业录音为佳；理想时长8-10秒。
    </p>
</div> 