/* ============================================================
   MTV 播放程序 —— 复刻 jdzent.top/115/mtv 播放特效
   ============================================================ */

:root {
  --codex-bg-0: #06111d;
  --codex-bg-1: #0b1726;
  --codex-bg-2: #10243a;
  --codex-panel: rgba(9, 18, 31, .76);
  --codex-panel-strong: rgba(13, 25, 42, .88);
  --codex-panel-soft: rgba(255, 255, 255, .055);
  --codex-text: #eef7ff;
  --codex-muted: #9fb0c4;
  --codex-line: rgba(151, 190, 226, .22);
  --codex-line-strong: rgba(115, 210, 255, .38);
  --codex-cyan: #4dd0ff;
  --codex-teal: #3ee6b6;
  --codex-amber: #ffd166;
  --codex-rose: #ff7ac8;
  --codex-shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --codex-glow: 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 60px rgba(77, 208, 255, .12);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body, #root { min-height: 100%; }

body {
  margin: 0;
  color: var(--codex-text);
  font-family: "Noto Sans SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% -10%, rgba(77, 208, 255, .26), transparent 34%),
    radial-gradient(circle at 88% 2%, rgba(62, 230, 182, .18), transparent 30%),
    radial-gradient(circle at 62% 112%, rgba(255, 209, 102, .15), transparent 36%),
    linear-gradient(145deg, var(--codex-bg-0), var(--codex-bg-1) 46%, #09101b);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 网格线 overlay（42px 双网格） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(113, 201, 255, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 201, 255, .068) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .016) 1px, transparent 1px);
  background-size: 42px 42px;
  background-position: 0 0, 0 0, 21px 21px, 21px 21px;
  opacity: .9;
}

/* 内阴影光晕 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  border: 0;
  box-shadow: inset 0 0 90px rgba(77, 208, 255, .08);
}

* { scrollbar-color: rgba(77, 208, 255, .48) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(77, 208, 255, .48);
  background-clip: padding-box;
}
::-webkit-scrollbar-track { background: transparent; }

a { color: #8be4ff; text-decoration-color: rgba(139, 228, 255, .34); text-underline-offset: 3px; }
button, input, textarea, select { font-family: inherit; }

/* ============ 顶部导航（复刻原站面包屑 + 粉色胶囊链接） ============ */
.codex-nav {
  position: relative;
  z-index: 2;
  width: min(1376px, calc(100vw - 64px));
  margin: 18px auto 0;
}
.codex-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid rgba(151, 190, 226, .22);
  border-radius: 16px;
  background: rgba(9, 18, 31, .58);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .22);
  backdrop-filter: blur(14px);
}
.codex-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--codex-muted);
}
.codex-breadcrumb a { text-decoration: none; }
.codex-breadcrumb .sep { color: rgba(151, 190, 226, .4); }
.codex-breadcrumb .cur { color: var(--codex-text); font-weight: 600; }
.codex-nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 原站粉色胶囊导航链接样式 */
.nav-link {
  display: inline-block;
  padding: 2px 10px;
  color: #ff7ac8;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #ff7ac8;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: #ff7ac8; color: #fff; }
.nav-link.active { background: #ff7ac8; color: #fff; }

/* ============ 视频网格（复刻原站 hope-grid 6 列布局） ============ */
.codex-main {
  position: relative;
  z-index: 2;
  width: min(1376px, calc(100vw - 64px));
  margin: 22px auto 60px;
}
.hope-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.hope-grid > * { min-width: 0; }

.grid-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(151, 190, 226, .14);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02)), var(--codex-panel);
  cursor: pointer;
  position: relative;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.grid-item:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 208, 255, .38);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .34), 0 0 0 1px rgba(77, 208, 255, .14);
}
.grid-item:active { transform: translateY(0); }

.item-thumbnail {
  aspect-ratio: 1/1;
  width: 100%;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: #0b1020;
  position: relative;
}
.item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 缩略图加载前的占位播放图标 */
.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(77, 208, 255, .35);
}
.thumb-placeholder svg { width: 34%; height: 34%; }

/* 时长角标 */
.item-duration {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 1px 5px;
  font-size: 10px;
  line-height: 1.5;
  color: #fff;
  background: rgba(0, 0, 0, .66);
  border-radius: 4px;
  letter-spacing: .3px;
}

.grid-item p {
  margin: 0;
  padding: 6px 8px 7px;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--codex-text);
}
.grid-item .item-meta {
  font-size: 10px;
  color: var(--codex-muted);
  padding-top: 0;
  padding-bottom: 8px;
}

