/* 光影 Pro 审片室
   底色是调色棚那种中性灰，不带色偏，免得影响看片判断色彩；
   颜色只给人（五位评委各一色）和画面上的红色标记，梅紫留给「带队同步」这一个状态。 */
:root {
  --room: #232325;
  --panel: #2b2b2e;
  --raise: #343438;
  --line: #3b3b40;
  --ink: #ececee;
  --ink-2: #a4a4ab;
  --ink-3: #74747b;
  --plum: #b78ddb;
  --plum-deep: #5a2d82;
  --mark: #ff453a;
  --ok: #4cc38a;
  --warn: #e8a33d;
  --bad: #ff6b5e;
  --r: 6px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--room); color: var(--ink); font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  border: 1px solid var(--line); background: var(--raise); border-radius: var(--r);
  padding: 7px 14px; line-height: 1.2; transition: background .12s, transform .1s;
}
.btn:hover { background: #3d3d42; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: #1c1c1e; border-color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: #fff; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  font-size: 12px; font-weight: 600; color: #19191b; background: var(--c, #888);
}

/* ───── 登录 ───── */
#login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(360px, 100%); display: grid; gap: 10px; }
.login h1 { font-size: 26px; letter-spacing: -.01em; margin: 0 0 18px; font-weight: 600; }
.login label, .who-label { color: var(--ink-2); font-size: 13px; margin: 6px 0 0; }
.login input { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; }
.who { display: flex; flex-wrap: wrap; gap: 8px; }
.who button {
  display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 99px; padding: 4px 12px 4px 4px;
}
.who button[aria-pressed="true"] { border-color: var(--ink); background: var(--raise); }
.login .btn.primary { margin-top: 14px; padding: 10px; }
.err { color: var(--bad); min-height: 1.5em; margin: 0; font-size: 13px; }

