/* ============ 视频分割 工具专属样式（通用卡片/按钮/分割线/信息区使用 common.css） ============ */

/* 预览容器 */
.preview-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    min-height: 120px;
}
.preview-video {
    width: 100%;
    display: block;
    max-height: 220px;
    background: #000;
}
.preview-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 13px;
    background: #f1f5f9;
    pointer-events: none;
}

/* 主预览（右侧，更大）放在 .preview-video 之后以便 max-height 覆盖 */
.main-preview-video {
    max-height: 460px;
}

.preview-info {
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
}
.preview-info strong {
    color: #6d28d9;
}

/* 输出格式选择 */
.format-select {
    width: 100%;
    padding: 9px 30px 9px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fff;
    color: #374151;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.format-select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.format-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 设置项提示 */
.setting-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}
body.dark .setting-hint {
    color: #64748b;
}

/* 分割预览 / 主预览 */
.main-preview-video {
    max-height: 460px;
}

.preview-info {
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
}
.preview-info strong {
    color: #6d28d9;
}

/* 分割时长 */
.split-duration-container {
    display: flex;
    align-items: center;
    gap: 8px;
}
.split-duration-input {
    width: 120px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.split-duration-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.split-duration-unit {
    font-size: 14px;
    color: #6b7280;
}

/* 上传占位 */
.empty-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    padding: 40px 20px;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
}
.empty-preview:hover,
.empty-preview.drag-over {
    border-color: #8b5cf6;
    background: #f5f3ff;
}
.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.empty-text {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}
.empty-hint {
    margin-top: 6px;
    font-size: 13px;
    color: #9ca3af;
}

/* 视频信息（头部居中） */
.header-center {
    flex: 1;
    margin: 0 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}
.video-name-inline {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}
.video-meta-inline {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

/* 片段列表 */
.segment-list-container {
    margin-top: 16px;
}
.segment-list-header {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}
.segment-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.segment-list-scroll {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
}
.segment-list-scroll::-webkit-scrollbar {
    width: 8px;
}
.segment-list-scroll::-webkit-scrollbar-thumb {
    background: #c4b5fd;
    border-radius: 6px;
}
.segment-list-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}
.segment-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}
.segment-item:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
}
.segment-item.segment-active {
    border-color: #8b5cf6;
    background: #f5f3ff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.segment-thumb-wrap {
    flex-shrink: 0;
    width: 72px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
}
.segment-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.segment-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #94a3b8;
}
.segment-info {
    min-width: 0;
}
.segment-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.segment-time {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}
.segment-dur {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}
.segment-size {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

/* 处理状态卡片 */
.compress-status-card {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #ede9fe;
    border-radius: 12px;
    background: #faf5ff;
}
.compress-status-header {
    font-size: 14px;
    font-weight: 600;
    color: #6d28d9;
}
.compress-detail {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}
.compress-timer {
    font-weight: 600;
    color: #6d28d9;
}
.compress-progress-wrap {
    margin-top: 10px;
    height: 8px;
    border-radius: 6px;
    background: #ede9fe;
    overflow: hidden;
}
.compress-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    transition: width 0.3s;
}
.compress-patience {
    margin-top: 10px;
    font-size: 12px;
    color: #8b5cf6;
}

/* ============ 暗色模式 ============ */
body.dark .preview-container {
    background: #000;
}
body.dark .preview-placeholder {
    background: #1f1f27;
    color: #64748b;
}
body.dark .format-select {
    background-color: #2a2a32;
    border-color: #495057;
    color: #e5e7eb;
}
body.dark .format-select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
body.dark .main-preview-video {
    background: #000;
}
body.dark .preview-info {
    color: #94a3b8;
}
body.dark .preview-info strong {
    color: #c4b5fd;
}
body.dark .split-duration-input {
    background: #2a2a32;
    border-color: #495057;
    color: #e5e7eb;
}
body.dark .split-duration-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
body.dark .split-duration-unit {
    color: #9ca3af;
}
body.dark .empty-preview {
    border-color: #495057;
    background: #2a2a32;
}
body.dark .empty-preview:hover,
body.dark .empty-preview.drag-over {
    border-color: #8b5cf6;
    background: #2f2740;
}
body.dark .empty-text {
    color: #e5e7eb;
}
body.dark .empty-hint {
    color: #64748b;
}
body.dark .video-name-inline {
    color: #e5e7eb;
}
body.dark .video-meta-inline {
    color: #64748b;
}
body.dark .segment-list-header {
    color: #e5e7eb;
}
body.dark .segment-list-scroll::-webkit-scrollbar-thumb {
    background: #6d28d9;
}
body.dark .segment-list-scroll::-webkit-scrollbar-track {
    background: #2a2a32;
}
body.dark .segment-item {
    background: #2a2a32;
    border-color: #495057;
}
body.dark .segment-item:hover {
    border-color: #8b5cf6;
    background: #2f2740;
}
body.dark .segment-item.segment-active {
    border-color: #8b5cf6;
    background: #2f2740;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
body.dark .segment-thumb-wrap {
    background: #1f1f27;
}
body.dark .segment-name {
    color: #e5e7eb;
}
body.dark .segment-time {
    color: #9ca3af;
}
body.dark .segment-dur {
    color: #64748b;
}
body.dark .segment-size {
    color: #64748b;
}
body.dark .compress-status-card {
    background: #2a2238;
    border-color: #4c3a73;
}
body.dark .compress-status-header {
    color: #c4b5fd;
}
body.dark .compress-detail {
    color: #9ca3af;
}
body.dark .compress-timer {
    color: #c4b5fd;
}
body.dark .compress-progress-wrap {
    background: #4c3a73;
}
body.dark .compress-patience {
    color: #c4b5fd;
}
/* 信息区内联代码（文件名示例） */
.info-box code {
    background: #f3e8ff;
    color: #6d28d9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    word-break: break-all;
}
body.dark .info-box code {
    background: #2f2740;
    color: #c4b5fd;
}

/* 取消处理按钮 */
.btn-gray {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: #fff;
    border: none;
    cursor: pointer;
}
.btn-gray:hover:not(:disabled) {
    box-shadow: 0 4px 14px rgba(107, 114, 128, .35);
}
.btn-gray:disabled {
    opacity: .5;
    cursor: not-allowed;
}
body.dark .btn-gray {
    background: linear-gradient(135deg, #4b5563, #374151);
}

/* 状态卡片：当前处理段 */
.compress-current {
    color: #8b5cf6;
    font-weight: 600;
}
body.dark .compress-current {
    color: #c4b5fd;
}
