/* RiveStream — dark streaming home (rivestream.app inspired) */

:root {
  --rive-bg: #0b0c10;
  --rive-bg-2: #12141a;
  --rive-surface: #181b22;
  --rive-text: #f2f3f5;
  --rive-muted: #9aa0ad;
  --rive-line: rgba(255, 255, 255, 0.08);
  --rive-accent: #6c8cff;
  --rive-radius: 12px;
  --rive-header-h: 64px;
  --rive-gap: 28px;
  --rive-card-w: 140px;
}

.rive-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.type_tab .tit h1 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  display: inline;
}

.page-detail .info .con .tit {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

body.theme-rive {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(108, 140, 255, 0.16), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(80, 200, 180, 0.08), transparent 50%),
    var(--rive-bg);
  color: var(--rive-text);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.theme-rive a {
  color: inherit;
  text-decoration: none;
}

body.theme-rive img {
  max-width: 100%;
  vertical-align: middle;
}

/* —— Header (site-wide) —— */
.rive-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--rive-header-h);
  background: rgba(11, 12, 16, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rive-line);
  color: var(--rive-text);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.rive-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.rive-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--rive-text);
  text-decoration: none;
}

.rive-brand img {
  height: 28px;
  width: auto;
  border-radius: 6px;
}

.rive-brand-name {
  background: linear-gradient(90deg, #fff 0%, #b8c7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rive-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rive-nav::-webkit-scrollbar {
  display: none;
}

.rive-nav-link {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--rive-muted);
  font-size: 1.05rem;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.rive-nav-link:hover,
.rive-nav-link.is-active {
  color: var(--rive-text);
  background: rgba(255, 255, 255, 0.06);
}

.rive-search {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: min(280px, 36vw);
  height: 38px;
  padding: 0 4px 0 14px;
  border-radius: 999px;
  background: var(--rive-surface);
  border: 1px solid var(--rive-line);
}

.rive-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--rive-text);
  font-size: 0.875rem;
}

.rive-search-input::placeholder {
  color: var(--rive-muted);
}

.rive-search-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--rive-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.rive-search-btn:hover {
  color: var(--rive-text);
}

/* —— Mobile topbar controls (coreflix-style) —— */
.rive-menu-toggle,
.rive-brand-mobi,
.rive-search-trigger {
  display: none;
}

.rive-menu-toggle {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: var(--rive-surface);
  color: var(--rive-text);
  cursor: pointer;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.rive-menu-toggle:active {
  background: rgba(255, 255, 255, 0.1);
}

.rive-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  gap: 4px;
  width: 16px;
  height: 16px;
}

.rive-menu-grid i {
  display: block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 1px;
}

.rive-menu-grid i:first-child {
  width: 5px;
  height: 5px;
  place-self: center;
  transform: rotate(45deg);
}

.rive-brand-mobi {
  flex: 1;
  min-width: 0;
}

.rive-brand-mobi a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.rive-logo-mobi {
  display: block;
  height: 28px;
  width: auto;
  max-width: 36px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 6px;
}

.rive-brand-name-mobi {
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(90deg, #fff 0%, #b8c7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.rive-search-trigger {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--rive-muted);
  cursor: pointer;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  -webkit-tap-highlight-color: transparent;
}

.rive-search-trigger:active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--rive-text);
}

.rive-search-panel {
  display: none;
}

.rive-menu-drawer {
  display: none;
}

.rive-sidebar-mask {
  display: none;
}

/* —— Main / sections —— */
.rive-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 0 48px;
}

.rive-section {
  margin-bottom: var(--rive-gap);
}

.rive-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 12px;
}

.rive-section-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--rive-text);
}

.rive-section-title a {
  color: inherit;
  text-decoration: none;
}

.rive-section-title a:hover {
  color: var(--rive-accent);
}

