Initial commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 02:28:47 +00:00
commit 396a676146
21 changed files with 5386 additions and 0 deletions

1887
web/app.js Normal file

File diff suppressed because it is too large Load Diff

338
web/index.html Normal file
View File

@@ -0,0 +1,338 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>VibEdit</title>
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%234c8dff'/%3E%3Cpath d='M12 9l11 7-11 7z' fill='white'/%3E%3C/svg%3E">
<link rel="stylesheet" href="style.css">
</head>
<body>
<svg width="0" height="0" style="position:absolute" aria-hidden="true">
<defs>
<symbol id="i-play" viewBox="0 0 24 24"><path d="M7 4.5v15l12-7.5z" fill="currentColor" stroke="none"/></symbol>
<symbol id="i-pause" viewBox="0 0 24 24"><path d="M6.5 4.5h4v15h-4zM13.5 4.5h4v15h-4z" fill="currentColor" stroke="none"/></symbol>
<symbol id="i-start" viewBox="0 0 24 24"><path d="M6 5v14M19 5l-9 7 9 7z"/></symbol>
<symbol id="i-end" viewBox="0 0 24 24"><path d="M18 5v14M5 5l9 7-9 7z"/></symbol>
<symbol id="i-frame-prev" viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></symbol>
<symbol id="i-frame-next" viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></symbol>
<symbol id="i-sec-prev" viewBox="0 0 24 24"><path d="M12 6l-6 6 6 6M19 6l-6 6 6 6"/></symbol>
<symbol id="i-sec-next" viewBox="0 0 24 24"><path d="M12 6l6 6-6 6M5 6l6 6-6 6"/></symbol>
<symbol id="i-key-prev" viewBox="0 0 24 24"><path d="M5 5v14"/><path d="M14 7l-5 5 5 5 5-5z"/></symbol>
<symbol id="i-key-next" viewBox="0 0 24 24"><path d="M19 5v14"/><path d="M10 7l-5 5 5 5 5-5z"/></symbol>
<symbol id="i-vol" viewBox="0 0 24 24"><path d="M4 9h4l5-4v14l-5-4H4z"/><path d="M16.5 8.5a5 5 0 010 7M19 6a8.5 8.5 0 010 12"/></symbol>
<symbol id="i-mute" viewBox="0 0 24 24"><path d="M4 9h4l5-4v14l-5-4H4z"/><path d="M17 9l5 6M22 9l-5 6"/></symbol>
<symbol id="i-plus" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></symbol>
<symbol id="i-folder" viewBox="0 0 24 24"><path d="M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"/></symbol>
<symbol id="i-film" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 4v16M17 4v16M3 9h4M3 15h4M17 9h4M17 15h4"/></symbol>
<symbol id="i-trash" viewBox="0 0 24 24"><path d="M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 002 2h6a2 2 0 002-2l1-12M9 7V4h6v3"/></symbol>
<symbol id="i-copy" viewBox="0 0 24 24"><rect x="8" y="8" width="12" height="12" rx="2"/><path d="M16 8V6a2 2 0 00-2-2H6a2 2 0 00-2 2v8a2 2 0 002 2h2"/></symbol>
<symbol id="i-cut" viewBox="0 0 24 24"><circle cx="6" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M8.5 7.5L20 18M8.5 16.5L20 6"/></symbol>
<symbol id="i-undo" viewBox="0 0 24 24"><path d="M9 14L4 9l5-5"/><path d="M4 9h10a6 6 0 010 12h-3"/></symbol>
<symbol id="i-redo" viewBox="0 0 24 24"><path d="M15 14l5-5-5-5"/><path d="M20 9H10a6 6 0 000 12h3"/></symbol>
<symbol id="i-export" viewBox="0 0 24 24"><path d="M12 15V3M7 8l5-5 5 5"/><path d="M4 14v5a2 2 0 002 2h12a2 2 0 002-2v-5"/></symbol>
<symbol id="i-help" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M9.5 9.5a2.5 2.5 0 114 2c-1 .6-1.5 1.2-1.5 2.5M12 17.5v.01"/></symbol>
<symbol id="i-x" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6L6 18"/></symbol>
<symbol id="i-left" viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></symbol>
<symbol id="i-right" viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></symbol>
<symbol id="i-up" viewBox="0 0 24 24"><path d="M12 19V5M6 11l6-6 6 6"/></symbol>
<symbol id="i-new" viewBox="0 0 24 24"><path d="M14 3H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2V9z"/><path d="M14 3v6h6M12 12v6M9 15h6"/></symbol>
<symbol id="i-in" viewBox="0 0 24 24"><path d="M9 4H6v16h3M10 12h9M15 8l4 4-4 4"/></symbol>
<symbol id="i-out" viewBox="0 0 24 24"><path d="M15 4h3v16h-3M5 12h9M10 8l4 4-4 4"/></symbol>
<symbol id="i-check" viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5"/></symbol>
<symbol id="i-warn" viewBox="0 0 24 24"><path d="M12 3l10 18H2z"/><path d="M12 10v5M12 18v.01"/></symbol>
<symbol id="i-whole" viewBox="0 0 24 24"><rect x="3" y="7" width="18" height="10" rx="2"/><path d="M12 10v4M10 12h4"/></symbol>
</defs>
</svg>
<header class="topbar">
<div class="brand"><span class="logo"><svg><use href="#i-play"/></svg></span>VibEdit</div>
<div class="tb-group">
<button id="btnAdd" class="btn primary" title="Add video files"><svg class="ic"><use href="#i-plus"/></svg>Add videos</button>
<button id="btnBrowse" class="btn ghost" title="Add videos using the built-in file browser"><svg class="ic"><use href="#i-folder"/></svg></button>
</div>
<div class="tb-group">
<button id="btnUndo" class="btn ghost" title="Undo (Ctrl+Z)"><svg class="ic"><use href="#i-undo"/></svg></button>
<button id="btnRedo" class="btn ghost" title="Redo (Ctrl+Y)"><svg class="ic"><use href="#i-redo"/></svg></button>
<button id="btnNew" class="btn ghost" title="Start a new, empty project"><svg class="ic"><use href="#i-new"/></svg>New</button>
</div>
<span class="grow"></span>
<button id="jobPill" class="job-pill hidden" title="Show export progress"></button>
<button id="btnHelp" class="btn ghost" title="Keyboard shortcuts"><svg class="ic"><use href="#i-help"/></svg></button>
<button id="btnExport" class="btn accent" title="Export the clips"><svg class="ic"><use href="#i-export"/></svg>Export…</button>
</header>
<div id="banner" class="banner hidden"></div>
<main class="layout">
<aside class="panel sources">
<div class="panel-head"><span>Source videos</span><span id="srcCount" class="count"></span></div>
<ul id="sourceList" class="source-list"></ul>
<div id="sourceEmpty" class="empty">
<svg class="big-ic"><use href="#i-film"/></svg>
<p>No videos yet.</p>
<p class="dim">Click <b>Add videos</b> to load one or more source files.</p>
</div>
</aside>
<section class="panel viewer">
<div id="screen" class="screen">
<video id="video" preload="auto" playsinline></video>
<img id="still" class="still hidden" alt="">
<div id="screenMsg" class="screen-msg hidden"></div>
<div id="noSource" class="screen-empty">Add a video, then click it in the list to preview it here.</div>
</div>
<div class="transport">
<div class="tc-box">
<span id="tcCur" class="tc editable" title="Current position — click to type a time">00:00.000</span>
<span class="tc-sep">/</span>
<span id="tcDur" class="tc dim">00:00.000</span>
<span id="tcFrame" class="tc-frame dim"></span>
</div>
<div class="tp-buttons">
<button class="tbtn" data-act="start" title="Go to start (Home)"><svg><use href="#i-start"/></svg></button>
<button class="tbtn" data-act="prevKey" title="Previous keyframe (↑)"><svg><use href="#i-key-prev"/></svg></button>
<button class="tbtn" data-act="back1s" title="Back 1 second (Shift+←)"><svg><use href="#i-sec-prev"/></svg></button>
<button class="tbtn" data-act="prevFrame" title="Previous frame (←)"><svg><use href="#i-frame-prev"/></svg></button>
<button class="tbtn play" data-act="play" id="btnPlay" title="Play / pause (Space)"><svg><use href="#i-play"/></svg></button>
<button class="tbtn" data-act="nextFrame" title="Next frame (→)"><svg><use href="#i-frame-next"/></svg></button>
<button class="tbtn" data-act="fwd1s" title="Forward 1 second (Shift+→)"><svg><use href="#i-sec-next"/></svg></button>
<button class="tbtn" data-act="nextKey" title="Next keyframe (↓)"><svg><use href="#i-key-next"/></svg></button>
<button class="tbtn" data-act="end" title="Go to end (End)"><svg><use href="#i-end"/></svg></button>
</div>
<div class="tp-right">
<button class="tbtn" data-act="mute" id="btnMute" title="Mute (M)"><svg><use href="#i-vol"/></svg></button>
<input id="volume" type="range" min="0" max="1" step="0.05" value="1" title="Volume">
</div>
</div>
<div class="timeline-row">
<div id="timeline" class="timeline">
<canvas id="tlCanvas"></canvas>
<div id="tlHover" class="tl-hover hidden"><img alt=""><span></span></div>
</div>
<div class="zoom">
<button class="zbtn" data-act="zoomIn" title="Zoom in (+ or mouse wheel)">+</button>
<button class="zbtn" data-act="zoomOut" title="Zoom out (−)">−</button>
<button class="zbtn fit" data-act="zoomFit" title="Show the whole video (0)">Fit</button>
</div>
</div>
<div class="marks">
<button class="btn mark-btn" data-act="setIn" title="Set the In point at the playhead (I). Shift+I jumps to it."><svg class="ic"><use href="#i-in"/></svg>Set In <kbd>I</kbd></button>
<div class="mark-val"><label>In</label><span id="markIn" class="tc editable" title="Click to type">–</span></div>
<button class="btn mark-btn" data-act="setOut" title="Set the Out point at the playhead (O). Shift+O jumps to it."><svg class="ic"><use href="#i-out"/></svg>Set Out <kbd>O</kbd></button>
<div class="mark-val"><label>Out</label><span id="markOut" class="tc editable" title="Click to type">–</span></div>
<div class="mark-val"><label>Length</label><span id="markLen" class="tc">–</span></div>
<span class="grow"></span>
<button class="btn ghost" data-act="split" title="Split the clip under the playhead in two (S)"><svg class="ic"><use href="#i-cut"/></svg>Split <kbd>S</kbd></button>
<button class="btn ghost" data-act="playSel" title="Play from In to Out (P)"><svg class="ic"><use href="#i-play"/></svg>Play In→Out <kbd>P</kbd></button>
<button class="btn primary" id="btnAddClip" data-act="addClip" title="Add the In→Out range as a clip (Enter)"><svg class="ic"><use href="#i-plus"/></svg><span>Add clip</span> <kbd>Enter</kbd></button>
</div>
<div id="markHint" class="mark-hint hidden"></div>
</section>
<section class="panel clips">
<div class="panel-head">
<span>Clips</span><span id="clipCount" class="count"></span>
<span id="clipTotal" class="dim small"></span>
<span class="grow"></span>
<span class="dim small">Export method</span>
<div class="seg" id="modeSeg">
<button data-mode="copy" title="Copy the original streams: no quality loss, very fast. Cuts land on keyframes.">Lossless</button>
<button data-mode="encode" title="Re-encode: frame-exact cuts and a choice of format, size and quality. Slower.">Re-encode</button>
</div>
</div>
<div id="clipList" class="clip-list"></div>
<div id="clipEmpty" class="empty row">
<p>No clips yet. Set an <b>In</b> and <b>Out</b> point on the timeline and press <b>Add clip</b>,
or use <b>+ Whole</b> on a source and <b>Split</b> it. Clips are joined in this order — drag them to reorder.</p>
</div>
</section>
</main>
<!-- Export dialog -->
<dialog id="dlgExport" class="dlg">
<div class="dlg-head"><h2>Export</h2><button class="icon-btn" data-close title="Close"><svg class="ic"><use href="#i-x"/></svg></button></div>
<div class="dlg-body" id="exportForm">
<div class="summary" id="exSummary"></div>
<div class="field">
<div class="label">Method</div>
<div class="cards2">
<label class="rcard"><input type="radio" name="mode" value="copy">
<div><b>Lossless</b><small>Copies the original video and audio: no quality loss and very fast. Cuts can only start on keyframes, so a clip may begin a little early.</small></div></label>
<label class="rcard"><input type="radio" name="mode" value="encode">
<div><b>Re-encode</b><small>Frame-exact cuts. Choose the format, resolution and quality. Clips of different sizes are fitted together. Slower.</small></div></label>
</div>
</div>
<div class="field">
<div class="label">Output</div>
<div class="radios">
<label><input type="radio" name="join" value="1"> Join all clips into one video</label>
<label><input type="radio" name="join" value="0"> Save each clip as a separate file</label>
</div>
</div>
<div class="field">
<div class="label">Save as</div>
<div class="row">
<input id="exOutput" type="text" spellcheck="false" autocomplete="off">
<select id="exContainer" title="File type"></select>
<button class="btn" id="exBrowse" type="button"><svg class="ic"><use href="#i-folder"/></svg>Browse…</button>
</div>
<div class="hint" id="exOutHint"></div>
</div>
<div id="exCopyOpts" class="field">
<div class="label">Audio</div>
<div class="radios">
<label id="exAllAudioRow"><input type="checkbox" id="exAllAudio"> Keep all audio tracks</label>
<label><input type="checkbox" id="exNoAudioCopy"> Remove audio</label>
</div>
</div>
<div id="exEncOpts">
<div class="grid2">
<div class="field">
<div class="label">Video codec</div>
<select id="exVCodec"></select>
</div>
<div class="field">
<div class="label">Speed</div>
<select id="exSpeed">
<option value="fast">Fast (bigger file)</option>
<option value="balanced">Balanced</option>
<option value="slow">Slow (smaller file)</option>
</select>
</div>
</div>
<div class="field">
<div class="label">Quality <span id="exQLabel" class="dim"></span></div>
<div class="row q-row"><span class="dim small">Best</span><input type="range" id="exQuality" min="0" max="51" step="1"><span class="dim small">Smallest</span></div>
</div>
<div class="grid2">
<div class="field">
<div class="label">Resolution</div>
<select id="exHeight">
<option value="0">Same as source</option>
<option value="2160">2160p (4K)</option>
<option value="1440">1440p</option>
<option value="1080">1080p</option>
<option value="720">720p</option>
<option value="480">480p</option>
<option value="360">360p</option>
</select>
</div>
<div class="field">
<div class="label">Frame rate</div>
<select id="exFPS">
<option value="">Same as source</option>
<option value="24000/1001">23.976</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="30000/1001">29.97</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="60000/1001">59.94</option>
<option value="60">60</option>
</select>
</div>
</div>
<div class="grid2">
<div class="field">
<div class="label">Audio codec</div>
<select id="exACodec"></select>
</div>
<div class="field">
<div class="label">Audio bitrate</div>
<select id="exABitrate">
<option value="96">96 kbps</option>
<option value="128">128 kbps</option>
<option value="160">160 kbps</option>
<option value="192">192 kbps</option>
<option value="256">256 kbps</option>
<option value="320">320 kbps</option>
</select>
</div>
</div>
<div class="hint" id="exEncHint"></div>
</div>
<div id="exWarn" class="notice warn hidden"></div>
<div id="exProgress" class="progress hidden">
<div class="bar"><div id="exBar"></div></div>
<div class="pinfo"><span id="exPText"></span><span id="exPEta" class="dim"></span></div>
</div>
<div id="exResult" class="hidden"></div>
</div>
<div class="dlg-foot">
<button class="btn" data-close>Close</button>
<span class="grow"></span>
<button class="btn danger hidden" id="exCancel">Cancel export</button>
<button class="btn accent" id="exGo"><svg class="ic"><use href="#i-export"/></svg>Export</button>
</div>
</dialog>
<!-- Built-in file browser -->
<dialog id="dlgFiles" class="dlg files">
<div class="dlg-head"><h2 id="fbTitle">Add videos</h2><button class="icon-btn" data-close title="Close"><svg class="ic"><use href="#i-x"/></svg></button></div>
<div class="fb-bar">
<select id="fbRoots" title="Drive"></select>
<button class="btn" id="fbUp" title="Parent folder"><svg class="ic"><use href="#i-up"/></svg></button>
<input id="fbPath" type="text" spellcheck="false" autocomplete="off" title="Folder — type a path and press Enter">
</div>
<ul id="fbList" class="fb-list"></ul>
<div class="fb-save hidden" id="fbSaveRow"><label>File name</label><input id="fbName" type="text" spellcheck="false"></div>
<div class="dlg-foot">
<label class="small"><input type="checkbox" id="fbAll"> Show all files</label>
<span class="grow"></span>
<span id="fbSelInfo" class="dim small"></span>
<button class="btn" data-close>Cancel</button>
<button class="btn primary" id="fbOk">Add</button>
</div>
</dialog>
<!-- Confirm -->
<dialog id="dlgConfirm" class="dlg small">
<div class="dlg-body"><p id="cfText"></p></div>
<div class="dlg-foot"><span class="grow"></span><button class="btn" id="cfNo">Cancel</button><button class="btn accent" id="cfYes">OK</button></div>
</dialog>
<!-- Help -->
<dialog id="dlgHelp" class="dlg">
<div class="dlg-head"><h2>How to use VibEdit</h2><button class="icon-btn" data-close title="Close"><svg class="ic"><use href="#i-x"/></svg></button></div>
<div class="dlg-body help">
<ol class="steps">
<li><b>Add videos</b> and click one to preview it.</li>
<li>Move the playhead and press <kbd>I</kbd> / <kbd>O</kbd> to mark the start and end of a part you want, then <kbd>Enter</kbd> to add it as a clip. Repeat for every part (from any source).</li>
<li>Or add a whole video with <b>+ Whole</b>, put the playhead where you want to cut and press <kbd>S</kbd> to split; delete the pieces you don't want.</li>
<li>Drag clips to put them in order, then <b>Export</b> — joined into one video or as separate files.</li>
</ol>
<p class="dim">The In point includes the frame you see; the Out point cuts just before the frame you see. Your project is saved automatically.</p>
<table class="keys">
<tr><td><kbd>Space</kbd></td><td>Play / pause</td><td><kbd>I</kbd> <kbd>O</kbd></td><td>Set In / Out</td></tr>
<tr><td><kbd>←</kbd> <kbd>→</kbd></td><td>Previous / next frame</td><td><kbd>Shift</kbd>+<kbd>I</kbd>/<kbd>O</kbd></td><td>Go to In / Out</td></tr>
<tr><td><kbd>Shift</kbd>+<kbd>←</kbd> <kbd>→</kbd></td><td>Back / forward 1 s</td><td><kbd>Enter</kbd></td><td>Add clip (or finish editing)</td></tr>
<tr><td><kbd>Ctrl</kbd>+<kbd>←</kbd> <kbd>→</kbd></td><td>Back / forward 10 s</td><td><kbd>S</kbd></td><td>Split clip at playhead</td></tr>
<tr><td><kbd>↑</kbd> <kbd>↓</kbd></td><td>Previous / next keyframe</td><td><kbd>P</kbd></td><td>Play In → Out</td></tr>
<tr><td><kbd>Home</kbd> <kbd>End</kbd></td><td>Start / end</td><td><kbd>Delete</kbd></td><td>Delete selected clip</td></tr>
<tr><td><kbd>+</kbd> <kbd>−</kbd> <kbd>0</kbd></td><td>Zoom timeline / fit</td><td><kbd>Esc</kbd></td><td>Stop editing clip</td></tr>
<tr><td><kbd>M</kbd></td><td>Mute</td><td><kbd>Ctrl</kbd>+<kbd>Z</kbd> / <kbd>Y</kbd></td><td>Undo / redo</td></tr>
</table>
<p class="dim small" id="helpVersion"></p>
</div>
</dialog>
<div id="toasts" class="toasts"></div>
<div id="offline" class="offline hidden">
<div class="offline-box">
<h2>VibEdit is not running</h2>
<p>The VibEdit program was closed. Your project is saved — start VibEdit again to continue where you left off.</p>
</div>
</div>
<script src="app.js"></script>
</body>
</html>

