/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 合并预览容器样式 - 隐藏但保持功能 */
.merged-preview-container {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* 人物识别状态提示框 */
.character-recognition-status {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px dashed #e2e8f0;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-recognition-status.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
    color: #059669;
}

.character-recognition-status.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    color: #dc2626;
}

.merged-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.merged-preview-header h3 {
    color: #1d1d1f;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.merged-preview-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.merged-preview-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    aspect-ratio: 16/9;
    object-fit: contain;
    background: #000;
}

.merged-preview-image img:hover {
    transform: scale(1.02);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fafafa;
    color: #1d1d1f;
    line-height: 1.5;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f7 100%);
}

/* 头部样式 - Apple风格重设计 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    justify-self: start;
}

.nav {
    justify-self: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(45deg, #000 0%, #333 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.25rem;
    border-radius: 10px;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    position: relative;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
}

.nav-btn.active {
    background: #fff;
    color: #000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.user-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* 按钮样式 - Apple风格重设计 */
.btn-primary {
    background: #000;
    color: #fff;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.btn-primary:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-primary:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-primary:disabled:hover {
    background: #666;
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-secondary {
    background: #fff;
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.16);
}

.btn-secondary:hover {
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f0f0f0;
    color: #000;
}

.btn-icon-small {
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #666;
    font-size: 0.875rem;
}

.btn-add {
    background: transparent;
    border: 1px dashed #ddd;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    width: 100%;
    margin-top: 1rem;
    transition: all 0.2s;
}

.btn-add:hover {
    border-color: #000;
    color: #000;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* 主内容区 - Apple风格重设计 */
.main-content {
    flex: 1;
    padding: 3rem 0;
    overflow-y: auto;
    width: 100%;
    transition: opacity 0.3s ease;
}

.content-section {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

/* 输入模块样式 */
.input-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 1.5rem;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #000;
}

.tab-btn.active {
    color: #000;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #000;
}

.tab-content {
    display: none;
}

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

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #1d1d1f;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.char-count {
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.825rem;
    font-weight: 500;
}

textarea {
    width: 100%;
    padding: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    -webkit-appearance: none;
    appearance: none;
}

textarea:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

textarea::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-weight: 400;
}

.input-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
    align-items: center;
}

.input-actions:has(.thinking-toggle) {
    justify-content: space-between;
}

/* 思考模式开关样式 - Apple风格 */
.thinking-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 14px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #000;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1d1d1f;
    letter-spacing: -0.01em;
    user-select: none;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* 确保按钮文字在一行显示 */
