/* 全局样式优化 */
:root {
    --primary-color: #0078d4;
    --secondary-color: #00bcf2;
    --accent-color: #7c3aed;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --text-dark: #1a1a1a;
    --border-radius: 12px;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-accent: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    --border-color: #e0e0e0;
}

/* 美化任务名称样式 */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group.full-width {
    flex: 1;
    min-width: 100%;
}

.form-group.half {
    flex: 1;
    min-width: calc(50% - 10px);
}

.task-name-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.required {
    color: #dc3545;
    font-size: 14px;
}

.task-name-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.task-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #f8fafc;
}

.task-name-input::placeholder {
    color: #94a3b8;
    font-style: italic;
}

/* 批量生成表单优化 */
#batch-form-container .form-group {
    margin-bottom: 0;
}

#batch-form-container .form-row {
    margin-bottom: 20px;
}

/* 确保文本框全宽 */
#batch-input-text {
    width: 100%;
}

/* 确保语言、语音等选择框紧凑排列 */
#batch-form-container .form-row .form-group {
    flex: 1;
    min-width: calc(50% - 10px);
}

/* 合并结果选择框样式 */
#batch-concatenate {
    width: 100%;
}

/* 任务列表美化 */
.batch-job-item {
    transition: all 0.2s ease;
}

.batch-job-item:hover {
    background: #f0f4ff;
}

.batch-file-list {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 8px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background: var(--bg-color);
    min-height: 100vh;
}

/* 主容器优化 */
.microsoft-tts-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 左右分栏布局优化 */
.tts-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    align-items: stretch;
}

@media (max-width: 768px) {
    .tts-layout {
        grid-template-columns: 1fr;
    }
}

/* 文本输入区域优化 */
.text-input-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    border: 1px solid var(--border-color);
    height: 100%;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.text-input-section:hover {
    background: #fafbfc;
}

/* 参数选择区域优化 */
.params-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    border: 1px solid var(--border-color);
    height: 100%;
    transition: var(--transition);
    overflow-y: auto;
}

.params-section:hover {
    background: #fafbfc;
}

/* 表单组间距优化 */
.params-section .form-group {
    margin-bottom: 20px;
}

/* 文本输入区域表单组优化 */
.text-input-section .form-group {
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.text-input-section textarea {
    flex: 1;
    min-height: 300px;
}

/* 风格和角色选择容器优化 */
.style-role-container {
    margin-top: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

/* 无可用选项提示优化 */
.no-options-message {
    color: var(--text-light);
    font-style: italic;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 确保选择框容器有一致的高度 */
#batch-form-container .style-role-container {
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

/* 确保风格和角色扮演选择区域高度一致 */
#style-selection,
#role-selection,
#batch-style-selection,
#batch-role-selection {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 确保选择框和提示消息在容器中居中对齐 */
#style-selection select,
#role-selection select,
#batch-style-selection select,
#batch-role-selection select {
    flex: 1;
    min-height: 48px;
}

/* 确保批量表单中的选择框容器高度一致 */
#batch-form-container .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: stretch;
}

#batch-form-container .form-row .form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: calc(50% - 10px);
}

/* 确保批量表单中的选择框有一致的高度 */
#batch-form-container .form-group select {
    height: 48px;
}

/* 确保批量表单中的文本框有一致的高度 */
#batch-form-container .form-group textarea {
    min-height: 200px;
}

/* 批量生成表单标题样式 */
#batch-form-container h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* 加载状态优化 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 卡片样式优化 */
.tts-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.tts-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.tts-card:hover {
    background: #fafbfc;
}

/* 表单样式优化 */
.tts-form .form-group {
    margin-bottom: 20px;
}

.tts-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.tts-form textarea {
    width: 100%;
    padding: 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    transition: var(--transition);
    background: #fafafa;
    line-height: 1.6;
}

.tts-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

/* 字数统计样式 */
.word-count {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.word-count #current-word-count {
    color: var(--primary-color);
    font-weight: 600;
}

.word-count #max-word-count {
    color: var(--text-light);
    font-weight: 500;
}

