:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #1e1e2e;
    --bg-hover: #252535;
    --bg-active: #2a2a40;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-glow: rgba(99, 102, 241, 0.3);

    --text-primary: #f1f1f4;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;

    --border-color: #27273a;
    --border-hover: #3f3f5a;

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 头部 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-toggle {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

.theme-icon {
    font-size: 1.25rem;
}

/* 步骤条 */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 0;
    overflow-x: auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}

.step:hover:not(.active):not(.completed) {
    opacity: 0.7;
}

.step.locked {
    cursor: not-allowed;
    opacity: 0.45;
}

.step.locked:hover {
    opacity: 0.45;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.step.active .step-number {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    transition: color var(--transition-normal);
}

.step.active .step-label {
    color: var(--accent-primary);
    font-weight: 500;
}

.step.completed .step-label {
    color: var(--success);
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.5rem;
    position: relative;
    top: -14px;
    flex-shrink: 0;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.step-content {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

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

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

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

.btn-success:hover:not(:disabled) {
    background: #16a34a;
}

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

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
}

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

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.upload-area.dragover {
    border-color: var(--accent-primary);
    background: var(--bg-active);
    box-shadow: var(--shadow-glow);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* 进度条 */
.upload-progress {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar.large {
    height: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    margin-top: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 视频信息卡片 */
.video-info {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

.info-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.video-preview {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 操作栏 */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* 状态显示 */
.parsing-status,
.summary-status,
.splitting-status,
.generating-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.status-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.status-sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 1.5rem;
}

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

/* 字幕列表 */
.subtitle-result,
.summary-result,
.split-result,
.commentary-result,
.voice-result {
    animation: fadeIn 0.3s ease;
}

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

.result-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

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

.subtitle-list {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    max-height: 500px;
    overflow-y: auto;
}

.subtitle-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

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

.subtitle-item:hover {
    background: var(--bg-hover);
}

.subtitle-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.subtitle-text {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 错误消息 */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.error-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.error-text {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* 情节概要卡片 */
.summary-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.summary-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

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

.summary-content {
    padding: 1.5rem;
}

.summary-content textarea {
    width: 100%;
    min-height: 200px;
    background: transparent;
    border: none;
    resize: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.7;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.summary-content textarea:focus {
    outline: none;
}

.summary-content textarea.editing {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.summary-edit-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.2);
    animation: fadeIn 0.3s ease;
}

.hint-icon {
    font-size: 1rem;
}

.hint-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.summary-meta {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.meta-item {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-item span {
    color: var(--text-primary);
    font-weight: 500;
}

/* 拆分片段布局 */
.split-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.voice-speed-control {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
}

.voice-speed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.voice-speed-header strong {
    color: var(--accent-primary);
    font-size: 1.25rem;
}

.voice-speed-control input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--bg-secondary);
    outline: none;
    -webkit-appearance: none;
}

.voice-speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
    cursor: pointer;
}

.voice-speed-control input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
    cursor: pointer;
}

.voice-speed-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.voice-speed-footer {
    justify-content: stretch;
}

.voice-speed-footer .btn {
    flex: 1;
}

.sync-layout {
    grid-template-columns: 280px minmax(0, 1fr) 280px;
}

.split-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 600px;
}

.split-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 600px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.sidebar-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
}

.segment-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

.segment-list::-webkit-scrollbar {
    width: 6px;
}

.segment-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.segment-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.segment-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.segment-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.segment-item:hover {
    background: var(--bg-hover);
}

.segment-item.active {
    background: var(--bg-active);
    border-color: var(--accent-primary);
}

.segment-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-primary);
}

.segment-item.drag-over {
    border: 2px dashed var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.segment-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.segment-item-drag-handle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    cursor: grab;
    padding: 0.25rem;
    user-select: none;
    letter-spacing: -2px;
}

.segment-item-drag-handle:hover {
    color: var(--text-primary);
}

.segment-item.dragging .segment-item-drag-handle {
    cursor: grabbing;
}

.segment-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.segment-item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.segment-item-delete {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--error);
    border: none;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.segment-item-delete:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.segment-item-play {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success);
    color: white;
    font-size: 0.625rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.segment-item-play:hover {
    background: #16a34a;
    transform: scale(1.1);
}

.segment-item-play.playing {
    background: var(--warning);
}

.segment-item-time-row {
    display: flex;
    align-items: center;
}

.segment-item-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.segment-item-summary {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.split-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.video-section video {
    width: 100%;
    height: auto;
    max-height: 320px;
    display: block;
    background: #000;
}

.segment-info {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.info-input,
.info-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast);
}

.info-input:focus,
.info-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.info-textarea {
    min-height: 60px;
    resize: vertical;
}

.time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.time-input {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.timeline-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1rem;
    flex: 1;
    min-height: 200px;
}

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

.timeline-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoom-level {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.timeline-container {
    position: relative;
    height: 100px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.timeline-ruler {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.timeline-track {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    height: 56px;
    padding: 8px;
}

.timeline-segment {
    position: absolute;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: white;
    cursor: move;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.timeline-segment:hover {
    box-shadow: var(--shadow-glow);
}

.timeline-segment.selected {
    box-shadow: 0 0 0 2px white, var(--shadow-glow);
}

/* 解说词工作区 - 上下布局 */
.commentary-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.workspace-top {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
}

.workspace-top h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.config-list {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.config-item.fullwidth {
    grid-column: 1 / -1;
}

.config-item.readonly .config-value {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.config-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.config-input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.config-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.config-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.config-list-with-action {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.config-list {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* 增加输入框宽度 */
.config-input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    min-width: 140px;
}

.config-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.config-item.readonly .config-value {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
    min-width: 140px;
    display: inline-block;
}

.config-actions-inline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* 降低按钮高度，与输入框对齐 */
.config-actions-inline .btn-generate,
.config-actions-inline .btn-regenerate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    white-space: nowrap;
    height: 36px;
    font-size: 0.875rem;
}

/* 响应式：小屏幕时恢复垂直布局 */
@media (max-width: 768px) {
    .config-list-with-action {
        flex-direction: column;
        align-items: stretch;
    }

    .config-list {
        justify-content: flex-start;
    }

    .config-input,
    .config-item.readonly .config-value {
        min-width: auto;
        width: 100%;
    }

    .config-actions-inline {
        flex-direction: row;
        justify-content: flex-start;
    }

    .config-actions-inline .btn-generate,
    .config-actions-inline .btn-regenerate {
        height: auto;
    }
}

.btn-generate,
.btn-regenerate {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
}

.btn-generate .btn-icon,
.btn-regenerate .btn-icon {
    font-size: 1rem;
}

.workspace-bottom {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.result-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.result-meta strong {
    color: var(--accent-primary);
}

.commentary-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-text {
    font-size: 0.9375rem;
    text-align: center;
    max-width: 300px;
}

/* 解说词列表 */
.commentary-list,
.voice-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.commentary-card,
.voice-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    transition: border-color var(--transition-fast);
}

.commentary-card:hover,
.voice-card:hover {
    border-color: var(--border-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
}

.card-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.card-badge.original {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.card-badge.ai {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
}

.card-badge.segment {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.card-content {
    margin-bottom: 1rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.card-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.card-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* 卡片操作按钮区域 - 靠右布局，按钮在同一行 */
.card-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.card-actions-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 确保所有按钮高度一致 */
.card-actions-right .btn {
    height: 32px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
}

/* 按钮悬停效果 */
.card-actions-right .btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.card-actions-right .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* 原片预览和试听解说按钮特殊样式 */
.card-actions-right .preview-original:hover {
    border-color: var(--info);
    color: var(--info);
    background: rgba(59, 130, 246, 0.1);
}

.card-actions-right .preview-commentary:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.1);
}

/* 保留原有的 card-preview-actions 样式用于兼容性 */
.card-preview-actions .btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-preview-actions .btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.card-preview-actions .btn-secondary:hover::before {
    width: 200px;
    height: 200px;
}

.card-preview-actions .btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.card-preview-actions .btn-secondary:active,
.card-preview-actions .btn-secondary.preview-original:active,
.card-preview-actions .btn-secondary.preview-commentary:active {
    transform: translateY(0) scale(0.98) !important;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15) !important;
}

/* 原片预览模态框样式 */
.video-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

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

.video-preview-container {
    position: relative;
    width: 90%;
    max-width: 960px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

.video-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.video-preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.video-preview-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.video-preview-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.video-preview-content video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-preview-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.video-preview-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', monospace;
}

.video-preview-actions {
    display: flex;
    gap: 0.5rem;
}
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* 解说词上传区域样式 */
.result-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.commentary-upload-area {
    margin: 1rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.commentary-upload-area:hover,
.commentary-upload-area.dragover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    box-shadow: var(--shadow-glow);
}

.upload-area-inner {
    text-align: center;
    cursor: pointer;
}

.upload-area-inner .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.upload-area-inner .upload-text {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-area-inner .upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 解说词卡片样式增强 */
.commentary-card {
    position: relative;
    overflow: hidden;
}

.commentary-card.has-commentary {
    border-left: 3px solid var(--success);
}

.commentary-card.uploaded {
    border-left: 3px solid var(--accent-secondary);
}

.commentary-status-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.commentary-status-badge.ai {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.commentary-status-badge.uploaded {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
}

/* 解说词文本高亮动画 */
.commentary-text .highlight-word {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    animation: highlightPulse 0.3s ease;
}

@keyframes highlightPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}
    display: flex;
    gap: 0.75rem;
}

.audio-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.audio-label {
    color: var(--text-tertiary);
}

.audio-value {
    color: var(--text-primary);
    font-weight: 500;
}

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

.speed-input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8125rem;
    text-align: center;
}

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

/* 配音设置 */
.voice-settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.setting-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.voice-presets {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.voice-preset {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.voice-preset:hover {
    border-color: var(--border-hover);
}

.voice-preset.active {
    border-color: var(--accent-primary);
    background: var(--bg-active);
}

.preset-icon {
    font-size: 1.5rem;
}

.preset-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

.voice-preset.active .preset-name {
    color: var(--accent-primary);
    font-weight: 500;
}

.custom-voice-preset {
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(34, 197, 94, 0.08)),
        var(--bg-tertiary);
    border-style: dashed;
}

.custom-voice-preset::after {
    content: "可生成";
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.16);
    color: var(--accent-primary);
    font-size: 0.625rem;
    line-height: 1.2;
}

.custom-voice-preset.saved::after {
    content: "已保存";
    background: rgba(34, 197, 94, 0.14);
    color: var(--success);
}

.speed-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.speed-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.speed-slider input[type="range"] {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.speed-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

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

.speed-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    min-width: 45px;
    text-align: right;
}

.voice-start-action {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.start-voice-btn {
    align-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.42);
    box-shadow: none;
}

.start-voice-btn:hover:not(:disabled) {
    transform: none;
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    box-shadow: none;
}

.start-voice-btn .btn-icon {
    padding: 0;
    background: transparent;
    color: currentColor;
}

.custom-voice-preview {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(34, 197, 94, 0.06));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.custom-voice-template {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.custom-voice-template p {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
}

#playCustomVoice {
    align-self: center;
    flex-shrink: 0;
}

.preview-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.custom-voice-modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-voice-modal-input {
    width: 100%;
    min-height: 112px;
    resize: vertical;
    padding: 0.75rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font: inherit;
    line-height: 1.6;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.custom-voice-modal-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}

.custom-voice-modal-input::placeholder {
    color: var(--text-muted);
}

#generateCustomVoiceBtn {
    align-self: stretch;
    width: 100%;
}

#customVoiceModal .modal-footer .btn {
    flex: 1 1 0;
}

.voice-select-intro {
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    margin-bottom: 1rem;
}

.voice-select-intro p {
    margin: 0.25rem 0 0;
    color: var(--text-primary);
    line-height: 1.5;
}

.voice-select-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.voice-select-option {
    cursor: pointer;
    align-items: flex-start;
    text-align: left;
    min-height: 128px;
}

.voice-select-option.active {
    border-color: var(--accent-primary);
    background: var(--bg-active);
}

.voice-select-option.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.voice-select-option .preset-icon {
    align-self: center;
}

.voice-option-desc {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.45;
}

.voice-option-status {
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: auto;
}

/* 音画匹配工作区 - 基于拆分片段布局 */
.sync-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 280px;
    gap: 1.5rem;
    align-items: start;
}

.sync-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 650px;
}

.sync-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 650px;
}

/* 音频列表样式 */
.audio-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

.video-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    min-height: 0;
}

.audio-list::-webkit-scrollbar {
    width: 6px;
}

.audio-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.audio-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.audio-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.audio-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: grab;
    transition: all var(--transition-fast);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.video-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: grab;
    transition: all var(--transition-fast);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.video-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.video-item.dragging {
    opacity: 0.5;
    border: 2px dashed #3b82f6;
}

.video-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-item-time {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.audio-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.audio-item:active {
    cursor: grabbing;
}

.audio-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-primary);
}

.audio-item.playing {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.audio-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.audio-item-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.audio-item-btn.play {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.audio-item-btn.play:hover {
    background: #16a34a;
}

.audio-item-btn.delete:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.audio-item-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.audio-item-duration {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.audio-list-empty {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    padding: 1rem;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.playback-controls .btn {
    flex: 1 1 0;
    min-width: 0;
}

.playback-controls .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.playback-controls .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoom-display {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: center;
}

.timeline-panel {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-track {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    height: auto;
    padding: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: visible;
}

.track-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.track-icon {
    font-size: 0.875rem;
}

.track-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.track-duration {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.track-duration-editable {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.track-duration-input {
    width: 72px;
    padding: 0.125rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font: inherit;
    text-align: center;
}

.track-duration-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.16);
}

.track-content {
    position: relative;
    height: 60px;
    padding: 10px;
    overflow: hidden;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.audio-timeline .track-content,
.video-timeline .track-content {
    height: 82px;
    padding-top: 30px;
    overflow: visible;
}

.track-content.drag-over {
    background: rgba(99, 102, 241, 0.12);
    box-shadow: inset 0 0 0 2px var(--accent-primary);
}

#syncWorkspace .split-main {
    height: 600px;
    min-height: 0;
    gap: 0.75rem;
    overflow: hidden;
}

#syncWorkspace .video-section {
    flex: 1 1 auto;
    min-height: 260px;
    display: flex;
}

#syncWorkspace .video-section video {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
}

#syncWorkspace .playback-controls {
    flex: 0 0 auto;
    padding: 0.35rem 0.75rem;
}

#syncWorkspace .playback-controls .btn {
    min-height: 32px;
    padding: 0.35rem 1rem;
    font-size: 0.8125rem;
    line-height: 1;
}

#syncWorkspace .playback-controls .btn-icon {
    padding: 0;
    background: transparent;
    color: currentColor;
    font-size: 0.875rem;
    line-height: 1;
}

#syncWorkspace .playback-controls .btn-icon:hover {
    background: transparent;
    color: currentColor;
}

