/* ============================================================
   晓林影视 XIAOLIN-TV — 全新「流光旗舰版 UI」& 全站护眼日间/夜间双模引擎
   · 默认开启「☀️ 护眼日间模式」(Warm-Alabaster 暖瓷白底，久看不累)，支持一键切换「🌙 沉浸夜间模式」并永久本地记忆
   · 顶栏胶囊与下方影片网格宽度严格一致、居中对齐，彻底消除顶栏右侧多余留白
   · 严格隔离 TV 模式 (:not(.tv))，绝不干扰电视端极光大屏
   ============================================================ */

/* ---------- 1. 全站护眼日间模式 (Light Mode · 默认激活) ---------- */
body[data-mtheme="light"]:not(.tv) {
  --bg: #f3f6fb;
  --bg2: #ffffff;
  --card: #ffffff;
  --card-hover: #f8faff;
  --card-br: rgba(15, 23, 42, 0.08);
  --txt: #1e293b;
  --dim: #64748b;
  --acc: #2563eb;
  --acc2: #0ea5e9;
  --danger: #e11d48;
  --ok: #10b981;
  --glass: rgba(255, 255, 255, 0.92);
  --shadow: 0 12px 32px -6px rgba(15, 23, 42, 0.08);
  --glow: 0 8px 22px rgba(37, 99, 235, 0.22);
  --hero-overlay: linear-gradient(90deg, rgba(11, 17, 32, 0.92) 0%, rgba(11, 17, 32, 0.58) 52%, rgba(11, 17, 32, 0.12) 100%);
  background: linear-gradient(180deg, #eef3fa 0%, #f5f7fb 360px, #f3f6fb 100%);
  color: var(--txt);
}

body[data-mtheme="light"]:not(.tv) .topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

body[data-mtheme="light"]:not(.tv) .brand-name {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body[data-mtheme="light"]:not(.tv) .nav a.active {
  color: #ffffff !important;
}

body[data-mtheme="light"]:not(.tv) .card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

body[data-mtheme="light"]:not(.tv) .card:hover {
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.28);
}

body[data-mtheme="light"]:not(.tv) .searchbox {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.09);
}

body[data-mtheme="light"]:not(.tv) .icon-btn,
body[data-mtheme="light"]:not(.tv) .chip:not(.on) {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  color: #334155;
}

body[data-mtheme="light"]:not(.tv) .modal-box,
body[data-mtheme="light"]:not(.tv) .admin-card,
body[data-mtheme="light"]:not(.tv) .side-card,
body[data-mtheme="light"]:not(.tv) .rel-rail,
body[data-mtheme="light"]:not(.tv) .user-hero-card,
body[data-mtheme="light"]:not(.tv) .user-kpi-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.09);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
}

