/* Website browse refinement, 2026-10-29.
   Only home/category presentation. Keep data, templates, handlers, playback,
   navigation, embedded shells and car layouts under their existing owners. */
/* overflow-x:hidden makes body an overflow-y:auto box. The incumbent body's
   overscroll-behavior:none then blocks gestures reaching the document scroller.
   Permit chaining on browse screens; inline overlay locks still take priority. */
:where(html:not(.dwgj-car):not(.dwgj-embed)):has(#homeSection:not(.hidden) #homeMain, #catSection:not(.hidden)) body {
  overscroll-behavior-y: auto;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) :is(#homeMain, #catSection) {
  --browse-gutter: clamp(24px, 2.5vw, 40px);
  --browse-gap: 16px;
  max-width: 1600px;
  margin-inline: auto;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain {
  padding-top: 24px;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero {
  margin: 0 var(--browse-gutter) 32px !important;
  min-height: 400px !important;
  border-radius: 16px !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-content {
  padding: 32px 40px !important;
  gap: 14px !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-title {
  line-height: 1.16 !important;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-desc {
  max-width: 48ch;
  -webkit-line-clamp: 3 !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-mini {
  gap: 8px !important;
  padding: 16px !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-mini i {
  flex: 1 1 0;
  min-width: 0;
  max-width: 52px;
  width: auto !important;
  height: 64px !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-arrow {
  width: 44px !important;
  height: 44px !important;
  opacity: 1;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-arrow.prev {
  left: calc(50% + 16px);
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-block {
  margin: 0 0 28px !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-head {
  padding: 0 var(--browse-gutter) !important;
  margin-bottom: 12px !important;
  min-height: 44px;
  gap: 16px;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-head h3 {
  font-size: 20px !important;
  line-height: 1.4;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-head .more {
  min-height: 44px;
  padding: 0 4px;
  flex-shrink: 0;
  font-size: 13px;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-scroll {
  gap: var(--browse-gap) !important;
  padding: 4px var(--browse-gutter) 12px !important;
  scroll-padding-inline: var(--browse-gutter);
  scroll-snap-type: x proximity;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-card {
  --browse-card: clamp(144px, calc((min(100vw, 1600px) - 2 * var(--browse-gutter) - 7 * var(--browse-gap)) / 8), 176px);
  flex: 0 0 var(--browse-card) !important;
  width: var(--browse-card) !important;
  min-width: 0;
  scroll-snap-align: start;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-head {
  padding: 24px var(--browse-gutter) 20px !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-head h3 {
  margin-bottom: 16px !important;
  font-size: 24px !important;
  line-height: 1.4;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-filters {
  gap: 10px !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-filter-row {
  display: flex !important;
  align-items: flex-start;
  gap: 12px !important;
  min-width: 0;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-filter-label {
  flex: 0 0 40px !important;
  padding-top: 11px !important;
  margin: 0 !important;
  line-height: 18px;
  letter-spacing: 0 !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-genres {
  flex: 1 1 0;
  min-width: 0;
  gap: 8px !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-chip {
  min-height: 40px;
  padding: 8px 14px !important;
  font-size: 13px !important;
  line-height: 20px;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-chip.on {
  background: rgba(96, 165, 250, .14) !important;
  border-color: var(--accent) !important;
  color: #bfdbfe !important;
  font-weight: 650;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catGrid {
  padding: 0 var(--browse-gutter) !important;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)) !important;
  gap: 24px var(--browse-gap) !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-card .img,
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catGrid .poster .img {
  aspect-ratio: 2 / 3;
  border-radius: 12px !important;
  box-shadow: none !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-card .nm,
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catGrid .poster .name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2 !important;
  min-height: 2.8em;
  margin-top: 10px !important;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 14px !important;
  line-height: 1.4 !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-card .src,
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catGrid .poster .rmk {
  display: block;
  margin-top: 4px;
  font-size: 12px !important;
  line-height: 1.5 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-2) !important;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-more {
  min-height: 88px;
  padding-inline: var(--browse-gutter);
  font-size: 13px;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) :is(#homeMain, #catSection) button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
:where(html:not(.dwgj-car):not(.dwgj-embed)) :is(#homeMain, #catSection) button:disabled {
  opacity: .55;
  cursor: default;
}
@media (max-width: 920px) {
  :where(html:not(.dwgj-car):not(.dwgj-embed)) :is(#homeMain, #catSection) {
    --browse-gutter: 20px;
    --browse-gap: 14px;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-content {
    padding: 24px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-poster {
    min-height: clamp(200px, 44vw, 300px) !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-card {
    --browse-card: 144px;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-genres {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding: 2px 3px 6px !important;
    scroll-padding-inline: 3px;
    -webkit-overflow-scrolling: touch;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-chip {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 14px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-filter-label {
    padding-top: 15px !important;
  }
}
@media (max-width: 600px) {
  :where(html:not(.dwgj-car):not(.dwgj-embed)) :is(#homeMain, #catSection) {
    --browse-gutter: 16px;
    --browse-gap: 12px;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain {
    padding-top: 16px;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero {
    margin-bottom: 24px !important;
    border-radius: 12px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-content {
    padding: 20px !important;
    gap: 12px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-title {
    font-size: clamp(26px, 7vw, 34px) !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-mini {
    padding: 12px !important;
    gap: 5px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .hero-mini i {
    height: 48px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-head h3 {
    font-size: 18px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-card {
    --browse-card: calc((100vw - 2 * var(--browse-gutter) - 2 * var(--browse-gap)) / 3);
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-head {
    padding-top: 20px !important;
    padding-bottom: 16px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-head h3 {
    font-size: 22px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-filters {
    gap: 6px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-filter-row {
    gap: 8px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catSection .cat-filter-label {
    flex-basis: 32px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px var(--browse-gap) !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-card .nm,
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catGrid .poster .name {
    margin-top: 8px !important;
    font-size: 13px !important;
  }
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-card .src,
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #catGrid .poster .rmk {
    font-size: 11px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  :where(html:not(.dwgj-car):not(.dwgj-embed)) #homeMain .row-scroll {
    scroll-behavior: auto;
  }
}