/* 选择框样式优化 */
.tts-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fafafa;
    transition: var(--transition);
    cursor: pointer;
    appearance: none;
    box-sizing: border-box;
    height: 48px; /* 固定高度，与按钮匹配 */
}

/* 语音选择和试听按钮组合样式 */
.voice-select-with-preview {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.voice-select-with-preview select {
    flex: 1;
    margin: 0;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    height: 48px;
    background: #fafafa;
    padding: 12px 15px;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
    appearance: none;
}

.voice-select-with-preview .tts-btn-preview-voice {
    padding: 12px 18px;
    font-size: 0.95rem;
    min-width: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    margin: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--secondary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .voice-select-with-preview {
        flex-direction: column;
        gap: 10px;
    }
    
    .voice-select-with-preview select,
    .voice-select-with-preview .tts-btn-preview-voice {
        width: 100%;
    }
}

.tts-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
    z-index: 1;
}

.voice-select-with-preview select:focus {
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1), 100px 0 0 3px rgba(0, 120, 212, 0.1); /* 扩展阴影到按钮区域 */
}

.tts-form select:active {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

/* 移除浏览器默认的焦点轮廓，确保自定义样式正常工作 */
.tts-form select::-moz-focus-inner {
    border: 0;
}

/* 确保下拉选项样式正常 */
.tts-form select option {
    background: white;
    color: var(--text-dark);
    padding: 10px;
    border: none;
}

/* 修复下拉框的外观，确保在所有浏览器中一致 */
.tts-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* 试听按钮悬停和禁用样式 */
.voice-select-with-preview .tts-btn-preview-voice:hover:not(:disabled) {
    background: #00a8e8;
}

.voice-select-with-preview .tts-btn-preview-voice:active:not(:disabled) {
    box-shadow: 0 4px 15px rgba(0, 184, 242, 0.2);
}

.voice-select-with-preview .tts-btn-preview-voice:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* 简化的焦点样式 */
.voice-select-with-preview select:focus {
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

/* 批量生成功能样式 */
.batch-generation-section {
    margin-top: 40px;
}

.batch-generation-section .section-header {
    margin-bottom: 30px;
    text-align: center;
}

.batch-generation-section .section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* 历史记录样式 */
.history-section {
    margin-top: 40px;
}

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

.history-section .section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* 历史记录表格样式 */
.history-section .batch-jobs-table {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 5px;
}

/* 历史记录行样式 */
.history-section .batch-job-header {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.5fr 1.5fr;
}

.history-section .batch-job-item {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.5fr 1.5fr;
}

/* 任务类型样式 */
.job-status.single {
    background: #dbeafe;
    color: #1e40af;
}

.job-status.batch {
    background: #d1fae5;
    color: #065f46;
}

/* 语音名称和语言名称样式 */
.voice-name,
.language-name {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* 字数统计样式 */
.character-count {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* 批量表单样式优化 */
#batch-form-container {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

#batch-form-container h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 700;
}

/* 批量任务列表容器样式 */
#batch-jobs-container {
    margin-top: 40px;
}

#batch-jobs-container .jobs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

#batch-jobs-container .jobs-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 700;
}

.jobs-header-actions {
    display: flex;
    gap: 10px;
}

.tts-btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
}

.tts-btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    color: white;
}

