:root {
  --pro-bg: #0b1220;
  --pro-surface: #121a2b;
  --pro-surface-2: #1a2438;
  --pro-border: #26344f;
  --pro-text: #e5ecff;
  --pro-text-muted: #93a4c3;
  --pro-primary: #1677ff;
  --pro-success: #2bb673;
  --pro-warning: #f6c343;
}

body {
  background: radial-gradient(circle at top, #13203a, var(--pro-bg) 45%) !important;
  color: var(--pro-text) !important;
}

.topbar.unified-menu {
  background: linear-gradient(180deg, rgba(10, 17, 31, 0.97), rgba(12, 22, 40, 0.94)) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #2d3f5f;
  box-shadow: 0 10px 24px rgba(2, 8, 20, .35);
}

.topbar-inner {
  max-width: 1320px !important;
  height: 62px !important;
  min-height: 62px !important;
}

.nav-menu-mobile-bar {
  background: transparent !important;
  padding: 9px 8px !important;
  border-radius: 10px;
}

.nav-menu-mobile-scroll a {
  color: #bfd0ee !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 0 12px !important;
  line-height: 32px !important;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all .2s ease;
}

.nav-menu-mobile-scroll a.active,
.nav-menu-mobile-scroll a:hover {
  color: #fff !important;
  background: rgba(24, 45, 79, .8) !important;
  border-color: #365787;
}

.nav-menu-mobile-scroll a.active:before {
  display: none !important;
}

.topbar-search-mobile-main {
  background: #0f1b31 !important;
  border: 1px solid #294267 !important;
  border-radius: 999px !important;
  max-width: 1320px;
  width: calc(100% - 24px) !important;
  padding: 5px 12px !important;
}

.topbar-search-mobile-main input[type="text"] {
  color: #fff !important;
}

.topbar-search-mobile-main button {
  color: #c8d6f1 !important;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.topbar-search-mobile-main button:hover {
  background: rgba(67, 115, 183, 0.35);
}

.mobile-search-modal-content {
  background: var(--pro-surface) !important;
  border: 1px solid var(--pro-border);
}

.mobile-search-modal-form {
  background: var(--pro-surface-2) !important;
}

.mobile-search-modal-hot .hot-item {
  background: #1f2b42 !important;
  border: 1px solid var(--pro-border);
  color: #d6e3ff !important;
}

#site-announcement-container .alert {
  background: #12233d !important;
  border: 1px solid #264d83 !important;
  color: #d9e9ff !important;
  border-radius: 10px;
}

.video-card-wrap .video-card {
  border-radius: 10px !important;
  transition: transform .2s ease, box-shadow .2s ease !important;
}

.video-card-wrap .video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}

.video-card-title a,
.video-title-link {
  color: #e8efff !important;
}

.video-card-wrap:hover a,
.video-card:hover .video-title-link:hover {
  color: #8ab4ff !important;
}

.section-title {
  font-weight: 700 !important;
  letter-spacing: .2px !important;
}

.more-btn {
  color: #8ab4ff !important;
}

.more-btn:hover {
  color: #b3cdff !important;
}

.source-btn {
  color: #9eb4d8 !important;
  border-color: #39517a !important;
}

footer.bg-dark {
  background: rgba(9, 14, 26, .95) !important;
  border-top: 1px solid var(--pro-border);
}

.pro-page-shell {
  max-width: 1320px;
  margin: 0 auto;
}

.pro-toolbar {
  background: linear-gradient(180deg, rgba(20, 30, 50, .9), rgba(16, 24, 40, .9));
  border: 1px solid var(--pro-border);
  border-radius: 12px;
  padding: 10px 12px;
}

.pro-toolbar .subtitle {
  color: var(--pro-text-muted);
  font-size: 12px;
}

.filter-chip.active,
.source-filter.active {
  background: var(--pro-primary) !important;
  color: #fff !important;
  border-color: var(--pro-primary) !important;
}

.pro-status-tag {
  border: 1px solid #34507d;
  color: #b8cbeb;
  background: rgba(43, 66, 103, .2);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}

.search-grid .video-card {
  border: 1px solid #2a3f62;
  border-radius: 12px;
  background: rgba(17, 27, 44, .75);
  padding: 8px 8px 10px;
}

.search-grid .video-card-title a {
  color: #eaf2ff !important;
}

