:root {
  --bg: #0f1117; --panel: #181b24; --panel2: #1f2330; --line: #2a2f3f;
  --text: #e8eaf2; --muted: #8b91a7; --accent: #7c5cff; --accent2: #a78bff;
  --new: #2ee6a6; --danger: #ff6b6b; --radius: 12px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 0; }
[hidden] { display: none !important; }

button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 8px 14px; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .6; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
button.primary:hover { background: var(--accent2); }
button.ghost { background: transparent; }
input { font: inherit; width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin-top: 6px; }
input:focus-visible, button:focus-visible, .drop:focus-visible, .thumb:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.login { width: min(380px, 100%); display: grid; gap: 14px; }
.login label { display: block; font-size: 13px; color: var(--muted); }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.brand.big { font-size: 22px; }
.logo { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent); font-size: 12px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(15,17,23,.92); backdrop-filter: blur(6px); z-index: 5; }
.who { display: flex; gap: 12px; align-items: center; color: var(--muted); }
main { max-width: 1100px; margin: 0 auto; padding: 20px; display: grid; gap: 18px; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px 16px; text-align: center; background: var(--panel); cursor: pointer; transition: .15s; }
.drop p { margin: 6px 0; }
.drop-icon { font-size: 26px; color: var(--accent2); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--panel2); }
.drop small { color: var(--muted); }

.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.queue li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.q-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-status { color: var(--muted); white-space: nowrap; }
.q-err .q-status { color: var(--danger); }
.bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }

.feedhead { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.group { display: grid; gap: 10px; margin-bottom: 18px; }
.ghead { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #0f1117; }
.gname { font-weight: 600; }
.gcount { color: var(--muted); font-size: 13px; }
.pill { background: var(--new); color: #06281d; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; letter-spacing: .04em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.clip { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; }
.clip.new { border-color: var(--new); box-shadow: 0 0 0 1px var(--new), 0 0 22px rgba(46,230,166,.28); }
.thumb { display: block; width: 100%; aspect-ratio: 16/9; padding: 0; border: 0; border-radius: 0; background: linear-gradient(135deg, #232842, #171a28); position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); opacity: .85; }
.thumb:hover .play { opacity: 1; transform: scale(1.08); }
.badge { position: absolute; top: 8px; left: 8px; z-index: 1; }
.meta { padding: 10px 12px; display: grid; gap: 4px; }
.title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12.5px; gap: 8px; }
.acts { display: flex; gap: 6px; }
.acts a, .acts button { color: var(--muted); font-size: 12px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); background: transparent; text-decoration: none; }
.acts a:hover, .acts button:hover { color: var(--text); border-color: var(--accent); }
.acts .del:hover { color: var(--danger); border-color: var(--danger); }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: #000; color: var(--text); padding: 0; width: min(1000px, 94vw); overflow: hidden; }
dialog::backdrop { background: rgba(0,0,0,.75); }
dialog video { display: block; width: 100%; max-height: 80vh; background: #000; }
#ptitle { padding: 10px 14px; background: var(--panel); }
#close { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(0,0,0,.6); }

@media (max-width: 520px) { main { padding: 12px; } .grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }

.opts { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; margin-top: -6px; }
.opts label, .ed-opts label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.opts input, .ed-opts input { width: auto; margin: 0; accent-color: var(--accent); }
dialog.editor { background: var(--panel); padding: 16px; width: min(760px, 94vw); gap: 12px; }
dialog.editor[open] { display: grid; }
.editor video { max-height: 46vh; border-radius: 8px; }
.editor .name { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.editor .name input { margin: 0; font-size: 16px; }
.ed-file { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -6px; }
.ed-cut { display: grid; gap: 12px; }
#ed-note { margin: 0; }
.range { position: relative; height: 28px; margin: 4px 8px; }
.range-track { position: absolute; left: 0; right: 0; top: 11px; height: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; }
.range-fill { position: absolute; top: -1px; bottom: -1px; background: var(--accent); border-radius: 99px; }
.range-head { position: absolute; top: -7px; bottom: -7px; width: 2px; margin-left: -1px; background: #fff; opacity: .85; pointer-events: none; }
.range input[type=range] { position: absolute; left: 0; top: 0; width: 100%; height: 28px; margin: 0; padding: 0; background: none; border: 0; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 28px; }
.range input[type=range]::-moz-range-track { background: transparent; height: 28px; }
.range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 28px; border-radius: 6px; background: var(--accent2); border: 2px solid #fff; box-sizing: border-box; cursor: ew-resize; }
.range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 28px; border-radius: 6px; background: var(--accent2); border: 2px solid #fff; box-sizing: border-box; cursor: ew-resize; }
.range input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid #fff; outline-offset: 2px; }
.range-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.range-info b { color: var(--text); font-variant-numeric: tabular-nums; }
.range-info span { text-align: center; }
.ed-opts { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: flex-end; font-size: 13.5px; }
#ed-est { margin: 0; font-size: 13px; }
.ed-actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 520px) { .range-info { flex-wrap: wrap; justify-content: center; } }
.btn { display: inline-block; text-decoration: none; font: inherit; border-radius: 8px; padding: 8px 18px; border: 1px solid var(--line); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent2); }
.guest { cursor: default; display: grid; gap: 10px; justify-items: center; border-style: solid; }
.guest:hover { border-color: var(--line); background: var(--panel); }
.login .back { text-align: center; font-size: 13px; }
.login .back a { color: var(--muted); }