.codex-empty {
  margin-top: 60px;
  text-align: center;
  color: var(--codex-muted);
}
.codex-empty p { margin: 6px 0; }
.codex-empty .hint { font-size: 12px; }
.codex-empty code {
  color: #dff9ff;
  border: 1px solid rgba(151, 190, 226, .16);
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
  padding: 2px 6px;
}

@media (max-width: 900px) {
  .hope-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .codex-nav, .codex-main { width: calc(100vw - 32px); }
}
@media (max-width: 600px) {
  .hope-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .item-thumbnail { border-radius: 6px 6px 0 0; }
  .grid-item p { font-size: 10px; }
}

/* ============================================================
   播放弹窗 —— 逐行复刻原站 gbVideoOverlay / gbVideoBox
   ============================================================ */
#gbVideoOverlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: transparent;
  backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease;
}
#gbVideoOverlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

/* 弹窗框（原站最终渲染值：codex 主题渐变覆盖 + gbFrameGlow 呼吸光晕） */
#gbVideoBox {
  position: relative;
  width: min(980px, 96vw);
  padding: 6px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 149, 209, .92), rgba(255, 227, 244, .80) 42%, rgba(189, 162, 255, .86) 82%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .22),
    0 0 20px rgba(255, 122, 200, .36),
    0 0 42px rgba(189, 162, 255, .28),
    0 24px 88px rgba(0, 0, 0, .46);
  animation: gbFrameGlow 3.2s ease-in-out infinite alternate;
}

#gbArtWrap {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 78vh;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

#gbVideoClose {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
  transition: background .15s ease, transform .15s ease;
}
#gbVideoClose:hover { background: rgba(255, 255, 255, .2); transform: none; }

/* 标题条：半透明深色横条（参考 4560 实现） */
#gbVideoTitle {
  position: relative;
  z-index: 3;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #e5e7eb;
  text-align: center;
  font-weight: 600;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .72);
  backdrop-filter: blur(8px);
  word-break: break-all;
}

@keyframes gbFrameGlow {
  0%   { box-shadow: 0 0 0 1px rgba(255, 255, 255, .18), 0 0 14px rgba(255, 122, 200, .34), 0 0 30px rgba(183, 140, 255, .22); }
  100% { box-shadow: 0 0 0 1px rgba(255, 255, 255, .28), 0 0 26px rgba(255, 122, 200, .58), 0 0 56px rgba(183, 140, 255, .44); }
}

/* 全屏时铺满 */
#gbArtWrap:fullscreen,
#gbArtWrap:-webkit-full-screen,
#gbArtWrap.art-fullscreen,
#gbArtWrap.art-fullscreen-web {
  aspect-ratio: auto !important;
  max-height: none !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
}

/* ============================================================
   弹窗光影 —— 原站 codex 主题规则（全部收敛在 #gbVideoBox 一层，
   #gbArtWrap 保持朴素 14px 圆角黑底，与原站实测一致）
   ============================================================ */

/* 1) 渐变外壳 + 静态光晕 */
#gbVideoBox {
  position: relative !important;
  isolation: isolate !important;
  overflow: visible !important;
  border-radius: 22px !important;
  background:
    linear-gradient(135deg, rgba(255, 149, 209, .92), rgba(255, 227, 244, .80) 42%, rgba(189, 162, 255, .86) 82%) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .22),
    0 0 20px rgba(255, 122, 200, .36),
    0 0 42px rgba(189, 162, 255, .28),
    0 24px 88px rgba(0, 0, 0, .46) !important;
}

/* 2) 旋转变色光影：4 个彩色光斑 + conic-gradient 扫光，
     整体 rotate(360deg) 旋转 + hue-rotate 变色（codexPlayerGlow 5.6s） */
#gbVideoBox::before {
  content: "" !important;
  position: absolute !important;
  inset: -14px !important;
  z-index: -1 !important;
  pointer-events: none !important;
  border-radius: 30px !important;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 122, 200, .75) 0 7px, transparent 8px),
    radial-gradient(circle at 92% 14%, rgba(189, 162, 255, .70) 0 6px, transparent 7px),
    radial-gradient(circle at 16% 92%, rgba(255, 193, 227, .58) 0 6px, transparent 7px),
    radial-gradient(circle at 94% 86%, rgba(142, 84, 233, .72) 0 7px, transparent 8px),
    conic-gradient(from 140deg, rgba(255, 122, 200, 0), rgba(255, 122, 200, .50), rgba(189, 162, 255, .16), rgba(255, 193, 227, .40), rgba(142, 84, 233, .52), rgba(255, 122, 200, 0));
  filter: blur(12px) saturate(128%) !important;
  opacity: .82 !important;
  animation: codexPlayerGlow 5.6s linear infinite !important;
}