.search-grid .video-card-wrap:hover .video-card {
  border-color: #4a73b8;
}

.detail-main {
  max-width: 1262px;
  margin: 0 auto;
  display: grid !important;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px !important;
  align-items: start;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.detail-main-poster {
  background: rgba(15, 25, 43, .94);
  border: 1px solid #2d446a;
  border-radius: 14px;
  padding: 14px;
  position: sticky;
  top: 88px;
}

.detail-main-content {
  background: rgba(15, 25, 43, .94);
  border: 1px solid #2d446a;
  border-radius: 14px;
  padding: 18px;
  min-width: 0;
}

.detail-actions {
  background: rgba(12, 20, 35, .8);
  border: 1px dashed #3f5c88;
  border-radius: 10px;
  padding: 12px;
}

.detail-title {
  font-size: 26px;
  line-height: 1.25;
  margin-bottom: 14px;
}

.detail-desc {
  margin-top: 12px;
  color: #dce7fa;
  background: rgba(23, 36, 58, .85);
  border: 1px solid #2a3f63;
  border-radius: 10px;
  padding: 12px;
  max-height: 220px;
  overflow: auto;
}

.detail-info-list {
  margin-top: 12px;
  color: #c8d9f3;
}

.detail-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 112px;
  height: 40px;
  border-radius: 10px;
  padding: 0 14px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .2s ease;
}

.detail-btn .btn-icon,
.detail-btn .btn-text {
  display: inline-flex;
  align-items: center;
}

.detail-btn-play {
  background: linear-gradient(90deg, #2a79ff, #4f8fff);
  color: #fff;
  border-color: #5f9cff;
}

.detail-btn-share {
  background: rgba(28, 44, 73, .9);
  color: #d6e6ff;
  border-color: #365588;
}

.detail-btn-fav {
  background: rgba(26, 39, 64, .96);
  color: #d6e6ff;
  border-color: #365588;
}

.detail-btn-fav.is-active {
  background: linear-gradient(90deg, #e64b6f, #f06585);
  color: #fff;
  border-color: #f48ba3;
  box-shadow: 0 6px 16px rgba(230, 75, 111, .3);
}

.detail-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.episode-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 6px;
}

.episode-section-header .section-title {
  margin: 0;
  height: auto;
  line-height: 1.3;
}

.episode-source-picker {
  position: relative;
}

.episode-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #355380;
  background: rgba(18, 31, 53, .95);
  color: #dce9ff;
  border-radius: 8px;
  height: 34px;
  padding: 0 10px;
}

/* =========================================================
 * Detail poster hard-fix (prevent oversized image)
 * ========================================================= */
.detail-main {
  grid-template-columns: 300px minmax(0, 1fr) !important;
}

.detail-main-poster {
  width: 300px !important;
  max-width: 300px !important;
  min-width: 300px !important;
  overflow: hidden !important;
}

.detail-main-poster .detail-poster,
img.detail-poster {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 460px !important;
  object-fit: cover !important;
  border-radius: 12px !important;
}

@media (max-width: 900px) {
  .detail-main {
    grid-template-columns: 1fr !important;
  }
  .detail-main-poster {
    width: 100% !important;
    max-width: 280px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
  }
}

