/* GIF 工具专属样式：仅新增 .vc-gif-* / .vc-flow / .vc-step 类，不改动共享 video-tools.css 的既有类 */

/* ---------- 三步流程条（上传与剪辑 → 输出设置 → 预览与生成） ---------- */
.vc-flow {
    display: flex;
    align-items: stretch;
    gap: .35rem;
    margin-bottom: .75rem;
}
.vc-flow-step {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .6rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .5rem;
    background: var(--bs-body-bg, #fff);
}
.vc-flow-num {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    background: var(--bs-secondary-bg, #e9ecef);
    color: var(--bs-secondary-color, #6c757d);
}
.vc-flow-text {
    font-weight: 600;
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vc-flow-state {
    margin-left: auto;
    font-size: .75rem;
    color: var(--bs-secondary-color, #6c757d);
    white-space: nowrap;
}
.vc-flow-step.is-active {
    border-color: var(--bs-primary, #0d6efd);
    background: rgba(13, 110, 253, .06);
}
.vc-flow-step.is-active .vc-flow-num {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
}
.vc-flow-step.is-done .vc-flow-num {
    background: var(--bs-success, #198754);
    color: #fff;
}
.vc-flow-step.is-done .vc-flow-state {
    color: var(--bs-success, #146c43);
}
.vc-flow-arrow {
    display: none;
    align-items: center;
    color: var(--bs-secondary-color, #6c757d);
    font-size: .8rem;
}
@media (min-width: 768px) {
    .vc-flow-arrow { display: flex; }
}
/* 窄屏三步竖排成一条，步骤名缩短由 ellipsis 处理 */
@media (max-width: 575.98px) {
    .vc-flow { flex-direction: column; }
    .vc-flow-state { display: none; }
}

/* 卡片标题里的步骤编号 */
.vc-card-step {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
}
.vc-step-num {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 时间轴下方的截取时长读数 */
.vc-gif-len-chip {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    padding: .3rem .7rem;
    border-radius: .5rem;
    background: rgba(13, 110, 253, .08);
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}
.vc-gif-len-chip strong {
    font-size: 1.05rem;
}
.vc-len-unit {
    color: var(--bs-secondary-color, #6c757d);
}

/* 起止行按钮文字：宽屏显示「设为开始/结束」，窄屏只留瞄准图标 */
.vc-tc-btn-text {
    white-space: nowrap;
}
@media (max-width: 575.98px) {
    .vc-tc-btn-text { display: none; }
}

/* 高级设置角标（收起时也能看到启用了几项） */
.vc-gif-adv-badge {
    margin-left: .5rem;
    white-space: nowrap;
}
@media (max-width: 575.98px) {
    .vc-gif-adv-badge { display: none !important; }
}

/* 画幅适配方式（裁切填满 / 完整保留） */
.vc-gif-ar-mode {
    display: flex;
    gap: .75rem;
    margin-top: .4rem;
}
.vc-gif-ar-mode-item {
    font-size: .85rem;
    color: var(--bs-secondary-color, #6c757d);
    cursor: pointer;
}

/* 多片段剪辑列表 */
.vc-gif-seg-tools {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.vc-gif-seg-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.vc-gif-seg-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .375rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
}
.vc-gif-seg-idx {
    font-weight: 700;
    color: var(--bs-primary, #0d6efd);
    min-width: 1.25rem;
}
.vc-gif-seg-time {
    font-variant-numeric: tabular-nums;
    font-size: .85rem;
    flex: 1;
}

/* 倒放 + 速度 内联行 */
.vc-gif-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.vc-gif-speed {
    width: auto;
    min-width: 5rem;
}

/* 自定义裁剪框叠加层（覆盖在预览 video 上） */
.vc-player {
    position: relative;
    /* 八个手柄要能伸出到播放器边缘之外（角点 -7px、边中线 -5px），
     * 共享样式的 overflow:hidden 会把它们裁掉导致点不到；
     * 圆角改到 video 自身，视觉不变。仅本页面加载此文件，不影响其他工具。 */
    overflow: visible;
}
.vc-player video {
    border-radius: .5rem;
}
.vc-gif-cropbox {
    position: absolute;
    border: 2px dashed var(--bs-primary, #0d6efd);
    background: rgba(13, 110, 253, .12);
    cursor: move;
    box-sizing: border-box;
    z-index: 5;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.vc-gif-cropbox-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--bs-body-bg, #fff);
    border: 2px solid var(--bs-primary, #0d6efd);
    border-radius: 50%;
    box-sizing: border-box;
    z-index: 2;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
/* 四角圆点 */
.vc-gif-cropbox-handle.h-nw { left: -7px;  top: -7px;    cursor: nwse-resize; }
.vc-gif-cropbox-handle.h-ne { right: -7px; top: -7px;    cursor: nesw-resize; }
.vc-gif-cropbox-handle.h-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.vc-gif-cropbox-handle.h-sw { left: -7px;  bottom: -7px; cursor: nesw-resize; }
/* 四边胶囊（仿 Cropper 款） */
.vc-gif-cropbox-handle.h-n,
.vc-gif-cropbox-handle.h-s {
    left: 50%;
    width: 34px;
    height: 10px;
    margin-left: -17px;
    border-radius: 5px;
}
.vc-gif-cropbox-handle.h-n { top: -5px;    cursor: ns-resize; }
.vc-gif-cropbox-handle.h-s { bottom: -5px; cursor: ns-resize; }
.vc-gif-cropbox-handle.h-e,
.vc-gif-cropbox-handle.h-w {
    top: 50%;
    width: 10px;
    height: 34px;
    margin-top: -17px;
    border-radius: 5px;
}
.vc-gif-cropbox-handle.h-e { right: -5px; cursor: ew-resize; }
.vc-gif-cropbox-handle.h-w { left: -5px;  cursor: ew-resize; }

/* 文字 / 水印输入区 */
.vc-gif-wm-inputs .row {
    margin-top: .25rem;
}

/* 操作按钮行：预览 + 生成 */
.vc-gif-actions {
    display: flex;
    gap: .5rem;
}

/* 预览结果媒体 */
.vc-gif-preview {
    max-width: 100%;
    max-height: 240px;
    border-radius: .375rem;
    display: block;
    margin-top: .5rem;
}

/* 高级设置折叠卡：分组小标题 + 细分隔线，展开后不至一长列 */
.vc-gif-adv .card-header {
    padding-bottom: .25rem;
}
.vc-gif-adv-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: 0;
    padding: 0;
    color: var(--bs-body-color);
    text-align: left;
}
.vc-gif-adv-toggle:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: .25rem;
}
.vc-gif-adv-caret {
    color: var(--bs-secondary-color);
    transition: transform .2s ease;
}
.vc-gif-adv-toggle[aria-expanded="true"] .vc-gif-adv-caret {
    transform: rotate(180deg);
}
.vc-adv-group {
    padding-top: .55rem;
    margin-top: .55rem;
    border-top: 1px solid var(--bs-border-color);
}
.vc-adv-group:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}
.vc-adv-group-title {
    font-weight: 600;
    font-size: .8125rem;
    letter-spacing: .02em;
    color: var(--bs-secondary-color);
    margin-bottom: .4rem;
}

/* 高级设置紧凑化：组内控件横向合并，少滚屏 */
/* 画幅比例下拉 + 裁切/保留单选同一行（auto 时单选组整体隐藏，不留空行） */
.vc-gif-ar-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.vc-gif-ar-row > .form-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 11rem;
}
.vc-gif-ar-row .vc-gif-ar-mode {
    margin-top: 0;
}
/* 导出格式 + 目标大小同一行 */
.vc-gif-out-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}
.vc-gif-out-format {
    flex: 0 0 11rem;
}
.vc-gif-out-target {
    flex: 1 1 15rem;
}
/* 展开后卡头那句「画幅、裁剪、速度…」摘要就冗余了，收起时才需要 */
.vc-gif-adv:has(.collapse.show) .vc-gif-adv-sub {
    display: none;
}

/* 生成前实时预览播放器 */
.vc-gif-seq-strip {
    padding: .25rem 0;
}
.vc-gif-seq-player {
    max-width: 420px;
}
.vc-gif-seq-canvas {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .25rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}
.vc-gif-seq-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .25rem;
}
.vc-gif-seq-btn {
    flex: 0 0 auto;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: .25rem;
    line-height: 1;
    padding: .15rem .55rem;
    font-size: .8rem;
}
.vc-gif-seq-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .35rem;
}
.vc-gif-seq-chip {
    font-size: .75rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: transparent;
    color: var(--bs-body-color);
    border-radius: 2rem;
    padding: .05rem .6rem;
    font-variant-numeric: tabular-nums;
}
.vc-gif-seq-chip.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: var(--bs-white);
}
.vc-gif-seq-cap {
    font-size: .75rem;
    color: var(--bs-secondary-color, #6c757d);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- 输出设置紧凑化 ----------
 * 占屏太高：宽屏下预设四联排一行、四个常用参数一行、卡片内提示行精简，
 * 少滚一屏半屏，默认路径（社交分享）一屏内看完。 */
.vc-preset-grid .vc-preset {
    padding: .5rem 2rem .5rem .7rem;
}
@media (min-width: 992px) {
    .vc-preset-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    /* 循环复选框与「标签 + 下拉」行高对齐，不在第一行掉队 */
    .vc-gif-loop-cell {
        padding-top: 1.7rem;
    }
}

/* ---------- 第 3 步：效果预览（零编码实时播放） ---------- */
.vc-gif-fx {
    min-height: 2.5rem;
}
.vc-gif-fx-empty {
    border: 1px dashed var(--bs-border-color, #dee2e6);
    border-radius: .375rem;
    padding: 1.1rem .75rem;
    text-align: center;
    color: var(--bs-secondary-color, #6c757d);
    font-size: .85rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
}
/* 预览专用隐藏视频：离屏静音，仅作 canvas 抽帧源，不参与交互 */
.vc-gif-fx-video {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 2px;
    height: 2px;
    opacity: 0;
    pointer-events: none;
}

/* ---------- 体积估算区（风险 + 预计输出 + 参考说明，一块说完） ---------- */
.vc-estimate-box {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .5rem;
    padding: .55rem .75rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
}
.vc-estimate-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.vc-estimate-size {
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
}

/* ---------- 生成结果：实际大小 / 格式一行 ---------- */
.vc-gif-result-line {
    margin-top: .4rem;
    font-size: .85rem;
    color: var(--bs-secondary-color, #6c757d);
    font-variant-numeric: tabular-nums;
}

/* ---------- 自定义裁剪：源像素选区读数 ---------- */
.vc-gif-crop-readout {
    margin-top: .35rem;
    font-size: .8rem;
    color: var(--bs-secondary-color, #6c757d);
    font-variant-numeric: tabular-nums;
}
.vc-gif-crop-readout:empty {
    display: none;
}