.action-buttons .btn-primary,
.action-buttons .btn-secondary,
.footer-actions .btn-primary,
.footer-actions .btn-secondary {
    white-space: nowrap;
    min-width: auto;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.upload-area:hover {
    border-color: #000;
    background: #fafafa;
}

.upload-area.dragover {
    border-color: #000;
    background: #f0f0f0;
}

.upload-area svg {
    margin-bottom: 1rem;
}

.upload-area p {
    color: #666;
    margin: 0.5rem 0;
}

.upload-hint {
    font-size: 0.875rem;
    color: #999;
}

.file-info {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.file-name {
    color: #333;
}

.btn-remove {
    background: transparent;
    border: none;
    color: #ff4444;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

/* 图片生成模块样式 */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.process-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.process-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #000;
}

.segments-container,
.prompts-container {
    max-height: 400px;
    overflow-y: auto;
}

.segment-item,
.prompt-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.segment-header,
.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.segment-number {
    font-weight: 600;
    color: #333;
}

.segment-text,
.prompt-text {
    width: 100%;
    min-height: 80px;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    resize: vertical;
    font-size: 0.875rem;
}

/* 图片生成底部操作栏 */
.image-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem 2rem;
    background: transparent;
    border: none;
    margin-top: 2rem;
}

.image-footer button {
    width: auto !important;
    flex: none !important;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 调整图片生成页面的内容区域底部间距 */
#image-section {
    padding-bottom: 2rem;
}

/* 角色声音设定 - 工作流程指示器 */
.character-workflow {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f6f8fc 0%, #fff 100%);
    border-radius: 12px;
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.workflow-step:hover {
    transform: translateY(-2px);
}

.workflow-step.active .step-number {
    background: #6366f1;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.workflow-step.completed .step-number {
    background: #10b981;
    color: white;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step-name {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.workflow-step.active .step-name {
    color: #6366f1;
    font-weight: 600;
}

.workflow-line {
    width: 80px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 1rem;
}

/* 控制面板 */
.character-controls {
    margin-bottom: 2rem;
}

.control-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.control-header {
    margin-bottom: 1.5rem;
}

.control-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.control-header p {
    color: #64748b;
    font-size: 0.95rem;
}

.control-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-outline {
    background: white;
    border: 2px solid #e2e8f0;
    color: #475569;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-outline:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #f0f4ff;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

/* 批量操作栏 */
.batch-controls {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-small:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.btn-upload {
    background: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    border: 1px solid rgba(0, 0, 0, 0.8) !important;
}

.btn-upload:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: rgba(0, 0, 0, 1) !important;
    color: white !important;
}

/* 角色设定头部 - 使用视频生成相同的现代设计 */
.character-header-modern {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 声音合成头部 - 使用视频生成相同的现代设计 */
.voice-header-modern {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 声音配置和试听并排布局 */
.voice-config-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.voice-config-row .voice-config-compact,
.voice-config-row .voice-preview-compact {
    flex: 1;
}

/* 语音段落卡片样式 - 垂直布局 */
.voice-segment-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e5e7;
    padding: 1rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.voice-segment-card:hover {
    border-color: #007aff;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.1);
}

/* 段落上部分 - 水平布局 */
.segment-top-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.voice-segment-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 100px;
    flex-shrink: 0;
}

.voice-segment-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.segment-status {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    background: #f5f5f7;
    color: #6e6e73;
    font-weight: 500;
}

.voice-segment-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.segment-text {
    flex: 1;
    margin: 0;
}

.segment-text label {
    display: none; /* 隐藏标签以节省空间 */
}

.segment-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 60px;
    padding: 0.5rem;
    border: 1px solid #e5e5e7;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.3;
    resize: none;
    background: #fafafa;
    overflow-y: auto;
}

.segment-actions {
    flex-shrink: 0;
}

.btn-generate-voice {
    background: #1d1d1f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-generate-voice:hover {
    background: #424245;
}

.btn-generate-voice svg {
    width: 14px;
    height: 14px;
}


/* 语音播放器样式 - 扁平化版本 */
.voice-player {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    border: 1px solid #e9ecef;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.audio-info {
    font-size: 0.75rem;
    color: #6e6e73;
    font-weight: 500;
}

.btn-download {
    background: #007aff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.btn-download:hover {
    background: #0056b3;
}

.btn-download svg {
    width: 12px;
    height: 12px;
}

.audio-player {
    width: 100%;
    height: 32px;
    border-radius: 4px;
}

/* 角色展示网格 */
.character-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    justify-items: start;
}

/* 动态网格大小 */
.character-grid.grid-large {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    justify-items: start;
}

.character-grid.grid-medium {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    justify-items: start;
}

.character-grid.grid-small {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    justify-items: start;
}

.character-grid.grid-xlarge {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    justify-items: start;
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .character-grid.grid-large,
    .character-grid.grid-medium,
    .character-grid.grid-small,
    .character-grid.grid-xlarge {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .character-grid {
        grid-template-columns: 1fr;
    }
    .character-grid.grid-large,
    .character-grid.grid-medium,
    .character-grid.grid-small,
    .character-grid.grid-xlarge {
        grid-template-columns: 1fr;
    }
}

/* 小网格中的角色卡片样式调整 */
.character-grid.grid-small .character-card-new,
.character-grid.grid-xlarge .character-card-new {
    font-size: 14px;
}

.character-grid.grid-small .character-card-name,
.character-grid.grid-xlarge .character-card-name {
    font-size: 16px;
}

.character-grid.grid-small .character-description-edit,
.character-grid.grid-xlarge .character-description-edit {
    rows: 4;
    font-size: 13px;
}

.character-grid.grid-small .btn-small,
.character-grid.grid-xlarge .btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 12px;
}

.character-grid.grid-xlarge .character-card-image {
    aspect-ratio: 9 / 12;
}

/* 角色卡片关闭按钮 */
.character-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.character-close-btn:hover {
    background: #ff1a1a;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.character-close-btn:active {
    transform: scale(0.95);
}

/* 上传角色卡片样式调整 */
.character-card-new.uploaded-character .character-card-body {
    padding-bottom: 20px;
}

.character-card-new.uploaded-character .character-card-name {
    margin-bottom: 16px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.character-empty-state {
    grid-column: 1 / -1;
    background: white;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    color: #94a3b8;
}

.character-empty-state svg {
    opacity: 0.3;
    margin-bottom: 1rem;
}

.character-empty-state h4 {
    color: #64748b;
    margin-bottom: 0.5rem;
}

.character-empty-state p {
    margin-bottom: 1.5rem;
}

.empty-state-actions {
    margin-top: 1.5rem;
}

.empty-state-actions .btn-upload {
    margin: 0 auto;
}

/* 角色卡片样式 */
.character-card-new {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    max-width: 350px;
    width: 100%;
}

.character-card-new:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.character-card-select {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
}

.character-card-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-identified {
    background: #fef3c7;
    color: #92400e;
}

.status-generated {
    background: #dbeafe;
    color: #1e40af;
}

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

.character-card-image {
    position: relative;
    width: 100%;
    align-self: center;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.95rem;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 9/16;
}

.character-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.character-card-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}



.character-card-body {
    padding: 0.75rem;
}

.character-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    text-align: center;
}

.character-name-edit {
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
}

.character-name-edit:focus {
    border-color: #3b82f6;
}

.character-card-description {
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.character-description-edit {
    width: 100%;
    min-height: 120px;
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #374151;
    background: #f9fafb;
    resize: vertical;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s, background-color 0.2s;
}

.character-description-edit:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.character-description-edit::placeholder {
    color: #9ca3af;
}

.character-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.character-card-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: #1d1d1f;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-card-actions button:hover {
    background: #424245;
    transform: translateY(-1px);
}

/* 声音配置面板 */
.voice-config-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.voice-config-panel h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.75rem;
}

.voice-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.voice-presets h4,
.voice-params h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #475569;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.preset-btn {
    padding: 0.75rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.preset-btn:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.preset-btn.active {
    background: #6366f1;
    color: white;
    border-color: #4f46e5;
}

.param-group {
    margin-bottom: 1.25rem;
}

.param-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #475569;
    font-weight: 500;
    font-size: 0.95rem;
}

.param-group input[type="range"] {
    width: calc(100% - 60px);
    display: inline-block;
}

.param-value {
    display: inline-block;
    width: 50px;
    text-align: right;
    color: #6366f1;
    font-weight: 600;
}

.param-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
    color: #1e293b;
}