.source-status-wrap,
.source-loading,
.source-loaded,
.source-error {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.source-loading {
  display: block;
}

.source-loaded,
.source-error {
  display: none;
}

.source-loading-spinner {
  margin-top: 0;
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-top: 2px solid #4caf50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.source-status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.source-status-ok { background: #4caf50; }
.source-status-error { background: #ff4d4f; }
.current-source-name { font-size: .95rem; }
.source-arrow { margin-left: 2px; font-size: 12px; }

.episode-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 6px;
}

.episode-tabs-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.episode-tab {
  background: rgba(20, 35, 58, .95);
  border: 1px solid #365588;
  color: #e6efff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .9rem;
  height: auto;
}

.episode-tab .ep-count {
  margin-left: 8px;
  background: rgba(86, 137, 212, .25);
  color: #d9e8ff;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
}

.episode-list.active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  padding: 8px 6px 4px;
}

.episode-item {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid #365588;
  background: rgba(22, 36, 59, .92);
  color: #dce9ff;
  font-size: .9rem;
  text-decoration: none;
  transition: all .2s ease;
}

.episode-item:hover,
.episode-item.active {
  background: linear-gradient(90deg, #2a79ff, #4f8fff);
  border-color: #75a9ff;
  color: #fff;
}

@media (max-width: 768px) {
  .detail-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .detail-btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
  .episode-list.active {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
}

.episode-section {
  max-width: 1262px;
  margin: 16px auto 0;
  background: rgba(15, 25, 43, .95) !important;
  border: 1px solid #2d446a;
  border-radius: 12px !important;
}

@media (max-width: 900px) {
  .detail-main {
    grid-template-columns: 1fr !important;
  }
  .detail-main-poster {
    position: static;
  }
}

.breadcrumb {
  --bs-breadcrumb-divider-color: #6f87ad;
  --bs-breadcrumb-item-active-color: #c7d7f3;
}

.breadcrumb a {
  color: #8ab4ff;
  text-decoration: none;
}

.btn-outline-light {
  border-color: #3a4f73;
  color: #d6e5ff;
}

.btn-outline-light:hover {
  background: #203254;
  border-color: #4b6796;
}

/* =========================================================
 * Global toast & confirm styles
 * ========================================================= */

.pro-toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%) translateY(-12px);
  background: #1f7a47;
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  pointer-events: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity .18s ease-out, transform .18s ease-out;
  z-index: 100000;
  font-size: 13px;
}

.pro-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pro-toast-success { background: #1f7a47; }
.pro-toast-error { background: #a61b2b; }
.pro-toast-warning { background: #b9731f; }

.pro-toast-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .85);
  position: relative;
}

.pro-toast-success .pro-toast-icon::after,
.pro-toast-error .pro-toast-icon::after,
.pro-toast-warning .pro-toast-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, .9);
}

.pro-toast-text {
  white-space: nowrap;
}

.pro-confirm-mask {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
}

.pro-confirm-panel {
  background: #121a2b;
  border: 1px solid #2e4268;
  color: #fff;
  border-radius: 12px;
  padding: 16px 18px 14px;
  min-width: 280px;
  max-width: 90vw;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
  transform: translateY(10px);
  opacity: 0;
  animation: proConfirmIn .2s ease-out forwards;
}

.pro-confirm-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.pro-confirm-message {
  font-size: 13px;
  color: #c1d1f1;
  margin-bottom: 12px;
}

.pro-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes proConfirmIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* =========================================================
 * Migrated from index.php inline <style>
 * ========================================================= */
