/* 移动端 / 播放页 / 触控 / 安全区 — 覆盖所有页面 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

.section-head > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.section-head > div:has(.section-icon) {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--gold);
  font-weight: 900;
}

.header-nav a,
.filter-chip,
.primary-btn,
.ghost-btn,
.header-search button,
.nav-toggle {
  min-height: 44px;
}

@media (max-width: 1100px) {
  .movie-grid,
  .cq-card-grid,
  .pick-grid,
  .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cat-grid,
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-slide {
    grid-template-columns: 1fr;
  }

  .hero-visual img {
    max-height: 360px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .container {
    width: min(1180px, calc(100% - 24px));
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .header-nav {
    display: none;
    width: 100%;
    order: 5;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .header-nav.open {
    display: flex;
  }

  .header-nav a {
    padding: 10px 12px;
    border-bottom: 0;
    border-radius: 10px;
  }

  .header-nav a:hover,
  .header-nav a.active {
    background: var(--blue-soft);
  }

  .header-search {
    max-width: none;
    flex: 1 1 160px;
  }

  .movie-grid,
  .cq-card-grid,
  .related-grid,
  .pick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .cat-grid,
  .category-grid,
  .category-grid.large,
  .note-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    max-width: 220px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-studio__intro,
  .page-hero {
    padding-top: 24px;
  }

  .player-section,
  .content-card,
  .page-panel {
    padding: 16px;
  }
}

@media (max-width: 540px) {
  .header-brand__title {
    font-size: 1rem;
  }

  .hero-bar h1,
  .hero-studio__intro h1,
  .page-hero h1,
  .detail-info h1 {
    font-size: 1.35rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .primary-btn,
  .hero-actions .ghost-btn {
    width: 100%;
  }

  .movie-grid.related-grid {
    grid-template-columns: 1fr;
  }

  .card-compact {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .card-compact .poster-frame {
    aspect-ratio: auto;
    height: 100%;
    min-height: 140px;
  }

  .footer-bar-inner {
    flex-direction: column;
  }

  .bbaseo-fly {
    transform: scale(0.88);
    transform-origin: left bottom;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bbaseo-fly__mark,
  .bbaseo-fly i,
  .movie-card,
  .tuy-card {
    animation: none;
    transition: none;
  }
}

@media print {
  .site-header,
  .bbaseo-fly,
  .hero-control {
    display: none !important;
  }
}

/* 播放页贴边，避免小屏裁切 */
@media (max-width: 768px) {
  .player-box {
    border-radius: 0;
    margin: 0 -16px;
  }

  .player-box video {
    max-height: none;
  }
}
