/* ============================================
   GoMovie · Pink Theme — 短视频播放页专用样式
   ============================================ */

/* --- Header 透明化 --- */
header.sticky,
header.sticky.top-0,
header.sticky.top-0.z-40,
header.pink-header,
.pink-header {
  background: transparent !important;
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* --- Header 宽度约束 --- */
header.sticky .max-w-6xl,
header.pink-header .max-w-6xl,
.pink-header .max-w-6xl {
  width: var(--sp-video-w, 100%) !important;
  max-width: var(--sp-video-w, 100%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

header.sticky form[action="/search"].hidden.md\:flex,
header.pink-header form[action="/search"].hidden.md\:flex,
.pink-header form[action="/search"].hidden.md\:flex {
  max-width: var(--sp-video-w, 100%) !important;
}

header.sticky .fade-x,
header.sticky .fade-x > div,
header.pink-header .fade-x,
header.pink-header .fade-x > div,
.pink-header .fade-x,
.pink-header .fade-x > div {
  max-width: var(--sp-video-w, 100%) !important;
}

#cat-panel {
  max-width: min(320px, var(--sp-video-w, 100%)) !important;
}

header.sticky form[action="/search"].md\:hidden,
header.pink-header form[action="/search"].md\:hidden,
.pink-header form[action="/search"].md\:hidden {
  max-width: var(--sp-video-w, 100%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* --- play_sp 小屏模拟 --- */
html.sp-play header form[action="/search"].hidden.md\:flex { display: none !important; }
html.sp-play header form[action="/search"].md\:hidden { display: block !important; }
html.sp-play header .fade-x.hidden.md\:block { display: none !important; }
html.sp-play header #btn-cat { display: inline-flex !important; }

header input[name="q"],
header input[placeholder],
header .max-w-6xl input,
header .relative input,
.pink-header input[name="q"],
.pink-header .pink-search {
  background-color: transparent !important;
  background: transparent !important;
  border-color: transparent !important;
}

/* --- 全屏滚动视口 --- */
@media (min-width: 1024px) {
  #sp_viewport, html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  #sp_viewport::-webkit-scrollbar, html::-webkit-scrollbar, body::-webkit-scrollbar {
    width: 0; height: 0; background: transparent; display: none;
  }
}

:root { --vh: 100vh; }
html, body { height: 100%; margin: 0; padding: 0; overflow-x: hidden !important; }
html.sp-play,
body.sp-play { overflow: hidden !important; background: #000; }
html.sp-play main { max-width: none !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
html.sp-play footer,
html.sp-play .mobile-bottom-nav { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }

.container {
  position: relative;
  height: calc(var(--vh)) !important;
  width: 100% !important;
  background: #000;
  color: #fff;
  overflow: hidden !important;
}

#sp_viewport {
  height: calc(var(--vh)) !important;
  width: 100% !important;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
}

.ep-card {
  width: 100% !important;
  height: calc(var(--vh)) !important;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  overflow: hidden;
}

.ep-card > .bg {
  position: absolute;
  inset: 0;
  background: #000;
  pointer-events: none;
}

/* --- 播放器定位 --- */
#sp_player_wrap {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: calc(var(--vh)) !important;
  z-index: 0;
  pointer-events: none;
  margin: 0 auto;
  max-width: 100vw;
  overflow: hidden;
  width: 100vw;
}

#sp_player_wrap video {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  height: calc(var(--vh)) !important;
  width: auto !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: contain !important;
  object-position: center center !important;
  margin: 0 !important;
  pointer-events: none !important;
  display: block !important;
}

#sp_player_wrap > * { box-sizing: border-box; }

#danmu_layer {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

/* --- 工具栏 --- */
#sp_toolbar {
  position: fixed;
  right: 1rem;
  bottom: 25%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: auto;
}
#sp_toolbar button { pointer-events: auto; }
.like-icon { color: #f472b6 !important; }

/* --- 开始覆盖层 --- */
#sp_start_overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.2));
  display: none;
  align-items: center;
  justify-content: center;
}
#sp_start_overlay .box {
  background: rgba(0, 0, 0, 0.6);
  padding: 18px;
  border-radius: 12px;
  color: #fff;
}

/* --- 目录抽屉 --- */
#sp_toc_drawer {
  position: fixed;
  left: 0; right: auto;
  top: 0; bottom: 0;
  width: auto;
  max-width: 50vw;
  box-sizing: border-box;
  transform: translateX(-120%);
  background: rgba(0, 0, 0, 0.0);
  color: #fff;
  z-index: 108;
  box-shadow: 2px 0 18px rgba(0, 0, 0, 0.6);
  transition: transform 240ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: transform;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
  padding: 12px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#sp_toc_drawer::-webkit-scrollbar { width: 0 !important; height: 0 !important; }

#sp_toc_drawer .toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-weight: 600;
}
#sp_toc_drawer .toc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 4px 40px 4px;
}
#sp_toc_drawer .toc-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  text-align: left;
  transition: background 160ms ease;
}
#sp_toc_drawer .toc-item.active {
  background: rgba(244, 114, 182, 0.15);
  color: #f9a8d4;
}
#sp_toc_drawer .toc-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
#sp_toc_drawer .toc-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 6px;
}

@media (max-width: 640px) {
  #sp_toc_drawer { width: 78vw; }
}

/* --- 飞心动画 --- */
.fly-heart {
  position: fixed;
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #f472b6;
  z-index: 120;
  pointer-events: none;
  transition: transform 1000ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 1000ms linear;
  will-change: transform, opacity;
}
.fly-heart.small { width: 28px; height: 28px; font-size: 18px; }

/* --- 分类抽屉 --- */
html.sp-play #cat-overlay #cat-panel {
  background: rgba(0, 0, 0, 0.0) !important;
  right: var(--sp-cat-right, 0px);
  max-width: min(320px, var(--sp-video-w, 100%)) !important;
  border-left-color: rgba(251, 207, 232, 0.1) !important;
}
html.sp-play #cat-backdrop {
  background: rgba(0, 0, 0, 0.0) !important;
}

@media (max-width: 767px) {
  html.sp-play header #btn-cat { display: inline-flex !important; }
}
@media (min-width: 768px) {
  html.sp-play header #btn-cat { display: inline-flex !important; }
}
html.sp-play header #btn-cat {
  background: rgba(0, 0, 0, 0.0) !important;
  border-color: rgba(255, 255, 255, 0.0) !important;
}

/* --- 快进/后退手势 --- */
#sp_seek_gesture { pointer-events: auto; }

#sp_seek_ui {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px 18px 12px;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
}
#sp_seek_gesture.seeking #sp_seek_ui,
#sp_seek_gesture.controls-visible #sp_seek_ui {
  opacity: 1;
  transform: translateY(0);
}

#sp_seek_time_row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
#sp_seek_time_row span { font-variant-numeric: tabular-nums; }

#sp_seek_bar {
  position: relative;
  margin-top: 8px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
#sp_seek_bar_played {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: rgba(249, 168, 212, 0.6);
}
#sp_seek_bar_preview {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: rgba(244, 114, 182, 0.95);
}
#sp_seek_knob {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  border-radius: 999px;
  background: #f9a8d4;
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.4);
  left: 0%;
}