#syncWorkspace .timeline-panel {
    flex: 0 0 auto;
    padding: 0.625rem;
    gap: 0.625rem;
}

#syncWorkspace .track-header {
    padding: 0.4rem 0.75rem;
}

#syncWorkspace .audio-timeline .track-content,
#syncWorkspace .video-timeline .track-content {
    height: 72px;
    padding-top: 26px;
}

@media (max-width: 1200px) {
    #syncWorkspace .split-main {
        height: auto;
        overflow: visible;
    }

    #syncWorkspace .video-section {
        flex: 0 0 auto;
        min-height: 260px;
    }

    #syncWorkspace .video-section video {
        height: 260px;
    }
}

.timeline-drag-guide {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 2px dashed var(--warning);
    z-index: 7;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.55));
}

.timeline-drag-guide-audio {
    border-left-color: #22c55e;
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.5));
}

.timeline-drag-guide-video {
    border-left-color: #3b82f6;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.timeline-drag-guide-label {
    position: absolute;
    left: 8px;
    top: -27px;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: white;
    font-family: 'SF Mono', monospace;
    font-size: 0.6875rem;
    line-height: 1;
    white-space: nowrap;
}

.timeline-drag-guide.near-end .timeline-drag-guide-label {
    left: auto;
    right: 8px;
}