/* 3) 内发光装饰边框（白色细边框 + inset 光晕） */
#gbVideoBox::after {
  content: "" !important;
  position: absolute !important;
  inset: 4px !important;
  z-index: 1 !important;
  pointer-events: none !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, .18) !important;
  box-shadow: inset 0 0 28px rgba(255, 255, 255, .055) !important;
}

/* 4) video 元素层级与圆角（置于内发光边框之上） */
.codex-video-player-frame video {
  position: relative !important;
  z-index: 2 !important;
  border-radius: 17px !important;
  background: #000 !important;
  box-shadow: none !important;
}

/* 5) 五种光影主题（原站 codex-glow-*：边框本体 + 光斑同时变色，JS 轮换 → 边框变色） */
#gbVideoBox.codex-glow-aurora {
  background: linear-gradient(135deg, #0fd850, #23d5ab 40%, #4776e6 72%, #8e54e9) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), 0 0 18px rgba(35, 213, 171, .55), 0 0 38px rgba(71, 118, 230, .4), 0 0 64px rgba(142, 84, 233, .28), 0 24px 88px rgba(0, 0, 0, .46) !important;
}
#gbVideoBox.codex-glow-aurora::before {
  background:
    radial-gradient(circle at 8% 10%, rgba(35, 213, 171, .82) 0 7px, transparent 8px),
    radial-gradient(circle at 92% 14%, rgba(71, 118, 230, .76) 0 6px, transparent 7px),
    radial-gradient(circle at 16% 92%, rgba(15, 216, 80, .62) 0 6px, transparent 7px),
    radial-gradient(circle at 94% 86%, rgba(142, 84, 233, .78) 0 7px, transparent 8px),
    conic-gradient(from 40deg, rgba(35, 213, 171, 0), rgba(35, 213, 171, .58), rgba(71, 118, 230, .24), rgba(142, 84, 233, .50), rgba(35, 213, 171, 0)) !important;
}
#gbVideoBox.codex-glow-gold {
  background: linear-gradient(135deg, #f7971e, #ffd200 28%, #f7c948 52%, #c9871b 78%, #f7971e) !important;
  box-shadow: 0 0 0 1px rgba(255, 220, 80, .42), 0 0 14px rgba(247, 151, 30, .58), 0 0 30px rgba(255, 210, 0, .38), 0 0 54px rgba(201, 135, 27, .24), 0 24px 88px rgba(0, 0, 0, .46) !important;
}
#gbVideoBox.codex-glow-gold::before {
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 210, 0, .82) 0 7px, transparent 8px),
    radial-gradient(circle at 92% 14%, rgba(247, 151, 30, .76) 0 6px, transparent 7px),
    radial-gradient(circle at 16% 92%, rgba(247, 201, 72, .62) 0 6px, transparent 7px),
    radial-gradient(circle at 94% 86%, rgba(201, 135, 27, .72) 0 7px, transparent 8px),
    conic-gradient(from 250deg, rgba(255, 210, 0, 0), rgba(255, 210, 0, .58), rgba(247, 151, 30, .32), rgba(247, 201, 72, .46), rgba(201, 135, 27, .38), rgba(255, 210, 0, 0)) !important;
}
#gbVideoBox.codex-glow-neon {
  background: linear-gradient(135deg, #00f2fe, #4facfe 50%, #00c9a7) !important;
  box-shadow: 0 0 0 2px rgba(0, 242, 254, .5), 0 0 12px rgba(0, 242, 254, .72), 0 0 30px rgba(79, 172, 254, .48), 0 0 56px rgba(0, 201, 167, .3), 0 24px 88px rgba(0, 0, 0, .46) !important;
}
#gbVideoBox.codex-glow-neon::before {
  background:
    radial-gradient(circle at 8% 10%, rgba(0, 242, 254, .82) 0 7px, transparent 8px),
    radial-gradient(circle at 92% 14%, rgba(79, 172, 254, .76) 0 6px, transparent 7px),
    radial-gradient(circle at 16% 92%, rgba(0, 201, 167, .62) 0 6px, transparent 7px),
    radial-gradient(circle at 94% 86%, rgba(0, 242, 254, .78) 0 7px, transparent 8px),
    conic-gradient(from 90deg, rgba(0, 242, 254, 0), rgba(0, 242, 254, .58), rgba(79, 172, 254, .24), rgba(0, 201, 167, .50), rgba(0, 242, 254, 0)) !important;
}
#gbVideoBox.codex-glow-rose {
  background: linear-gradient(135deg, #c0392b, #f857a6 45%, #8e0e66) !important;
  box-shadow: 0 0 0 1px rgba(255, 100, 130, .32), 0 0 16px rgba(248, 87, 166, .52), 0 0 34px rgba(192, 57, 43, .38), 0 0 58px rgba(142, 14, 102, .24), 0 24px 88px rgba(0, 0, 0, .46) !important;
}
#gbVideoBox.codex-glow-rose::before {
  background:
    radial-gradient(circle at 10% 12%, rgba(248, 87, 166, .85) 0 7px, transparent 8px),
    radial-gradient(circle at 90% 16%, rgba(255, 100, 130, .72) 0 6px, transparent 7px),
    radial-gradient(circle at 18% 90%, rgba(192, 57, 43, .62) 0 6px, transparent 7px),
    radial-gradient(circle at 94% 84%, rgba(142, 14, 102, .80) 0 7px, transparent 8px),
    conic-gradient(from 145deg, rgba(248, 87, 166, 0), rgba(248, 87, 166, .62), rgba(255, 100, 130, .20), rgba(142, 14, 102, .56), rgba(248, 87, 166, 0)) !important;
}
#gbVideoBox.codex-glow-galaxy {
  background: linear-gradient(135deg, #2d1b69, #7b2ff7 45%, #4a0e8f 72%, #130f40) !important;
  box-shadow: 0 0 0 1px rgba(123, 47, 247, .48), 0 0 20px rgba(123, 47, 247, .58), 0 0 42px rgba(74, 14, 143, .42), 0 0 72px rgba(45, 27, 105, .38), 0 24px 88px rgba(0, 0, 0, .46) !important;
}
#gbVideoBox.codex-glow-galaxy::before {
  background:
    radial-gradient(circle at 8% 10%, rgba(123, 47, 247, .82) 0 7px, transparent 8px),
    radial-gradient(circle at 92% 14%, rgba(149, 90, 255, .76) 0 6px, transparent 7px),
    radial-gradient(circle at 16% 92%, rgba(74, 14, 143, .62) 0 6px, transparent 7px),
    radial-gradient(circle at 94% 86%, rgba(45, 27, 105, .85) 0 7px, transparent 8px),
    conic-gradient(from 200deg, rgba(123, 47, 247, 0), rgba(123, 47, 247, .58), rgba(149, 90, 255, .24), rgba(74, 14, 143, .52), rgba(123, 47, 247, 0)) !important;
}

