/* default 主题 — play.html 内联样式提取 */

/* 防止整体横向溢出 */
html, body { max-width: 100%; box-sizing: border-box; }

/* 伪全屏样式 */
.gm-pseudo-fullscreen-backdrop{position:fixed;left:0;top:0;right:0;bottom:0;z-index:10000;background:rgba(0,0,0,0.95);display:flex;align-items:center;justify-content:center}
.gm-pseudo-fullscreen-panel{position:relative;width:100%;max-width:1400px;height:56.25vw;max-height:90vh;border-radius:12px;overflow:hidden;background:#000}
.gm-pseudo-fullscreen-panel .aspect-video{height:100%}
.gm-pseudo-fullscreen-close{position:absolute;right:12px;top:12px;z-index:10002;padding:8px 10px;border-radius:8px;background:rgba(0,0,0,0.55);color:#fff;border:none}
.gm-pfs-toggle-btn{position:absolute;right:12px;top:12px;z-index:10003;padding:8px;border-radius:8px;background:rgba(0,0,0,0.5);color:#fff;border:none}
/* 手机横屏提示 */
.gm-pfs-rotate-hint{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:#fff;background:rgba(0,0,0,0.6);padding:10px 14px;border-radius:8px;z-index:10003;display:none}
@media (max-width:768px){
  .gm-pseudo-fullscreen-panel{width:100%;height:100%;max-width:none;max-height:none;border-radius:0}
}

/* 保证 video 在容器内正确拉伸/裁剪 */
#player_wrap .aspect-video video, #player_wrap > video { width:100%; height:100%; object-fit:contain; max-width:100%; }

/* 确保 video 元素在各种包装结构下都能填充容器并按 object-fit 缩放 */
.video-js, .video-js * { box-sizing: border-box; }
.video-js, .video-js .vjs-tech, #player, #player.video-js { width: 100% !important; height: 100% !important; max-width: 100% !important; }
.video-js .vjs-tech, #player { object-fit: contain !important; object-position: center center !important; }

/* 在伪全屏横屏时，让 video 保持宽高比，两侧有黑边 */
body.gm-pseudo-fullscreen-active.gm-pfs-landscape .video-js,
body.gm-pseudo-fullscreen-active.gm-pfs-landscape .video-js .vjs-tech,
body.gm-pseudo-fullscreen-active.gm-pfs-landscape #player {
  width: auto !important;
  max-width: 100% !important;
  height: 100% !important;
  display: block !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  object-position: center center !important;
}

/* 横屏伪全屏特殊处理 */
body.gm-pseudo-fullscreen-active.gm-pfs-landscape .gm-pseudo-fullscreen-backdrop {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
}

body.gm-pseudo-fullscreen-active.gm-pfs-landscape .gm-pseudo-fullscreen-panel {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #000 !important;
}

/* 确保横屏时视频占满全屏高度，但宽度按比例自适应 */
body.gm-pseudo-fullscreen-active.gm-pfs-landscape #player_wrap .aspect-video {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  padding-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

/* 横屏时隐藏滚动条，防止影响全屏 */
body.gm-pseudo-fullscreen-active.gm-pfs-landscape {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

/* 横屏时强制全屏高度 */
@media (orientation: landscape) and (max-width: 768px) {
  .gm-pseudo-fullscreen-active .gm-pseudo-fullscreen-panel {
    height: 100vh !important;
    max-height: 100vh !important;
  }
  
  /* 横屏时视频居中显示，两侧留黑边 */
  .gm-pseudo-fullscreen-active .video-js,
  .gm-pseudo-fullscreen-active #player,
  .gm-pseudo-fullscreen-active .vjs-tech {
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }
}

/* =====================
   安卓横屏安全区域适配
   ===================== */
@supports (padding: env(safe-area-inset-right)) {
  body.gm-pseudo-fullscreen-active .gm-pseudo-fullscreen-backdrop {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
  }
}

/* =====================
   伪全屏工具栏 — fixed 定位，覆盖在视频可见区域的内右边
   位置和尺寸完全由 JS 通过 CSS 变量和 inline style 控制
   ===================== */
#gm_pfs_toolbar {
  display: none;
  position: fixed;
  z-index: 10005;
  /* 布局 */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--pfs-tb-gap, 12px);
  padding: 8px 0;
  /* 透明背景 — 按钮自带半透明底 */
  background: transparent;
  pointer-events: none; /* 容器不拦截，子元素拦截 */
  box-sizing: border-box;
}

body.gm-pseudo-fullscreen-active #gm_pfs_toolbar {
  display: flex;
}

#gm_pfs_toolbar button {
  /* 按钮大小由 CSS 变量控制，JS 根据视频高度动态设置 */
  width: var(--pfs-btn-size, 38px);
  height: var(--pfs-btn-size, 38px);
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s;
  pointer-events: auto; /* 子元素可点击 */
}
#gm_pfs_toolbar button:active {
  background: rgba(0,0,0,0.65);
}

#gm_pfs_toolbar button svg {
  width: var(--pfs-icon-size, 20px);
  height: var(--pfs-icon-size, 20px);
}

/* 点赞心形图标颜色 */
#gm_pfs_toolbar .pfs-like-icon {
  color: #ff4d6d;
}

/* =====================
   选集抽屉 — fixed 定位，覆盖在视频可见区域的内左边，透明背景
   ===================== */
#gm_pfs_toc {
  display: none;
  position: fixed;
  z-index: 10006;
  /* 透明背景 */
  background: rgba(0,0,0,0.0);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 6px;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#gm_pfs_toc::-webkit-scrollbar { width:0; height:0; }

#gm_pfs_toc .pfs-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

#gm_pfs_toc .pfs-toc-close {
  background: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gm_pfs_toc .pfs-toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 2px 30px 2px;
}

#gm_pfs_toc .pfs-toc-item {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  color: #fff;
  font-size: 13px;
  text-align: left;
  border: none;
  width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
#gm_pfs_toc .pfs-toc-item.active {
  background: rgba(255,255,255,0.18);
}
#gm_pfs_toc .pfs-toc-item:active {
  background: rgba(255,255,255,0.12);
}

/* 飞心动画 */
.gm-pfs-fly-heart {
  position: fixed;
  font-size: 26px;
  color: #ff4d6d;
  z-index: 10010;
  pointer-events: none;
  will-change: transform, opacity;
}