#global-loading {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 40, 60, 0.18);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#global-loading .loader {
  width: 30px;
  height: 30px;
  border: 6px solid #16a34a;
  border-top: 6px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  background: transparent;
}
.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #ccc;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.capsule-switch {
  background: #23242b;
  border-radius: 999px;
  display: flex;
  padding: 4px;
  gap: 2px;
}
.capsule-btn {
  border: none;
  background: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 999px;
  padding: 8px 28px;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
}
.capsule-btn.active {
  background: linear-gradient(90deg, #16a34a, #22c55e);
  color: #fff;
}
.scrollable-row {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  gap: 0.75rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  scrollbar-width: none;
}
.scrollable-row-wrap { position: relative; }
.scroll-arrow {
  position: absolute;
  top: 35%;
  z-index: 10;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.scroll-arrow.left { left: 0; }
.scroll-arrow.right { right: 0; }
.scroll-arrow:hover { opacity: 1; }
.scroll-arrow svg {
  width: 24px;
  height: 24px;
  color: #16a34a;
}
.video-card-wrap {
  min-width: 120px;
  max-width: 180px;
  flex: 0 0 40vw;
  width: 100%;
  margin-bottom: 0;
}
@media (min-width: 576px) {
  .video-card-wrap { flex: 0 0 160px; }
}
@media (min-width: 768px) {
  .video-card-wrap { flex: 0 0 180px; }
}
.video-card {
  background: transparent;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s, transform 0.18s;
  cursor: pointer;
  min-width: 0;
  height: auto;
}
.video-card:hover { transform: translateY(-6px) scale(1.04); }
.video-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.video-card-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #181a20;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}
.video-card-rate {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  border-radius: 999px;
  z-index: 2;
  height: 28px;
  width: 28px;
  line-height: 28px;
  text-align: center;
}
.video-card-title {
  margin: 14px 0 10px 0;
  font-size: 1.08rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-card-title a {
  display: inline-block !important;
  font-size: 14px !important;
  color: #fff;
  font-weight: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  transition: color 0.2s;
  height: 50px;
  line-height: 50px;
}
.video-title-link {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: color 0.2s;
}
.video-title-link:hover,
.video-card:hover .video-title-link,
.video-card:hover .video-card-title a,
.video-card-wrap:hover a {
  color: #16a34a !important;
}
.latest-episode {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 2px 5px;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 10;
  pointer-events: none;
  border-left: 2px solid transparent;
}
.latest-loading {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  padding: 2px 5px;
  border-radius: 8px;
  z-index: 10;
  pointer-events: none;
}
.loading-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.video-masonry-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px 36px;
  margin-top: 12px;
}
body,
.container-fluid {
  overflow-x: hidden !important;
}
.row { align-items: stretch !important; }
.text-success { text-align: center; }
@media (min-width: 1310px) {
  .container-fluid {
    width: 1310px;
    margin: 0 auto;
    position: static;
  }
}
@media (max-width: 600px) {
  .scroll-arrow { display: none; }
  .scrollable-row::-webkit-scrollbar {
    display: block;
    height: 0;
    background: #23242b;
  }
  .scrollable-row::-webkit-scrollbar-thumb {
    background: #16a34a;
    border-radius: 0;
  }
  .video-card-wrap {
    min-width: 90px;
    max-width: 110px;
    flex: 0 0 32vw;
  }
  .video-card-img-wrap { margin-bottom: -10px; }
  .video-card-title {
    min-height: unset;
    font-size: 0.98rem;
    padding: 0 0 0.5rem 0;
    margin-top: 0;
    margin-bottom: 0.1rem;
  }
  .video-title-link {
    font-size: 0.95rem;
    height: 20px;
    line-height: 20px;
  }
  .video-masonry-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px 6px !important;
  }
  .video-masonry-grid .video-card-wrap {
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 0 !important;
  }
  ::-webkit-scrollbar { width: 2px !important; }
}
@media (min-width: 601px) {
  .scrollable-row { scrollbar-width: none; }
  .scrollable-row::-webkit-scrollbar { display: none; }
}
@media (min-width: 801px) {
  .mobile-search-modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.3);
  }
  .mobile-search-modal[style*="block"] {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-search-modal-content {
    position: static;
    width: 100%;
    max-width: 100vw;
    background: #202128;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 32px 32px 24px 32px;
    min-height: 220px;
    margin: 0 auto;
  }
  .mobile-search-modal-form { margin-bottom: 18px; }
  .mobile-search-modal-hot .hot-list {
    gap: 12px 18px;
    flex-wrap: wrap;
  }
  .mobile-search-modal-hot .hot-item {
    font-size: 1rem;
    padding: 6px 18px;
  }
  .mobile-search-modal-cancel {
    font-size: 1.1rem;
    margin-left: 18px;
  }
}

/* =========================================================
 * Migrated from search.php inline <style>
 * ========================================================= */
.search-page-container {
  max-width: 1310px;
  margin: 0 auto;
  padding: 32px 19px 0 19px;
}
.search-form-wrap {
  display: none;
  justify-content: center;
  margin-bottom: 32px;
}
.search-form {
  width: 100%;
  max-width: 520px;
  position: relative;
}
.search-form input[type="text"] {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  padding: 0 48px 0 44px;
  font-size: 1.1rem;
  color: #222;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.04);
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}
.search-form input[type="text"]:focus {
  border: 1.5px solid #16a34a;
  background: #fff;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.08);
}
.search-form .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #bdbdbd;
  font-size: 1.3rem;
}
.search-results-wrap { margin-top: 32px; }
.search-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px 40px;
  margin-top: 24px;
}
.search-results-mask {
  min-height: 80vh;
  width: 100%;
  background: transparent;
}
.search-empty {
  text-align: center;
  color: #888;
  font-size: 1.2rem;
  margin: 60px 0 80px 0;
}
@media (max-width: 1200px) {
  .search-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .search-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .search-page-container { padding: 12px 2vw 0 2vw; }
  .search-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0 6px !important;
  }
}

/* =========================================================
 * Migrated from detail.php inline <style>
 * ========================================================= */
