/* ============================================
   GoMovie · Pink Theme — 播放页专用样式
   ============================================ */

body.gm-no-x,
html.gm-no-x {
  overflow-x: hidden;
}

/* --- 预加载进度 --- */
.gm-prefetch-progress {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 40;
  display: none;
  pointer-events: none;
  background: rgba(157, 23, 77, 0.55);
  border: 1px solid rgba(251, 207, 232, 0.2);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 10px;
}

/* --- 伪全屏 --- */
.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 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid rgba(251, 207, 232, 0.15);
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 160ms ease;
}
.gm-pseudo-fullscreen-close:hover {
  background: rgba(236, 72, 153, 0.4);
}

.gm-pfs-toggle-btn {
  position: absolute;
  right: 12px; top: 12px;
  z-index: 10003;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 1px solid rgba(251, 207, 232, 0.1);
  cursor: pointer;
  transition: background 160ms ease;
}
.gm-pfs-toggle-btn:hover {
  background: rgba(236, 72, 153, 0.35);
}

.gm-pfs-rotate-hint {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background: rgba(157, 23, 77, 0.6);
  padding: 10px 18px;
  border-radius: 12px;
  z-index: 10003;
  display: none;
  font-size: 13px;
  backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
  .gm-pseudo-fullscreen-panel {
    width: 100%; height: 100%;
    max-width: none; max-height: none;
    border-radius: 0;
  }
}

/* --- 播放器容器 --- */
#player_wrap .aspect-video video,
#player_wrap > video {
  width: 100%; height: 100%;
  object-fit: contain;
  max-width: 100%;
}

.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;
}

/* --- 伪全屏横屏 --- */
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;
  }
}

/* --- 弹幕输入框粉色主题 --- */
#danmu_input {
  background: rgba(253, 242, 248, 0.5);
  border: 1px solid rgba(251, 207, 232, 0.5);
  border-radius: 0.75rem;
  color: #4a2040;
  transition: all 200ms ease;
}
#danmu_input::placeholder { color: rgba(180, 100, 140, 0.4); }
#danmu_input:focus {
  border-color: #f9a8d4;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.08);
  background: rgba(255, 255, 255, 0.85);
}

#danmu_send {
  color: rgba(180, 100, 140, 0.5);
  transition: color 160ms ease;
}
#danmu_send:hover { color: #ec4899; }

/* --- 选集面板粉色主题 --- */
#playlist .rounded-2xl {
  border-color: rgba(251, 207, 232, 0.4);
  background: rgba(253, 242, 248, 0.3);
}

#playlist a.bg-gradient-to-r {
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.2);
}

/* =====================
   安卓横屏安全区域适配
   ===================== */
@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 {
  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: #ec4899;
}

/* =====================
   选集抽屉 — 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: #ec4899;
  z-index: 10010;
  pointer-events: none;
  will-change: transform, opacity;
}
