@font-face { font-family: 'InterVT'; src: url('fonts/inter-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --ink: #14161a; --acc: #0b9c86; --accd: #08806d; --accbg: #e6f6f3; --bg: #f4f5f7; --panel: #fff; --line: #e1e4e8; --line2: #eef0f3;
  --tx: #17191d; --tx2: #5d6470; --tx3: #8d94a0; --ok: #16884a; --okbg: #e5f5ec; --warn: #b4560b; --warnbg: #fff4e5; --bad: #c0392b; --badbg: #fdecea;
  --mono: 'Cascadia Mono', Consolas, ui-monospace, monospace; color-scheme: light;
}
* { box-sizing: border-box }
html, body { height: 100%; margin: 0 }
body { background: var(--bg); color: var(--tx); font: 14px/1.45 InterVT, 'Segoe UI', system-ui, sans-serif; }
button, input, select { font: inherit; color: inherit }
[hidden] { display: none !important }
.app { min-height: 100vh; display: flex; flex-direction: column }
.top { height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 22px; gap: 14px; flex: none; position: sticky; top: 0; z-index: 20 }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: inherit; text-decoration: none }
.logo { width: 30px; height: 30px; background: var(--acc); display: grid; place-items: center; flex: none }
.top .sp { flex: 1 }
.top .meta { font-size: 12.5px; color: var(--tx2); display: flex; gap: 18px; align-items: center }
.top .meta b { color: var(--ok); font-weight: 600 }
.btn { height: 40px; padding: 0 18px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; color: var(--tx); white-space: nowrap }
.btn:hover { background: #f7f8fa }
.btn.pri { background: var(--acc); border-color: var(--acc); color: #fff } .btn.pri:hover { background: var(--accd) }
.btn.big { height: 52px; font-size: 16px; padding: 0 28px }
.btn.ghost { border-color: transparent; background: transparent; color: var(--tx2) } .btn.ghost:hover { color: var(--tx); background: #f0f1f4 }
.btn:disabled { opacity: .45; cursor: default }
.main { flex: 1; display: flex; min-height: 0 }
/* start */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 40px 20px }
.hero h1 { margin: 0; font-size: 44px; letter-spacing: -.03em; text-align: center; line-height: 1.1 }
.hero p.l { margin: 0; font-size: 17px; color: var(--tx2); text-align: center; max-width: 640px }
.drop { width: min(860px, 100%); height: 300px; border: 2px dashed #c3c8d0; background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; cursor: pointer; text-align: center; padding: 20px }
.drop:hover, .drop.over { border-color: var(--acc); background: #f5fcfa }
.drop .ic { width: 64px; height: 64px; background: var(--accbg); display: grid; place-items: center }
.drop b { font-size: 20px } .drop span { color: var(--tx2) } .drop u { color: var(--tx) }
.chips { display: flex; border: 1px solid var(--line); background: var(--panel); flex-wrap: wrap }
.chips button { border: 0; border-right: 1px solid var(--line); background: none; padding: 12px 20px; font-weight: 600; color: var(--tx2); cursor: pointer; text-align: center }
.chips button:last-child { border-right: 0 } .chips button.on { background: var(--ink); color: #fff }
.chips small { display: block; font-weight: 500; font-size: 11.5px; color: var(--tx3) } .chips button.on small { color: #c9ced6 }
.ticks { display: flex; gap: 28px; color: var(--tx2); font-size: 13.5px; flex-wrap: wrap; justify-content: center }
.ticks span::before { content: '\2713  '; color: var(--ok); font-weight: 700 }
.strip { background: var(--panel); border-top: 1px solid var(--line); padding: 14px 22px; display: flex; gap: 26px; align-items: center; font-size: 13px; color: var(--tx2); flex: none; flex-wrap: wrap }
.strip b { color: var(--tx); font-size: 11px; letter-spacing: .08em; text-transform: uppercase }
.strip a { color: var(--tx); text-decoration: none; font-weight: 600 } .strip a:hover { color: var(--accd) }
.strip a small { display: block; font-weight: 400; color: var(--tx3) }
.err { background: var(--badbg); color: var(--bad); padding: 12px 16px; max-width: 860px; width: 100%; border: 1px solid #f3c2bc }
/* editor */
.stage { flex: 1; display: flex; flex-direction: column; padding: 22px; gap: 14px; min-width: 0 }
.video { flex: 1; min-height: 300px; background: #0e1013; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center }
.video video, .video canvas, .video img { max-width: 100%; max-height: 100%; display: block }
.video .msg { color: #c9ced6; text-align: center; padding: 20px }
.tc { position: absolute; left: 14px; bottom: 12px; color: #fff; font: 600 12px var(--mono); background: rgba(0,0,0,.55); padding: 4px 8px }
.playbtn { position: absolute; right: 14px; bottom: 10px; height: 30px; border: 0; background: rgba(0,0,0,.55); color: #fff; padding: 0 12px; font-weight: 600; cursor: pointer }
.timeline { height: 86px; background: var(--panel); border: 1px solid var(--line); position: relative; padding: 12px 16px; overflow: hidden; user-select: none; flex: none }
.thumbs { display: flex; height: 44px; gap: 2px; position: relative; background: #e7e9ed; cursor: pointer }
.thumbs canvas, .thumbs i { flex: 1; min-width: 0; height: 44px; object-fit: cover; display: block; background: #dfe2e7 }
.trimbox { position: absolute; top: 0; bottom: 0; border: 3px solid var(--acc); box-shadow: 0 0 0 2000px rgba(244,245,247,.66); pointer-events: none }
.handle { position: absolute; top: -4px; bottom: -4px; width: 14px; margin-left: -7px; background: var(--acc); cursor: ew-resize; z-index: 2 }
.playhead { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); pointer-events: none; z-index: 3 }
.tl-lab { position: absolute; bottom: 6px; left: 16px; right: 16px; display: flex; justify-content: space-between; font: 500 11.5px var(--mono); color: var(--tx3) }
.side { width: 420px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; flex: none; overflow: auto }
.side .sec { padding: 18px 22px; border-bottom: 1px solid var(--line2) }
.side h4 { margin: 0 0 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--tx3) }
.files .f { display: flex; gap: 12px; align-items: center; padding: 8px 10px; margin: 0 -10px; cursor: pointer; border-left: 3px solid transparent }
.files .f.sel { background: var(--accbg); border-left-color: var(--acc) }
.files .f .fi { width: 40px; height: 40px; background: var(--accbg); display: grid; place-items: center; flex: none; overflow: hidden }
.files .f .fi canvas { width: 40px; height: 40px; object-fit: cover }
.files .f .w { flex: 1; min-width: 0 } .files .f b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.files .f span { font-size: 12px; color: var(--tx2); font-family: var(--mono) }
.files .f .x { border: 0; background: none; color: var(--tx3); cursor: pointer; font-size: 16px; padding: 4px 6px }
.files .f .st { font-size: 12px; font-weight: 700; color: var(--ok) } .files .f .st.bad { color: var(--bad) }
.seg { display: flex; border: 1px solid var(--line) }
.seg button { flex: 1; border: 0; border-right: 1px solid var(--line); background: var(--panel); height: 38px; font-weight: 600; color: var(--tx2); cursor: pointer; white-space: nowrap; padding: 0 6px; min-width: 0 }
.seg button:last-child { border-right: 0 } .seg button.on { background: var(--ink); color: #fff } .seg button:disabled { opacity: .4; cursor: default }
.target { display: flex; align-items: stretch; margin-top: 12px; border: 2px solid var(--ink) }
.target input { flex: 1; border: 0; font: 800 34px InterVT, system-ui; padding: 6px 14px; width: 100px; outline: none; min-width: 0 }
.target span { display: flex; align-items: center; padding: 0 16px; font-weight: 700; font-size: 18px; background: var(--bg); border-left: 1px solid var(--line) }
.quick { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap }
.quick button { border: 1px solid var(--line); background: var(--panel); padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--tx2); cursor: pointer }
.quick button:hover { border-color: var(--ink); color: var(--tx) }
.row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; margin-top: 10px }
.row label { font-size: 13px; color: var(--tx2) }
.est { background: var(--accbg); padding: 16px 22px; border-bottom: 1px solid var(--line2) }
.est .k { font-size: 12px; color: var(--tx2); font-weight: 600; letter-spacing: .02em }
.est .n { font-size: 30px; font-weight: 800; letter-spacing: -.02em } .est .s { font-size: 12px; color: var(--tx2); font-family: var(--mono) }
.est .q { font-size: 12.5px; color: var(--tx2); margin-top: 6px } .est .q.warn { color: var(--warn); font-weight: 600 }
.go { padding: 18px 22px; margin-top: auto; display: flex; flex-direction: column; gap: 10px }
.go .btn { width: 100% }
.note { font-size: 12px; color: var(--tx3); text-align: center }
.bar { height: 10px; background: var(--line2) } .bar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .2s }
.prog .lab { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px } .prog .lab b { font-family: var(--mono) }
/* done */
.done { flex: 1; display: flex; gap: 22px; padding: 26px; min-height: 0 }
.cmp { flex: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.cmpv { flex: 1; min-height: 300px; position: relative; background: #0e1013; overflow: hidden; cursor: ew-resize; user-select: none }
.cmpv video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain }
.cmpv .slider { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1px; background: #fff; pointer-events: none }
.cmpv .slider::after { content: '\27F7'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 40px; height: 40px; background: #fff; display: grid; place-items: center; font-weight: 800; color: var(--ink) }
.lab2 { position: absolute; top: 16px; color: #fff; font: 600 12px var(--mono); background: rgba(0,0,0,.6); padding: 5px 9px; pointer-events: none }
.res { width: 460px; display: flex; flex-direction: column; gap: 14px; flex: none; overflow: auto }
.card { background: var(--panel); border: 1px solid var(--line); padding: 22px }
.card .fn { font-size: 12px; color: var(--tx2); font-weight: 600; text-transform: uppercase; word-break: break-all }
.sizes { display: flex; align-items: center; gap: 16px; flex-wrap: wrap } .sizes .a { font-size: 22px; color: var(--tx3); text-decoration: line-through; font-weight: 700 } .sizes .b { font-size: 52px; font-weight: 800; letter-spacing: -.03em }
.saved { display: inline-block; background: var(--okbg); color: var(--ok); font-weight: 700; padding: 4px 10px; margin-top: 6px } .saved.warn { background: var(--warnbg); color: var(--warn) }
.kv { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 18px; font-size: 13px; margin-top: 14px }
.kv span { color: var(--tx2) } .kv b { font-family: var(--mono); font-weight: 600; text-align: right } .kv i { font-style: normal; text-align: right; color: var(--tx3); font-family: var(--mono) }
.queue .it { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line2); font-size: 13px; cursor: pointer }
.queue .it:first-of-type { border-top: 0 } .queue .it b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap } .queue .it span { font-family: var(--mono); color: var(--tx2) } .queue .it em { font-style: normal; color: var(--ok); font-weight: 700 }
.queue .it.sel b { color: var(--accd) }
.tip a { color: var(--accd); font-weight: 600; cursor: pointer }
.overlay { position: fixed; inset: 0; background: rgba(20,22,26,.35); display: grid; place-items: center; z-index: 50 }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; z-index: 60; font-size: 13px; max-width: 90vw }
.disc { font-size: 11.5px; color: var(--tx3) }
@media (max-width: 1000px) {
  .main, .done { flex-direction: column } .side, .res { width: auto; border-left: 0; border-top: 1px solid var(--line) }
  .hero h1 { font-size: 32px } .drop { height: 220px } .top .meta span + span { display: none } .video { min-height: 220px } .cmpv { min-height: 240px }
}
@media (max-width: 560px) { .top .meta { display: none } .chips button { flex: 1 1 45%; border-bottom: 1px solid var(--line) } .ticks { gap: 10px 18px } }
/* ---- Video to Text */
.opts { display: flex; gap: 0; border: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; align-items: stretch }
.opts > div { padding: 10px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; justify-content: center }
.opts > div:last-child { border-right: 0 }
.opts label.k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx3) }
.opts select { border: 1px solid var(--line); background: var(--panel); height: 32px; padding: 0 8px; min-width: 170px }
.opts .seg button { height: 32px; padding: 0 12px; flex: none }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; white-space: nowrap }
.chk input { width: 16px; height: 16px; accent-color: var(--acc) }
.tr { flex: none; width: 520px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0 }
.tr .hd { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px }
.tr .hd .r1 { display: flex; align-items: center; gap: 10px }
.tr .hd h3 { margin: 0; font-size: 15px; flex: 1 }
.tr .find { height: 34px; border: 1px solid var(--line); padding: 0 10px; width: 100%; outline: none }
.tr .find:focus { border-color: var(--acc) }
.tr .list { flex: 1; overflow: auto; padding: 6px 0 40px }
.sg { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 6px 18px 6px 15px; border-left: 3px solid transparent }
.sg:hover { background: #f8f9fb }
.sg.on { background: var(--accbg); border-left-color: var(--acc) }
.sg .t { border: 0; background: none; font: 600 12px var(--mono); color: var(--accd); cursor: pointer; text-align: left; padding: 3px 0; height: fit-content }
.sg .tx { outline: none; padding: 2px 4px; margin: 0 -4px; line-height: 1.55; font-size: 14.5px }
.sg .tx:focus { background: #fff; box-shadow: inset 0 0 0 1px var(--acc) }
.sg mark { background: #ffe58a; color: inherit }
.sg.pending .tx { color: var(--tx3) }
.tr .ft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap }
.tr .ft .btn { height: 36px; padding: 0 12px; font-size: 13px }
.stat { font-size: 12.5px; color: var(--tx2) } .stat b { color: var(--tx) }
.audioart { color: #c9ced6; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; padding: 20px }
.audioart audio { width: min(520px, 90%) }
.wave { width: 100%; height: 90px; display: block }
.capbox { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); max-width: 84%; text-align: center; color: #fff; background: rgba(0,0,0,.62); padding: 6px 12px; font-weight: 700; font-size: clamp(14px, 1.8vw, 20px); line-height: 1.3; pointer-events: none }
.menu { position: absolute; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(20,22,26,.18); z-index: 30; min-width: 230px; padding: 4px 0 }
.menu button { display: flex; width: 100%; border: 0; background: none; padding: 9px 14px; text-align: left; cursor: pointer; gap: 10px }
.menu button:hover { background: #f4f5f7 } .menu small { margin-left: auto; color: var(--tx3) }
@media (max-width: 1000px) { .tr { width: auto; border-left: 0; border-top: 1px solid var(--line); min-height: 420px } }