.video-clip {
    position: absolute;
    left: 0;
    top: 10px;
    right: 0;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

.clip-thumb {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-block {
    position: absolute;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    color: white;
    font-size: 0.75rem;
    cursor: move;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
    overflow: hidden;
}

.audio-block:hover {
    box-shadow: var(--shadow-glow);
}

.audio-block.selected {
    box-shadow: 0 0 0 2px white, var(--shadow-glow);
}

.timeline-audio-block {
    position: absolute;
    top: 30px;
    height: 40px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 48%, #059669 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.625rem;
    color: white;
    font-size: 0.75rem;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
    overflow: visible;
    z-index: 2;
}

.timeline-video-block {
    position: absolute;
    top: 30px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 48%, #1d4ed8 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.625rem;
    color: white;
    font-size: 0.75rem;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
    overflow: visible;
    z-index: 2;
}

.timeline-video-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.35);
}

.timeline-video-block.dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.timeline-audio-block.selected,
.timeline-video-block.selected {
    box-shadow: 0 0 0 2px white, 0 0 18px rgba(245, 158, 11, 0.45);
}

.timeline-audio-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
}

.timeline-audio-block.dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.block-title {
    position: absolute;
    left: 0;
    top: -24px;
    max-width: 180px;
    padding: 0.125rem 0.375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.block-duration {
    font-family: 'SF Mono', monospace;
    font-size: 0.6875rem;
    opacity: 0.78;
    flex-shrink: 0;
}

.block-speed {
    padding: 0.075rem 0.3rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    font-family: 'SF Mono', monospace;
    font-size: 0.6875rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.block-delete-btn {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.26);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.block-delete-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.05);
}

