/* Coreflix theme — inspired by https://coreflix.tv/ */
:root,
.theme-coreflix,
html.theme-coreflix {
  --primary: #2596be;
  --primary-hover: #2eacd8;
  --bg-deepest: #050810;
  --bg-base: #0f1420;
  --bg-elevated: #151b2b;
  --bg-surface: #1a2236;
  --text-primary: #e8ecf4;
  --text-secondary: #8b95a8;
  --text-muted: #5a6478;
  --sidebar-w: 68px;
  --topbar-h: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html.theme-coreflix,
body.theme-coreflix,
body.body.theme-coreflix {
  background: var(--bg-deepest) !important;
  color: var(--text-primary);
  font-family: var(--font);
  min-height: 100vh;
}

html.theme-coreflix body,
body.theme-coreflix {
  background: var(--bg-deepest) !important;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  padding-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  overflow-x: hidden;
}

html.theme-coreflix {
  overflow-x: hidden;
}

/* Hide legacy chrome that conflicts */
.theme-coreflix .header,
.theme-coreflix .zy-fun,
.theme-coreflix .changetheme,
body.theme-coreflix > .header {
  display: none !important;
}

/* ---------- Sidebar ---------- */
.cf-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #0a0e18 0%, var(--bg-deepest) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 18px;
  box-sizing: border-box;
}

.cf-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 6px 18px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 18px;
}

.cf-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
  display: block;
}

.cf-logo-mark {
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  user-select: none;
}

.cf-logo-mark.sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--primary), #1a6f8f);
  font-size: 14px;
  flex-shrink: 0;
}

.cf-side-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.cf-side-nav::-webkit-scrollbar {
  display: none;
}

.cf-nav-item {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s, background 0.2s, transform 0.2s;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.cf-nav-item .iconfont {
  font-size: 22px;
  line-height: 1;
}

.cf-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.cf-nav-item.is-active {
  color: #fff;
  background: rgba(37, 150, 190, 0.22);
  box-shadow: inset 0 0 0 1px rgba(37, 150, 190, 0.45);
}

.cf-nav-tip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
  box-shadow: var(--shadow);
  z-index: 20;
}

.cf-nav-item:hover .cf-nav-tip {
  opacity: 1;
  visibility: visible;
}

.cf-side-foot {
  margin-top: auto;
  padding-top: 10px;
}

.cf-history,
.cf-history-top {
  position: relative;
}

.cf-history > span,
.cf-history-top > span {
  display: flex;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}

.cf-history > span:hover,
.cf-history-top > span:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.cf-history .menu-ul,
.cf-history-top .menu-ul,
.watch-history .menu-ul {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  min-width: 240px;
  max-height: 320px;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 0;
  margin: 0;
  list-style: none;
  display: none;
  z-index: 1100;
}

.cf-history-top .menu-ul {
  left: auto;
  right: 0;
  bottom: auto;
  top: calc(100% + 8px);
}

.watch-history .menu-ul.is-open,
.cf-history .menu-ul.is-open,
.cf-history-top .menu-ul.is-open {
  display: block;
}

.watch-history .menu-ul li a,
.cf-history .menu-ul a {
  display: block;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
}

.watch-history .menu-ul li a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.cf-sidebar-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 990;
}

.cf-sidebar-mask.is-open {
  display: block;
}

/* ---------- Top bar ---------- */
.cf-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  z-index: 980;
  display: flex;
  align-items: center;
  padding: 0;
  background: rgba(5, 8, 16, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
}

@media (min-width: 961px) {
  .cf-topbar {
    background: rgba(5, 8, 16, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}

.cf-topbar-inner {
  width: 100%;
  max-width: 1400px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 520px) 1fr;
  align-items: center;
  column-gap: 16px;
}

.cf-menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}

.cf-menu-toggle:active {
  background: rgba(255, 255, 255, 0.1);
}

.cf-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  gap: 4px;
  width: 16px;
  height: 16px;
}

.cf-menu-grid i {
  display: block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 1px;
}

.cf-menu-grid i:first-child {
  width: 5px;
  height: 5px;
  place-self: center;
  transform: rotate(45deg);
}

.cf-topbar-left {
  display: flex;
  align-items: center;
  min-width: 0;
  justify-self: start;
}

.cf-brand-pc {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary) !important;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.cf-brand-pc:hover {
  color: #fff !important;
}