.tts-btn-danger:active {
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* 批量任务列表样式 */
.batch-jobs-table {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.batch-job-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 15px;
    padding: 15px 20px;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.batch-job-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 15px;
    padding: 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.batch-job-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.batch-job-item:hover {
    background: #f0f4ff;
}

.batch-job-item:hover::before {
    opacity: 1;
}

.job-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.job-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.job-status.pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.job-status.running {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    animation: pulse 1.5s infinite;
}

.job-status.succeeded {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.job-status.failed {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.job-progress {
    display: none;
}

.progress-bar,
.progress-fill,
.progress-text {
    display: none;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.job-time {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

.job-time::before {
    content: '🕒';
}

.job-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: nowrap;
    align-items: center;
}

.tts-btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-weight: 500;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: auto;
    flex: 1;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 批量任务列表优化 */
.batch-jobs-table {
    display: grid;
    gap: 15px;
    margin-top: 20px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 5px;
}

/* 任务列表分页样式 */
.batch-jobs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
}

.batch-jobs-pagination button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.batch-jobs-pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.batch-jobs-pagination button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.batch-jobs-pagination .page-info {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* 批量任务列表响应式优化 */
@media (max-width: 1024px) {
    .job-actions {
        flex-wrap: nowrap;
    }
    
    .tts-btn-sm {
        padding: 4px 8px;
        font-size: 0.75rem;
        max-width: 100px;
    }
}

@media (max-width: 768px) {
    .job-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tts-btn-sm {
        max-width: none;
        flex: 1;
        width: calc(50% - 4px);
    }
}

.tts-btn-sm:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tts-btn-sm:active:not(:disabled) {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tts-btn-sm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 文件上传样式 */
.batch-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.batch-file-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.batch-file-item:hover {
    background: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.batch-file-item:hover::before {
    opacity: 1;
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: var(--text-light);
    font-size: 0.85rem;
    min-width: 80px;
}

.file-words {
    color: var(--primary-color);
    font-size: 0.85rem;
    min-width: 80px;
    font-weight: 600;
}

.batch-file-warning {
    padding: 12px 15px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.9rem;
    margin-top: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-file-warning::before {
    content: '⚠️';
    font-size: 1.2rem;
}

/* 描述文本样式 */
.form-group .description {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .batch-job-header,
    .batch-job-item {
        grid-template-columns: 1.5fr 1fr 1.5fr 1fr 1fr;
        gap: 10px;
    }
    
    .tts-btn-sm {
        min-width: 70px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    /* 批量表单响应式 */
    #batch-form-container {
        padding: 20px;
    }
    
    /* 批量任务列表响应式 */
    .batch-job-header {
        display: none;
    }
    
    .batch-job-item {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
        padding: 20px 15px;
    }
    
    .job-progress {
        justify-content: center;
    }
    
    .job-actions {
        justify-content: center;
        gap: 10px;
    }
    
    .job-status {
        margin: 0 auto;
        display: inline-block;
    }
    
    /* 作业标题响应式 */
    #batch-jobs-container .jobs-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    /* 按钮响应式 */
    .tts-btn-sm {
        min-width: auto;
        width: auto;
    }
}

/* 空任务列表样式 */
#batch-jobs-list p {
    text-align: center;
    color: var(--text-light);
    margin: 40px 0;
    padding: 30px;
    background: #f8fafc;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
}

/* 复选框容器样式 */
.checkbox-container {
    display: flex;
    align-items: center;
    margin-top: 10px;
    padding: 12px 15px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.checkbox-container:hover {
    background: #f1f5f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color);
    transition: all 0.3s ease;
}

.checkbox-container input[type="checkbox"]:hover {
    transform: scale(1.1);
}

.checkbox-container label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
    color: var(--text-dark);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.checkbox-container:hover label {
    color: var(--primary-color);
}

/* 滑块样式优化 */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    transition: var(--transition);
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
    transition: var(--transition);
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.5);
    background: var(--secondary-color);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
    transition: var(--transition);
}

.slider-container input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.5);
    background: var(--secondary-color);
}

.slider-value {
    min-width: 55px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    background: #f0f8ff;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e0f0ff;
}

/* 按钮样式优化 */
.tts-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.tts-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.5s ease;
}

.tts-btn:hover::before {
    left: 100%;
}

.tts-btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.tts-btn-primary:hover {
    filter: brightness(1.1);
}

.tts-btn-primary:active {
    box-shadow: 0 4px 15px rgba(0, 120, 212, 0.2);
}

.tts-btn-secondary {
    background: #f0f0f0;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.tts-btn-secondary:hover {
    background: #e5e5e5;
    border-color: #d0d0d0;
}

.tts-btn-secondary:active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 按钮组优化 */
.tts-btn-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.tts-btn-group .tts-btn {
    flex: 1;
    min-width: 150px;
}

@media (max-width: 768px) {
    .tts-btn-group {
        flex-direction: column;
    }
    
    .tts-btn-group .tts-btn {
        width: 100%;
        min-width: auto;
    }
}

/* 结果区域优化 */
.result-section {
    margin-top: 30px;
    padding: 28px;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    position: relative;
}

.result-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 8px 8px 0 0;
}

.result-section h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 700;
}

/* 音频播放器优化 */
.audio-player {
    margin: 20px 0;
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    position: relative;
}



audio {
    width: 100%;
    outline: none;
    background: #fafafa;
    border-radius: 8px;
    padding: 12px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

audio:hover {
    background: white;
    border-color: var(--primary-color);
}

/* 状态消息优化 */
.status-message {
    padding: 18px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 600;
    position: relative;
    padding-left: 55px;
    font-size: 0.95rem;
    border: 2px solid transparent;
}

.status-message::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
}

.status-message.success {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.status-message.success::before {
    content: '✅';
}

.status-message.error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.status-message.error::before {
    content: '❌';
}

.status-message.loading {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.status-message.loading::before {
    content: '⏳';
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 简化的顶部标题样式 */
.top-simple-header {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px 25px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.top-simple-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.simple-header-content h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    line-height: 1.2;
}

.simple-header-content > p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin: 0;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* 积分与会员信息样式 */
.points-info-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.points-info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
}

.points-info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: center;
}

.points-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.points-info-item:hover {
    background: #f0f4ff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.1);
}

.points-info-item strong {
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: block;
}

@media (max-width: 768px) {
    .points-info-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .points-info-section {
        padding: 20px;
    }
    
    .points-info-item {
        padding: 12px;
    }
}

/* 顶部核心模块样式优化（保留但不使用） */
.top-core-section {
    display: none;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 50px 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.top-core-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.core-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
    line-height: 1.2;
}

.core-content > p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 45px;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

/* 核心统计数据优化 */
.core-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 55px;
    flex-wrap: wrap;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.core-stat-item {
    text-align: center;
    min-width: 140px;
}

.core-stat-number {
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.2;
}

.core-stat-label {
    font-size: 1rem;
    color: var(--text-light);
    display: block;
    font-weight: 500;
}

/* 核心优势优化 */
.core-advantages h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 35px;
    color: var(--text-dark);
    text-align: center;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.advantage-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    text-align: left;
    padding: 25px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.advantage-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

.advantage-item:hover {
    background: white;
}

.advantage-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-top: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(0, 120, 212, 0.1);
    border-radius: 50%;
}

.advantage-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.advantage-item p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.7;
    margin: 0;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .top-core-section {
        padding: 40px 20px;
    }
    
    .core-content h1 {
        font-size: 2.2rem;
    }
    
    .core-content > p {
        font-size: 1rem;
        margin-bottom: 35px;
    }
    
    .core-stats {
        gap: 35px;
        margin-bottom: 45px;
        padding: 15px 0;
    }
    
    .core-stat-number {
        font-size: 2.2rem;
    }
    
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .advantage-item {
        padding: 20px;
    }
    
    .core-advantages h2 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
}

