/* Web Streaming Custom Dark Theme Enhancements */
@layer utilities {
  .scrollbar-none::-webkit-scrollbar {
    display: none;
  }
  .scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

body {
  background-color: #0b0f19;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

/* Glassmorphism effects */
.glass-panel {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-nav {
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Card hover glow */
.card-hover {
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 28px -6px rgba(59, 130, 246, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

/* Custom player aspect ratio container */
.player-ratio-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 75vh;
  background: #000;
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
}

/* Active Episode Pill Pulse */
.active-pill {
  background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
  color: #ffffff !important;
  font-weight: 600;
  border-color: #60a5fa !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* ============================================================
   ArtPlayer Settings & Popover Menu Overhaul (齿轮面板视觉深度重构)
   确保子菜单切换顺畅、点击有效、消除文字折行重叠
   ============================================================ */
.art-video-player .art-settings {
  min-width: 310px !important;
  max-width: 360px !important;
  height: auto !important; /* 关键：根据子菜单内容自适应展开，避免写死导致截断 */
  max-height: 420px !important;
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.85), 0 0 25px rgba(59, 130, 246, 0.2) !important;
  padding: 8px 6px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

/* 核心修复：未激活的面板必须隐藏，激活面板才展现，杜绝面板重叠遮挡事件 */
.art-video-player .art-settings .art-setting-panel {
  display: none !important;
  flex-direction: column !important;
  gap: 3px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.art-video-player .art-settings .art-setting-panel.art-current {
  display: flex !important;
}

/* 每一个设置菜单行 */
.art-video-player .art-settings .art-setting-panel .art-setting-item {
  height: 42px !important;
  min-height: 42px !important;
  line-height: 42px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border-radius: 9px !important;
  transition: background-color 0.15s ease !important;
  box-sizing: border-box !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  white-space: nowrap !important;
  background-color: transparent !important;
  cursor: pointer !important;
}

.art-video-player .art-settings .art-setting-panel .art-setting-item:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* 确保内部文字/图标不拦截外层点击事件，使点击 100% 触发在 item 上 */
.art-video-player .art-settings .art-setting-panel .art-setting-item > div {
  pointer-events: none !important;
}

/* 当前高亮/激活行 */
.art-video-player .art-settings .art-setting-panel .art-setting-item.art-current {
  background-color: rgba(37, 99, 235, 0.25) !important;
  color: #60a5fa !important;
  font-weight: 600 !important;
}

/* 左侧标题与图标 */
.art-video-player .art-settings .art-setting-panel .art-setting-item .art-setting-item-left {
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #f1f5f9 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* 右侧副标题/提示语/开关 */
.art-video-player .art-settings .art-setting-panel .art-setting-item .art-setting-item-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.art-video-player .art-settings .art-setting-panel .art-setting-item .art-setting-item-right-tooltip {
  font-size: 12px !important;
  color: #94a3b8 !important;
  font-weight: 400 !important;
  white-space: nowrap !important;
}

/* 子菜单返回顶栏 */
.art-video-player .art-settings .art-setting-panel .art-setting-item-back {
  height: 40px !important;
  min-height: 40px !important;
  line-height: 40px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  margin-bottom: 5px !important;
  font-weight: 600 !important;
  color: #93c5fd !important;
  font-size: 13px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
}

/* 底部清晰度快捷选择器浮层样式联动 */
.art-video-player .art-selector-list {
  min-width: 180px !important;
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8) !important;
  padding: 6px !important;
}

.art-video-player .art-selector-list .art-selector-item {
  height: 38px !important;
  line-height: 38px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  color: #e2e8f0 !important;
  transition: all 0.15s ease !important;
}

.art-video-player .art-selector-list .art-selector-item:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.art-video-player .art-selector-list .art-selector-item.art-current {
  background-color: rgba(37, 99, 235, 0.25) !important;
  color: #60a5fa !important;
  font-weight: 600 !important;
}

/* ============================================================
   分类导航药丸按钮与播放完结遮罩样式
   ============================================================ */
.cat-pill {
  background: rgba(30, 41, 59, 0.7);
  color: #94a3b8;
  border: 1px solid rgba(51, 65, 85, 0.6);
  backdrop-filter: blur(8px);
}
.cat-pill:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #f8fafc;
  border-color: rgba(96, 165, 250, 0.4);
}
.cat-pill.active-cat {
  background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
  color: #ffffff !important;
  border-color: rgba(147, 197, 253, 0.7) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
}

/* 播放完结遮罩 */
#player-finished-overlay {
  z-index: 35;
}

/* ============================================================
   移动端与平板端 原生 App 级体验优化 (Native App Look & Feel)
   ============================================================ */

/* 苹果刘海屏与底部指示条安全区适配 */
.safe-pt {
  padding-top: max(0.5rem, env(safe-area-inset-top));
}
.safe-pb {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

/* 手机底部 App 原生悬浮导航栏 */
.mobile-bottom-bar {
  background: rgba(9, 13, 22, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 消除移动端点击蓝色闪烁高亮 */
* {
  -webkit-tap-highlight-color: transparent;
}

/* 丝滑滚动体验 */
.smooth-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* 现代电影海报盒模型：标准 2:3 黄金比例与防溢出阴影 */
.poster-card {
  width: 100%;
  aspect-ratio: 2 / 3;
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background-color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.poster-card:active {
  transform: scale(0.97);
}

@media (min-width: 640px) {
  .poster-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 16px 30px -8px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.25);
  }
}

/* 移动端横向滑块边缘渐变柔和遮罩 */
.scroll-mask-x {
  mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
}

/* ============================================================
   全网视频解析与下载专区样式 (Downloader View Styles)
   ============================================================ */
.dl-textarea-glow {
  transition: all 0.25s ease;
  background: rgba(15, 23, 42, 0.75);
}
.dl-textarea-glow:focus {
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.25), inset 0 0 10px rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}

.dl-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.dl-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.15);
}

.dl-quality-btn {
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.6);
}
.dl-quality-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #ffffff;
}
.dl-quality-btn.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.dl-image-thumb {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dl-image-thumb:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}



