/* 视频生成页面样式 */

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

.main-content {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.left-panel,
.right-panel {
    flex: 1;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.left-panel h2,
.right-panel h2 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #007bff;
}

/* 脚本输入区域 */
#script-input {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

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

/* 拆分设置 */
.split-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.split-options label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.split-options input[type="checkbox"] {
    margin-right: 8px;
}

.split-options input[type="text"] {
    margin-left: 8px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100px;
}

#split-script-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px 0 rgba(0, 123, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#split-script-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(0, 123, 255, 0.4);
}

/* 拆分预览 */
#split-preview {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
}

.split-summary {
    margin-bottom: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 4px;
    font-size: 14px;
}

.sentence-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.sentence-number {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 10px;
    min-width: 30px;
    text-align: center;
}

.sentence-text {
    flex: 1;
    font-size: 14px;
    margin-right: 10px;
}

.edit-sentence-btn,
.delete-sentence-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.edit-sentence-btn {
    background: #28a745;
    color: white;
}

.delete-sentence-btn {
    background: #dc3545;
    color: white;
}

.sentence-preview-item {
    display: flex;
    align-items: center;
    padding: 6px;
    margin-bottom: 6px;
    background: #fff;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.preview-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.no-content {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* 视频设置 */
.video-settings {
    display: grid;
    gap: 15px;
}

.video-settings label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

.video-settings input[type="text"],
.video-settings input[type="number"],
.video-settings input[type="color"] {
    margin-left: 10px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.video-settings input[type="file"] {
    margin-left: 10px;
}

.video-settings input[type="color"] {
    width: 50px;
    height: 35px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 预览和导出 */
.preview-export {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#video-preview {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    background: #f8f9fa;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video-preview canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.preview-info {
    margin-top: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 4px;
    font-size: 14px;
}

.video-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-controls label {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.video-controls input[type="text"] {
    margin-left: 10px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 1;
}

.primary-btn {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px 0 rgba(40, 167, 69, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
}

.primary-btn:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(40, 167, 69, 0.4);
}

.primary-btn:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    width: 0%;
    transition: width 0.3s ease;
}

#progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
}

/* 结果容器 */
#result-container {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 20px;
}

#result-container h3 {
    color: #155724;
    margin-bottom: 15px;
}

.video-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 4px;
    margin-bottom: 10px;
}

.video-info {
    flex: 1;
}

.video-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.video-meta {
    font-size: 12px;
    color: #666;
}

.download-btn {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .split-options {
        grid-template-columns: 1fr;
    }
    
    .video-controls {
        align-items: stretch;
    }
    
    .video-controls label {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .video-controls input[type="text"] {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误消息 */
.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* 成功消息 */
.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}


/* 结果显示样式增强 */
.video-result-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.video-info h4 {
    color: #28a745;
    margin-bottom: 15px;
    font-size: 18px;
}

.video-meta p {
    margin: 5px 0;
    color: #6c757d;
    font-size: 14px;
}

.download-options {
    margin-top: 15px;
    text-align: center;
}

.download-btn.primary {
    background: #28a745;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    display: inline-block;
    transition: background-color 0.3s;
}

.download-btn.primary:hover {
    background: #218838;
}

.download-note {
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

.individual-videos {
    margin-top: 20px;
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
}

.individual-videos h5 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
}

.video-list {
    max-height: 300px;
    overflow-y: auto;
}

.video-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 8px;
    background: white;
}

.video-item-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.video-number {
    font-weight: bold;
    color: #007bff;
    margin-right: 8px;
    min-width: 30px;
}

.video-sentence {
    color: #495057;
    font-size: 14px;
}

.download-btn.small {
    background: #007bff;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: background-color 0.3s;
}

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

/* 消息样式 */
.message {
    padding: 12px 20px;
    margin: 10px 0;
    border-radius: 6px;
    font-size: 14px;
    position: relative;
}

.info-message {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

