/* ====== 视频剪切 专属样式（布局/卡片/按钮等通用样式由 common.css 提供，整体结构与 shipinfenbianlvzhuanhuan 保持一致） ====== */

.header-count {
    font-size: 13px;
    color: #8b5cf6;
    background: #f5f3ff;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-mid {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.card-header-sep {
    color: #d1d5db;
}

.card-header-right-btn-clear {
    padding: 6px 8px;
    font-size: 12px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.card-header-right-btn-clear:hover:not(:disabled) {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.card-header-right-btn-clear:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ 主预览 ============ */
.preview-body {
    min-height: 120px;
}

.preview-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 360px;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    border: 2px solid #e5e7eb;
}

.preview-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.preview-video.preview-ready {
    opacity: 1;
}

.preview-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
    background: #1f2937;
}

.preview-placeholder-icon {
    font-size: 36px;
}

.preview-tip {
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #7c3aed;
    background: #f3e8ff;
    border-radius: 10px;
    vertical-align: middle;
}

.preview-tip.result {
    color: #16a34a;
    background: #dcfce7;
}

/* 输出格式选项（统一 mode-btn） */
.seg-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.seg-group .mode-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.setting-tip {
    margin-top: 8px;
    font-size: 12px;
    color: #8b8b97;
    line-height: 1.5;
}