.cf-brand-mobi {
  display: none;
  flex: 1;
  min-width: 0;
}

.cf-brand-mobi a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
}

.cf-logo-img-mobi {
  display: block;
  height: 32px;
  width: auto;
  max-width: 36px;
  flex-shrink: 0;
  object-fit: contain;
}

.cf-brand-name-mobi {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  letter-spacing: 0.02em;
}

.cf-search {
  width: 100%;
  max-width: 520px;
  margin: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-self: center;
}

.cf-search-ico {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.cf-search-input {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0 16px 0 40px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.cf-search-input::placeholder {
  color: var(--text-muted);
}

.cf-search-input:focus {
  border-color: rgba(37, 150, 190, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 150, 190, 0.15);
}

.cf-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  margin-left: 0;
}

.cf-search-trigger {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.cf-search-trigger:active {
  background: rgba(255, 255, 255, 0.08);
}

/* Search panel: mobile center popup (bcine-style) */
html.theme-coreflix #searchPanel:not(.is-open),
html.theme-coreflix .search-panel:not(.is-open) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

html.theme-coreflix body > #searchPanel.search-panel-portal,
html.theme-coreflix body > #searchPanel.is-open {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 20px !important;
  z-index: 100020 !important;
  box-sizing: border-box !important;
}

html.theme-coreflix body > #searchPanel.search-panel-portal:not(.is-open) {
  display: none !important;
  pointer-events: none !important;
}

html.theme-coreflix body > #searchPanel.search-panel-portal.is-open,
html.theme-coreflix body > #searchPanel.is-open {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.68) !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

html.theme-coreflix body > #searchPanel.search-panel-portal.is-open .search-panel-inner,
html.theme-coreflix body > #searchPanel.is-open .search-panel-inner {
  position: relative;
  width: min(92vw, 420px) !important;
  display: flex !important;
  align-items: center;
  gap: 8px;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  overflow: visible !important;
  pointer-events: auto !important;
  margin: 0 !important;
  transform: translateY(0);
  animation: cfSearchPop 0.22s ease;
}

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

html.theme-coreflix body > #searchPanel.search-panel-portal.is-open .search-box,
html.theme-coreflix body > #searchPanel.search-panel-portal.is-open .vodsearch,
html.theme-coreflix body > #searchPanel.is-open .search-box,
html.theme-coreflix body > #searchPanel.is-open .vodsearch {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

html.theme-coreflix body > #searchPanel.search-panel-portal.is-open .search-box,
html.theme-coreflix body > #searchPanel.is-open .search-box {
  flex: 1;
  width: auto !important;
  height: 48px !important;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  margin: 0 !important;
  padding: 0 !important;
}

html.theme-coreflix body > #searchPanel.search-panel-portal.is-open .vodsearch,
html.theme-coreflix body > #searchPanel.is-open .vodsearch {
  width: 100% !important;
  height: 100% !important;
  align-items: center;
}

html.theme-coreflix body > #searchPanel.search-panel-portal.is-open .search-input,
html.theme-coreflix body > #searchPanel.is-open .search-input {
  display: block !important;
  flex: 1 !important;
  width: 100% !important;
  height: 100% !important;
  font-size: 16px;
  padding: 0 16px !important;
  color: var(--text-primary);
  border: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  overflow: visible !important;
  background: transparent;
  outline: none;
}

html.theme-coreflix body > #searchPanel.search-panel-portal.is-open .search-btn,
html.theme-coreflix body > #searchPanel.is-open .search-btn {
  display: inline-flex !important;
  align-items: center;
  padding: 0 16px 0 0 !important;
  font-size: 18px;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  width: auto !important;
  pointer-events: auto !important;
  overflow: visible !important;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  cursor: pointer;
}

html.theme-coreflix body > #searchPanel.search-panel-portal.is-open .search-panel-close,
html.theme-coreflix body > #searchPanel.is-open .search-panel-close {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px !important;
  height: 40px !important;
  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;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

html.theme-coreflix body.search-popup-open {
  overflow: hidden;
}

/* ---------- Main / Hero ---------- */
.cf-main {
  min-height: calc(100vh - var(--topbar-h));
  background: var(--bg-deepest);
}

