/* Video type 5: a bright, continuous channel shelf with grid fallbacks for catalog pages. */
:root {
  --v5-bg: #f4f6f8;
  --v5-surface: #ffffff;
  --v5-surface-alt: #e9edf1;
  --v5-ink: #17202a;
  --v5-muted: #66717d;
  --v5-line: #cbd2d9;
  --v5-accent: #1769aa;
  --v5-accent-ink: #ffffff;
  --v5-header: #ffffff;
  --v5-header-ink: #17202a;
  --v5-shadow: 0 5px 18px rgba(23, 32, 42, 0.09);
  --v5-radius: 4px;
  --v5-tile-width: 310px;
  --v5-media-ratio: 16 / 9;
  --v5-title-font: Arial, "Microsoft YaHei", sans-serif;
  --v5-ui-font: Arial, "Microsoft YaHei", sans-serif;
}

html {
  scroll-behavior: smooth;
}

.video-type-5,
.video-type-5 *,
.video-type-5 *::before,
.video-type-5 *::after {
  box-sizing: border-box;
}

.video-type-5 {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background: var(--v5-bg);
  color: var(--v5-ink);
  font: 14px/1.55 var(--v5-ui-font);
}

.video-type-5 a {
  color: inherit;
  text-decoration: none;
}

.video-type-5 button,
.video-type-5 input,
.video-type-5 select,
.video-type-5 textarea {
  max-width: 100%;
  font: inherit;
}

.video-type-5 img,
.video-type-5 video {
  display: block;
  max-width: 100%;
}

.video-type-5 :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--v5-accent);
  outline-offset: 3px;
}

.video-type-5 :where(h1, h2, h3, p, span, strong, small, em, a) {
  overflow-wrap: anywhere;
}

.v5-header {
  position: sticky;
  z-index: 100;
  top: 0;
  display: grid;
  min-height: 68px;
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--v5-line);
  background: var(--v5-header);
  color: var(--v5-header-ink);
  box-shadow: 0 2px 12px rgba(23, 32, 42, 0.06);
}

.v5-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 10px clamp(16px, 2.5vw, 34px);
  border-right: 1px solid var(--v5-line);
}

.v5-brand > :where(i, b:first-child) {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--v5-accent);
  color: var(--v5-accent);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0;
}

.v5-brand > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.v5-brand strong,
.v5-brand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v5-brand strong {
  font: 800 17px/1.2 var(--v5-title-font);
}

.v5-brand small {
  margin-top: 3px;
  color: var(--v5-muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.v5-nav,
.v5-actions {
  display: flex;
  min-width: 0;
  align-items: stretch;
}

.v5-nav {
  overflow-x: auto;
  scrollbar-width: none;
}

.v5-nav::-webkit-scrollbar {
  display: none;
}

.v5-nav a,
.v5-actions a,
.v5-actions button {
  display: flex;
  min-width: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(12px, 1.6vw, 22px);
  border: 0;
  border-right: 1px solid var(--v5-line);
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.v5-nav a:hover,
.v5-nav a.is-current,
.v5-actions a:hover,
.v5-actions button:hover {
  background: var(--v5-accent);
  color: var(--v5-accent-ink);
}

.v5-actions {
  border-left: 1px solid var(--v5-line);
}

.v5-actions input {
  width: clamp(120px, 13vw, 210px);
  min-width: 0;
  padding: 9px 12px;
  border: 0;
  background: var(--v5-surface-alt);
  color: var(--v5-ink);
}

.v5-actions input::placeholder {
  color: var(--v5-muted);
  opacity: 1;
}

.v5-main {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 3.5vw, 54px) clamp(16px, 4vw, 64px) 70px;
}

.v5-channel-intro {
  display: grid;
  min-height: 180px;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  align-items: end;
  gap: clamp(24px, 5vw, 80px);
  margin-bottom: clamp(32px, 5vw, 64px);
  padding: clamp(24px, 4vw, 56px) 0;
  border-top: 4px solid var(--v5-accent);
  border-bottom: 1px solid var(--v5-line);
}

.v5-channel-intro > * {
  min-width: 0;
}

.v5-channel-intro :where(h1, h2) {
  max-width: 920px;
  margin: 0;
  font: 800 clamp(32px, 5vw, 68px)/1.04 var(--v5-title-font);
  letter-spacing: 0;
}

.v5-channel-intro p {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--v5-muted);
  font-size: 14px;
  line-height: 1.75;
}

.v5-spotlight {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  margin-bottom: clamp(36px, 6vw, 76px);
  overflow: hidden;
  border: 1px solid var(--v5-line);
  border-radius: var(--v5-radius);
  background: var(--v5-surface);
  box-shadow: var(--v5-shadow);
}

.v5-spotlight .v5-tile-media {
  height: 100%;
  min-height: 360px;
  aspect-ratio: auto;
  border-right: 1px solid var(--v5-line);
}

.v5-spotlight .v5-tile-body {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  flex-direction: column;
  padding: clamp(24px, 4vw, 50px);
}

.v5-spotlight .v5-tile-title {
  margin: 10px 0 16px;
  font-size: clamp(25px, 3vw, 42px);
  -webkit-line-clamp: 3;
}

.v5-channel-section {
  min-width: 0;
  margin: 0 0 clamp(42px, 6vw, 78px);
}

.v5-channel-section > header,
.v5-main .head,
.v5-main .page-heading {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--v5-line);
}