.episode-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.episode-item .playon-bars {
  position: absolute;
  left: 50%;
  top: 70%;
  transform: translate(-50%, 0) scaleY(-1);
  display: flex;
  gap: 2px;
  pointer-events: none;
}
.episode-item .playon-bars span {
  display: inline-block;
  width: 5px;
  height: 10px;
  background: #ffd600;
  border-radius: 2px;
  animation: playon 1s ease 0.3s infinite;
}
.episode-item .playon-bars span:nth-child(1) { animation-delay: 0s; }
.episode-item .playon-bars span:nth-child(2) { animation-delay: 0.2s; }
.episode-item .playon-bars span:nth-child(3) { animation-delay: 0.4s; }
.episode-item .playon-bars span:nth-child(4) { animation-delay: 0.6s; }
@keyframes playon {
  0%, 100% { height: 8px; }
  20% { height: 18px; }
  40% { height: 12px; }
  60% { height: 16px; }
  80% { height: 10px; }
}
.episode-modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.episode-modal-mask {
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
}
.episode-modal-content {
  position: relative;
  background: #23242b;
  border-radius: 18px 18px 0 0;
  padding: 24px 18px 18px 18px;
  min-width: 320px;
  max-width: 100vw;
  width: 100vw;
  max-height: 80vh !important;
  overflow-y: auto !important;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.18);
  margin-bottom: 0;
}
.episode-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 12px;
}
.episode-modal-close {
  cursor: pointer;
  font-size: 1.5rem;
  color: #fff;
}
.episode-modal-body {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px 0;
  min-height: 200px !important;
  max-height: calc(80vh - 120px) !important;
  overflow-y: auto !important;
  margin-bottom: 120px;
}
.episode-modal-body.loading-mode {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}
.episode-source-btn-modal {
  background: #181a20;
  color: #fff;
  border-radius: 8px;
  padding: 16px 0;
  cursor: pointer;
  border: none;
  font-size: 1.1rem;
  position: relative;
  width: 30%;
  min-width: 0;
  box-sizing: border-box;
  margin: 5px;
  margin-bottom: 12px;
  text-align: center;
  transition: background 0.15s;
}
.episode-source-btn-modal.active,
.episode-source-btn-modal:hover {
  background: #ff9800;
  color: #fff;
}
.episode-source-btn-modal .source-ep-count {
  position: absolute;
  top: 3px;
  right: 0;
  background: none;
  color: #fff;
  font-size: 0.95rem;
  padding: 1px 8px;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
}
.sort-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 1rem;
  transition: all 0.2s;
}
.sort-btn:hover { background: rgba(255, 255, 255, 0.1); }
.sort-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

/* =========================================================
 * Detail page visual fixes (latest overrides)
 * ========================================================= */
.detail-actions .detail-btn-fav {
  background: rgba(26, 39, 64, .96) !important;
  color: #d6e6ff !important;
  border: 1px solid #365588 !important;
  box-shadow: none !important;
}

.detail-actions .detail-btn-fav.is-active {
  background: linear-gradient(90deg, #e64b6f, #f06585) !important;
  border-color: #f48ba3 !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(230, 75, 111, .3) !important;
}

.episode-section .episode-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 6px;
}

.episode-section .section-title {
  margin: 0 !important;
  line-height: 1.35 !important;
  font-size: 1.1rem !important;
}

.episode-section .episode-tabs {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 6px;
}

.episode-section .episode-tab {
  background: rgba(20, 35, 58, .95) !important;
  border: 1px solid #365588 !important;
  color: #e6efff !important;
  border-radius: 999px !important;
  padding: 6px 12px !important;
  height: auto !important;
}

.episode-section .episode-tab .ep-count {
  background: rgba(86, 137, 212, .25) !important;
  color: #d9e8ff !important;
}

.episode-section .episode-list.active {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  padding: 8px 6px 4px;
}

.episode-section .episode-item {
  min-height: 40px;
  border-radius: 8px !important;
  border: 1px solid #365588 !important;
  background: rgba(22, 36, 59, .92) !important;
  color: #dce9ff !important;
  text-decoration: none;
  transition: all .2s ease;
}

.episode-section .episode-item:hover,
.episode-section .episode-item.active {
  background: linear-gradient(90deg, #2a79ff, #4f8fff) !important;
  border-color: #75a9ff !important;
  color: #fff !important;
}

.episode-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #355380;
  background: rgba(18, 31, 53, .95);
  color: #dce9ff;
  border-radius: 8px;
  height: 34px;
  padding: 0 10px;
}