.rive-section-more {
  flex-shrink: 0;
  color: var(--rive-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.rive-section-more:hover {
  color: var(--rive-text);
}

.rive-swipe-hint {
  display: none !important;
}

/* —— Home grid (no swipe) —— */
.rive-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px 14px;
}

.rive-grid .rive-card {
  flex: none;
  width: auto;
  min-width: 0;
  scroll-snap-align: unset;
}

/* —— Hero (bcine-inspired) —— */
.rive-hero {
  position: relative;
  margin: 8px 0 32px;
  border-radius: 20px;
  overflow: hidden;
  min-height: 380px;
  background: var(--rive-surface);
  isolation: isolate;
}

.rive-hero__backdrop {
  position: absolute;
  inset: 0;
  background-image: var(--rive-hero-bg);
  background-size: cover;
  background-position: center top;
  filter: blur(2px) saturate(1.08);
  transform: scale(1.06);
  z-index: 0;
}

.rive-hero__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(11, 12, 16, 0.94) 0%, rgba(11, 12, 16, 0.72) 42%, rgba(11, 12, 16, 0.35) 70%, rgba(11, 12, 16, 0.55) 100%),
    linear-gradient(0deg, rgba(11, 12, 16, 0.85) 0%, transparent 45%);
  pointer-events: none;
}

.rive-hero__body {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 28px;
  align-items: flex-end;
  padding: 36px 32px 32px;
  min-height: 380px;
  color: #fff;
}

.rive-hero__poster {
  flex: 0 0 180px;
  width: 180px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1a1a22;
}

.rive-hero__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rive-hero__info {
  flex: 1;
  min-width: 0;
  max-width: 640px;
  padding-bottom: 4px;
}

.rive-hero__eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2dd4bf;
}

.rive-hero__title {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3.5vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rive-hero__blurb {
  margin: 0 0 16px;
  color: rgba(242, 243, 245, 0.78);
  font-size: 0.98rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rive-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.rive-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffe566;
}

.rive-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rive-chip {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s ease;
}

.rive-chip:hover {
  background: rgba(255, 255, 255, 0.14);
}

.rive-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.rive-btn-play,
.rive-btn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none !important;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.rive-btn-play {
  background: #2dd4bf;
  color: #06241f !important;
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.28);
}

.rive-btn-play i {
  font-size: 0.95rem;
  color: inherit;
}

.rive-btn-more {
  background: rgba(255, 255, 255, 0.96);
  color: #111 !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.rive-btn-play:hover,
.rive-btn-more:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.rive-btn-play:hover {
  box-shadow: 0 10px 28px rgba(45, 212, 191, 0.38);
}

.rive-btn-more:hover {
  background: #fff;
  color: #000 !important;
}

/* —— TOP10 —— */
.rive-top10-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px 14px;
  padding: 4px 0;
}

.rive-top10__item {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  width: 100%;
  padding-left: 28px;
  box-sizing: border-box;
}

.rive-top10__num {
  position: absolute;
  left: 0;
  bottom: 44px;
  z-index: 1;
  font-size: clamp(3.2rem, 5vw, 5rem);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.9);
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  user-select: none;
}

.rive-top10__item:nth-child(-n + 3) .rive-top10__num {
  -webkit-text-stroke-color: #2dd4bf;
}

.rive-top10__card {
  flex: 1;
  min-width: 0;
}

.rive-top10__card .rive-card {
  flex: none;
  width: 100%;
}

body.page-home .page-home-main {
  max-width: none;
  padding: 16px 0 48px;
}

body.page-home .page-home-main > .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

body.page-home .rive-section-head {
  padding-left: 0;
  padding-right: 0;
}

/* —— Horizontal row (legacy / non-home) —— */
.rive-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 20px 12px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.rive-row::-webkit-scrollbar {
  height: 6px;
}

.rive-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.rive-row.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
}

.rive-row.is-dragging a {
  pointer-events: none;
}

/* —— Poster cards —— */
.rive-card {
  flex: 0 0 var(--rive-card-w);
  width: var(--rive-card-w);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.rive-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--rive-radius);
  overflow: hidden;
  background: var(--rive-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rive-card:hover .rive-poster {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

.rive-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rive-poster::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}

.rive-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 1;
  max-width: calc(100% - 16px);
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rive-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--rive-text);
  min-height: 2.4em;
}

/* —— Footer —— */
.rive-footer {
  border-top: 1px solid var(--rive-line);
  padding: 28px 20px 40px;
  color: var(--rive-muted);
  font-size: 0.8rem;
  text-align: center;
  background: transparent;
}

.rive-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.rive-footer p {
  margin: 0 0 8px;
}

.rive-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.rive-footer-links a {
  color: var(--rive-muted);
  text-decoration: none;
}

