/* ============================================================
   Preview · 审片室
   主舞台优先，右侧作为成片库。深色播放区刻意独立于应用主题，
   让视频始终保持清晰聚焦。
   ============================================================ */

.screening {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 16px;
  align-items: stretch;
  min-height: min(690px, calc(100dvh - 166px));
  margin: -6px -18px 0;
}

.screening__stage {
  display: flex;
  min-width: 0;
  min-height: 0;
}

/* ---------- 主舞台 ---------- */
.stage {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: var(--shadow-2), var(--sheen);
}

.stage__screen {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: clamp(12px, 2.4vw, 28px);
  overflow: hidden;
  background:
    radial-gradient(ellipse 72% 82% at 50% 46%, rgba(46, 107, 255, 0.13), transparent 66%),
    linear-gradient(135deg, #171b23 0%, #0a0c10 58%, #111722 100%);
}

.stage__screen::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 72%, transparent);
}

.stage__screen.is-unavailable {
  background:
    radial-gradient(ellipse 44% 42% at 50% 48%, rgba(137, 148, 170, 0.07), transparent 75%),
    linear-gradient(135deg, #11141a 0%, #090b0f 100%);
}

.stage__screen.is-unavailable::before { opacity: 0.09; }

.stage__screen video,
.stage__screen img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #050607;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.48);
}

.stage__missing {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 360px);
  padding: 28px 24px;
  color: #69717f;
  text-align: center;
}

.stage__checking {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 360px);
  padding: 28px 24px;
  color: #626b79;
  text-align: center;
}

.stage__checking-kicker {
  margin-bottom: 10px;
  color: #596270;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.14em;
}

.stage__checking-title {
  color: #838c9a;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stage__checking p {
  margin: 8px 0 0;
  color: #596270;
  font-size: 12.5px;
}

.stage__missing-kicker {
  margin-bottom: 10px;
  color: #505866;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.14em;
}

.stage__missing-title {
  color: #8a92a0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stage__missing-desc,
.stage__missing-hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
}

.stage__missing-desc { margin-top: 10px; color: #68717f; }
.stage__missing-hint { margin-top: 1px; color: #4f5866; }

.stage__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title actions"
    "tags actions";
  gap: 7px 16px;
  align-items: center;
  padding: 15px 16px 16px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-soft));
}

.stage__title {
  grid-area: title;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.012em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage__tags {
  display: flex;
  grid-area: tags;
  flex-wrap: wrap;
  gap: 6px;
}

.stage__tracks {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 26px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  background: var(--surface-2);
}

.stage__track {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur), color var(--dur), box-shadow var(--dur);
}

.stage__track i { font-size: 13px; }
.stage__track:hover:not(:disabled) { color: var(--text); }
.stage__track.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-1);
}
.stage__track:disabled { cursor: not-allowed; opacity: 0.45; }
.stage__track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.stage__tag {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1;
}

.stage__actions {
  display: flex;
  grid-area: actions;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.stage__empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 44px 24px;
  border: 1px dashed var(--border-2);
  border-radius: var(--r-panel);
  background:
    radial-gradient(circle at 50% 34%, var(--accent-soft), transparent 42%),
    var(--surface);
  text-align: center;
}

.stage__empty .state__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

/* ---------- 成片库 ---------- */
.screening__rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: var(--shadow-1), var(--sheen);
}

.screening__rail > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 17px 15px 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 680;
}

.screening__rail > h2::before {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  content: "▶";
  font-size: 10px;
}

.screening__list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 9px;
  overflow: auto;
}

.screening__list .state {
  margin: auto 0;
  padding: 24px 12px;
  text-align: center;
}

.screening__list .state__icon {
  width: 42px;
  height: 42px;
  margin-inline: auto;
  font-size: 19px;
}

.pvitem {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 10px;
  overflow: hidden;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  transition: background var(--dur), border-color var(--dur), box-shadow var(--dur), transform var(--dur);
}

.pvitem:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.pvitem:active { transform: translateY(1px); }

.pvitem:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pvitem.is-active {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.pvitem__thumb {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(46, 107, 255, 0.18), transparent 62%),
    var(--surface-3);
  color: var(--text-2);
  font-size: 20px;
}

.pvitem.is-active .pvitem__thumb {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 7px 14px color-mix(in srgb, var(--accent) 25%, transparent);
}

.pvitem__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 3px;
}

.pvitem__title {
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pvitem__meta {
  overflow: hidden;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pvitem.is-active .pvitem__meta { color: var(--accent-text); }

/* ---------- 响应式 ---------- */
@media (max-width: 1040px) {
  .screening { grid-template-columns: minmax(0, 1fr) 256px; }
  .stage__bar { padding: 13px 14px 14px; }
  .stage__actions { gap: 5px; }
  .stage__actions .btn { padding-inline: 9px; }
  .stage__actions .btn span { display: none; }
}

@media (max-width: 820px) {
  .screening {
    grid-template-columns: 1fr;
    min-height: 0;
    margin: 0;
  }

  .screening__stage { min-height: min(62dvh, 500px); }
  .screening__rail { min-height: 230px; max-height: 300px; }
  .screening__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
  .stage__empty { min-height: 300px; }
}

@media (max-width: 560px) {
  .screening__stage { min-height: 420px; }
  .stage__screen { padding: 10px; }
  .stage__bar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "tags" "actions";
    gap: 8px;
  }
  .stage__actions { justify-content: flex-start; }
  .stage__actions .btn { padding-inline: 10px; }
  .stage__actions .btn span { display: inline; }
  .screening__list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .pvitem { transition: none; }
}