/* 操作指南样式优化 */
.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 0;
    padding: 0;
}

.guide-step {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.guide-step::before {
    content: attr(data-step);
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.2);
}

.guide-step h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--text-dark);
    position: relative;
    z-index: 1;
}

.guide-step p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.guide-step:hover {
    background: white;
    border-color: var(--primary-color);
}

/* 应用场景样式优化 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 0;
    padding: 0;
}

.feature-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.feature-card .feature-icon {
    font-size: 2.5rem;
    margin-bottom: 18px;
    display: block;
    color: var(--primary-color);
    transition: var(--transition);
}

.feature-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--text-dark);
    line-height: 1.3;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
}

.feature-card:hover {
    background: white;
    border-color: var(--primary-color);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* 卡片标题优化 */
.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 28px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* 主内容区域优化 */
.tts-main {
    margin-bottom: 40px;
}

/* 增强可访问性 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 打印样式优化 */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .microsoft-tts-container {
        max-width: none;
        padding: 20px;
    }
    
    .text-input-section,
    .params-section,
    .tts-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .tts-btn {
        display: none;
    }
    
    .top-core-section {
        background: white;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}

/* 美化弹窗样式 */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    min-width: 320px;
    max-width: 90%;
    animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
        scale: 0.9;
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
        scale: 1;
    }
}