.cf-hero {
  position: relative;
  min-height: min(72vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin: 0;
}

.page-home .cf-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-top: 48px;
  padding-bottom: 56px;
}

.cf-hero-bg {
  position: absolute;
  inset: 0;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center top;
  transform: translateZ(0);
}

.cf-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 8, 16, 0.92) 0%, rgba(5, 8, 16, 0.55) 42%, rgba(5, 8, 16, 0.2) 70%, transparent 100%),
    linear-gradient(0deg, var(--bg-deepest) 0%, transparent 48%);
}

.cf-hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, var(--bg-deepest));
  pointer-events: none;
}

.cf-hero-content {
  position: relative;
  max-width: 640px;
  padding: 0;
}

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

.cf-hero-tag {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 150, 190, 0.18);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cf-hero-title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.cf-hero-blurb {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
  max-width: 52ch;
}

.cf-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 22px;
  color: var(--text-muted);
  font-size: 13px;
}

.cf-hero-meta .cf-score {
  color: #f5c542;
}

.cf-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
  border: 0;
  cursor: pointer;
}

.cf-btn:hover {
  transform: translateY(-1px);
}

.cf-btn-primary,
.theme-coreflix a.cf-btn-primary {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(37, 150, 190, 0.35);
}

.cf-btn-primary:hover,
.theme-coreflix a.cf-btn-primary:hover {
  background: var(--primary-hover);
  color: #fff !important;
}

.cf-btn-primary .iconfont {
  color: #fff !important;
}

.cf-btn-ghost,
.theme-coreflix a.cf-btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary) !important;
  backdrop-filter: blur(8px);
}

.cf-btn-ghost:hover,
.theme-coreflix a.cf-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff !important;
}

/* ---------- Rows ---------- */
.page-home .cf-main > .container,
.page-home .cf-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
  box-sizing: border-box;
}

.page-home .cf-main > .container {
  padding-top: 8px;
  padding-bottom: 40px;
}

.cf-rows {
  padding: 0;
  position: relative;
  z-index: 3;
}

.cf-row {
  margin-bottom: 28px;
  content-visibility: auto;
  contain-intrinsic-size: 1px 320px;
}

.cf-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 0 12px;
}

.cf-row-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.cf-row-more {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}

.cf-row-more:hover {
  color: var(--primary);
}

.cf-row-track {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 16px 12px;
  overflow: hidden;
  padding: 4px 0 16px;
}

.page-home .cf-card-title {
  font-size: 12px;
  margin-top: 8px;
}

.page-home .cf-card-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Poster cards ---------- */
.cf-card {
  width: auto;
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: 160px 280px;
}

.cf-card-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.2s ease;
}

.cf-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cf-card:hover .cf-card-poster {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(37, 150, 190, 0.45);
  z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
  .cf-card-poster {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .cf-card-poster img {
    transition: transform 0.35s ease;
  }
  .cf-card:hover .cf-card-poster {
    transform: scale(1.05);
  }
  .cf-card:hover .cf-card-poster img {
    transform: scale(1.06);
  }
}

.cf-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 16, 0.35);
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
  font-size: 28px;
}

.cf-card:hover .cf-card-play {
  opacity: 1;
}

.cf-card-remarks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: #fff;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-card-title {
  margin: 10px 2px 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  max-height: 2.7em;
  overflow: hidden;
}

.cf-card-title a {
  color: var(--text-primary) !important;
  text-decoration: none;
}

.cf-card-title a:hover {
  color: var(--primary) !important;
}

/* Grid contexts (type/search/detail related) */
.theme-coreflix .a-con,
.theme-coreflix .filter-list,
.theme-coreflix .vod-list {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 16px 12px;
  padding: 12px 0;
  max-width: 100%;
  overflow: hidden;
}

.theme-coreflix .a-con .cf-card,
.theme-coreflix .filter-list .cf-card {
  width: auto;
}

/* 详情/播放页：猜你喜欢 PC 一行 8 部 */
@media (min-width: 768px) {
  .theme-coreflix.page-detail .play-like .a-con,
  .theme-coreflix.page-play .play-like .a-con,
  .theme-coreflix .play-like .a-con {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 12px 10px;
    overflow: hidden;
    max-width: 100%;
  }

  .theme-coreflix .play-like .cf-card-title {
    font-size: 12px;
  }
}