.playhead-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--warning);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.75);
    z-index: 6;
    cursor: ew-resize;
    pointer-events: auto;
    transform: translateX(-50%);
    touch-action: none;
}

.playhead-line::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -1px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--warning);
    transform: translate(-50%, -50%);
}

body.dragging-playhead {
    cursor: ew-resize;
    user-select: none;
}

.resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle.left {
    left: 0;
}

.resize-handle.right {
    right: 0;
}

.resize-handle::after {
    content: '';
    width: 2px;
    height: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
}

.sync-materials {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.sync-materials h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.material-list {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.material-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: grab;
    transition: all var(--transition-fast);
}

.material-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.material-item:active {
    cursor: grabbing;
}

.material-icon {
    font-size: 0.875rem;
}

.material-name {
    font-size: 0.75rem;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 预览导出 */
.export-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.25rem;
    align-items: stretch;
}

.export-preview-panel,
.export-side-panel {
    min-width: 0;
    height: 100%;
}

.export-preview-panel,
.option-card,
.export-delivery-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.export-preview-panel {
    padding: 1rem;
}

.export-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.875rem;
}

.export-panel-header h3,
.option-card h4,
.export-delivery-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.export-panel-header p,
.export-delivery-header p {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.export-status-chip {
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(34, 197, 94, 0.32);
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    font-size: 0.75rem;
    white-space: nowrap;
}

.export-side-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.export-delivery-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.option-card,
.export-delivery-card {
    padding: 1rem;
}

/* 导出选项 */
.export-options {
    margin: 0;
}

.option-card h4 {
    margin-bottom: 0.875rem;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.18);
}

