/* ========================================
   Template Group 14 - 新云影视
   responsive.css - Media Queries (Dark Theme)
   ======================================== */

/* Large Desktop (1200px+) */
@media (max-width: 1200px) {
  .container { max-width: 100%; }
  .card-grid { grid-template-columns: repeat(4, 1fr); }
  .hot-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Tablet Landscape (992px) */
@media (max-width: 992px) {
  .hot-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .section-flex { flex-direction: column; }
  .rank-sidebar { width: 100%; }
  .home-two-col { grid-template-columns: 1fr; }
  .search-box input { width: 180px; }
  .detail-header { flex-direction: column; }
  .detail-poster { width: 100%; max-width: 300px; margin: 0 auto; }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
  .top-bar .container { flex-wrap: wrap; gap: 10px; }
  .top-bar .logo { font-size: 18px; }
  .search-box { width: 100%; }
  .search-box input { width: 100%; }
  .search-box button { flex-shrink: 0; }
  .nav-bar .container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-bar a { padding: 10px 14px; font-size: 14px; white-space: nowrap; }
  .hot-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ranking-first { flex-direction: column; align-items: center; text-align: center; }
  .rank-poster { width: 100px; height: 140px; }
  .detail-header { padding: 16px; }
  .detail-info h1 { font-size: 22px; }
}

/* Phone (576px) */
@media (max-width: 576px) {
  .hot-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .section-flex { padding: 12px; }
  .ranking-section { padding: 12px; }
  .back-to-top { width: 36px; height: 36px; font-size: 14px; bottom: 20px; right: 20px; }
  .section-header h2, .section-header h3 { font-size: 16px; }
  .filter-bar { padding: 12px; }
  .play-sources { padding: 16px; }
  .synopsis { padding: 16px; }
  .comment-section { padding: 16px; }
}

/* ===== 骨架变体兜底（零特异性 :where，只补缺失、不覆盖已有样式） =====
 * 无论 dy_tpl_card 输出哪种结构，卡片都不错版/撑破。
 * 已有规则特异性 > 0，优先级恒高于本块。
 */
:where(ul.card-grid, ol.card-grid) { list-style: none; margin: 0; padding: 0; }
:where(.card-grid > li, .card-grid > div, .card-grid > a, .card-grid > article, .card-grid > figure) { min-width: 0; }
:where(a.card, .card) { display: block; text-decoration: none; }
:where(.card img, .poster img, .thumb img, span.thumb img, span.poster img) { width: 100%; height: 100%; object-fit: cover; display: block; }
:where(span.poster) { display: block; width: 100%; height: 100%; }
:where(.card-title) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:where(.card-meta) { display: block; }
:where(.info) { min-width: 0; }