.alert-content {
    display: flex;
    align-items: flex-start;
    padding: 24px;
    gap: 20px;
}

.alert-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 4px;
}

.alert-icon.success {
    background: #d1fae5;
    color: #065f46;
}

.alert-icon.error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-icon.info {
    background: #dbeafe;
    color: #1e40af;
}

.alert-text {
    flex: 1;
    min-width: 0;
}

.alert-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-dark);
}

.alert-message {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
}

.alert-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    margin-top: -8px;
    margin-right: -8px;
}

.alert-close:hover {
    background: #f0f0f0;
    color: var(--text-dark);
    transform: rotate(90deg);
}

/* 成功和错误状态的颜色 */
.custom-alert.success .alert-title {
    color: #065f46;
}

.custom-alert.error .alert-title {
    color: #991b1b;
}

.custom-alert.info .alert-title {
    color: #1e40af;
}

/* 历史记录弹窗专用样式 */
#history-modal {
    max-width: 90%;
    width: 950px;
    max-height: 85vh;
    overflow: hidden;
}

#history-modal .alert-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
}

#history-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

#history-modal .modal-header-content {
    flex: 1;
}

#history-modal .alert-title {
    color: white;
    font-size: 1.5rem;
    margin: 0 0 4px 0;
}

#history-modal .alert-message {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 0.95rem;
}

#history-modal .alert-close {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

#history-modal .alert-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 历史记录列表容器 */
#history-list-container {
    overflow-y: auto;
    max-height: 70vh;
    padding: 0;
    background: #fafbfc;
    border-top: 1px solid #e1e4e8;
    border-bottom: 1px solid #e1e4e8;
}

/* 自定义滚动条 */
#history-list-container::-webkit-scrollbar {
    width: 8px;
}

#history-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#history-list-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

#history-list-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 历史记录表样式 */
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
    overflow-x: auto;
    display: block;
}

.history-header {
    display: grid;
    grid-template-columns: 100px 200px 150px 120px 100px 1fr;
    gap: 10px;
    padding: 16px 24px;
    background: #f6f8fa;
    border-bottom: 2px solid #e1e4e8;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    position: sticky;
    top: 0;
    z-index: 10;
    min-width: max-content;
}

.history-item {
    display: grid;
    grid-template-columns: 100px 200px 150px 120px 100px 1fr;
    gap: 10px;
    padding: 16px 24px;
    border-bottom: 1px solid #eaecef;
    transition: all 0.15s ease;
    align-items: center;
    min-width: max-content;
}

.history-item:hover {
    background: #f0f4ff;
}

.history-item:last-child {
    border-bottom: none;
}

/* 任务状态标签 */
.job-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.job-status.single {
    background: #e6fcf5;
    color: #027a48;
}

.job-status.batch {
    background: #f0f9ff;
    color: #0369a1;
}

/* 历史记录字段样式 */
.voice-name,
.language-name,
.character-count,
.job-time {
    display: flex;
    align-items: center;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.character-count {
    font-weight: 600;
    color: #667eea;
}

.job-time {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* 空状态样式 */
#history-list p {
    text-align: center;
    color: var(--text-light);
    margin: 40px 0;
    font-size: 1rem;
    font-style: italic;
}

/* 历史记录统计区域 */
.history-stats {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0 0 12px 12px;
    margin-top: 15px;
}

.history-stats .total-characters {
    font-size: 0.95rem;
}

.history-stats .total-characters strong {
    font-size: 1.3rem;
    font-weight: 700;
    margin-left: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #history-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .history-header,
    .history-item {
        grid-template-columns: 80px 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
        padding: 12px 16px;
    }
    
    .history-header span:nth-child(4),
    .history-header span:nth-child(5),
    .history-item .character-count,
    .history-item .job-time {
        grid-column: span 2;
    }
    
    .history-header {
        font-size: 0.7rem;
    }
    
    .history-item {
        font-size: 0.85rem;
    }
    
    .job-status {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}