.rive-footer-links a:hover {
  color: var(--rive-text);
}

/* Hide legacy chrome when Rive chrome is present */
body:has(.rive-header) .zy-fun,
body:has(.rive-header) .changetheme {
  display: none !important;
}

/* —— Responsive —— */
@media (max-width: 1100px) {
  .rive-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .rive-top10-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --rive-card-w: 118px;
    --rive-header-h: 56px;
    --rive-gap: 22px;
  }

  .rive-section-title {
    font-size: 1.15rem;
  }

  .rive-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 10px;
  }

  .rive-top10-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rive-top10__item:nth-child(n + 9) {
    display: none;
  }

  .rive-hero__body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px 24px;
    min-height: 300px;
  }

  .rive-hero__poster {
    width: 140px;
    flex-basis: 140px;
    margin: 0 auto 4px;
  }

  .rive-hero__info {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .rive-hero__meta,
  .rive-hero__actions {
    justify-content: center;
  }

  .rive-hero__shade {
    background:
      linear-gradient(180deg, rgba(11, 12, 16, 0.55) 0%, rgba(11, 12, 16, 0.78) 45%, rgba(11, 12, 16, 0.92) 100%);
  }
}

@media (max-width: 767px) {
  .rive-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: var(--rive-header-h);
  }

  .rive-header-inner {
    display: none;
  }

  .rive-menu-toggle,
  .rive-brand-mobi,
  .rive-search-trigger {
    display: flex;
  }

  .rive-brand-mobi {
    justify-content: flex-start;
  }

  .rive-search-trigger {
    margin-left: auto;
  }

  body.rive-nav-open,
  body.rive-search-open {
    overflow: hidden;
  }

  .rive-sidebar-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .rive-sidebar-mask.is-open {
    display: block;
    opacity: 1;
  }

  .rive-menu-drawer,
  .rive-menu-drawer.is-portal {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 310px);
    max-width: 310px;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    border-radius: 0 20px 20px 0;
    background: var(--rive-bg);
    border-right: 1px solid var(--rive-line);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.55);
    z-index: 100001;
    transform: translateX(-105%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
  }

  .rive-menu-drawer.is-open {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
  }

  .rive-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 16px 14px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--rive-line);
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.14) 0%, transparent 72%);
    flex-shrink: 0;
  }

  .rive-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .rive-drawer-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0, 204, 76, 0.35);
    background: var(--rive-surface);
  }

  .rive-drawer-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--rive-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rive-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    font-size: 24px;
    line-height: 1;
    color: var(--rive-muted);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    cursor: pointer;
  }

  .rive-drawer-close:active {
    background: rgba(255, 255, 255, 0.12);
  }

  .rive-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px calc(18px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .rive-drawer-main,
  .rive-drawer-sub {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .rive-drawer-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
  }

  .rive-drawer-label {
    display: block;
    padding: 14px 6px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rive-muted);
  }

  .rive-drawer-sub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .rive-drawer-main li a {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    font-size: 15px;
    color: var(--rive-text);
    border-radius: 12px;
    min-height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    text-decoration: none;
    box-sizing: border-box;
  }

  .rive-drawer-sub li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    font-size: 13px;
    color: var(--rive-text);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    text-decoration: none;
    min-height: 44px;
    box-sizing: border-box;
  }

  .rive-drawer-main li a i,
  .rive-drawer-sub li a i {
    flex-shrink: 0;
    font-size: 18px;
    color: #2dd4bf;
  }

  .rive-drawer-sub li a i {
    font-size: 16px;
  }

  .rive-drawer-main li a span,
  .rive-drawer-sub li a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rive-drawer-main li a.active,
  .rive-drawer-sub li a.active {
    background: rgba(45, 212, 191, 0.14);
    border-color: rgba(45, 212, 191, 0.32);
    color: #fff;
  }

  .rive-drawer-main li a:active,
  .rive-drawer-sub li a:active {
    background: rgba(255, 255, 255, 0.08);
  }

  .rive-search-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100020;
    margin: 0;
    padding: 0 20px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.68);
  }

  .rive-search-panel.is-open {
    display: flex;
  }

  .rive-search-panel-inner {
    position: relative;
    width: min(92vw, 420px);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: riveSearchPop 0.22s ease;
  }

  @keyframes riveSearchPop {
    from {
      opacity: 0;
      transform: scale(0.96) translateY(10px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  .rive-search-panel-form {
    flex: 1;
    display: flex;
    align-items: center;
    height: 48px;
    border-radius: 14px;
    background: var(--rive-surface);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
  }

  .rive-search-panel-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--rive-text);
    font-size: 16px;
    padding: 0 16px;
  }

  .rive-search-panel-input::placeholder {
    color: var(--rive-muted);
  }

  .rive-search-panel-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px 0 0;
    border: 0;
    background: transparent;
    color: var(--rive-text);
    font-size: 18px;
    cursor: pointer;
  }

  .rive-search-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
  }
}