body[data-mtheme="light"]:not(.tv) .bottom-tab-bar {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

/* ---------- 2. 沉浸影院夜间模式 (Dark Mode) ---------- */
body.ui-modern[data-mtheme="dark"]:not(.tv) {
  --bg: #090d16;
  --bg2: #111827;
  --card: #131c2e;
  --card-hover: #1b263b;
  --card-br: rgba(255, 255, 255, 0.08);
  --txt: #f1f5f9;
  --dim: #94a3b8;
  --acc: #38bdf8;
  --acc2: #2563eb;
  --danger: #fb7185;
  --ok: #34d399;
  --glass: rgba(15, 23, 42, 0.88);
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.5);
  --glow: 0 0 26px rgba(56, 189, 248, 0.32);
  --hero-overlay: linear-gradient(90deg, rgba(9, 13, 22, 0.94) 0%, rgba(9, 13, 22, 0.56) 52%, rgba(9, 13, 22, 0.14) 100%);
  background: radial-gradient(circle at 50% 0%, #13203d 0%, #090d16 55%);
  color: var(--txt);
}

/* ---------- 3. 顶栏「☀️ 护眼日间 / 🌙 沉浸夜间」切换胶囊 ---------- */
.color-mode-btn {
  width: auto !important;
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

body[data-mtheme="light"]:not(.tv) .color-mode-btn {
  background: linear-gradient(135deg, #fffbeb, #fef3c7) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #b45309 !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
}

body[data-mtheme="dark"]:not(.tv) .color-mode-btn {
  background: rgba(30, 41, 59, 0.85) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  color: #e0f2fe !important;
}

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

@media (max-width: 820px) {
  .color-mode-btn {
    padding: 0 10px !important;
    height: 34px !important;
    font-size: 12px;
  }
  .color-mode-btn .cm-txt {
    display: none;
  }
}

/* ---------- 4. 流光旗舰版 UI: 悬浮毛玻璃胶囊顶栏 (与下方影片严格居中对齐，零右侧留白) ---------- */
body.ui-modern:not(.tv) #themeBtn {
  display: none !important;
}

@media (min-width: 961px) {
  /* 容器与顶栏共享完全一致的居中宽度 (1480px)，确保上下左右边缘 100% 齐平 */
  body.ui-modern:not(.tv) .container {
    max-width: 1480px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 22px !important;
    padding-right: 22px !important;
  }

  body.ui-modern:not(.tv) .topbar {
    position: sticky;
    top: 12px;
    z-index: 60;
    width: min(calc(100% - 44px), 1436px);
    max-width: 1436px;
    margin: 12px auto 8px;
    border-radius: 999px;
    border: 1px solid var(--card-br);
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
  }

  body.ui-modern:not(.tv) .topbar-inner {
    width: 100%;
    max-width: none;
    height: 64px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
  }

  body.ui-modern:not(.tv) .brand {
    flex-shrink: 0;
  }

  body.ui-modern:not(.tv) .nav {
    flex: 0 1 auto !important;
    margin: 0 auto;
    background: rgba(148, 163, 184, 0.11);
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid var(--card-br);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  body.ui-modern:not(.tv) .nav a {
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14.5px;
    font-weight: 600;
  }

  body.ui-modern:not(.tv) .nav a.active {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  }

  body.ui-modern:not(.tv) .topbar-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
  }

  body.ui-modern:not(.tv) .searchbox {
    border-radius: 999px;
    width: 240px;
    padding: 7px 14px;
  }

  body.ui-modern:not(.tv) .announce {
    width: min(calc(100% - 44px), 1436px);
    max-width: 1436px;
    margin: 10px auto 4px;
  }
}

/* ---------- 5. 流光旗舰版 UI: 杂志级「左72%主巨幕 + 右28%五片导视轨」 ---------- */
body:not(.ui-modern) .fs-hero-rail,
body:not(.ui-modern) .fs-quick-bar,
body:not(.ui-modern) #fsTop10Row {
  display: none !important;
}

@media (min-width: 961px) {
  body.ui-modern:not(.tv) .hero.fs-hero-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 336px;
    gap: 20px;
    height: 430px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    margin-bottom: 20px;
  }

  body.ui-modern:not(.tv) .hero.fs-hero-stage .fs-hero-main {
    position: relative;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
    background: #0b1120;
    box-shadow: 0 20px 46px -10px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 960px) {
  .fs-hero-rail {
    display: none !important;
  }
  .hero.fs-hero-stage .fs-hero-main {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
  }
}

body.ui-modern:not(.tv) .hero .hero-bg::after {
  background:
    linear-gradient(90deg, rgba(8, 13, 26, 0.92) 0%, rgba(8, 13, 26, 0.56) 52%, rgba(8, 13, 26, 0.08) 100%),
    linear-gradient(180deg, transparent 50%, rgba(8, 13, 26, 0.86) 100%) !important;
}

body.ui-modern:not(.tv) .hero .hero-content {
  color: #ffffff !important;
  left: 38px;
  bottom: 34px;
  max-width: 580px;
}

body.ui-modern:not(.tv) .hero .hero-title {
  color: #ffffff !important;
  font-size: clamp(24px, 2.6vw, 40px);
  font-weight: 900;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
}

body.ui-modern:not(.tv) .hero .hero-desc {
  color: rgba(241, 245, 249, 0.88) !important;
  font-size: 14.5px;
  line-height: 1.6;
}

body.ui-modern:not(.tv) .hero .hero-meta .tag {
  background: rgba(37, 99, 235, 0.85);
  color: #ffffff;
  font-weight: 700;
  border: none;
}

body.ui-modern:not(.tv) .hero .hero-meta .tag.plain {
  background: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  backdrop-filter: blur(6px);
}

body.ui-modern:not(.tv) .hero .hero-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

body.ui-modern:not(.tv) .hero #heroPlay {
  border-radius: 999px;
  padding: 11px 28px;
  font-size: 15.5px;
  font-weight: 800;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
  border: none;
  color: #fff;
}

