:root {
  --bg: #0f0f10;
  --panel: #18181b;
  --line: #2a2a2f;
  --text: #ececf1;
  --muted: #9a9aa5;
  --accent: #ff3b5c;
  --ok: #34c77b;
  --warn: #e8b13a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
main { max-width: 1400px; margin: 0 auto; padding: 24px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: rgba(15,15,16,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }
.search { flex: 1; max-width: 560px; margin: 0 auto; }
.search input { width: 100%; border-radius: 999px; }
nav { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.inline { display: inline; margin: 0; }

input, textarea { width: 100%; padding: 9px 12px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: inherit; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=file] { padding: 7px; }
input[type=checkbox] { width: auto; }
label { display: block; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
label input, label textarea { margin-top: 5px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn { display: inline-block; padding: 8px 16px; background: var(--accent); color: #fff; border: 0; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }
.danger { color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 16px; }
.card { display: block; min-width: 0; }
.card:hover { text-decoration: none; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--panel); border-radius: 12px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card:hover .thumb img { opacity: .9; }
.dur { position: absolute; right: 6px; bottom: 6px; padding: 1px 5px; background: rgba(0,0,0,.8); border-radius: 4px; font-size: 12px; font-weight: 600; }
.card-title { margin-top: 9px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }
.empty a { color: var(--accent); }
.h { font-size: 16px; color: var(--muted); font-weight: 600; }

.watch { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; }
.player { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; display: block; }
.vtitle { font-size: 20px; margin: 14px 0 8px; }
.vmeta { display: flex; align-items: center; gap: 14px; }
.chan { font-weight: 700; }
.desc { margin-top: 14px; padding: 12px 14px; background: var(--panel); border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.more { display: flex; flex-direction: column; gap: 18px; }
.more .h { margin: 0; }

.channel-head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.channel-head h1 { margin: 0; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 32px; font-weight: 800; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; max-width: 720px; margin-bottom: 20px; }
.narrow { max-width: 400px; margin: 40px auto; }
.notice { border-color: var(--ok); }
.notice code { display: block; margin: 10px 0; padding: 10px; background: var(--bg); border-radius: 8px; font-size: 16px; user-select: all; }
.row-head { display: flex; align-items: center; justify-content: space-between; }
.status { min-height: 1.4em; margin: 10px 0; color: var(--muted); }
.status.err { color: var(--accent); }
progress { width: 100%; height: 8px; accent-color: var(--accent); }

.table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line); }
.tag.ready { background: rgba(52,199,123,.15); color: var(--ok); }
.tag.failed { background: rgba(255,59,92,.15); color: var(--accent); }
.tag.queued, .tag.processing, .tag.uploading { background: rgba(232,177,58,.15); color: var(--warn); }

@media (max-width: 1000px) {
  .watch { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  main { padding: 16px; }
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .search { order: 3; flex-basis: 100%; }
  nav { margin-left: auto; gap: 12px; font-size: 14px; }
  .cols { grid-template-columns: 1fr; }
  .table { font-size: 13px; }
}