/* ───── 片库 ───── */
#library { max-width: 1080px; margin: 0 auto; padding: 28px 16px 60px; }
.lib-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.lib-head h1 { font-size: 22px; margin: 0 auto 0 0; font-weight: 600; letter-spacing: -.01em; }
.quota { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.quota-bar { width: 120px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.quota-bar i { display: block; height: 100%; background: var(--ink-2); width: 0; transition: width .3s; }
.quota.tight .quota-bar i { background: var(--warn); }
.quota.full .quota-bar i { background: var(--bad); }
.me { display: flex; align-items: center; gap: 7px; background: none; border: 0; color: var(--ink-2); padding: 0; }

.upload-panel {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px 16px; align-items: end;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 22px;
}
.up-file { grid-column: 1 / -1; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.up-file b { color: var(--ink); font-weight: 600; margin-right: 10px; }
.upload-panel label { display: grid; gap: 5px; color: var(--ink-2); font-size: 13px; }
.upload-panel input { background: var(--room); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; color: var(--ink); }
.up-actions { display: flex; gap: 8px; }
.up-note { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--warn); }
.up-note:empty { display: none; }
.up-note.bad { color: var(--bad); }

.lib-table { display: grid; }
.lib-row {
  display: grid; grid-template-columns: 160px minmax(0, 1fr) 90px 110px 70px 70px 72px; gap: 18px; align-items: center;
  padding: 12px 8px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: 4px;
}
.lib-row:last-child { border-bottom: 1px solid var(--line); }
a.lib-row:hover { background: #29292c; }
.lib-head-row { color: var(--ink-3); font-size: 12px; padding-top: 0; padding-bottom: 8px; border-top: 0; }
.thumb { width: 160px; aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; border-radius: 3px; position: relative; overflow: hidden; }
.thumb.vertical { background-size: contain; }
.lib-name b { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-name span { color: var(--ink-2); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; }
.num.strong { color: var(--ink); font-weight: 600; font-size: 15px; }
.left-days { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.left-days.soon { color: var(--warn); }
.lib-empty, .lib-foot { color: var(--ink-3); font-size: 13px; }
.lib-foot { margin-top: 18px; }

/* 上传中的行 */
.lib-row.up { grid-template-columns: 160px minmax(0, 1fr) auto; }
.up-prog { display: grid; gap: 6px; }
.up-prog .bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.up-prog .bar i { display: block; height: 100%; background: var(--ink); width: 0; }
.up-prog .bar.paused i { background: var(--ink-3); }
.up-prog .bar.err i { background: var(--warn); }
.up-stat { display: flex; gap: 16px; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.up-btns { display: flex; gap: 8px; }

/* ───── 审片 ───── */
#review { height: 100%; }
.rv { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: 100%; }
.rv-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0 20px 12px; }
.rv-bar { display: flex; align-items: center; gap: 16px; height: 56px; flex: none; }
.back { color: var(--ink-2); text-decoration: none; font-size: 13px; padding: 4px 0; }
.back::before { content: ""; display: inline-block; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 1.6px 1.6px; transform: rotate(45deg); margin-right: 6px; vertical-align: 1px; }
.back:hover { color: var(--ink); }
.rv-title { min-width: 0; margin-right: auto; display: flex; align-items: baseline; gap: 12px; }
.rv-title b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-title span { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.peers { display: flex; }
.peers .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--room); position: relative; }
.peers .avatar.lead::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--plum); }
.btn.sync.on { background: var(--plum-deep); border-color: var(--plum); color: #fff; }

.follow-bar {
  display: flex; align-items: center; gap: 14px; flex: none; margin-bottom: 10px;
  padding: 8px 12px; border-radius: var(--r); background: rgba(90, 45, 130, .35); border: 1px solid rgba(183, 141, 219, .45);
  font-size: 13px;
}
.follow-bar .lat { color: var(--ink-2); font-variant-numeric: tabular-nums; margin-right: auto; }

.stage { position: relative; flex: 1 1 auto; min-height: 200px; background: #000; border-radius: 4px; overflow: hidden; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
#ink { position: absolute; left: 0; top: 0; touch-action: none; }
#ink.drawing { cursor: crosshair; }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--ink-2); padding: 24px; background: rgba(0,0,0,.6); }
.danmaku { position: absolute; top: 14px; right: 14px; display: grid; gap: 8px; justify-items: end; pointer-events: none; max-width: 60%; }
.dm {
  display: flex; gap: 8px; align-items: center; padding: 6px 12px 6px 6px; border-radius: 99px;
  background: rgba(20, 20, 22, .72); backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%);
  font-size: 14px; animation: dm-in .22s cubic-bezier(.2, .8, .2, 1);
}
.dm.out { opacity: 0; transform: translateX(12px); transition: opacity .3s, transform .3s; }
.dm .tcs { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12px; }
@keyframes dm-in { from { opacity: 0; transform: translateX(16px); } }

.controls { display: flex; align-items: center; gap: 6px; height: 52px; flex: none; }
.ctl { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r); border: 0; background: none; color: var(--ink); }
.ctl:hover { background: var(--raise); }
.ctl.play svg { fill: currentColor; stroke: none; width: 22px; height: 22px; }
.ctl:disabled { color: var(--ink-3); background: none; cursor: default; }
.tc { margin-left: 8px; font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
@media (max-width: 1180px) { .frame-no, #vol { display: none; } }
#tcNow { font-size: 22px; font-weight: 500; }
.tc-dur { color: var(--ink-3); font-size: 13px; margin-left: 6px; }
.frame-no { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; margin-left: 4px; min-width: 70px; }
.tools { display: flex; align-items: center; gap: 2px; margin-left: auto; padding: 0 6px; }
.tool { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r); background: none; color: var(--ink-2); }
.tool svg { width: 18px; height: 18px; }
.tool:hover { color: var(--ink); background: var(--raise); }
.tool[aria-pressed="true"] { color: var(--ink); background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); }
.swatches { display: flex; gap: 4px; margin: 0 6px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 0; background: var(--c); box-shadow: 0 0 0 2px var(--room); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--room), 0 0 0 3.5px var(--ink); }
#vol { width: 80px; accent-color: var(--ink-2); }

/* 时间轴：评论变成头像小圆点 */
.timeline { position: relative; height: 44px; flex: none; cursor: pointer; touch-action: none; outline: none; }
.tl-track { position: absolute; left: 0; right: 0; top: 26px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.tl-fill { display: block; height: 100%; width: 0; background: var(--ink-2); }
.tl-head { position: absolute; top: 18px; width: 2px; height: 20px; margin-left: -1px; background: var(--ink); border-radius: 1px; pointer-events: none; }
.timeline:focus-visible .tl-head { box-shadow: 0 0 0 2px var(--plum); }
.tl-marks { position: absolute; left: 0; right: 0; top: 0; height: 22px; }
.tl-mark {
  position: absolute; top: 2px; width: 18px; height: 18px; margin-left: -9px; padding: 0; border: 0;
  border-radius: 50%; font-size: 10px; font-weight: 700; color: #19191b; background: var(--c);
  box-shadow: 0 0 0 2px var(--room); transition: transform .12s;
}
.tl-mark.ink { box-shadow: 0 0 0 2px var(--room), 0 0 0 3.5px var(--mark); }
.tl-mark.done { opacity: .4; }
.tl-mark:hover, .tl-mark.on { transform: scale(1.25); z-index: 2; }
.tl-tip {
  position: absolute; bottom: 46px; transform: translateX(-50%); max-width: 280px; width: max-content;
  background: #1b1b1d; border: 1px solid var(--line); border-radius: var(--r); padding: 7px 10px; font-size: 13px;
  pointer-events: none; z-index: 5; box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.tl-tip .tcs { color: var(--ink-3); font-variant-numeric: tabular-nums; margin-right: 6px; }
.keys { margin: 4px 0 0; color: var(--ink-3); font-size: 12px; flex: none; }

/* 右栏 */
.rv-side { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; align-items: center; gap: 22px; padding: 0 18px; height: 56px; border-bottom: 1px solid var(--line); flex: none; }
.tab { border: 0; background: none; padding: 17px 0 15px; color: var(--ink-3); border-bottom: 2px solid transparent; font-weight: 500; }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.tab span { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 400; margin-left: 2px; }
.conn { margin-left: auto; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.conn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.conn.live::before { background: var(--ok); }
.conn.down { color: var(--warn); }
.conn.down::before { background: var(--warn); }
.pane { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }

.notes { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; flex: 1 1 auto; }
.note { display: grid; grid-template-columns: 24px 1fr; gap: 4px 10px; padding: 12px 18px; cursor: pointer; }
.note:hover { background: #303034; }
.note.on { background: #35353a; }
.note.done .note-text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.note.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: rgba(183, 141, 219, .28); } }
.note-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.note-head b { font-weight: 600; font-size: 13px; }
.note-tc { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-2); background: var(--room); border-radius: 4px; padding: 0 6px; }
.note-ink { width: 8px; height: 8px; border-radius: 50%; border: 1.6px solid var(--mark); align-self: center; }
.note-acts { margin-left: auto; display: flex; gap: 2px; opacity: 0; }
.note:hover .note-acts, .note:focus-within .note-acts { opacity: 1; }
.note-acts button { border: 0; background: none; color: var(--ink-3); font-size: 12px; padding: 0 4px; }
.note-acts button:hover { color: var(--ink); }
.note-text { grid-column: 2; white-space: pre-wrap; word-break: break-word; }
.notes-empty { color: var(--ink-3); padding: 24px 18px; font-size: 13px; }

.composer { border-top: 1px solid var(--line); padding: 12px 18px 16px; display: grid; gap: 8px; flex: none; }
.cmp-at { display: flex; gap: 10px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
#cmpInk { color: var(--mark); }
.composer textarea, .my-score textarea {
  resize: none; background: var(--room); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; color: var(--ink);
}
.composer textarea:focus, .my-score textarea:focus, .my-score input:focus { border-color: var(--ink-3); outline: none; }
.cmp-row { display: flex; align-items: center; }
.cmp-hint { color: var(--ink-3); font-size: 12px; margin-right: auto; }

#pane-score { overflow-y: auto; padding: 18px; gap: 18px; }
.verdict-sum { display: flex; align-items: baseline; gap: 14px; }
.verdict-sum .big { font-size: 40px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.verdict-sum .label { font-size: 15px; font-weight: 600; }
.verdict-sum .sub { color: var(--ink-3); font-size: 12px; display: block; margin-top: 2px; font-weight: 400; }
.score-list { list-style: none; margin: 0; padding: 0; display: grid; }
.score-list li { display: grid; grid-template-columns: 24px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.score-list .sc-note { grid-column: 2 / -1; color: var(--ink-2); font-size: 12px; margin-top: -4px; }
.score-list .sc-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.score-list .pending { color: var(--ink-3); }
.v-pass { color: var(--ok); } .v-unsure { color: var(--warn); } .v-fail { color: var(--bad); }
.my-score { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.ms-title { margin: 0; font-weight: 600; }
.verdicts { display: flex; gap: 8px; }
.verdicts label { flex: 1; }
.verdicts input { position: absolute; opacity: 0; pointer-events: none; }
.verdicts span { display: block; text-align: center; padding: 7px 0; border: 1px solid var(--line); border-radius: var(--r); font-weight: 600; cursor: pointer; }
.verdicts input:checked + span { background: var(--raise); border-color: currentColor; }
.verdicts input:focus-visible + span { outline: 2px solid var(--plum); outline-offset: 2px; }
.ms-score { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; }
.ms-score input { width: 90px; background: var(--room); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #f2f2f4; color: #1c1c1e; padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
  transition: opacity .18s, transform .18s; z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .rv { grid-template-columns: 1fr; height: auto; }
  .rv-main { padding: 0 16px 12px; }
  .stage { flex: none; aspect-ratio: 16 / 9; }
  .rv-side { border-left: 0; border-top: 1px solid var(--line); min-height: 60vh; }
  .controls { flex-wrap: wrap; height: auto; padding: 6px 0; }
  .tools { margin-left: 0; }
  .keys { display: none; }
  .lib-row { grid-template-columns: 112px minmax(0, 1fr) 60px; }
  .lib-row .hide-m { display: none; }
  .thumb { width: 112px; }
  .lib-head-row { display: none; }
  .upload-panel { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

