/* ============================================================================
   video-slot.css —— 视频位通用样式（三套共用）
   ----------------------------------------------------------------------------
   换肤靠这几组变量（三套 tokens 里已有 --bg / --ink / --line 等，直接复用）：
     --vslot-bg        视频位底色（默认沿用 --bg-sub）
     --vslot-fg        图标/文字色（默认 --ink）
     --vslot-line      描边（默认 --line 或 --border）
     --vslot-ratio     嵌入态比例（默认 16 / 9）
   三套如需差异化，在各自 site.css 里覆盖变量即可，不要复制本文件。
   ============================================================================ */

.vslot {
  --vslot-bg: var(--bg-sub, #EDE8DF);
  --vslot-fg: var(--ink, #1A1815);
  --vslot-line: var(--border, rgba(26, 24, 21, 0.12));
  --vslot-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: var(--vslot-bg);
  color: var(--vslot-fg);
}

.vslot__poster,
.vslot__video,
.vslot__inline-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vslot__video,
.vslot__inline-video {
  z-index: 2;
  opacity: 0;
  transition: opacity var(--vslot-fade, 600ms) ease;
}

.vslot--playing .vslot__video,
.vslot--playing .vslot__inline-video {
  opacity: 1;
}

/* 自动播放中的 inline 视频：播放按钮降低存在感，不遮住画面 */
.vslot--inline.vslot--playing .vslot__play-icon {
  opacity: 0.6;
}

/* ---------- background 态：铺满父容器 ---------- */
.vslot--background {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.vslot--background.vslot--poster-only .vslot__poster {
  /* 只有 poster 时轻微压暗，保证上面压的文字可读（具体数值各套可覆盖） */
  filter: brightness(0.94);
}

/* 完全无素材：一块安静的底色，不写任何说明文字 */
.vslot--empty {
  background: var(--vslot-bg);
}

.vslot--empty::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 14px,
      color-mix(in srgb, var(--vslot-fg) 4%, transparent) 14px 15px
    );
  opacity: 0.5;
}

/* ---------- inline 态：占位框 + 播放按钮 ---------- */
.vslot--inline {
  aspect-ratio: var(--vslot-ratio);
  width: 100%;
}

.vslot__play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--vslot-fg);
}

.vslot__play-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid var(--vslot-line);
  background: color-mix(in srgb, var(--bg, #fff) 82%, transparent);
  backdrop-filter: blur(6px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.35s ease;
}

.vslot__play:hover .vslot__play-icon,
.vslot__play:focus-visible .vslot__play-icon {
  transform: scale(1.06);
  background: color-mix(in srgb, var(--bg, #fff) 94%, transparent);
}

.vslot__play:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

/* 无真实文件时的反馈：播放图标轻微回落，不做错误提示动画 */
.vslot--no-source .vslot__play-icon {
  opacity: 0.55;
}

/* ---------- entry 态：一条可点击的入口条 ---------- */
.vslot--entry {
  background: transparent;
  border-top: 1px solid var(--vslot-line);
  border-bottom: 1px solid var(--vslot-line);
}

.vslot-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md, 16px);
  padding-block: 14px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.vslot-entry__main,
.vslot-entry__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 0;
}

.vslot-entry__main {
  text-align: left;
}

.vslot-entry__main:hover,
.vslot-entry__meta:hover {
  opacity: 0.7;
}

.vslot-entry__main:focus-visible,
.vslot-entry__meta:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.vslot-entry__ics {
  display: inline-flex;
  opacity: 0.75;
}

/* ---------- 灯箱 ---------- */
.vslot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(10px);
  animation: vslot-fade 0.28s ease both;
}

.vslot-lightbox__inner {
  position: relative;
  width: min(1180px, 100%);
}

.vslot-lightbox__video {
  display: block;
  width: 100%;
  max-height: 82vh;
  background: #000;
}

.vslot-lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: transparent;
  color: #f5f5f7;
  cursor: pointer;
}

.vslot-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.vslot-lightbox__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

body.vslot-lock {
  overflow: hidden;
}

@keyframes vslot-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .vslot__video,
  .vslot__play-icon {
    transition: none;
  }
  .vslot-lightbox {
    animation: none;
  }
}