@media (max-width: 1199px) {
  .theme-coreflix .a-con,
  .theme-coreflix .filter-list,
  .theme-coreflix .vod-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 959px) {
  .theme-coreflix .a-con,
  .theme-coreflix .filter-list,
  .theme-coreflix .vod-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .theme-coreflix .a-con,
  .theme-coreflix .filter-list,
  .theme-coreflix .vod-list,
  .theme-coreflix .play-like .a-con {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 10px;
  }
}

.theme-coreflix .block,
.theme-coreflix .index-block,
.theme-coreflix .main .container,
.theme-coreflix .pt50 {
  background: transparent;
  color: var(--text-primary);
}

.theme-coreflix .main {
  padding-left: 0;
  padding-right: 0;
  min-height: 50vh;
}

.theme-coreflix .main .container {
  max-width: 1400px;
  padding: 20px 28px 40px;
  margin: 0 auto;
}

.theme-coreflix .a-tit h2,
.theme-coreflix .a-tit {
  color: var(--text-primary);
}

.theme-coreflix a:not(.cf-btn) {
  color: var(--primary);
}

.theme-coreflix .a-tit a,
.theme-coreflix .cf-card-title a {
  color: inherit;
}

/* ---------- Footer ---------- */
.cf-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: var(--bg-deepest);
  padding: 28px 28px 40px;
  margin-left: 0;
}

.cf-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.cf-footer-copy {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.cf-footer-links {
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.cf-footer-links a {
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
}

.cf-footer-links a:hover {
  color: var(--primary);
}

.theme-coreflix .footer {
  display: none;
}

/* ---------- Search results ---------- */
.theme-coreflix.page-search .main .container {
  max-width: 1400px;
  padding: 20px 28px 48px;
}

.cf-search-head {
  text-align: center;
  padding: 8px 0 28px;
}

.cf-search-head h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

.cf-search-head p,
.cf-search-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.cf-search-head strong {
  color: var(--primary);
  font-weight: 700;
}

.cf-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cf-search-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  height: 100%;
}

.cf-search-item:hover {
  border-color: rgba(37, 150, 190, 0.25);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.cf-search-poster {
  position: relative;
  flex-shrink: 0;
  width: 112px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.cf-search-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cf-search-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--text-primary);
  font-size: 11px;
  line-height: 1.5;
  backdrop-filter: blur(4px);
}

.cf-search-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cf-search-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.cf-search-title a {
  color: var(--text-primary) !important;
  text-decoration: none;
}

.cf-search-title a:hover {
  color: var(--primary) !important;
}

.cf-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cf-search-tags a {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-secondary) !important;
  font-size: 12px;
  text-decoration: none;
  line-height: 1.5;
}

.cf-search-tags a:hover {
  background: rgba(37, 150, 190, 0.18);
  color: var(--primary) !important;
}

.cf-search-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cf-search-meta-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.6;
}

.cf-search-meta-row dt {
  flex-shrink: 0;
  width: 36px;
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.cf-search-meta-row dd {
  margin: 0;
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
}

.cf-search-meta-row dd a {
  color: var(--primary) !important;
  text-decoration: none;
}

.cf-search-meta-row dd a:hover {
  text-decoration: underline;
}

.cf-search-clamp1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  white-space: normal;
}

.cf-search-clamp3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  color: var(--text-primary) !important;
}

.cf-search-meta-row--plot dd {
  color: var(--text-primary);
}

.cf-search-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.cf-search-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--primary) !important;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(37, 150, 190, 0.28);
}

.cf-search-play:hover {
  background: var(--primary-hover) !important;
  color: #fff !important;
}

.cf-search-play.is-disabled {
  background: var(--bg-surface) !important;
  color: var(--text-muted) !important;
  box-shadow: none;
  cursor: default;
}

.cf-search-play i {
  font-size: 16px;
}

.cf-search-detail {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary) !important;
  font-size: 12px;
  text-decoration: none;
}

.cf-search-detail:hover {
  border-color: rgba(37, 150, 190, 0.4);
  color: var(--primary) !important;
}