@media (max-width: 560px) {
  :root {
    --rive-card-w: 104px;
  }

  .rive-section-head,
  .rive-row {
    padding-left: 12px;
    padding-right: 12px;
  }

  body.page-home .rive-section-head {
    padding-left: 0;
    padding-right: 0;
  }

  body.page-home .page-home-main > .container {
    padding: 0 12px;
  }

  .rive-brand-name {
    font-size: 1.05rem;
  }

  .rive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 8px;
  }

  .rive-top10-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 8px;
  }

  .rive-top10__item {
    padding-left: 18px;
  }

  .rive-top10__num {
    font-size: 2.6rem;
    bottom: 40px;
    -webkit-text-stroke-width: 1.5px;
  }

  .rive-top10__item:nth-child(n + 7) {
    display: none;
  }

  .rive-hero {
    border-radius: 14px;
    min-height: 0;
  }

  .rive-hero__poster {
    width: 120px;
    flex-basis: 120px;
  }

  .rive-card:hover .rive-poster {
    transform: none;
  }
}

/* —— Category / filter pages —— */
body.theme-rive.page-type .page-type-main {
  padding: 20px 0 48px;
}

body.theme-rive.page-type .container {
  max-width: 1400px;
  padding: 0 20px;
}

body.theme-rive .rive-page-head {
  display: flex;
  align-items: baseline;
  margin: 4px 0 18px;
}

body.theme-rive .rive-page-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #fff 0%, #b8c7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-rive .rive-screen.category {
  background: rgba(24, 27, 34, 0.92);
  border: 1px solid var(--rive-line);
  border-radius: 14px;
  padding: 8px 16px 4px;
  margin-top: 0;
  margin-bottom: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.theme-rive .rive-screen.category dl {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rive-line);
  line-height: 1.4;
}

body.theme-rive .rive-screen.category dl:last-child {
  border-bottom: 0;
}

body.theme-rive .rive-screen.category dl dt {
  flex-shrink: 0;
  margin-right: 0;
  padding-top: 2px;
}