/* 6) 移动端（≤720px，原站）：GPU 轻量动画 codexPlayerGlowLite + 弹窗布局调整 */
@media (max-width: 720px) {
  #gbVideoBox {
    width: 98vw !important;
    max-width: 98vw !important;
    padding: 4px !important;
    border-radius: 16px !important;
  }
  #gbArtWrap {
    width: 100% !important;
    max-height: 88vh !important;
  }
  #gbVideoTitle {
    font-size: 14px !important;
    margin-top: 8px !important;
  }
  #gbVideoBox::before {
    display: block !important;
    filter: blur(8px) saturate(116%) !important;
    animation: codexPlayerGlowLite 6s linear infinite !important;
    will-change: transform, opacity !important;
  }
}

/* 减少动态效果偏好：关闭全部动画（原站） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes codexPlayerGlow {
  0%   { transform: rotate(0deg) scale(1); filter: blur(12px) saturate(128%) hue-rotate(0deg); opacity: .76; }
  35%  { transform: rotate(126deg) scale(1.018); filter: blur(14px) saturate(145%) hue-rotate(34deg); opacity: .92; }
  70%  { transform: rotate(252deg) scale(.992); filter: blur(11px) saturate(135%) hue-rotate(-22deg); opacity: .80; }
  100% { transform: rotate(360deg) scale(1); filter: blur(12px) saturate(128%) hue-rotate(0deg); opacity: .76; }
}
@keyframes codexPlayerGlowLite {
  0%   { transform: rotate(0deg) scale(1); opacity: .72; }
  50%  { transform: rotate(180deg) scale(1.012); opacity: .92; }
  100% { transform: rotate(360deg) scale(1); opacity: .72; }
}

/* 加载状态文字 */
.gb-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #fff;
  font-size: 14px;
  gap: 10px;
}
.gb-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: #ff7ac8;
  animation: gbSpin .8s linear infinite;
}
@keyframes gbSpin { to { transform: rotate(360deg); } }

/* Artplayer 主题色微调（粉色调） */
.artplayer-app .art-icon-button svg,
.artplayer-app .art-control svg { filter: none; }