.option-label,
.option-desc {
    display: block;
}

.option-label {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.option-desc {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.35;
}

.regenerate-preview-btn {
    width: 100%;
    justify-content: center;
    min-height: 38px;
    box-shadow: none;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

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

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: 24px;
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent-primary);
}

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

/* 预览区域 */
.preview-section {
    margin: 0;
}

.preview-video {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    background: #000;
    border-radius: calc(var(--radius-lg) - 2px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

.preview-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.48));
    backdrop-filter: blur(2px);
}

.preview-progress {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* 导出按钮 */
.export-actions {
    margin: 0;
}

.export-buttons {
    display: grid;
    gap: 0.625rem;
}

.export-buttons .btn {
    justify-content: flex-start;
    gap: 0.625rem;
    min-height: 42px;
    padding: 0.625rem 0.75rem;
    border-color: var(--border-color);
    background: rgba(15, 23, 42, 0.2);
    box-shadow: none;
}

.export-buttons .btn:disabled {
    cursor: not-allowed;
    opacity: 1;
}

.export-delivery-card.is-disabled {
    background: rgba(15, 23, 42, 0.36);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: none;
}

.export-delivery-card.is-disabled .export-delivery-header h4,
.export-delivery-card.is-disabled .export-delivery-header p {
    color: var(--text-tertiary);
}

.export-delivery-card.is-disabled .export-buttons .btn {
    pointer-events: none;
    background: rgba(15, 23, 42, 0.28);
    border-color: rgba(148, 163, 184, 0.14);
    color: var(--text-tertiary);
    filter: grayscale(0.45);
}

.export-buttons .btn-icon {
    width: 1.25rem;
    padding: 0;
    font-size: 1rem;
    background: transparent;
    color: currentColor;
}

.export-buttons .btn-text {
    font-size: 0.8125rem;
    font-weight: 500;
}

.export-delivery-header {
    margin-bottom: 0.875rem;
}

/* 模态框 */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal[style*="flex"] {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

#customVoiceModal .modal-content {
    max-width: 560px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.close-modal {
    color: var(--text-tertiary);
}

.close-modal:hover {
    color: var(--text-primary);
}

/* 小型模态框 */
.modal-sm .modal-content {
    max-width: 400px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.finish-modal-content {
    max-width: 520px;
    padding-top: 2rem;
    overflow: visible;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(34, 197, 94, 0.18), transparent 42%),
        var(--bg-secondary);
}

.finish-celebration {
    position: relative;
    width: 112px;
    height: 112px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.finish-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.08);
    animation: finishRing 1.35s ease-out both;
}

.finish-check {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
    font-size: 2.25rem;
    font-weight: 800;
    box-shadow: 0 18px 42px rgba(34, 197, 94, 0.35);
    animation: finishCheck 0.58s cubic-bezier(0.2, 1.4, 0.45, 1) both;
}

.finish-spark {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.6);
    animation: finishSpark 1.1s ease-out both;
}