/* ============ 分割操作区 ============ */
.divider {
    width: 100%;
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

.split-bar {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.split-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.auto-play-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.auto-play-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.split-current {
    font-size: 12px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

/* ============ 片段编辑列表（与 shipinpinjie 视频卡片样式保持一致） ============ */
.segment-list-container {
    margin-top: 12px;
}

.segment-list-header {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.segment-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-height: 550px;
    overflow-y: auto;
}

.video-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
}

.video-card:hover {
    border-color: #a78bfa;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.12);
}

.video-card.segment-active {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.video-card.segment-removed {
    border-color: #fecaca;
    background: #fef2f2;
    opacity: 0.85;
}

.video-preview {
    position: relative;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    padding: 12px;
}

.segment-preview-box {
    background: #000;
    padding: 0;
    min-height: 140px;
}

.segment-card-video {
    width: 100%;
    height: 140px;
    object-fit: contain;
    display: block;
    background: #000;
}

.segment-card-placeholder {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

/* 片段预览框拖动进度条 */
.segment-scrub {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px 6px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
    cursor: pointer;
    touch-action: none;
}

.segment-scrub-track {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.35);
}

.segment-scrub-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 3px;
    background: #8b5cf6;
}

.segment-scrub-handle {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #8b5cf6;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

body.dark .segment-scrub-track {
    background: rgba(255, 255, 255, 0.2);
}

.segment-removed-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(254, 242, 242, 0.88);
    color: #dc2626;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.video-index {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
}

.video-info {
    padding: 12px;
}

.video-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.segment-edit-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-input {
    width: 70px;
    padding: 4px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    background: white;
}

.time-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.time-separator {
    font-size: 12px;
    color: #6b7280;
}

/* ============ 处理状态/进度 ============ */
.cut-status {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.cut-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.cut-count {
    font-weight: 600;
    color: #0369a1;
}

/* 失败提示卡片 */
.error-card {
    border: 1px solid #fecaca;
    background: #fef2f2;
    border-radius: 10px;
    padding: 16px;
    margin-top: 12px;
    text-align: center;
}

.error-icon {
    font-size: 32px;
}

.error-text {
    font-size: 15px;
    font-weight: 600;
    color: #b91c1c;
    margin: 6px 0;
}

.error-info {
    font-size: 12px;
    color: #dc2626;
    margin-bottom: 12px;
    word-break: break-all;
}

/* 空态上传区（单视频） */
.empty-preview {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    background: #fafafa;
}

.empty-preview.upload-zone {
    cursor: pointer;
    transition: all 0.2s;
}

.empty-preview.upload-zone:hover,
.empty-preview.upload-zone.drag-over {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 12px;
    color: #9ca3af;
}

/* 工具栏说明文字 */
.btn-note {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f5f5f7;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.7;
    color: #6b7280;
    text-align: left;
}
body.dark .btn-note {
    background: #23232b;
    color: #9ca3af;
}

/* 重置分割等幽灵按钮 */
.btn-ghost {
    background: #fff;
    color: #6b7280;
    border: 1px solid #d1d5db;
}
.btn-ghost:hover:not(:disabled) {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: #f5f3ff;
}
.btn-ghost:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
body.dark .btn-ghost {
    background: #2a2a32;
    color: #9ca3af;
    border-color: #495057;
}
body.dark .btn-ghost:hover:not(:disabled) {
    background: #2f2740;
    color: #c4b5fd;
    border-color: #8b5cf6;
}

/* 后台处理提示 */
.btn-status {
    margin-top: 8px;
    font-size: 12px;
    color: #8b5cf6;
}
body.dark .btn-status {
    color: #c4b5fd;
}

/* 剪切信息 */
.cut-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    padding: 8px 12px;
    background: #f5f5f7;
    border-radius: 6px;
    font-size: 13px;
    color: #4b5563;
}
.cut-info-item b {
    color: #6d28d9;
}
body.dark .cut-info {
    background: #23232b;
    color: #c4c4cc;
}
body.dark .cut-info-item b {
    color: #a78bfa;
}

/* 窄屏：底部按钮换行，避免溢出 */
@media (max-width: 768px) {
    .btn-container-center {
        flex-wrap: wrap;
    }
    .btn-container-center .btn {
        flex: 1 1 auto;
    }
    .seg-group {
        flex-wrap: wrap;
    }
    .seg-group .mode-btn {
        min-width: 64px;
    }
    .segment-list {
        grid-template-columns: 1fr;
    }
}

/* ====== 暗色模式 ====== */
body.dark .header-count {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
}

body.dark .card-header-right-btn-clear {
    background: #374151;
    border-color: #495057;
    color: #9ca3af;
}

body.dark .card-header-right-btn-clear:hover:not(:disabled) {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

body.dark .preview-tip {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.18);
}

body.dark .preview-tip.result {
    color: #86efac;
    background: rgba(22, 163, 74, 0.2);
}

body.dark .preview-container {
    border-color: #3a3a45;
}

body.dark .preview-placeholder {
    background: #1f2937;
    color: #9ca3af;
}

body.dark .segment-preview-video {
    border-color: #3a3a45;
}

body.dark .video-card {
    background: #2a2a35;
    border-color: #3a3a45;
}

body.dark .video-card:hover {
    border-color: #8b5cf6;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.25);
}

body.dark .video-card.segment-active {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.16);
}

body.dark .video-card.segment-removed {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.12);
}

body.dark .segment-preview-box {
    background: #000;
}

body.dark .segment-card-video {
    background: #000;
}

body.dark .segment-removed-mask {
    background: rgba(60, 20, 20, 0.88);
    color: #fca5a5;
}

body.dark .video-index {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

body.dark .video-name {
    color: #e5e5ea;
}

body.dark .meta-badge.target {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

body.dark .meta-badge.removed {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

body.dark .video-size .size-item {
    color: #8b8b95;
}

body.dark .time-input {
    background: #2a2a35;
    border-color: #3a3a45;
    color: #e5e5ea;
}

body.dark .cut-status {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

body.dark .cut-count {
    color: #c4b5fd;
}

body.dark .error-card {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

body.dark .error-text,
body.dark .error-info {
    color: #fca5a5;
}

body.dark .empty-preview {
    background: #1c1c24;
    border-color: #33333d;
}

body.dark .empty-preview.upload-zone:hover,
body.dark .empty-preview.upload-zone.drag-over {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
}

body.dark .upload-text {
    color: #e5e5ea;
}

body.dark .upload-hint {
    color: #8b8b95;
}