body.ui-modern:not(.tv) .hero #heroFavBtn {
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 14.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

/* 右侧 5 片联动导视轨 */
.fs-hero-rail {
  background: var(--card);
  border: 1px solid var(--card-br);
  border-radius: 24px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-shadow: var(--shadow);
  height: 100%;
  overflow: hidden;
}

.fs-rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  flex: 1;
  min-height: 0;
  text-decoration: none;
  color: var(--txt);
}

.fs-rail-item:hover {
  background: var(--card-hover);
}

.fs-rail-item.active {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--acc);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.fs-rail-thumb {
  width: 88px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #0f172a;
  position: relative;
}

.fs-rail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fs-rail-info {
  flex: 1;
  min-width: 0;
}

.fs-rail-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-rail-item.active .fs-rail-title {
  color: var(--acc);
}

.fs-rail-sub {
  font-size: 12px;
  color: var(--dim);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 6. 流光旗舰版 UI: 快捷分类胶囊栏 (.fs-quick-bar) ---------- */
.fs-quick-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scrollbar-width: none;
}

.fs-quick-bar::-webkit-scrollbar {
  display: none;
}

.fs-qpill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-br);
  color: var(--txt);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  transition: all 0.18s ease;
}

.fs-qpill:hover {
  transform: translateY(-2px);
  border-color: var(--acc);
  color: var(--acc);
}

.fs-qpill.primary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff !important;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

/* ---------- 7. 流光旗舰版 UI: 🔥 TOP 10 热播风云榜 (#fsTop10Row) ---------- */
#fsTop10Row {
  margin-bottom: 30px;
}

.fs-top10-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 1180px) {
  .fs-top10-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .fs-top10-grid {
    display: flex;
    overflow-x: auto;
    gap: 14px;
    padding-bottom: 8px;
    scrollbar-width: none;
  }
  .fs-top10-grid .card {
    flex: 0 0 150px;
  }
}

.fs-top10-card {
  position: relative;
  overflow: visible !important;
}

.fs-rank-badge {
  position: absolute;
  left: -6px;
  bottom: 42px;
  z-index: 4;
  font-size: 64px;
  font-weight: 900;
  font-style: italic;
  line-height: 0.82;
  letter-spacing: -4px;
  pointer-events: none;
  background: linear-gradient(180deg, #94a3b8 0%, rgba(148, 163, 184, 0.25) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.28));
}

.fs-rank-badge.r1 {
  background: linear-gradient(180deg, #ff6b3d 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fs-rank-badge.r2 {
  background: linear-gradient(180deg, #f59e0b 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fs-rank-badge.r3 {
  background: linear-gradient(180deg, #0ea5e9 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- 8. 流光旗舰版卡片与网格居中对齐优化 ---------- */
body.ui-modern:not(.tv) .grid {
  justify-content: center;
}

body.ui-modern:not(.tv) .card {
  border-radius: 16px;
  padding: 6px 6px 10px;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease;
}

body.ui-modern:not(.tv) .card:hover {
  transform: translateY(-6px);
}

body.ui-modern:not(.tv) .card-poster {
  border-radius: 12px;
}

body.ui-modern:not(.tv) .card-badge {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
  font-weight: 800;
  border-radius: 7px;
  padding: 2px 8px;
}

body.ui-modern:not(.tv) .card-name {
  font-weight: 700;
  margin-top: 8px;
  padding: 0 4px;
}

body.ui-modern:not(.tv) .card-sub,
body.ui-modern:not(.tv) .card-src {
  padding: 0 4px;
}

body.ui-modern:not(.tv) .row-head .row-title {
  font-size: 22px;
  font-weight: 900;
}