.spark-1 {
    top: 6px;
    right: 22px;
    animation-delay: 0.08s;
}

.spark-2 {
    bottom: 18px;
    left: 8px;
    animation-delay: 0.18s;
}

.spark-3 {
    bottom: 10px;
    right: 6px;
    animation-delay: 0.28s;
}

.finish-copy {
    padding: 0 1.5rem 1.25rem;
}

.finish-kicker {
    display: inline-flex;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 700;
}

.finish-copy h3 {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.25;
}

.finish-copy p {
    margin: 0.75rem 0 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.finish-modal-footer {
    justify-content: stretch;
}

.finish-modal-footer .btn {
    flex: 1;
}

@keyframes finishCheck {
    from {
        opacity: 0;
        transform: scale(0.58) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes finishRing {
    0% {
        opacity: 0;
        transform: scale(0.65);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.28);
    }
    72% {
        opacity: 1;
        box-shadow: 0 0 0 18px rgba(34, 197, 94, 0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

@keyframes finishSpark {
    0% {
        opacity: 0;
        transform: scale(0.4) translateY(8px);
    }
    45% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0.35;
        transform: scale(0.8) translateY(-6px);
    }
}

.confirm-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.confirm-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.confirm-message p {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

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

.btn-error:hover:not(:disabled) {
    background: #dc2626;
}

.upload-subtitle-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-subtitle-area:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.upload-subtitle-area.dragover {
    border-color: var(--accent-primary);
    background: var(--bg-active);
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

.toast.warning {
    border-color: var(--warning);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast-close {
    margin-left: auto;
    padding: 0.25rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .split-layout {
        grid-template-columns: 1fr;
    }

    .split-sidebar {
        height: 300px;
        max-height: 300px;
    }

    .split-main {
        height: auto;
    }

    .stepper {
        padding: 1rem;
    }

    .step-label {
        display: none;
    }

    .step-connector {
        width: 20px;
    }

    .voice-presets {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .video-info {
        grid-template-columns: 1fr;
    }

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

    .voice-presets {
        grid-template-columns: repeat(2, 1fr);
    }

    .custom-voice-preview {
        flex-direction: column;
    }

    #playCustomVoice,
    #generateCustomVoiceBtn {
        width: 100%;
    }

    .start-voice-btn {
        align-self: stretch;
    }

    .action-bar {
        flex-direction: column-reverse;
        gap: 1rem;
    }

    .export-workspace {
        grid-template-columns: 1fr;
    }

    .preview-video {
        max-width: 100%;
    }

    .export-buttons {
        flex-direction: column;
    }

    .export-buttons .btn {
        flex-direction: row;
        padding: 0.625rem 0.75rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* 选中文本样式 */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* 禁用文本选择 */
.no-select {
    user-select: none;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 骨架屏动画 */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ==================== 字幕编辑器样式 ==================== */

.subtitle-editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: 600px;
}

.subtitle-video-section {
    display: flex;
    flex-direction: column;
    background: #000;
    border-right: 1px solid var(--border-color);
    height: 100%;
}

.video-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a25 100%);
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.video-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.video-filename {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', monospace;
}

.subtitle-list-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    height: 100%;
    overflow: hidden;
}

.subtitle-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.subtitle-list-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.subtitle-edit-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

.subtitle-edit-list::-webkit-scrollbar {
    width: 6px;
}

.subtitle-edit-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.subtitle-edit-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.subtitle-edit-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.subtitle-edit-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.subtitle-edit-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.subtitle-edit-item.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-glow);
}

.subtitle-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.subtitle-play-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-left: 0.25rem;
}

.subtitle-item-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
}

.subtitle-item-play {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success);
    color: white;
    font-size: 0.875rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.subtitle-item-play:hover {
    background: #16a34a;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.subtitle-item-play.playing {
    background: var(--warning);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

.subtitle-item-actions {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

.subtitle-item-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.subtitle-item-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.subtitle-item-content {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subtitle-text-edit {
    width: 100%;
    min-height: 60px;
    padding: 0.625rem 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.subtitle-text-edit:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.subtitle-text-edit::placeholder {
    color: var(--text-muted);
}

.subtitle-time-edit {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.subtitle-time-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.subtitle-time-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.subtitle-time-input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: 'SF Mono', monospace;
    transition: border-color var(--transition-fast);
}

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

/* 响应式调整 */
@media (max-width: 1200px) {
    .subtitle-editor-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: 80vh;
    }

    .subtitle-video-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: 350px;
        flex-shrink: 0;
    }

    .subtitle-list-section {
        height: 350px;
    }

    .subtitle-edit-list {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .voice-select-options {
        grid-template-columns: 1fr;
    }

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

    .subtitle-item-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .subtitle-item-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.25rem;
    }
}