body.theme-rive .rive-screen.category dl dt h2 {
  margin: 0;
  background: transparent;
  color: var(--rive-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 4px 0;
  line-height: 1.4;
  min-width: 2.5em;
}

body.theme-rive .rive-screen.category dl dd {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  margin: 0;
  padding-right: 48px;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

body.theme-rive .rive-screen.category dl dd a {
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--rive-muted);
  font-size: 0.98rem;
  line-height: 1.4;
  background: transparent;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

body.theme-rive .rive-screen.category dl dd a:hover {
  color: var(--rive-text);
  background: rgba(255, 255, 255, 0.06);
}

body.theme-rive .rive-screen.category dl dd a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

body.theme-rive .rive-screen.category dl .screen-tog {
  top: 12px;
  right: 0;
  color: var(--rive-muted);
  font-size: 0.9rem;
  padding: 4px 8px;
}

body.theme-rive .rive-screen-sort dd a.order.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

body.theme-rive .rive-category-con {
  margin-bottom: 28px;
}

body.theme-rive .rive-category-con .a-con {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px 14px;
}

body.theme-rive .rive-category-con .a-con .rive-card {
  flex: none;
  width: auto;
  min-width: 0;
  scroll-snap-align: unset;
}

body.theme-rive .rive-category-con .rive-card-title {
  min-height: 2.5em;
}

body.theme-rive.page-type .page {
  margin-top: 8px;
  margin-bottom: 16px;
}

body.theme-rive.page-type .page a {
  background: var(--rive-surface);
  color: var(--rive-muted);
  border: 1px solid var(--rive-line);
  border-radius: 10px;
  min-width: 36px;
  line-height: 34px;
  margin: 0 3px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

body.theme-rive.page-type .page a:hover {
  color: var(--rive-text);
  border-color: rgba(108, 140, 255, 0.4);
}

body.theme-rive.page-type .page .page-active {
  background: var(--rive-accent);
  border-color: transparent;
  color: #fff;
}

body.theme-rive.page-type .page .page-unactive {
  opacity: 0.45;
  text-decoration: none;
}

@media (max-width: 1100px) {
  body.theme-rive .rive-category-con .a-con {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body.theme-rive .rive-category-con .a-con {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 10px;
  }

  body.theme-rive .rive-page-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 767px) {
  body.theme-rive.page-type .container {
    padding: 0 12px;
  }

  body.theme-rive .rive-page-head {
    margin-bottom: 14px;
  }

  body.theme-rive .rive-screen.category {
    padding: 6px 12px 2px;
    border-radius: 12px;
    margin-bottom: 16px;
  }

  body.theme-rive .rive-screen.category dl {
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
  }

  body.theme-rive .rive-screen.category dl dd {
    padding-right: 0;
    display: flex !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
  }

  body.theme-rive .rive-screen.category dl .screen-tog {
    display: none !important;
  }

  body.theme-rive .rive-screen.category dl dd a {
    padding: 5px 12px;
    font-size: 0.92rem;
  }

  body.theme-rive .rive-category-con .a-con {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 8px;
  }

  /* 移动端每页显示 15 部 */
  body.theme-rive .rive-category-con .a-con > .rive-card:nth-child(n + 16) {
    display: none;
  }

  body.theme-rive .rive-card:hover .rive-poster {
    transform: none;
  }
}

/* —— Play page: side collapse + mobile 2-col episodes —— */
.page-play .play-like .a-con .rive-card {
  flex: none;
  width: auto;
  min-width: 0;
}

.page-detail .play-like .a-con .rive-card {
  flex: none;
  width: auto;
  min-width: 0;
}

.page-play .play-side__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.page-play .rive-side-toggle {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--rive-muted, #9aa0ad);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 961px) {
  .page-play .rive-side-toggle--close {
    display: inline-flex;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    padding: 0;
  }

  .page-play .rive-side-toggle--close:hover {
    color: #fff;
    background: rgba(45, 212, 191, 0.22);
    border-color: rgba(45, 212, 191, 0.45);
  }

  .page-play .rive-side-toggle--open {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 6;
    height: 34px;
    padding: 0 12px 0 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: rgba(11, 12, 16, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .page-play .rive-side-toggle--open:hover {
    background: rgba(45, 212, 191, 0.9);
    border-color: transparent;
    color: #06241f;
  }

  .page-play .player {
    position: relative;
  }

  .page-play .playbox.is-side-hidden .play-side {
    display: none !important;
  }

  .page-play .playbox.is-side-hidden .player {
    width: 100% !important;
  }

  .page-play .playbox.is-side-hidden .player .player-wrapper {
    border-radius: 12px 12px 0 0;
  }

  .page-play .playbox.is-side-hidden .player .player-info {
    border-radius: 0 0 12px 12px;
  }

  .page-play .playbox.is-side-hidden .rive-side-toggle--open {
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  .page-play .play-side__eps,
  .page-play .jisu {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow: visible !important;
    overflow-x: visible !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
    padding: 0 0 12px !important;
    -webkit-overflow-scrolling: auto;
  }

  .page-play .play-side__eps a,
  .page-play .jisu a {
    margin: 0 !important;
    min-width: 0 !important;
    flex: unset !important;
    width: 100% !important;
    box-sizing: border-box !important;
    line-height: 36px;
    font-size: 13px;
    border-radius: 8px;
    padding: 0 6px;
  }

  /* 猜你喜欢：移动端 6 部，PC 12 部 */
  .page-play .play-like .a-con > .rive-card:nth-child(n + 7),
  .page-play .play-like .a-con > .a-con-inner:nth-child(n + 7),
  .page-detail .play-like .a-con > .rive-card:nth-child(n + 7),
  .page-detail .play-like .a-con > .a-con-inner:nth-child(n + 7) {
    display: none !important;
  }
}
