/* 视频工作台 · 剪片台 */
/* 方向：暗色后期台 · 工业工整 · 琥珀强调（非霓虹） */

:root {
  --bg: #101216;
  --bg-soft: #171a20;
  --bg-panel: #1c2028;
  --ink: #e8eaee;
  --ink-dim: #9aa0ab;
  --ink-faint: #6b7280;
  --line: #262b35;
  --amber: #e0a458;
  --amber-deep: #c9853a;
  --amber-soft: #3a3126;
  --teal: #5fb3ad;
  --danger: #d36a5a;
  --radius: 10px;
  --mono: "SF Mono", "Menlo", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background:
    radial-gradient(1200px 500px at 80% -10%, #1b2029 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 1240px; margin: 0 auto; padding: 0 28px 48px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--amber); color: #15130e; font-weight: 800; font-size: 20px;
  border-radius: 9px; box-shadow: 0 6px 18px rgba(224,164,88,.25);
}
.brand h1 { font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--ink-dim); letter-spacing: 1.5px; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.select {
  background: var(--bg-panel); color: var(--ink); border: 1px solid var(--line);
  padding: 7px 10px; border-radius: 8px; font-size: 13px; min-width: 200px;
}
.select:focus { outline: 2px solid var(--amber); outline-offset: 1px; }

.pill {
  font-size: 12px; padding: 4px 12px; border-radius: 999px; font-weight: 600;
}
.pill-idle { background: #23262e; color: var(--ink-dim); }
.pill-run  { background: var(--amber-soft); color: var(--amber); animation: pulse 1.2s ease-in-out infinite; }
.pill-ok   { background: #20332e; color: var(--teal); }
.pill-err  { background: #3a2424; color: var(--danger); }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- 副导航 ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tab {
  background: none; border: none; color: var(--ink-dim); font-size: 14px; font-weight: 600;
  padding: 13px 16px 12px; cursor: pointer; position: relative; transition: color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--amber); }
.tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--amber); border-radius: 2px;
}

/* ---------- 面板 ---------- */
.panel { display: none; }
.panel.active { display: block; animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.panel-head { margin-bottom: 18px; }
.panel-head h2 { font-size: 21px; font-weight: 700; letter-spacing: .3px; }
.hint { font-size: 13px; color: var(--ink-dim); margin-top: 4px; max-width: 900px; }

.block { background: var(--bg-panel); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.block h3 { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 12px; letter-spacing: .3px; }

.row { display: grid; gap: 18px; }
.row.split { grid-template-columns: 1.3fr 1fr; }
@media (max-width: 860px) { .row.split { grid-template-columns: 1fr; } }
.col { min-width: 0; }

/* ---------- 列表 ---------- */
.listbox {
  max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); padding: 6px;
}
.listbox::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.listbox::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: #2c323d; border-radius: 4px; }

.item {
  display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 7px;
  cursor: pointer; border: 1px solid transparent; transition: background .12s, border-color .12s;
}
.item:hover { background: #20252e; }
.item.selected { background: var(--amber-soft); border-color: var(--amber); }
.item .name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: 11px; color: var(--ink-faint); font-family: var(--mono); }
.tag { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #262b35; color: var(--ink-dim); font-weight: 600; }
.tag.video { color: var(--teal); background: #1d2c2a; }
.tag.audio { color: var(--amber); background: var(--amber-soft); }

/* ---------- 表单 ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 12px; color: var(--ink-dim); }
.field input {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  padding: 9px 12px; border-radius: 8px; font-size: 14px; width: 120px;
}
.field input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }

.btn {
  border: 1px solid var(--line); background: #232833; color: var(--ink);
  padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: transform .1s, background .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: #2a313d; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.btn-primary { background: var(--amber); border-color: var(--amber); color: #17130c; }
.btn-primary:hover:not(:disabled) { background: #eab06a; }
.btn-accent { background: var(--teal); border-color: var(--teal); color: #0e1a18; }

/* ---------- 输出列表 ---------- */
.output-list { display: grid; gap: 8px; }
.out-file {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
.out-file .of-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.out-file a { color: var(--amber); text-decoration: none; font-size: 12px; white-space: nowrap; }
.out-file a:hover { text-decoration: underline; }
.out-file .of-none { color: var(--ink-faint); font-size: 13px; }

/* ---------- SRT 编辑器 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
#srtFileName { font-size: 13px; color: var(--ink-dim); flex: 1; font-family: var(--mono); }
.editor {
  width: 100%; min-height: 380px; background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 13px;
  font-family: var(--mono); line-height: 1.7; resize: vertical;
}
.editor:focus { outline: 2px solid var(--amber); outline-offset: 1px; }

/* ---------- 素材库 ---------- */
.filter { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip {
  background: var(--bg-panel); border: 1px solid var(--line); color: var(--ink-dim);
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.chip.active { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .12s, border-color .12s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--amber); }
.tile .thumb { height: 96px; background: var(--bg) center/cover no-repeat; display: grid; place-items: center; color: var(--ink-faint); font-size: 24px; }
.tile .t-name { padding: 8px 10px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .t-dir { padding: 0 10px 8px; font-size: 10px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { grid-column: 1/-1; text-align: center; color: var(--ink-faint); padding: 40px 0; }
.empty b { color: var(--ink-dim); }

/* ---------- 动效工作台 ---------- */
.table-wrap { overflow-x: auto; }
table.mt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.mt th {
  text-align: left; font-size: 11px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--ink-faint); padding: 8px 8px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg-panel); white-space: nowrap;
}
table.mt td { padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.mt tr:hover td { background: #1f242e; }
table.mt .tc { font-family: var(--mono); color: var(--ink-dim); white-space: nowrap; font-size: 11.5px; }
table.mt .txt { color: var(--ink); max-width: 260px; }
table.mt input, table.mt select {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  padding: 6px 8px; border-radius: 6px; font-size: 12px; width: 100%;
}
table.mt input:focus, table.mt select:focus { outline: 2px solid var(--amber); outline-offset: 0; }
select.opt { min-width: 96px; }
.foot-msg { margin-top: 12px; font-size: 12px; color: var(--ink-faint); }

/* ---- 剪辑渲染面板 ---- */
.field.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.field.inline span { white-space: nowrap; }
.render-status { min-height: 24px; padding: 8px 0; color: var(--ink-dim); font-size: 13px; }
.render-player video { margin-top: 8px; }
.render-player .log {
  white-space: pre-wrap; word-break: break-all;
  background: #14161c; border: 1px solid #2a2e38; border-radius: 10px;
  padding: 12px; font-size: 12px; line-height: 1.6;
  max-height: 320px; overflow: auto; color: #c9a86a;
}
