/* ========= 视频容器基础样式 ========= */
.video-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 1rem auto;
    aspect-ratio: 16/9; /* 保持视频比例 */
    background-color: var(--deep-blue);
    
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
  }
  
  /* ========= 缩略图样式 ========= */
  .video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
    z-index: 2;

    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
  }
  /* 缩略图图片 */
.video-thumbnail img {

    border-radius: 8px;
    object-position: center center; /* 聚焦中心区域 */
    display: block; /* 去除图片默认间隙 */
    width: 100%;/*auto*/
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover; /* contain关键属性 */
    object-position: center center;
    margin: 0 auto;
}
  .video-thumbnail::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    transition: opacity 0.3s ease;
  }
  
  /* 悬停效果 */
  .video-thumbnail:hover::after {
    opacity: 0.5;
  }
  
  /* ========= 播放按钮样式 ========= */
  .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255,255,255,0.9);
    font-size: 4rem !important; /* 覆盖字体图标库默认大小 */
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none; /* 防止点击干扰 */
    z-index: 3;
  }
  
  /* 悬停动画 */
  .video-thumbnail:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    color: rgba(255,255,255,1);
  }
  
  /* ========= 视频元素样式 ========= */
  .video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1;
  }
  
  /* 视频激活状态 */
  .video-container video.active {
    opacity: 1;
    visibility: visible;
    z-index: 4;
  }
  
  /* ========= 状态类 ========= */
  /* 隐藏缩略图 */
  .video-thumbnail.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  
  /* 加载状态 */
  .video-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 5;
  }
  
  /* 错误状态 */
  .video-error::after {
    content: "⚠️ 视频加载失败";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    z-index: 5;
  }
  
  /* ========= 动画 ========= */
  @keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
  }
  
  /* ========= 响应式设计 ========= */
  @media (max-width: 640px) {
    .video-container {
      border-radius: 0;
      margin: 0 auto;
    }
    
    .play-icon {
      font-size: 3rem !important;
    }
  }
  
  /* ========= 浏览器兼容性处理 ========= */
  /* 隐藏原生控件直到悬停 */
  video::-webkit-media-controls {
    opacity: 0;
    transition: opacity 0.3s;
  }
  
  video:hover::-webkit-media-controls {
    opacity: 1;
  }
  
  /* 移动端点击高光移除 */
  .video-thumbnail {
    -webkit-tap-highlight-color: transparent;
  }