/* 1. 基础布局适配 */
.video-container {
  /* display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px; */
}

.video-item {
  position: relative;
  height: 100%;
  /* background: #000; */
  cursor: pointer;
  overflow: hidden;
  -webkit-touch-callout: none !important; /* 禁用系统默认菜单 */
  -webkit-user-select: none !important;
}

/* 2. 封面图与左下角图标 */
.poster,
.play-icon {
  position: absolute;
  transition: opacity 0.3s ease, visibility 0.3s;
  z-index: 2;
}

.poster {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-icon {
  left: 1rem;
  bottom: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
}

.play-icon-center {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  left: 0;
  bottom: 0;
}
.play-icon-center  > div {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 5rem;
  height: 5rem;
}
.play-icon-center  > div i {
  margin-left: 0.5rem;
  font-size: 3rem;
}

/* 3. 播放器插槽容器 */
.player-slot {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.player-slot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    inset: 0;
    z-index: 100;
     /* 必须高于视频层，低于控制条层 */
    background: transparent;
}

/* 确保控制条还是可以点的，控制条 z-index 设为 101 */
.xg-controls, .xgplayer-controls {
    z-index: 101 !important;
}

/* 4. 播放状态切换 */
.video-item.is-playing .player-slot {
  z-index: 10;
}

.video-item.is-playing .poster,
.video-item.is-playing .play-icon {
  opacity: 0;
  visibility: hidden;
}

/* 5. 核心：强制显示控制条的补丁 */
/* 兼容 v2 (.xgplayer-controls) 和 v3 (.xg-controls) */
.force-show-controls .xgplayer-controls,
.force-show-controls .xg-controls {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}
 .xgplayer .xg-options-list li {
  padding-bottom: 2rem;
}

/* 6. 初始存储容器：不可见但参与 DOM 渲染 */
#xgplayer-storage {
  position: absolute;
  width: 0;
  height: 0;
  left: -9999px;
  opacity: 0;
}


/* 7. 确保移动后的播放器样式归位 */
.player-slot #xgplayer-storage {
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  opacity: 1;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .video-container {
    /* grid-template-columns: 1fr; */
  }
}


@media (max-width: 767px) {
  .play-icon-center  > div {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 3rem;
    height: 3rem;
  }
  .play-icon-center  > div i {
    margin-left: 0.25rem;
    font-size: 1.5rem;
  }
}