/* ==========================================================================
   IDEEDA Tech — 全站视频卡片统一（Round 16）
   目标：三处视频卡片（首页 Sample Videos / Video Gallery 及分类页 / 案例栏目 Videos）
        尺寸、封面比例、标签与标题排版完全一致。

   规格（桌面 ≥1024，容器 1200）：
   - 栅格：3 列，gap 24px → 卡片约 384px 宽
   - 封面：16:9（384 × 216），object-fit: cover
   - 信息区：padding 16/18/18，标签 11px，标题 15px/700/1.45，两行截断
   - 卡片：圆角 14px，1px 边框 #E4EBF2，白底
   断点：1024 以下 2 列，768 以下 1 列。
   本文件最后加载，用 !important 覆盖各页面历史写法。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 栅格：四类容器统一 3 列
   -------------------------------------------------------------------------- */
.video-grid,
.video-grid-enhanced,
.cs-video-grid,
.tax-media-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 24px !important;
  padding: 0 !important;
  margin: 28px 0 0 !important;
  align-items: stretch !important;
}

.tax-media-grid {
  margin-top: 28px !important;
}

/* --------------------------------------------------------------------------
   2. 卡片外壳：统一圆角 / 边框 / 背景 / 等高
   -------------------------------------------------------------------------- */
.video-card,
.video-card-modal,
.cs-video-card,
.tax-media-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  border-radius: 14px !important;
  border: 1px solid #E4EBF2 !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(16, 43, 69, .04) !important;
  overflow: hidden !important;
  transition: transform .28s cubic-bezier(.16, 1, .3, 1), box-shadow .28s ease, border-color .28s ease !important;
}

.video-card:hover,
.video-card-modal:hover,
.cs-video-card:hover,
.tax-media-card:hover {
  transform: translateY(-4px) !important;
  border-color: #C9DAE8 !important;
  box-shadow: 0 12px 32px rgba(15, 44, 76, .12) !important;
}

/* --------------------------------------------------------------------------
   3. 封面：统一 16:9，清除历史 padding-bottom / min-height 写法
   -------------------------------------------------------------------------- */
.video-thumb,
.cs-video-thumb,
.tax-media-card__media {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  min-height: 0 !important;
  padding-bottom: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  background: #0F2440 !important;
}

/* 首页卡片封面是内联 background-image，绝不能在这里写 background 简写（会清掉图片） */
.video-thumb-modal {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  min-height: 0 !important;
  padding-bottom: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  background-color: #0F2440 !important;
}

.video-thumb-img,
.video-thumb-fb,
.video-preview,
.cs-video-poster,
.cs-video-preview,
.tax-media-card__media img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.cs-video-thumb {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 封面轻微放大，hover 有呼吸感但不影响文字清晰度 */
.tax-media-card__media img {
  transition: transform .4s ease !important;
}
.tax-media-card:hover .tax-media-card__media img {
  transform: scale(1.03) !important;
}

/* --------------------------------------------------------------------------
   4. 时长 / 角标：统一胶囊样式
   -------------------------------------------------------------------------- */
.video-duration,
.cs-video-duration,
.tax-media-card__dur {
  position: absolute !important;
  right: 12px !important;
  bottom: 12px !important;
  padding: 3px 9px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  letter-spacing: .02em !important;
  color: #fff !important;
  background: rgba(8, 26, 48, .72) !important;
  border-radius: 999px !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  z-index: 2 !important;
}

/* --------------------------------------------------------------------------
   5. 信息区：统一内边距与排版
   -------------------------------------------------------------------------- */
.video-info,
.video-info-modal,
.cs-video-info,
.tax-media-card__body {
  display: flex !important;
  flex-direction: column !important;
  padding: 16px 18px 18px !important;
  min-height: 104px !important;
  flex: 1 1 auto !important;
}

/* 标签 */
.video-tag,
.cs-video-tag,
.tax-media-card__tag {
  display: inline-block !important;
  width: fit-content !important;
  max-width: 100% !important;
  padding: 3px 10px !important;
  margin: 0 0 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.6 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  color: #0077B3 !important;
  background: rgba(0, 149, 218, .10) !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 标题：统一 15px / 两行，保证同一行卡片标题区高度一致 */
.video-info h4,
.video-info-modal h4,
.cs-video-info h4,
.tax-media-card__title {
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  color: #16202C !important;
  margin: 0 !important;
  min-height: 2.9em !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* 分类页摘要：与标题同字号体系，两行截断 */
.tax-media-card__excerpt {
  margin: 8px 0 0 !important;
  font-size: 12.5px !important;
  line-height: 1.6 !important;
  color: #6B7986 !important;
  -webkit-line-clamp: 2 !important;
}

/* --------------------------------------------------------------------------
   6. 链接容器不吃掉卡片高度
   -------------------------------------------------------------------------- */
.video-card-link {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  text-decoration: none !important;
  color: inherit !important;
}

/* 首页卡片 hover 时 main.js 会插入预览 <video>（z-index:2）。
   按钮层级提到 3 只是为了「未播放 / 加载中」时不被视频盖住；
   一旦真正开始播放，JS 会加 .is-previewing 让按钮淡出（见 play-buttons.css 3.5），
   这样橙色圆不会挡住画面。 */
.video-card-modal .video-play-overlay {
  z-index: 3 !important;
}

.video-card-modal.is-previewing .video-play-overlay {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* --------------------------------------------------------------------------
   7. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .video-grid,
  .video-grid-enhanced,
  .cs-video-grid,
  .tax-media-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }
}

@media (max-width: 767px) {
  .video-grid,
  .video-grid-enhanced,
  .cs-video-grid,
  .tax-media-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }
  .video-info,
  .video-info-modal,
  .cs-video-info,
  .tax-media-card__body {
    min-height: 0 !important;
    padding: 14px 16px 16px !important;
  }
  .video-info h4,
  .video-info-modal h4,
  .cs-video-info h4,
  .tax-media-card__title {
    min-height: 0 !important;
  }
}

/* --------------------------------------------------------------------------
   8. 竖屏视频（宽高比 < 1）
   16:9 卡片不改成竖版（会打乱栅格），改用 contain：完整画面居中，
   左右用深蓝底补齐，避免 cover 把 9:16 画面裁成中间一条。
   -------------------------------------------------------------------------- */
.video-thumb.is-portrait .video-thumb-img,
.video-thumb.is-portrait .video-preview,
.video-thumb-modal.is-portrait .video-preview,
.cs-video-thumb.is-portrait .cs-video-poster,
.cs-video-thumb.is-portrait .cs-video-preview,
.tax-media-card__media.is-portrait img {
  object-fit: contain !important;
  background-color: #0A1A2F !important;
}

/* 竖屏卡片左侧补一条极淡的内阴影，避免纯色留白显得空洞 */
.video-thumb.is-portrait,
.cs-video-thumb.is-portrait,
.tax-media-card__media.is-portrait {
  background: radial-gradient(circle at 50% 50%, #16324F 0%, #0A1A2F 70%) !important;
}