@media (max-width: 767px) {
  .theme-coreflix.page-search .main .container {
    padding: 12px 14px 36px;
  }

  .cf-search-head {
    text-align: center;
    padding: 2px 0 12px;
  }

  .cf-search-summary {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    text-align: center;
  }

  .cf-search-again {
    display: none;
  }

  .cf-search-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cf-search-item {
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(26, 34, 54, 0.95) 0%, rgba(15, 20, 32, 0.98) 100%);
  }

  .cf-search-poster {
    width: 92px;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  }

  .cf-search-badge {
    top: auto;
    bottom: 6px;
    right: 6px;
    left: 6px;
    text-align: center;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.78);
  }

  .cf-search-body {
    gap: 6px;
  }

  .cf-search-title {
    font-size: 15px;
    text-align: left;
    line-height: 1.35;
  }

  .cf-search-title a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .cf-search-tags {
    justify-content: flex-start;
    gap: 6px;
    max-height: 28px;
    overflow: hidden;
  }

  .cf-search-tags a {
    padding: 2px 8px;
    font-size: 11px;
  }

  .cf-search-meta {
    gap: 3px;
  }

  .cf-search-meta-row {
    font-size: 12px;
    gap: 8px;
    line-height: 1.45;
  }

  .cf-search-meta-row dt {
    width: 28px;
  }

  .cf-search-meta-row--plot {
    display: none;
  }

  .cf-search-actions {
    justify-content: flex-start;
    gap: 8px;
    padding-top: 2px;
  }

  .cf-search-play,
  .cf-search-detail {
    flex: 1;
    justify-content: center;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .cf-search-empty {
    margin-top: 24px;
    padding: 28px 16px;
    text-align: center;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px dashed rgba(255, 255, 255, 0.08);
  }

  .cf-search-empty p {
    margin: 0 0 12px;
    color: var(--text-secondary);
    font-size: 14px;
  }

  .cf-search-empty a {
    display: inline-flex;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(37, 150, 190, 0.18);
    color: var(--primary) !important;
    text-decoration: none;
    font-weight: 600;
  }

  .theme-coreflix.page-search .page,
  .theme-coreflix.page-search .paging,
  .theme-coreflix.page-search .mac_pages {
    margin-top: 28px;
    margin-bottom: 12px;
    padding-top: 12px;
  }
}

@media (min-width: 768px) {
  .cf-search-again {
    display: none;
  }

  .cf-search-empty {
    margin-top: 28px;
    padding: 36px 20px;
    text-align: center;
    color: var(--text-secondary);
  }

  .cf-search-empty a {
    color: var(--primary) !important;
  }
}

/* ---------- Detail / Play ---------- */
.theme-coreflix.page-detail,
.theme-coreflix .page-detail,
body.theme-coreflix.page-detail {
  background: var(--bg-deepest);
}

.theme-coreflix.page-detail .movbox,
.theme-coreflix.page-detail .cover {
  background-color: var(--bg-base);
}

.theme-coreflix.page-detail .cover {
  opacity: 0.35;
  filter: blur(2px) saturate(0.9);
}

.theme-coreflix.page-detail .info,
.theme-coreflix.page-detail .con,
.theme-coreflix.page-detail .tit,
.theme-coreflix.page-detail .p1,
.theme-coreflix.page-detail .p2,
.theme-coreflix.page-detail .name,
.theme-coreflix.page-detail .juqing,
.theme-coreflix.page-detail .zhuyan,
.theme-coreflix.page-detail .daoyan,
.theme-coreflix.page-detail .zhuangtai {
  color: var(--text-primary);
}

.theme-coreflix.page-detail .play a,
.theme-coreflix.page-detail .info .play a {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 999px;
  border: 0;
  box-shadow: 0 8px 22px rgba(37, 150, 190, 0.3);
}

.theme-coreflix.page-detail .type a,
.theme-coreflix.page-detail .type span {
  color: var(--text-secondary);
}

.theme-coreflix.page-detail .info .con .p1 .tit {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
}

.theme-coreflix.page-detail .info .con .p1 .type {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  white-space: normal;
  overflow: visible;
}

.theme-coreflix.page-detail .info .con .p1 .type span {
  max-width: 100%;
  white-space: normal;
}

.theme-coreflix.page-detail .info .con .p1 p {
  white-space: normal;
  overflow: visible;
}

.theme-coreflix.page-detail .main,
.theme-coreflix.page-detail .movbox {
  max-width: 100%;
  overflow-x: hidden;
}

