/* ============================================================
   video-subtitle-burn / style.css
   V3.9 变量跟随站点主题；宽高自适应；禁用横向溢出
   ============================================================ */
.vsb-container {
    --video-accent: var(--primary, #2563eb);
    --video-accent-hover: var(--primary-hover, #1d4ed8);
    --video-surface: var(--bg-input, #fff);
    --video-onfg: var(--text-on-accent, #fff);
    --video-panel: var(--bg-card, var(--bg-input, #fff));
    --video-soft: var(--bg-btn, #f3f4f6);
    --video-soft-hover: var(--bg-btn-hover, #e5e7eb);
    --video-line: var(--border, #e5e7eb);
    --video-txt: var(--text, #333);
    --video-txt2: var(--text-secondary, #6b7280);
    --video-ok: var(--success, #16a34a);
    --video-err: var(--danger, #dc2626);
    --video-fill: var(--bg-page, #f7f8fa);
    --video-r: var(--radius, 10px);
    --video-rs: var(--radius-sm, 6px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
    overflow-y: hidden;
    color: var(--video-txt);
    font-size: 14px;
    line-height: 1.6;
}
.vsb-container * { box-sizing: border-box; }
.vsb-layout { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.vsb-main { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.vsb-side { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.vsb-panel {
    background: var(--video-panel);
    border: 1px solid var(--video-line);
    border-radius: var(--video-r);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.vsb-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 2px; }
.vsb-headt { font-size: 15px; font-weight: 700; color: var(--video-txt); }
.vsb-heads { font-size: 12px; color: var(--video-txt2); }
.vsb-drop {
    border: 2px dashed var(--video-line);
    border-radius: var(--video-r);
    background: var(--video-fill);
    padding: 26px 16px;
    text-align: center;
    color: var(--video-txt2);
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.vsb-drop:hover, .vsb-drop.over { border-color: var(--video-accent); background: var(--video-soft); }
.vsb-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.vsb-col { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; min-width: 0; }
.vsb-lbl { font-size: 12px; color: var(--video-txt2); display: flex; align-items: center; gap: 6px; }
.vsb-input, .vsb-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--video-line);
    border-radius: var(--video-rs);
    background: var(--video-surface);
    color: var(--video-txt);
    font-size: 13px;
    min-width: 0;
}
.vsb-check { width: 15px; height: 15px; accent-color: var(--video-accent); flex: 0 0 auto; }
.vsb-range { width: 100%; accent-color: var(--video-accent); min-width: 0; }
.vsb-btn {
    padding: 8px 14px;
    border: 1px solid var(--video-line);
    border-radius: var(--video-rs);
    background: var(--video-soft);
    color: var(--video-txt);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    flex: 0 0 auto;
    transition: background .15s, border-color .15s;
}
.vsb-btn:hover:not(:disabled) { background: var(--video-soft-hover); }
.vsb-btn:disabled { opacity: .45; cursor: not-allowed; }
.vsb-btn.primary {
    background: var(--video-accent);
    border-color: var(--video-accent);
    color: var(--video-onfg);
}
.vsb-btn.primary:hover:not(:disabled) { background: var(--video-accent-hover); }
.vsb-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.vsb-seg button {
    padding: 6px 12px;
    border: 1px solid var(--video-line);
    border-radius: var(--video-rs);
    background: var(--video-surface);
    color: var(--video-txt);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.vsb-seg button.on { background: var(--video-accent); border-color: var(--video-accent); color: var(--video-onfg); }
.vsb-meta { margin: 0; font-size: 12px; color: var(--video-txt2); word-break: break-all; }
.vsb-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--video-txt2);
    background: var(--video-fill);
    border-left: 3px solid var(--video-line);
    padding: 8px 12px;
    border-radius: 0 var(--video-rs) var(--video-rs) 0;
}
.vsb-okmsg { color: var(--video-ok); }
.vsb-errmsg { color: var(--video-err); }
.vsb-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.vsb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--video-line);
    border-radius: var(--video-rs);
    background: var(--video-surface);
    font-size: 12px;
}
.vsb-item .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsb-item .sz { flex: 0 0 auto; color: var(--video-txt2); font-variant-numeric: tabular-nums; }
.vsb-item .pc { flex: 0 0 auto; font-weight: 700; color: var(--video-ok); font-variant-numeric: tabular-nums; }
.vsb-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.vsb-thumb {
    width: 108px;
    border: 1px solid var(--video-line);
    border-radius: var(--video-rs);
    background: var(--video-surface);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
}
.vsb-thumb canvas, .vsb-thumb img { width: 100%; height: 72px; object-fit: contain; background: var(--video-fill); border-radius: 4px; }
.vsb-thumb .tx { color: var(--video-txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsb-thumb .btns { display: flex; gap: 4px; }
.vsb-thumb .btns button { flex: 1 1 0; padding: 3px 0; font-size: 11px; }
.vsb-prog { height: 6px; background: var(--video-fill); border-radius: 3px; overflow: hidden; }
.vsb-prog > i { display: block; height: 100%; background: var(--video-accent); width: 0%; transition: width .2s; }
.vsb-canvasbox {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    background: var(--video-fill);
    border: 1px solid var(--video-line);
    border-radius: var(--video-rs);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.vsb-canvasbox canvas { max-width: 100%; height: auto; display: block; }
.vsb-empty { color: var(--video-txt2); font-size: 13px; text-align: center; padding: 20px 0; }

@media (max-width: 900px) {
    .vsb-layout { flex-direction: column; }
    .vsb-main, .vsb-side { width: 100%; flex: 1 1 auto; }
}
@media (max-width: 640px) {
    .vsb-panel { padding: 14px; }
    .vsb-col { flex: 1 1 100%; }
    .vsb-row { gap: 8px; }
}

/* ---- 结果区补充样式（自动补全） ---- */
.vsb-src {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--video-fill);
    border: 1px solid var(--video-line);
    border-radius: var(--video-rs);
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
    min-height: 72px;
}
.vsb-src > * { max-width: 100%; }
.vsb-src video, .vsb-src img, .vsb-src canvas {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}
.vsb-src:empty::before {
    content: "";
    display: block;
    width: 100%;
    min-height: 52px;
}

.vsb-out {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--video-fill);
    border: 1px solid var(--video-line);
    border-radius: var(--video-rs);
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
    min-height: 72px;
}
.vsb-out > * { max-width: 100%; }
.vsb-out video, .vsb-out img, .vsb-out canvas {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}
.vsb-out:empty::before {
    content: "";
    display: block;
    width: 100%;
    min-height: 52px;
}

.vsb-area {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 110px;
    resize: vertical;
    padding: 10px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: var(--video-txt);
    background: var(--video-fill);
    border: 1px solid var(--video-line);
    border-radius: var(--video-rs);
    outline: none;
}
.vsb-area:focus { border-color: var(--video-accent); }
