/* SRT Subtitle Generator — scoped to #srt. Uses the site tokens from site.css. */
#srt{display:flex;flex-direction:column;gap:18px}
#srt .tool-head{display:flex;flex-direction:column;gap:8px}
#srt .tool-head p{margin:0;color:var(--muted);max-width:68ch}
#srt .panel{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:14px;min-width:0}
#srt .drop{border:1.5px dashed var(--line);border-radius:14px;padding:20px;display:flex;gap:14px;align-items:center;flex-wrap:wrap;background:var(--panel);cursor:pointer}
#srt .drop.over,#srt .drop:focus-within{border-color:var(--accent)}
#srt .drop-ic{width:48px;height:48px;border-radius:12px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;flex:none}
#srt .drop-txt{display:flex;flex-direction:column;gap:2px;flex:1 1 240px;min-width:0}
#srt .drop-txt strong{font-size:16px}
#srt .fname{font-family:var(--f-mono);font-size:13px;overflow-wrap:anywhere}
#srt .opts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
#srt .field{display:flex;flex-direction:column;gap:6px;min-width:0}
#srt .field label{font-weight:500;font-size:14px;display:flex;justify-content:space-between;gap:8px}
#srt .field output{font-family:var(--f-mono);color:var(--accent)}
#srt select{width:100%;padding:10px 12px;border-radius:10px;border:1px solid var(--line);background:var(--bg);font:15px var(--f-sans);color:var(--fg)}
#srt input[type=range]{width:100%;accent-color:var(--accent)}
#srt .msg{margin:0;font-size:14px;color:var(--muted);min-height:1.4em}
#srt .msg.err{color:var(--bad)}
#srt .prog{display:flex;flex-direction:column;gap:6px}
#srt .prog-top{display:flex;justify-content:space-between;gap:10px;font-size:14px}
#srt .prog-top b{font-family:var(--f-mono);font-weight:500;font-variant-numeric:tabular-nums}
#srt .prog-bar{height:8px;border-radius:9px;background:var(--bg);overflow:hidden}
#srt .prog-bar i{display:block;height:100%;width:0;background:var(--accent);transition:width .3s}
#srt .player{display:flex;flex-direction:column;gap:0;border-radius:12px;overflow:hidden;background:#0e1116}
#srt .media-wrap video{display:block;width:100%;max-height:420px;background:#000}
#srt .media-wrap audio{display:block;width:100%;padding:12px;box-sizing:border-box}
#srt .cap{min-height:52px;padding:10px 14px;color:#fff;text-align:center;font-size:17px;line-height:1.35;white-space:pre-line;background:#0e1116}
#srt .res-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
#srt .res-head h2{margin:0}
#srt .segs{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;max-height:560px;overflow-y:auto}
#srt .seg{display:grid;grid-template-columns:34px 120px minmax(0,1fr);gap:10px;align-items:start;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
#srt .seg.on{border-color:var(--accent);background:var(--accent-soft)}
#srt .seg .n{font-family:var(--f-mono);font-size:12px;color:var(--muted);padding-top:6px;cursor:pointer}
#srt .seg .tm{display:flex;flex-direction:column;gap:4px}
#srt .seg .tm input{font:12.5px var(--f-mono);padding:4px 6px;border-radius:6px;border:1px solid var(--line);background:var(--panel);color:var(--fg);width:100%;box-sizing:border-box}
#srt .seg .tm input.bad{border-color:var(--bad)}
#srt .seg textarea{font:15px/1.4 var(--f-sans);padding:6px 8px;border-radius:8px;border:1px solid transparent;background:transparent;color:var(--fg);resize:vertical;min-height:44px;width:100%;box-sizing:border-box}
#srt .seg textarea:focus{border-color:var(--line);background:var(--panel)}
#srt .tips{font-size:14px;color:var(--muted);border-top:1px solid var(--line);padding-top:14px}
#srt .tips strong{color:var(--fg)}
#srt .tips ul{margin:6px 0 0;padding-left:18px;display:grid;gap:4px}
@media (max-width:760px){
  #srt .opts{grid-template-columns:1fr}
  #srt .seg{grid-template-columns:1fr}
  #srt .seg .n{padding:0}
  #srt .seg .tm{flex-direction:row}
}
#srt .meter{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
@keyframes srtpulse{from{opacity:.35}to{opacity:1}}
#srt .adv summary{cursor:pointer;font-weight:600;list-style:none;display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
#srt .adv summary::before{content:"+";font-family:var(--f-mono);color:var(--muted);width:12px}
#srt .adv[open] summary::before{content:"−"}
#srt .adv[open] summary{margin-bottom:6px}
#srt .adv{gap:0;padding-block:14px}#srt .adv[open]{gap:12px}
#srt .wait{display:flex;align-items:center;gap:10px;font-weight:600;font-size:16px}
#srt .spin{width:18px;height:18px;border-radius:50%;border:2.5px solid var(--accent-soft);border-top-color:var(--accent);animation:srtspin .9s linear infinite;flex:none}
@keyframes srtspin{to{transform:rotate(360deg)}}
#srt #progLabel{color:var(--muted);transition:opacity .35s}
#srt #progLabel.fade{opacity:0}
#srt .prog-bar i{transition:width .6s ease}
@media (prefers-reduced-motion:reduce){#srt .spin{animation-duration:3s}#srt #progLabel{transition:none}}
#srt .msg:empty{display:none}