338
web/style.css Normal file
View File

@@ -0,0 +1,338 @@
:root {
--bg: #0e1014;
--panel: #161920;
--panel2: #1d2129;
--panel3: #252a34;
--line: #2b313c;
--line2: #3a4250;
--text: #e7e9ee;
--dim: #98a1b1;
--dim2: #6b7383;
--accent: #4c8dff;
--accent-h: #6aa1ff;
--mark: #ffb547;
--ok: #3ccf91;
--warn: #ffb547;
--danger: #ff5d5d;
--radius: 8px;
--mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", ui-monospace, monospace;
color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
background: var(--bg);
color: var(--text);
font: 14px/1.4 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
display: flex;
flex-direction: column;
overflow: hidden;
user-select: none;
}
input, select, textarea, button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.grow { flex: 1; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
kbd {
font: 11px var(--mono);
padding: 1px 5px;
border: 1px solid var(--line2);
border-bottom-width: 2px;
border-radius: 4px;
color: var(--dim);
background: rgba(255,255,255,.03);
}
.btn kbd { margin-left: 2px; border-color: rgba(255,255,255,.18); color: inherit; opacity: .7; }
/* buttons */
.btn {
display: inline-flex; align-items: center; gap: 6px;
height: 32px; padding: 0 12px;
background: var(--panel3); border: 1px solid var(--line2); border-radius: 6px;
cursor: pointer; white-space: nowrap;
transition: background .12s, border-color .12s;
}
.btn:hover { background: #2d3340; border-color: #4a5364; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel3); border-color: var(--line2); }
.btn.primary { background: #2a4a85; border-color: #3a62ad; }
.btn.primary:hover { background: #335aa0; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.accent:hover { background: var(--accent-h); }
.btn.danger { background: #5a2226; border-color: #8a3036; }
.btn.danger:hover { background: #6c282d; }
.ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 6px; color: var(--dim); cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--panel3); color: var(--text); }
/* top bar */
.topbar {
display: flex; align-items: center; gap: 14px;
height: 52px; padding: 0 12px;
background: var(--panel); border-bottom: 1px solid var(--line);
flex: none;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: .2px; margin-right: 6px; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; }
.logo svg { width: 15px; height: 15px; color: #fff; margin-left: 2px; }
.tb-group { display: flex; gap: 4px; align-items: center; }
.tb-group + .tb-group { padding-left: 12px; border-left: 1px solid var(--line); }
.job-pill {
height: 30px; padding: 0 12px; border-radius: 15px; cursor: pointer;
border: 1px solid #3a62ad; background: #1c2b48; color: #cfe0ff; font-size: 13px;
background-image: linear-gradient(90deg, #2a4a85 var(--p, 0%), transparent var(--p, 0%));
}
.banner { background: #4a2a12; color: #ffd9b0; padding: 10px 16px; border-bottom: 1px solid #6b3d1b; flex: none; user-select: text; }
.banner code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 4px; }
.banner a { color: #ffc27a; }
/* layout */
.layout {
flex: 1; min-height: 0;
display: grid;
grid-template-columns: 290px minmax(0, 1fr);
grid-template-rows: minmax(0, 1fr) 232px;
gap: 8px; padding: 8px;
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0; display: flex; flex-direction: column; }
.panel-head {
display: flex; align-items: center; gap: 8px;
height: 40px; padding: 0 12px; flex: none;
border-bottom: 1px solid var(--line);
font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: #c5cad4;
}
.panel-head .small, .panel-head .seg { text-transform: none; letter-spacing: 0; font-weight: 400; }
.count { background: var(--panel3); color: var(--dim); border-radius: 10px; padding: 0 7px; font-size: 12px; letter-spacing: 0; }
.count:empty { display: none; }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--dim); }
.empty p { margin: 4px 0; max-width: 560px; }
.empty b { color: var(--text); }
.big-ic { width: 44px; height: 44px; fill: none; stroke: var(--dim2); stroke-width: 1.5; margin-bottom: 8px; }
/* sources */
.sources { grid-row: 1; grid-column: 1; }
.source-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.source-list:empty { display: none; }
.src {
display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 10px;
padding: 7px; border-radius: 7px; cursor: pointer; border: 1px solid transparent;
position: relative;
}
.src:hover { background: var(--panel2); }
.src.cur { background: #1c2740; border-color: #2f4a7d; }
.src-thumb { width: 96px; height: 54px; border-radius: 5px; background: #000 center/cover no-repeat; position: relative; overflow: hidden; }
.src-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.src-thumb::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.src-thumb .audio-only { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 22px; }
.src-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 18px; }
.src-meta { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-actions { display: flex; gap: 4px; margin-top: 3px; align-items: center; }
.chip-btn {
font-size: 11.5px; height: 22px; padding: 0 7px; border-radius: 5px;
border: 1px solid var(--line2); background: var(--panel3); color: var(--dim); cursor: pointer;
display: inline-flex; align-items: center; gap: 4px;
}
.chip-btn:hover { color: var(--text); border-color: #4a5364; }
.chip-btn .ic { width: 13px; height: 13px; }
.src-x { position: absolute; top: 5px; right: 5px; opacity: 0; }
.src:hover .src-x, .src.cur .src-x { opacity: 1; }
.src-status { font-size: 11px; color: var(--dim2); }
/* viewer */
.viewer { grid-row: 1; grid-column: 2; overflow: hidden; }
.screen { flex: 1; min-height: 120px; position: relative; background: #000; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.screen video, .screen .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.screen-empty, .screen-msg {
position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
color: var(--dim); text-align: center; padding: 20px; pointer-events: none;
}
.screen-msg { inset: auto 12px 12px auto; padding: 8px 12px; background: rgba(10,12,16,.85); border: 1px solid var(--line2); border-radius: 6px; font-size: 13px; color: var(--text); pointer-events: auto; max-width: 70%; text-align: left; }
.screen-msg.center { inset: 0; margin: auto; height: fit-content; width: fit-content; }
.transport { display: flex; align-items: center; gap: 12px; padding: 8px 12px 4px; flex: none; }
.tc-box { display: flex; align-items: baseline; gap: 6px; min-width: 250px; }
.tc { font: 15px var(--mono); letter-spacing: .3px; }
#tcCur { font-size: 18px; color: #fff; }
.tc-sep { color: var(--dim2); }
.tc-frame { font: 12px var(--mono); }
.editable { cursor: text; border-radius: 4px; padding: 1px 4px; margin: -1px -4px; }
.editable:hover { background: var(--panel3); }
.tc-input { font: inherit; width: 9.5em; background: #0b0d11; border: 1px solid var(--accent); border-radius: 4px; color: #fff; padding: 0 4px; outline: none; }
.tp-buttons { flex: 1; display: flex; justify-content: center; gap: 2px; }
.tbtn {
width: 36px; height: 34px; border-radius: 6px; border: 0; background: transparent; color: #cdd2db;
display: grid; place-items: center; cursor: pointer;
}
.tbtn:hover { background: var(--panel3); color: #fff; }
.tbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tbtn.play { width: 46px; height: 38px; background: var(--panel3); border: 1px solid var(--line2); margin: 0 6px; }
.tbtn.play svg { width: 22px; height: 22px; }
.tp-right { display: flex; align-items: center; gap: 4px; min-width: 250px; justify-content: flex-end; }
#volume { width: 90px; accent-color: var(--accent); }
.timeline-row { display: flex; gap: 8px; padding: 4px 12px; flex: none; align-items: stretch; }
.timeline { flex: 1; position: relative; height: 74px; }
#tlCanvas { width: 100%; height: 100%; display: block; border-radius: 6px; cursor: pointer; }
.tl-hover {
position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%);
background: #0b0d11; border: 1px solid var(--line2); border-radius: 6px; padding: 4px;
pointer-events: none; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 3px;
box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.tl-hover img { display: block; height: 72px; min-width: 40px; border-radius: 3px; background: #000; }
.tl-hover img:not([src]) { display: none; }
.tl-hover span { font: 12px var(--mono); }
.zoom { display: flex; flex-direction: column; gap: 3px; }
.zbtn { width: 38px; flex: 1; border-radius: 5px; border: 1px solid var(--line2); background: var(--panel3); cursor: pointer; font-size: 15px; line-height: 1; color: var(--dim); }
.zbtn.fit { font-size: 11px; }
.zbtn:hover { color: var(--text); }
.marks { display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px; flex: none; flex-wrap: wrap; }
.mark-btn .ic { color: var(--mark); }
.mark-val { display: flex; flex-direction: column; line-height: 1.15; min-width: 88px; }
.mark-val label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--dim2); }
.mark-val .tc { font-size: 14px; }
.mark-hint { margin: -4px 12px 10px; display: flex; flex-direction: column; gap: 6px; flex: none; }
.hint-row { padding: 6px 10px; border-radius: 6px; font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hint-row.warn { background: #3a2a10; border: 1px solid #6b4a17; color: #ffd9a0; }
.hint-row.edit { background: #1c2740; border: 1px solid #2f4a7d; color: #cfe0ff; }
.hint-row .ic { width: 15px; height: 15px; }
.hint-row .chip-btn { color: inherit; background: rgba(255,255,255,.06); }
/* clips */
.clips { grid-row: 2; grid-column: 1 / span 2; }
.seg { display: inline-flex; background: var(--panel3); border: 1px solid var(--line2); border-radius: 7px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 5px; cursor: pointer; color: var(--dim); font-size: 13px; }
.seg button.on { background: var(--accent); color: #fff; }
.clip-list { flex: 1; display: flex; gap: 10px; padding: 10px 12px; overflow-x: auto; overflow-y: hidden; align-items: flex-start; }
.clip-list:empty { display: none; }
.empty.row { flex-direction: row; }
.clip {
flex: none; width: 178px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line);
display: flex; flex-direction: column; overflow: hidden; cursor: pointer; position: relative;
border-top: 3px solid var(--c);
}
.clip:hover { border-color: var(--line2); border-top-color: var(--c); }
.clip.sel { border-color: var(--accent); border-top-color: var(--c); box-shadow: 0 0 0 1px var(--accent); }
.clip.dragging { opacity: .4; }
.clip.drop-before::before, .clip.drop-after::after {
content: ""; position: absolute; top: 0; bottom: 0; width: 3px; background: var(--accent); border-radius: 2px;
}
.clip.drop-before::before { left: 0; }
.clip.drop-after::after { right: 0; }
.clip-thumb { height: 80px; background: #000; position: relative; }
.clip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip-thumb .audio-only { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 26px; }
.clip-num { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.75); border-radius: 4px; padding: 0 6px; font: 600 12px var(--mono); }
.clip-dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.75); border-radius: 4px; padding: 0 6px; font: 12px var(--mono); }
.clip-warn { position: absolute; right: 6px; top: 6px; background: rgba(58,42,16,.92); color: var(--warn); border-radius: 4px; padding: 1px 4px; display: flex; }
.clip-warn .ic { width: 14px; height: 14px; }
.clip-body { padding: 6px 8px 2px; min-width: 0; }
.clip-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-range { font: 11.5px var(--mono); color: var(--dim); white-space: nowrap; }
.clip-actions { display: flex; justify-content: space-between; padding: 2px 4px 4px; opacity: .55; }
.clip:hover .clip-actions, .clip.sel .clip-actions { opacity: 1; }
.clip-actions button { background: none; border: 0; color: var(--dim); padding: 4px; border-radius: 5px; cursor: pointer; display: grid; }
.clip-actions button:hover { background: var(--panel3); color: var(--text); }
.clip-actions button.del:hover { color: var(--danger); }
.clip-actions .ic { width: 15px; height: 15px; }
/* dialogs */
.dlg {
background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 12px;
padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 40px);
box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.dlg[open] { display: flex; flex-direction: column; }
.dlg.small { width: min(460px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(5,6,9,.65); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.dlg-body { padding: 8px 18px 12px; overflow-y: auto; user-select: text; }
.dlg-body p { white-space: pre-line; }
.dlg-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.field { margin: 12px 0; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); margin-bottom: 6px; font-weight: 600; }
.label .dim { text-transform: none; letter-spacing: 0; font-weight: 400; }
.row { display: flex; gap: 8px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.dlg input[type=text], .dlg select {
height: 34px; background: #0f1217; border: 1px solid var(--line2); border-radius: 6px; padding: 0 9px; outline: none; min-width: 0;
}
.dlg input[type=text]:focus, .dlg select:focus { border-color: var(--accent); }
.dlg select { width: 100%; }
.row input[type=text] { flex: 1; }
.row select { width: auto; }
.radios { display: flex; gap: 18px; flex-wrap: wrap; }
.radios label, .rcard { cursor: pointer; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rcard { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel2); }
.rcard:has(input:checked) { border-color: var(--accent); background: #18233a; }
.rcard input { margin-top: 3px; }
.rcard b { display: block; margin-bottom: 2px; }
.rcard small { color: var(--dim); font-size: 12.5px; line-height: 1.35; display: block; }
.q-row input { flex: 1; accent-color: var(--accent); }
.hint { font-size: 12.5px; color: var(--dim); margin-top: 5px; }
.summary { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; color: #cfd5df; }
.notice { border-radius: 8px; padding: 9px 12px; margin: 12px 0; white-space: pre-line; font-size: 13px; }
.notice.warn { background: #3a2a10; border: 1px solid #6b4a17; color: #ffd9a0; }
.notice.error { background: #3a1416; border: 1px solid #7a2a2f; color: #ffc2c2; font-family: var(--mono); font-size: 12px; max-height: 220px; overflow: auto; }
.notice.ok { background: #10301f; border: 1px solid #1f6a43; color: #b8f0d2; }
.notice.ok .paths { font: 12px var(--mono); margin: 6px 0; word-break: break-all; }
.progress { margin: 14px 0 4px; }
.bar { height: 10px; background: var(--panel3); border-radius: 5px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #7fb0ff); transition: width .25s; }
.pinfo { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; }
/* file browser */
.dlg.files { width: min(760px, calc(100vw - 32px)); height: min(640px, calc(100vh - 40px)); }
.fb-bar { display: flex; gap: 6px; padding: 6px 18px 10px; }
.fb-bar select { width: auto !important; }
.fb-bar input { flex: 1; }
.fb-list { list-style: none; margin: 0 18px; padding: 4px; flex: 1; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #0f1217; min-height: 0; }
.fb-list li { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 5px; cursor: pointer; }
.fb-list li:hover { background: var(--panel2); }
.fb-list li.sel { background: #22375e; }
.fb-list li .ic { color: var(--dim); }
.fb-list li.dir .ic { color: #e2b45b; }
.fb-list .fb-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-list .fb-size { color: var(--dim2); font-size: 12px; font-family: var(--mono); }
.fb-list .fb-empty { color: var(--dim); justify-content: center; cursor: default; padding: 30px; }
.fb-save { display: flex; gap: 10px; align-items: center; padding: 10px 18px 0; }
.fb-save input { flex: 1; }
/* help */
.help ol.steps { padding-left: 20px; margin-top: 4px; }
.help ol.steps li { margin: 6px 0; }
.keys { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.keys td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.keys td:nth-child(odd) { white-space: nowrap; }
/* toasts */
.toasts { position: fixed; right: 16px; top: 62px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; z-index: 100; pointer-events: none; }
.toast {
background: #232834; border: 1px solid var(--line2); border-radius: 8px; padding: 9px 14px; max-width: min(520px, calc(100vw - 32px));
box-shadow: 0 8px 24px rgba(0,0,0,.5); pointer-events: auto; white-space: pre-line; animation: tin .18s ease-out;
}
.toast.error { border-color: #8a3036; background: #3a1a1d; }
.toast.ok { border-color: #1f6a43; background: #12301f; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
.offline { position: fixed; inset: 0; background: rgba(5,6,9,.85); display: grid; place-items: center; z-index: 200; }
.offline-box { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 24px 28px; max-width: 460px; text-align: center; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #333a47; border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 980px) {
.layout { grid-template-columns: 1fr; grid-template-rows: 160px minmax(0, 1fr) 232px; }
.sources { grid-row: 1; grid-column: 1; }
.viewer { grid-row: 2; grid-column: 1; }
.clips { grid-row: 3; grid-column: 1; }
.tc-box, .tp-right { min-width: 0; }
}