/* YouTube 新闻轮播 —— 全屏 / OBS 浏览器源
   ===========================================================================
   ★★★ 合规：本文件**不含任何遮挡、裁剪或覆盖 YouTube 播放器的样式**。
        播放器区域完整呈现，保留 YouTube 标识与广告（docs/40 §2）。
   ★★ 播放器层与图片层是**互斥**的两层，不是叠在一起 ——
        进图片时播放器已被 JS 销毁，这里也不留任何 z-index 覆盖关系。 */

html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  background: #000; overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #e6ecf3;
}

#stage { position: fixed; inset: 0; background: #000; }

/* ---- 播放器层 ---- */
#playerbox { position: absolute; inset: 0; background: #000; }
#playerbox iframe,
#playerbox #player { width: 100%; height: 100%; border: 0; display: block; }

/* ---- 图片层（与播放器层互斥，靠 hidden 切换） ---- */
#imagebox { position: absolute; inset: 0; background: #0b0f14; }
#imagebox[hidden] { display: none; }

#imagebox img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;               /* ★ 唯一允许的取值，绝不 cover */
  object-position: center center;
}

/* 空白处用同图放大模糊垫底，不额外请求 */
#imagebox .blurbg {
  position: absolute; inset: -6%;
  background-position: center center; background-size: cover;
  filter: blur(28px) brightness(.42) saturate(.9);
  transform: scale(1.08);
}

/* ---- 休息画面（2026-08-06）----
   出现时机：① 播放池为空 ② 整轮视频全部播放失败（fail() 的熔断）
   ★★★ object-fit 只允许 contain，**绝不 cover** ——
        这张图上有标题、两位老师头像和底部小字，cover 会把边裁掉，
        等于在播出画面上放一张残图。
   ★ z-index 高于 #pager 与 #idle：休息时不该同时出现页码或另一层待机文字。 */
#rest {
  position: absolute; inset: 0; z-index: 8;
  display: flex; align-items: center; justify-content: center;
  background: #000; overflow: hidden;
}
#rest[hidden] { display: none; }
#rest img {
  width: 100%; height: 100%;
  object-fit: contain;               /* ★ 唯一允许的取值 */
  object-position: center center;
  display: block;
}
/* 有图时文字退到底部做说明；无图时它是唯一内容，居中显示 */
.yn-rest-text {
  color: #8fa3b8; font-size: 34px; letter-spacing: .08em;
  text-align: center; padding: 0 6vw;
}
#rest img + .yn-rest-text {
  position: absolute; left: 0; right: 0; bottom: 3vh;
  font-size: 20px; color: rgba(230, 236, 243, .72);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .9);
}
/* ★ OBS 下休息画面同样铺满整个视口（与 body.obs 的画布规则一致） */
body.obs #rest { width: 100vw; height: 100vh; top: 0; left: 0; }
body.obs #rest img { width: 100vw; height: 100vh; }

/* ---- 待机 ---- */
#idle {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; letter-spacing: .12em; color: #8fa3b8; text-align: center;
  padding: 0 6vw;
}
#idle[hidden] { display: none; }

/* ---- 首次点击门（普通浏览器）---- */
#gate {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: rgba(0, 0, 0, .92); text-align: center; padding: 0 6vw;
}
#gate[hidden] { display: none; }
#gate button {
  font-size: 26px; padding: 18px 34px; border-radius: 12px; cursor: pointer;
  background: #1b2836; color: #e6ecf3; border: 1px solid rgba(255, 255, 255, .18);
}
#gate button:hover { background: #26384c; }
#gate p { margin: 0; color: #9fb2c6; font-size: 16px; }

/* ---- 页码 ---- */
#pager {
  position: absolute; right: 3vw; bottom: 3vh; z-index: 5;
  font-size: 20px; color: #b9c7d6; text-shadow: 0 2px 10px rgba(0, 0, 0, .8);
  pointer-events: none;              /* ★ 不挡播放器上的任何点击 */
}
#pager[hidden] { display: none; }

/* ---- 控制栏 ---- */
#bar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; z-index: 15;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(12, 18, 26, .82); border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px);
  opacity: 1; transition: opacity .35s ease;
}
#bar[hidden] { display: none; }
#bar button {
  min-width: 44px; height: 36px; border-radius: 8px; cursor: pointer;
  background: #1b2836; color: #e6ecf3; border: 1px solid rgba(255, 255, 255, .14);
  font-size: 16px; line-height: 1;
}
#bar button:hover { background: #26384c; }
#stat { font-size: 14px; color: #9fb2c6; margin-left: 6px; min-width: 120px; }

body.idle-ui #bar { opacity: 0; pointer-events: none; }
body.idle-ui { cursor: none; }

/* ★ OBS 模式：控制栏与鼠标一律不出现，不靠"自动隐藏"碰运气 */
body.obs #bar { display: none !important; }
body.obs { cursor: none !important; }

/* ---------------------------------------------------------------------------
   ★★★ OBS 纯画布（2026-08-06）
   ---------------------------------------------------------------------------
   ① 画布尺寸显式写成 100vw / 100vh。
      上面的 `#stage{position:fixed;inset:0}` 在效果上已经等于视口，
      这里再写一遍是为了**在样式表上一眼可查**"画布就是整个视口"，
      不用去推 fixed+inset 的等价关系。overflow:hidden 已在 html,body 上，
      所以 100vw 不会因滚动条宽度产生横向溢出。
   ② 页码角标一律不出现。JS 里已经 `elPager.hidden = OBS`，
      这里是**第二道**：万一将来有人改回无条件显示，样式还挡着。
      —— 播出画面上任何本站文字都是播出事故。
   ③ 不加任何遮挡/裁剪播放器的样式（合规底线，docs/40 §2 不变）。 */
body.obs #stage,
body.obs #playerbox,
body.obs #imagebox {
  width: 100vw; height: 100vh;
  top: 0; left: 0; right: auto; bottom: auto;
}
body.obs #playerbox iframe,
body.obs #playerbox #player {
  width: 100vw; height: 100vh; border: 0; display: block;
}
body.obs #pager { display: none !important; }