.v5-channel-section > header > *,
.v5-main .head > *,
.v5-main .page-heading > * {
  min-width: 0;
}

.v5-channel-section > header :where(h2, h3),
.v5-main .head h2,
.v5-main .page-heading h1 {
  margin: 0;
  font: 800 clamp(21px, 2.4vw, 32px)/1.15 var(--v5-title-font);
  letter-spacing: 0;
}

.v5-channel-section > header p,
.v5-main .page-heading p {
  margin: 4px 0 0;
  color: var(--v5-muted);
  font-size: 11px;
}

.v5-channel-section > header > a,
.v5-main .section-action {
  flex: 0 0 auto;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--v5-accent);
  color: var(--v5-accent);
  font-size: 10px;
  font-weight: 800;
}

/* The shelf is deliberately horizontal; catalog wrappers remain grids below. */
.v5-channel-strip {
  display: grid;
  grid-auto-columns: minmax(230px, var(--v5-tile-width));
  grid-auto-flow: column;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 2px 2px 15px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 2px;
  scroll-snap-type: inline mandatory;
  scrollbar-color: var(--v5-accent) var(--v5-surface-alt);
  scrollbar-width: thin;
}

.v5-channel-strip > * {
  min-width: 0;
  scroll-snap-align: start;
}

.v5-channel-strip.is-at-start {
  border-inline-start-color: transparent;
}

.v5-channel-strip.is-at-end {
  border-inline-end-color: transparent;
}

.v5-shelf-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-height: 36px;
  margin: -8px 0 9px;
}

.v5-shelf-controls[hidden] {
  display: none;
}

.v5-shelf-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--v5-line);
  border-radius: var(--v5-radius);
  background: var(--v5-surface);
  color: var(--v5-ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.v5-shelf-button:hover:not(:disabled) {
  border-color: var(--v5-accent);
  background: var(--v5-accent);
  color: var(--v5-accent-ink);
}

.v5-shelf-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.v5-shelf-position {
  min-width: 62px;
  color: var(--v5-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.v5-tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--v5-line);
  border-radius: var(--v5-radius);
  background: var(--v5-surface);
  box-shadow: 0 2px 8px rgba(23, 32, 42, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.v5-tile:hover {
  border-color: var(--v5-accent);
  box-shadow: var(--v5-shadow);
  transform: translateY(-3px);
}

.v5-tile > a {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
}

.v5-tile-media {
  position: relative;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: var(--v5-media-ratio);
  background: var(--v5-surface-alt);
}

.v5-tile-media > :where(img, video, picture),
.v5-tile-media > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v5-tile-media > img,
.v5-tile-media > picture > img {
  transition: transform 300ms ease, filter 180ms ease;
}

.v5-tile:hover .v5-tile-media > img,
.v5-tile:hover .v5-tile-media > picture > img {
  transform: scale(1.025);
}

.v5-tile-badge {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 9px;
  max-width: calc(100% - 18px);
  padding: 4px 7px;
  overflow: hidden;
  border-radius: min(var(--v5-radius), 4px);
  background: var(--v5-accent);
  color: var(--v5-accent-ink);
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.v5-tile-body {
  display: flex;
  min-width: 0;
  min-height: 116px;
  flex: 1;
  flex-direction: column;
  padding: 13px 14px 14px;
}

.v5-tile-title {
  display: -webkit-box;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--v5-ink);
  font: 750 15px/1.42 var(--v5-title-font);
  letter-spacing: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.v5-tile-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  color: var(--v5-muted);
  font-size: 9px;
}

.v5-tile-meta > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v5-tile-meta > :last-child {
  flex: 0 1 auto;
  color: var(--v5-accent);
  font-weight: 800;
}

.v5-main :where(.grid, .v5-grid) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 15px;
  min-width: 0;
}

.v5-main :where(.grid, .v5-grid) > * {
  min-width: 0;
}

.v5-main .section {
  min-width: 0;
  margin-bottom: clamp(38px, 5vw, 68px);
}

.v5-footer {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.4fr) auto;
  gap: 32px;
  padding: 42px clamp(16px, 4vw, 64px) 20px;
  border-top: 4px solid var(--v5-accent);
  background: var(--v5-header);
  color: var(--v5-header-ink);
}

.v5-footer > * {
  min-width: 0;
}

.v5-footer p {
  margin: 0;
  color: var(--v5-muted);
  font-size: 11px;
  line-height: 1.8;
}

.v5-footer nav {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 9px 20px;
  flex-wrap: wrap;
  font-size: 10px;
  font-weight: 700;
}

.v5-footer nav a:hover {
  color: var(--v5-accent);
}

.v5-footer-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--v5-line);
  color: var(--v5-muted);
  font-size: 9px;
}