.voice-preview {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
}

/* 新的声音合成模块样式 */
.voice-synthesis-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 声音合成头部 */
.voice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
}

.voice-title h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: white;
}

.voice-title p {
    opacity: 0.9;
    font-size: 1rem;
}

.voice-actions {
    display: flex;
    gap: 1rem;
}

/* 全局设置面板 */
.voice-global-settings {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.voice-global-settings h4 {
    color: #007bff;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.global-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.setting-item select,
.setting-item input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.setting-item select:focus,
.setting-item input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 段落语音配置区域 */
.voice-paragraphs-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.paragraphs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.paragraphs-header h4 {
    color: #1e293b;
    font-size: 1.2rem;
}

.paragraphs-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.paragraphs-info span {
    color: #64748b;
    font-size: 0.9rem;
}

.btn-icon {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-icon:hover {
    background: #059669;
}

/* 段落容器 */
.voice-paragraphs-container {
    min-height: 300px;
}

.voice-paragraphs-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
}

.empty-state {
    text-align: center;
    color: #64748b;
}

.empty-state svg {
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state h4 {
    margin-bottom: 0.5rem;
    color: #374151;
}

/* 段落卡片样式 */
.voice-paragraph-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.voice-paragraph-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.voice-paragraph-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-paragraph-header h5 {
    font-size: 1rem;
    margin: 0;
}

.paragraph-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

.voice-paragraph-content {
    padding: 1.5rem;
}

.paragraph-text-area {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.paragraph-text-area:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.paragraph-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
}

.emotion-controls {
    display: none;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: end;
}

.emotion-controls.show {
    display: grid;
}

.emotion-scale-input {
    width: 80px;
}

/* 合成控制按钮 */
.voice-synthesis-controls {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.synthesis-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-success:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 合成进度 */
.synthesis-progress {
    margin-top: 1rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s ease;
    width: 0%;
}

/* 合成结果 */
.voice-results {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.voice-results h4 {
    color: #10b981;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.voice-result-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f9fafb;
}

.voice-result-item.success {
    border-left: 4px solid #10b981;
}

.voice-result-item.error {
    border-left: 4px solid #ef4444;
}

.result-audio-player {
    margin-top: 1rem;
}

.result-audio-player audio {
    width: 100%;
    max-width: 400px;
}

/* 底部导航 */
.voice-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .voice-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .voice-actions {
        justify-content: center;
    }

    .global-settings-grid,
    .paragraph-settings-grid {
        grid-template-columns: 1fr;
    }

    .synthesis-actions {
        flex-direction: column;
        align-items: center;
    }

    .voice-navigation {
        flex-direction: column;
        gap: 1rem;
    }
}
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* 底部操作栏 */
.character-footer {
    background: transparent;
    border: none;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
}

.character-footer .footer-actions {
    flex-shrink: 0;
    width: auto;
}

.character-footer .footer-actions button {
    width: auto !important;
    flex: none !important;
}

.progress-info {
    color: #64748b;
    font-weight: 500;
}

.footer-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
    justify-content: space-between;
}

.footer-actions button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.footer-actions button svg {
    width: 16px;
    height: 16px;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.control-group select,
.control-group input[type="number"],
.control-group input[type="color"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.control-group input[type="range"] {
    width: 100%;
}

/* 视频编辑模块样式 */
.video-preview {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.preview-container {
    aspect-ratio: 16/9;
    position: relative;
    background: #000;
}

#preview-video {
    width: 100%;
    height: 100%;
    display: none;
}

.preview-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.preview-controls {
    background: #1a1a1a;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-display {
    color: #fff;
    font-size: 0.875rem;
    margin-left: auto;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-slider {
    width: 100px;
}

/* 时间线编辑器 */
.timeline-editor {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.timeline-toolbar {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-tool {
    background: #f5f5f5;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-tool:hover {
    background: #e0e0e0;
}

.timeline-zoom {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-zoom button {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

/* 删除早期的timeline-tracks定义，避免水平滚动条 */

.track {
    display: flex;
    margin-bottom: 0.5rem;
    min-height: 60px;
}

.track-header {
    width: 100px;
    padding: 0.5rem;
    background: transparent;
    border-right: 1px solid #e0e0e0;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.track-content {
    flex: 1;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    position: relative;
    min-width: 600px;
}

.clip {
    position: absolute;
    top: 4px;
    bottom: 4px;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: move;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    color: #fff;
}

.video-clip {
    background: #4a90e2;
    width: 150px;
}

/* 旧的audio-clip样式已移除，使用新的样式定义 */

.music-clip {
    background: #ff6b6b;
    width: 300px;
    left: 0;
}

.subtitle-clip {
    background: #ffd93d;
    color: #333;
    width: 100px;
    left: 0;
}

/* 编辑面板 */
.edit-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.edit-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.edit-panel h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #000;
}


/* 导出模块样式 */
.export-container {
    display: grid;
    gap: 1.5rem;
}

.export-config,
.export-queue,
.export-history {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.bitrate-control {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bitrate-control input {
    width: 80px;
}

/* 导出队列 */
.queue-item,
.history-item {
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.queue-info,
.history-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.queue-name,
.history-name {
    font-weight: 500;
    color: #333;
}

.queue-size,
.history-size {
    color: #666;
    font-size: 0.875rem;
}

.history-date {
    color: #999;
    font-size: 0.875rem;
}

.queue-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4caf50;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.875rem;
    color: #666;
    min-width: 40px;
}

.queue-actions,
.history-actions {
    display: flex;
    gap: 0.5rem;
}

.export-actions {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.export-options {
    display: flex;
    gap: 1.5rem;
}

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

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* 状态栏 */
.status-bar {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-info {
    color: #666;
    font-size: 0.875rem;
}

.status-actions {
    display: flex;
    gap: 0.5rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.btn-close:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* 加载提示 */
.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2000;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.loading.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #000;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

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

.loading p {
    color: #666;
    margin: 0;
}

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

    .header-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .logo {
        justify-self: center;
        text-align: center;
    }

    .nav {
        width: 100%;
        order: 3;
        margin-top: 0;
        overflow-x: auto;
    }

    .main-content {
        padding: 1rem;
    }

    .process-grid,
    .control-grid,
    .config-grid {
        grid-template-columns: 1fr;
    }

    .track-header {
        width: 60px;
        font-size: 0.75rem;
    }

    .edit-panels {
        grid-template-columns: 1fr;
    }

    .export-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .export-options {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* AI思考过程样式 - Apple风格重设计 */
.thinking-container {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: saturate(180%) blur(20px);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.98);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 600px;
    }
}

.thinking-header {
    background: linear-gradient(135deg, #1d1d1f 0%, #2d2d2f 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thinking-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.thinking-icon {
    font-size: 1.1rem;
    animation: pulse 3s infinite;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.btn-collapse {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.825rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
}

.btn-collapse:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.thinking-content {
    padding: 2rem;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #1d1d1f;
    background: #fff;
    min-height: 120px;
    max-height: 400px;
    overflow-y: auto;
    position: relative;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.thinking-cursor {
    display: inline-block;
    color: #000;
    font-weight: 600;
    animation: blink 1.2s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.thinking-content.collapsed {
    max-height: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.thinking-content::-webkit-scrollbar {
    width: 4px;
}

.thinking-content::-webkit-scrollbar-track {
    background: transparent;
}

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

.thinking-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}


/* 图片生成头部 - 使用视频生成相同的现代设计 */
.image-header-modern {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 新的分段展示样式 */
.segments-display {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    width: calc(100vw - 4rem);
    margin-left: calc(-50vw + 50% + 2rem);
    max-width: none;
}

.segments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.segments-header h3 {
    font-size: 1.4rem;
    color: #1e293b;
    margin: 0;
    font-weight: 600;
}

.segment-count {
    background: #6366f1;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
}

.segments-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-height: none;
    overflow: visible;
    padding: 0 2rem;
}

/* 段落容器响应式布局 */
@media (max-width: 1400px) {
    .segments-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .segments-container {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .segments-display {
        width: calc(100vw - 2rem);
        margin-left: calc(-50vw + 50% + 1rem);
        padding: 1.5rem;
    }
}

.segments-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}

.segment-card {
    background: #fff;
    border-radius: 12px;
    border: 2px dashed #333;
    overflow: hidden;
    transition: all 0.3s ease;
    padding: 1.5rem;
    min-height: 300px;
}

.segment-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.segment-card .segment-header {
    background: #f8f9fa;
    padding: 1.25rem 1.5rem;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.segment-card .segment-number {
    color: #000;
    font-weight: 600;
    font-size: 1.2rem;
}

.segment-content {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* 语音合成紧凑样式 */
.voice-synthesis-compact {
    max-width: 1200px;
    margin: 0 auto;
}

/* 全局配置卡片 */
.voice-config-compact {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.voice-config-compact h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 16px 0;
    letter-spacing: -0.2px;
}

.config-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.config-item-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-item-compact label {
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
}

.select-wrapper {
    position: relative;
}

.select-compact {
    width: 100%;
    padding: 12px 36px 12px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    color: #1d1d1f;
    background: #ffffff;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    max-height: 300px;
}

.select-compact:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* 自定义下拉选择器样式 */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-display {
    width: 100%;
    padding: 12px 36px 12px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    color: #1d1d1f;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-select-display:hover {
    border-color: #a8a8a8;
}

.custom-select-display:focus,
.custom-select-display.active {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d2d2d7;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.custom-select-dropdown.active {
    display: block;
}

.select-category {
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.select-option:hover {
    background: #f8f9fa;
}

.select-option.selected {
    background: #000000;
    color: #ffffff;
}

.select-option-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.select-option-name {
    font-size: 14px;
    font-weight: 500;
    color: inherit;
}

.select-option-info {
    font-size: 12px;
    color: #6e6e73;
}

.select-option.selected .select-option-info {
    color: #cccccc;
}

.select-option-category {
    font-size: 11px;
    padding: 2px 6px;
    background: #e9ecef;
    border-radius: 4px;
    color: #6c757d;
    font-weight: 500;
}

.select-option.selected .select-option-category {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6e6e73;
}

.slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-compact {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.slider-compact::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #000000;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-compact::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slider-compact::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #000000;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6e6e73;
}

.slider-labels span:nth-child(2) {
    font-weight: 600;
    color: #1d1d1f;
}

/* 试听功能 */
.voice-preview-compact {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 20px 30px 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.voice-preview-compact h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 12px 0;
    letter-spacing: -0.2px;
}

.preview-content-compact {
    display: flex;
    gap: 12px;
    align-items: center;
}

.preview-input-compact {
    flex: 1;
    position: relative;
}

.input-compact {
    width: 100%;
    padding: 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    color: #1d1d1f;
    background: #ffffff;
    transition: all 0.3s ease;
}

.input-compact:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.input-compact::placeholder {
    color: #a1a1a6;
}

.char-counter {
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 12px;
    color: #6e6e73;
}

.btn-preview-compact {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-preview-compact:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-preview-compact:active {
    transform: translateY(0);
    background: #0a0a0a;
}

/* 段落配置卡片 */
.voice-segments-compact {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.segments-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.segments-header-compact h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: -0.2px;
}

.segments-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.segment-counter {
    font-size: 14px;
    color: #6e6e73;
    font-weight: 500;
}

.btn-load-compact,
.btn-synthesize-compact {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-load-compact:hover,
.btn-synthesize-compact:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-load-compact:active,
.btn-synthesize-compact:active {
    transform: translateY(0);
    background: #0a0a0a;
}

.btn-synthesize-compact {
    margin-left: 8px;
}

.empty-state-elegant {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon-modern {
    margin-bottom: 16px;
}

.empty-icon-modern svg {
    color: #d2d2d7;
}

.empty-state-elegant h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 8px 0;
}

.empty-state-elegant p {
    font-size: 14px;
    color: #6e6e73;
    margin: 0;
    line-height: 1.4;
}

/* 底部导航 */
.voice-navigation-modern {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem 2rem;
    background: transparent;
    border: none;
    margin-top: 2rem;
}

.voice-navigation-modern button {
    width: auto !important;
    flex: none !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn-modern {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-btn-back {
    background: #f0f0f0;
    color: #1d1d1f;
}

.nav-btn-back:hover {
    background: #e5e5e5;
    transform: translateX(-1px);
}

.nav-btn-next {
    background: #000000;
    color: #ffffff;
}

.nav-btn-next:hover {
    background: #1a1a1a;
    transform: translateX(1px);
}

.segment-text-display {
    background: #f8f9fa;
    color: #000;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.4;
    border: 1px dashed #999;
    min-height: 50px;
}

.segment-prompt {
    margin-top: 0.75rem;
}

.segment-prompt label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.art-prompt {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #555;
    border-radius: 4px;
    resize: vertical;
    font-size: 0.8rem;
    font-family: inherit;
    color: #333;
    background: #f8f9fa;
    transition: all 0.2s ease;
    min-height: 80px;
    height: auto;
    overflow: visible;
}

.art-prompt:focus {
    outline: none;
    border-color: #777;
    box-shadow: 0 0 0 2px rgba(119, 119, 119, 0.3);
}

.art-prompt::placeholder {
    color: #999;
}

/* 图片生成区域样式 */
.image-generation-area {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.image-generation-area .btn-primary {
    width: 100%;
    margin-bottom: 1rem;
}

.btn-regenerate {
    background: #333;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-regenerate:hover {
    background: #555;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-regenerate:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.generated-images {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.generated-image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 16/9;
}

.generated-image-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.generated-image-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    aspect-ratio: 16/9;
}

/* 图片预览模态框 */
.image-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.image-preview-modal.active {
    display: flex;
}

.image-preview-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.image-preview-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    z-index: 1001;
}

.image-preview-close:hover {
    background: white;
    transform: scale(1.1);
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

.switch input:checked + .slider {
    background-color: #6366f1;
}

.switch input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 22px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 段落操作区域样式 */
.segment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* 编辑模式切换样式 */
.edit-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.toggle-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.3s ease;
}

/* 开关激活时的标签样式 */
.switch input:checked + .slider + .toggle-label,
.edit-mode-toggle .toggle-label.active {
    color: #6366f1;
    font-weight: 600;
}

/* ===============================
   视频生成模块样式
   =============================== */

/* 视频生成头部 */
.video-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.video-title h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 0.25rem;
}

.video-title p {
    font-size: 0.9rem;
    color: #86868b;
    font-weight: 400;
}

/* 视频生成配置 */
.video-config {
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.config-group h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 1rem;
}

.config-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* 视频段落展示区域 */
.video-segments-display {
    margin-bottom: 2rem;
}

.video-segments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.video-segments-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1d1d1f;
}

.video-segment-count {
    font-size: 0.9rem;
    color: #86868b;
    font-weight: 500;
}

.video-segments-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-height: none;
    overflow: visible;
    padding: 0 2rem;
}

/* 视频段落容器响应式布局 */
@media (max-width: 1400px) {
    .video-segments-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .video-segments-container {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .video-segments-modern {
        width: calc(100vw - 2rem);
        margin-left: calc(-50vw + 50% + 1rem);
        padding: 1.5rem;
    }
}

/* 视频段落卡片 */
.video-segment-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 2rem;
    transition: all 0.3s ease;
    min-height: 300px;
}

.video-segment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.video-segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.video-segment-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
}

.video-segment-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-indicator.pending {
    background: #fbbf24;
    animation: pulse 2s infinite;
}

.status-indicator.generating_prompt {
    background: #3b82f6;
    animation: pulse 1.5s infinite;
}

.status-indicator.generating_video {
    background: #8b5cf6;
    animation: pulse 1s infinite;
}

.status-indicator.completed {
    background: #10b981;
}

.status-indicator.failed {
    background: #ef4444;
}

.status-text {
    font-size: 0.85rem;
    color: #86868b;
    font-weight: 500;
}

/* 视频段落内容 */
.video-segment-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.video-source-info {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 1.5rem;
    align-items: start;
}

.source-text label,
.source-image label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
}

.text-content {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
    border: 1px solid #e5e7eb;
}

.image-preview {
    background: #f8f9fa;
    border-radius: 8px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.no-image {
    color: #9ca3af;
    font-size: 0.8rem;
    text-align: center;
}

/* 视频提示词区域 */
.video-prompt-section label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
}

.video-prompt {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.video-prompt:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 视频结果区域 */
.video-result-section {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: start;
}

.video-preview {
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: relative;
}

.video-placeholder {
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    text-align: center;
}

.video-placeholder svg {
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.video-placeholder p {
    font-size: 0.9rem;
    font-weight: 500;
}

.generated-video {
    width: 100%;
    height: auto;
    border-radius: 12px;
}


.video-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

.btn-generate-video,
.btn-regenerate-video {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.btn-generate-video {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.btn-generate-video:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-generate-video:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.btn-regenerate-video {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-regenerate-video:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-regenerate-video:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.btn-download,
.btn-preview {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-download {
    background: #f59e0b;
    color: white;
}

.btn-download:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.btn-preview {
    background: #6366f1;
    color: white;
}

.btn-preview:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

/* 视频生成空状态 */
.video-segments-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}


.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.4;
}

