/* ==========================================================================
   视频站样式 · Gridline Video
   ========================================================================== */

/* ---------- 卡片 ---------- */
.cg-video-card {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow .18s ease, transform .18s ease;
}
.cg-video-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  transform: translateY(-2px);
}

.cg-video-card .clean-grid-grid-post-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}
.cg-video-card .clean-grid-grid-post-thumbnail > a { display: block; height: 100%; }
.cg-video-card .clean-grid-grid-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cg-video-card .clean-grid-grid-post-thumbnail .cg-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font: 700 28px/1 Oswald, Arial, sans-serif;
  color: rgba(255, 255, 255, .55);
}

/* 播放按钮 */
.cg-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.cg-play-badge svg { margin-left: 3px; }
.cg-video-card:hover .cg-play-badge { opacity: 1; transform: scale(1); }

/* 时长角标 */
.cg-duration-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font: 500 11px/1.5 Oswald, Arial, sans-serif;
  letter-spacing: .3px;
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
}
.cg-duration-badge.small { font-size: 10px; padding: 1px 4px; right: 4px; bottom: 4px; }

/* 卡片文字 */
.cg-video-card .clean-grid-grid-post-title {
  text-align: left;
  border-bottom: 0;
  padding: 9px 10px 2px;
  font: 700 14px/1.45 Poppins, 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}
.cg-video-card .clean-grid-grid-post-title a { color: #1a1a1a !important; }
.cg-video-card .clean-grid-grid-post-title a:hover { color: #c0392b !important; }

.cg-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 10px;
  font-size: 11.5px;
  color: #8b8b8b;
}
.cg-card-cat {
  background: #f2f2f2;
  color: #666;
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

/* ---------- 播放页 ---------- */
.cg-watch-wrap {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  padding: 14px 0 30px;
}
.cg-watch-main { flex: 1 1 auto; min-width: 0; }
.cg-watch-side { flex: 0 0 300px; width: 300px; }

.cg-player-box {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}
.cg-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  outline: none;
}
.cg-embed-ratio {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.cg-embed-ratio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.cg-player-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  color: #aaa;
  font-size: 14px;
}

.cg-watch-title {
  margin: 16px 0 8px;
  font: 700 24px/1.4 Poppins, 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  color: #111;
  letter-spacing: 0;
  border: 0;
  padding: 0;
}

.cg-watch-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #ececec;
  font-size: 12.5px;
  color: #8b8b8b;
}
.cg-watch-cat {
  background: #c0392b;
  color: #fff !important;
  padding: 2px 9px;
  border-radius: 3px;
  font-size: 12px;
}
.cg-watch-actions { margin-left: auto; }
.cg-icon-btn {
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.cg-icon-btn:hover { border-color: #c0392b; color: #c0392b; }

.cg-watch-desc {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #f7f7f7;
  border-left: 3px solid #c0392b;
  border-radius: 0 4px 4px 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: #444;
}
.cg-watch-body {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.8;
  color: #333;
}
.cg-watch-body img { max-width: 100%; height: auto; }

.cg-watch-main .cg-tags { margin: 16px 0 0; }

/* 相关推荐 */
.cg-related-block { margin-top: 28px; }
.cg-related-title {
  font: 700 16px/1.4 Poppins, 'PingFang SC', Arial, sans-serif;
  color: #111;
  margin: 0 0 6px;
  padding: 0 0 8px;
  border-bottom: 2px solid #c0392b;
  display: inline-block;
}
.cg-related-block .clean-grid-posts-container { padding: 0; }

/* 侧栏 */
.cg-side-box {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  padding: 14px;
  margin-bottom: 18px;
}
.cg-side-title {
  font: 700 15px/1.4 Poppins, 'PingFang SC', Arial, sans-serif;
  color: #111;
  margin: 0 0 10px;
  padding: 0 0 8px;
  border-bottom: 2px solid #c0392b;
}
.cg-side-list { list-style: none; margin: 0; padding: 0; }
.cg-side-list li + li { margin-top: 10px; }
.cg-side-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
}
.cg-side-rank {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: #eee;
  color: #888;
  font: 700 11px/18px Oswald, Arial, sans-serif;
  text-align: center;
}
.cg-side-rank.top { background: #c0392b; color: #fff; }
.cg-side-thumb {
  position: relative;
  flex: 0 0 96px;
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: #111;
  display: block;
}
.cg-side-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cg-side-thumb .cg-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, .5);
  font: 700 14px/1 Oswald, Arial, sans-serif;
}
.cg-side-info { min-width: 0; display: block; }
.cg-side-info strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font: 600 12.5px/1.45 Poppins, 'PingFang SC', Arial, sans-serif;
  color: #222;
}
.cg-side-info small { color: #999; font-size: 11px; }
.cg-side-list a:hover strong { color: #c0392b; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .cg-watch-side { flex-basis: 260px; width: 260px; }
}
@media (max-width: 900px) {
  .cg-watch-wrap { flex-direction: column; }
  .cg-watch-side { width: 100%; flex-basis: auto; }
  .cg-watch-title { font-size: 20px; }
}
@media (max-width: 640px) {
  .cg-video-card .clean-grid-grid-post-title { font-size: 13px; min-height: 38px; }
  .cg-watch-meta { gap: 9px; font-size: 12px; }
  .cg-play-badge { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
}

/* ---------- 列表网格：用 grid 替掉主题的 flex+float 混排 ---------- */
.clean-grid-posts .clean-grid-posts-container {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  justify-content: normal !important;
}
.clean-grid-posts .clean-grid-grid-post {
  float: none !important;
  width: auto !important;
  flex: none !important;
  margin: 0 !important;
  clear: none !important;
}

@media (max-width: 1000px) {
  .clean-grid-posts .clean-grid-posts-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}
@media (max-width: 800px) {
  .clean-grid-posts .clean-grid-posts-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}
@media (max-width: 520px) {
  .clean-grid-posts .clean-grid-posts-container {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 12px;
  }
}

/* grid 容器里的辅助元素不占格子 */
.clean-grid-posts .clean-grid-posts-container > .clear,
.cg-related-block .clean-grid-posts-container > .clear {
  display: none !important;
}
.clean-grid-posts .clean-grid-posts-container > .cg-empty,
.cg-related-block .clean-grid-posts-container > .cg-empty {
  grid-column: 1 / -1;
}