.theme-coreflix.page-detail .movbox .container,
.theme-coreflix.page-detail .main .container {
  max-width: 1400px;
  padding-left: 28px;
  padding-right: 28px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.theme-coreflix.page-detail .block,
.theme-coreflix.page-detail .a-tit h2 {
  color: var(--text-primary);
}

.theme-coreflix.page-detail .info .pic {
  flex-shrink: 0;
  width: 180px;
  margin-right: 28px;
}

.theme-coreflix.page-detail .info .pic a {
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  background: var(--bg-elevated);
}

.theme-coreflix.page-detail .info .pic img {
  width: 100%;
  height: 100%;
  max-width: none;
  margin-bottom: 0;
  object-fit: cover;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  display: block;
}

.theme-coreflix.page-detail .info .con {
  flex: 1;
  min-width: 0;
}

@media (max-width: 767px) {
  .theme-coreflix.page-detail .info .pic {
    width: 132px;
    margin: 0 auto 16px;
  }
}

.theme-coreflix.page-play,
body.theme-coreflix.page-play {
  background: var(--bg-deepest);
}

.theme-coreflix.page-play .playbox,
.theme-coreflix.page-play .player,
.theme-coreflix.page-play .play-side,
.theme-coreflix.page-play .player-info {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.06);
}

.theme-coreflix.page-play .play-crumb,
.theme-coreflix.page-play .play-crumb a {
  color: var(--text-secondary);
}

.theme-coreflix.page-play .play-crumb a:hover,
.theme-coreflix.page-play .name {
  color: var(--text-primary);
}

.theme-coreflix.page-play .play-side__tab.is-active,
.theme-coreflix.page-play .play-side__sort-btn.is-active {
  background: rgba(37, 150, 190, 0.25);
  color: #fff;
  border-color: var(--primary);
}

.theme-coreflix.page-play .play-side__tab,
.theme-coreflix.page-play .playlist a,
.theme-coreflix.page-play .play-side a {
  color: var(--text-secondary);
}

.theme-coreflix .play-side__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-coreflix .cf-side-toggle {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  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) {
  .theme-coreflix .cf-side-toggle--close {
    display: inline-flex;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    padding: 0;
  }

  .theme-coreflix .cf-side-toggle--close:hover {
    color: #fff;
    background: rgba(37, 150, 190, 0.22);
    border-color: rgba(37, 150, 190, 0.45);
  }

  .theme-coreflix .cf-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(5, 8, 16, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .theme-coreflix .cf-side-toggle--open:hover {
    background: rgba(37, 150, 190, 0.9);
    border-color: transparent;
  }

  .theme-coreflix.page-play .player {
    position: relative;
  }

  .theme-coreflix .playbox.is-side-hidden .play-side {
    display: none !important;
  }

  .theme-coreflix .playbox.is-side-hidden .player {
    width: 100% !important;
  }

  .theme-coreflix .playbox.is-side-hidden .player .player-wrapper {
    border-radius: 12px 12px 0 0;
  }

  .theme-coreflix .playbox.is-side-hidden .player .player-info {
    border-radius: 0 0 12px 12px;
  }

  .theme-coreflix .playbox.is-side-hidden .cf-side-toggle--open {
    display: inline-flex;
  }
}

.theme-coreflix.page-play .playlist a:hover,
.theme-coreflix.page-play .playlist a.active,
.theme-coreflix.page-play .playlist .active a {
  color: #fff;
  background: rgba(37, 150, 190, 0.2);
  border-color: var(--primary);
}

@media (max-width: 767px) {
  .theme-coreflix.page-play .main .container {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 32px;
  }

  .theme-coreflix.page-play .play-crumb {
    margin: 10px 0 10px;
    font-size: 12px;
  }

  .theme-coreflix.page-play .player .player-wrapper {
    margin: 0 !important;
    border-radius: 10px;
  }

  .theme-coreflix.page-play .player .player-info {
    padding: 10px 0 6px !important;
    margin-top: 10px !important;
  }

  .theme-coreflix.page-play .player .player-info .minfo .name {
    font-size: 17px;
    white-space: normal;
    word-break: break-word;
  }

  .theme-coreflix.page-play .play-side {
    margin-top: 12px;
    border-radius: 10px;
    overflow: hidden;
  }

  .theme-coreflix.page-play .play-side__head {
    padding: 10px 10px 0;
    gap: 8px;
  }

  .theme-coreflix.page-play .play-side__toolbar {
    padding: 0 2px;
  }

  .theme-coreflix.page-play .play-side__tabs {
    flex-wrap: wrap !important;
    overflow: visible !important;
    max-height: none !important;
    padding: 0 2px 6px;
    gap: 6px;
  }

  .theme-coreflix.page-play .play-side__tab {
    flex: 0 1 auto;
  }

  .theme-coreflix.page-play .play-side__eps,
  .theme-coreflix.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;
    padding: 0 10px 12px !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
    -webkit-overflow-scrolling: auto;
  }

  .theme-coreflix.page-play .play-side__eps a,
  .theme-coreflix.page-play .jisu a {
    margin: 0 !important;
    min-width: 0 !important;
    flex: unset !important;
    width: 100%;
    line-height: 34px;
    font-size: 12px;
    border-radius: 8px;
    padding: 0 4px;
  }

  .theme-coreflix.page-play .play-like,
  .theme-coreflix.page-play .block {
    margin-top: 16px;
  }

  .theme-coreflix.page-play .mj-tab .a-con .cf-card:nth-child(n + 7),
  .theme-coreflix.page-play .play-like .a-con .cf-card:nth-child(n + 7),
  .theme-coreflix.page-detail .mj-tab .a-con .cf-card:nth-child(n + 7),
  .theme-coreflix.page-detail .play-like .a-con .cf-card:nth-child(n + 7) {
    display: none;
  }
}