@media (max-width: 1180px) {
  .v5-main :where(.grid, .v5-grid) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v5-header {
    grid-template-columns: minmax(180px, auto) minmax(0, 1fr) auto;
  }

  .v5-actions {
    display: flex;
  }

  .v5-actions input {
    width: clamp(120px, 16vw, 180px);
  }

  .v5-actions button {
    padding-inline: 12px;
  }
}

@media (max-width: 820px) {
  .v5-header {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .v5-brand {
    min-height: 60px;
    border-right: 0;
    border-bottom: 1px solid var(--v5-line);
  }

  .v5-actions {
    min-width: 0;
    border-bottom: 1px solid var(--v5-line);
  }

  .v5-actions input {
    width: min(32vw, 150px);
  }

  .v5-nav {
    grid-column: 1 / -1;
    min-height: 48px;
  }

  .v5-nav a {
    min-height: 48px;
    padding-inline: 17px;
  }

  .v5-channel-intro,
  .v5-spotlight {
    grid-template-columns: 1fr;
  }

  .v5-channel-intro {
    min-height: 0;
  }

  .v5-spotlight .v5-tile-media {
    min-height: 0;
    aspect-ratio: var(--v5-media-ratio);
    border-right: 0;
    border-bottom: 1px solid var(--v5-line);
  }

  .v5-main :where(.grid, .v5-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  .v5-main {
    padding-inline: 12px;
  }

  .v5-channel-intro {
    gap: 16px;
    margin-bottom: 30px;
    padding-block: 25px;
  }

  .v5-channel-intro :where(h1, h2) {
    font-size: 34px;
  }

  .v5-channel-section > header,
  .v5-main .head,
  .v5-main .page-heading {
    align-items: flex-start;
  }

  .v5-channel-section > header :where(h2, h3),
  .v5-main .head h2,
  .v5-main .page-heading h1 {
    font-size: 22px;
  }

  .v5-channel-strip {
    grid-auto-columns: min(78vw, 300px);
    gap: 10px;
  }

  .v5-shelf-controls {
    margin-top: -5px;
  }

  .v5-main :where(.grid, .v5-grid) {
    gap: 14px 9px;
  }

  .v5-tile-body {
    min-height: 104px;
    padding: 10px;
  }

  .v5-tile-title {
    margin-bottom: 8px;
    font-size: 13px;
  }

  .v5-tile-meta {
    gap: 5px;
    font-size: 8px;
  }

  .v5-spotlight .v5-tile-body {
    padding: 20px;
  }

  .v5-spotlight .v5-tile-title {
    font-size: 25px;
  }

  .v5-footer {
    grid-template-columns: 1fr;
    padding-inline: 16px;
  }

  .v5-footer nav {
    justify-content: flex-start;
  }

  .v5-footer-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .v5-header {
    grid-template-columns: 1fr;
  }

  .v5-actions {
    grid-row: 2;
    width: 100%;
    min-height: 46px;
  }

  .v5-actions input {
    width: auto;
    flex: 1;
  }

  .v5-nav {
    grid-row: 3;
  }
}

@media (max-width: 360px) {
  .v5-main :where(.grid, .v5-grid) {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .video-type-5 *,
  .video-type-5 *::before,
  .video-type-5 *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