@media (max-width: 380px) {
  .theme-coreflix.page-play .play-side__eps,
  .theme-coreflix.page-play .jisu {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* 详情页剧集：移动端一行 2 个 */
@media (max-width: 767px) {
  .theme-coreflix .detail-playlist .playlist-eps,
  .theme-coreflix.page-detail .detail-playlist .playlist-eps {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .theme-coreflix .detail-playlist .playlist-eps a {
    padding: 11px 8px !important;
  }
}

/* Misc legacy overrides under theme */
.theme-coreflix .banner,
.theme-coreflix .index-banner {
  display: none;
}

.theme-coreflix .mt50,
.theme-coreflix .pt50 {
  margin-top: 0 !important;
  padding-top: 16px !important;
}

.theme-coreflix .container {
  color: var(--text-primary);
}

.theme-coreflix input,
.theme-coreflix select,
.theme-coreflix textarea {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.08);
}

.theme-coreflix .paging a,
.theme-coreflix .mac_pages a,
.theme-coreflix .page a {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: transparent;
}

.theme-coreflix .paging .active a,
.theme-coreflix .mac_pages .active a,
.theme-coreflix .page .active a,
.theme-coreflix .page .page-active {
  background: var(--primary);
  color: #fff;
}

.theme-coreflix .page,
.theme-coreflix .paging,
.theme-coreflix .mac_pages {
  margin: 28px 0 16px;
  padding-top: 8px;
}

@media (max-width: 767px) {
  .theme-coreflix .page,
  .theme-coreflix .paging,
  .theme-coreflix .mac_pages,
  .theme-coreflix.page-search .page {
    margin-top: 28px !important;
    margin-bottom: 20px;
    padding-top: 12px;
  }
}

html.theme-coreflix body.search-popup-open,
html.theme-coreflix body.cf-nav-open {
  overflow: hidden;
}

/* ---------- Mobile menu drawer (bcine-style, right slide) ---------- */
.cf-menu-drawer {
  display: none;
}

.cf-drawer-head {
  display: none;
}

@media (max-width: 767px) {
  .cf-sidebar {
    display: none !important;
  }

  .cf-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;
  }

  .cf-sidebar-mask.is-open {
    display: block;
    opacity: 1;
  }

  .cf-menu-drawer,
  .cf-menu-drawer.cf-menu-drawer-portal {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    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(--bg-base);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    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;
  }

  .cf-menu-drawer.is-open,
  .cf-menu-drawer.cf-menu-drawer-portal.is-open {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
  }

  .cf-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 rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(37, 150, 190, 0.16) 0%, transparent 72%);
    flex-shrink: 0;
  }

  .cf-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .cf-drawer-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(37, 150, 190, 0.4);
    background: var(--bg-elevated);
  }

  .cf-drawer-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cf-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(--text-muted);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    cursor: pointer;
  }

  .cf-drawer-close:active {
    background: rgba(255, 255, 255, 0.12);
  }

  .cf-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px calc(18px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .cf-drawer-main,
  .cf-drawer-sub {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .cf-drawer-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
  }

  .cf-drawer-label {
    display: block;
    padding: 14px 6px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .cf-drawer-sub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cf-drawer-main li a {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    font-size: 15px;
    color: var(--text-primary);
    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;
  }

  .cf-drawer-sub li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    font-size: 13px;
    color: var(--text-primary);
    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;
  }

  .cf-drawer-main li a i,
  .cf-drawer-sub li a i {
    flex-shrink: 0;
    font-size: 18px;
    color: var(--primary);
  }

  .cf-drawer-sub li a i {
    font-size: 16px;
  }

  .cf-drawer-main li a span,
  .cf-drawer-sub li a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cf-drawer-main li a.active,
  .cf-drawer-sub li a.active {
    background: rgba(37, 150, 190, 0.14);
    border-color: rgba(37, 150, 190, 0.28);
    color: #fff;
  }

  .cf-drawer-main li a:active,
  .cf-drawer-sub li a:active {
    background: rgba(255, 255, 255, 0.08);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .page-home .cf-hero-inner {
    padding-top: 32px;
    padding-bottom: 40px;
  }

  .page-home .cf-main > .container,
  .page-home .cf-hero-inner,
  .cf-topbar-inner {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 767px) {
  html.theme-coreflix body,
  body.theme-coreflix {
    padding-left: 0;
  }

  .cf-topbar {
    left: 0;
    padding: 0 12px;
    gap: 8px;
  }

  .cf-topbar-inner {
    display: none;
  }

  .cf-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .cf-brand-mobi,
  .cf-search-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cf-brand-mobi {
    justify-content: flex-start;
  }

  .cf-search-trigger {
    display: inline-flex !important;
    margin-left: auto;
    color: var(--primary);
    font-size: 22px;
    position: relative;
    z-index: 2;
  }

  .cf-history-top {
    display: none;
  }

  .cf-hero {
    min-height: 58vh;
  }

  .cf-hero-title {
    font-size: 1.75rem;
  }

  .cf-nav-tip {
    display: none;
  }

  .cf-row-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
  }

  .page-home .cf-row-track .cf-card:nth-child(n + 7) {
    display: none;
  }
}

@media (min-width: 769px) {
  .cf-history-top {
    display: none;
  }
}

/* 移动端筛选：取消横滑，选项全部换行展示 */
@media (max-width: 991px) {
  .theme-coreflix .category.block,
  .theme-coreflix .block.category {
    overflow: visible !important;
  }
  .theme-coreflix .category dl {
    align-items: flex-start !important;
    overflow: visible !important;
  }
  .theme-coreflix .category dl dd {
    display: flex !important;
    flex-wrap: wrap !important;
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: 100% !important;
    overflow: visible !important;
    overflow-x: visible !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    line-clamp: unset !important;
    max-height: none !important;
    height: auto !important;
    padding-right: 0 !important;
    gap: 6px !important;
  }
  .theme-coreflix .category dl dd a {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
  .theme-coreflix .category dl .screen-tog {
    display: none !important;
  }
}

/* ---------- Back to top ---------- */
.cf-gotop {
  position: fixed;
  right: 22px;
  bottom: 28px;
  z-index: 1200;
  width: 46px;
  height: 46px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff !important;
  background: linear-gradient(160deg, #35b4de 0%, #1f86ad 100%) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(37, 150, 190, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease, background .2s ease, box-shadow .2s ease;
  cursor: pointer;
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
}

.cf-gotop svg {
  display: block;
  flex-shrink: 0;
}

.cf-gotop svg path {
  fill: #fff !important;
}

.cf-gotop.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cf-gotop:hover,
.cf-gotop:focus {
  background: linear-gradient(160deg, #4ec4ea 0%, #2596be 100%) !important;
  color: #fff !important;
  box-shadow: 0 12px 32px rgba(37, 150, 190, 0.45);
}

.cf-gotop:active {
  transform: translateY(1px) scale(0.96);
}

@media (max-width: 767px) {
  .cf-gotop {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .cf-gotop {
    right: 14px;
    bottom: 20px;
    width: 42px;
    height: 42px;
  }
}
