/* 频道页默认深色背景，降低视频周围的视觉干扰。 */
:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #10151a;
  color: #e7edf1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 1000px;
  margin: auto;
  padding: 24px;
}
header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
header h1 {
  margin: 0;
  font-size: 24px;
}
header span {
  margin-left: auto;
  color: #91e0b2;
  font-size: 12px;
  letter-spacing: 2px;
}
a {
  color: #a7b4bf;
}
p {
  color: #a7b4bf;
  line-height: 1.6;
}
/* 播放器及其覆盖层：画面保持比例，进入按钮和提示叠放在视频区域内。 */
#player {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}
#video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
button {
  border: 0;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
summary:focus-visible {
  outline: 3px solid #98e4b9;
  outline-offset: 4px;
}
.entry {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
#enter {
  pointer-events: auto;
  background: #98e4b9;
  border-radius: 999px;
  padding: 14px 24px;
  color: #13251c;
  min-height: 48px;
}
/* 覆盖 .entry 的布局显示方式，让脚本设置 hidden 时确实隐藏进入按钮。 */
.entry[hidden] {
  display: none;
}
#status {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(64px, env(safe-area-inset-bottom));
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border-radius: 8px;
  background: #000b;
  font-size: 13px;
  line-height: 1.5;
  color: #d4dfe6;
  overflow-wrap: anywhere;
}
#control-feedback {
  position: absolute;
  left: 50%;
  bottom: max(68px, env(safe-area-inset-bottom));
  z-index: 1;
  max-width: calc(100% - 24px);
  padding: 7px 11px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #000c;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}
/* 播放控制覆盖在画面右下角；脚本按播放与操作状态控制其显隐。 */
#controls {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 4px;
  transition:
    opacity 0.2s,
    visibility 0.2s;
}
#fullscreen,
#sleep-timer,
#volume-balance,
#brightness,
#picture-in-picture,
#page-fullscreen {
  position: relative;
  display: grid;
  place-items: center;
  height: 48px;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  filter: drop-shadow(0 1px 3px #000);
}
#fullscreen {
  width: 48px;
}
#sleep-timer,
#volume-balance,
#brightness,
#picture-in-picture,
#page-fullscreen {
  width: 48px;
}
#picture-in-picture[hidden] {
  display: none;
}
#sleep-timer {
  padding: 0;
}
#sleep-timer:hover,
#volume-balance:hover,
#brightness:hover,
#picture-in-picture:hover,
#page-fullscreen:hover,
#fullscreen:hover {
  background: #ffffff30;
}
#volume-balance[aria-pressed='true'],
#volume-balance[aria-pressed='true']:hover,
#sleep-timer.active,
#sleep-timer.active:hover {
  background: transparent;
  color: #98e4b9;
}
#volume-balance[aria-pressed='true']::after,
#sleep-timer.active::after {
  position: absolute;
  right: 7px;
  bottom: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}
#sleep-timer-menu {
  position: absolute;
  right: 156px;
  bottom: 52px;
  width: max-content;
  padding: 6px;
  border: 1px solid #ffffff24;
  border-radius: 10px;
  background: #172028f2;
  box-shadow: 0 8px 24px #0008;
}
#brightness-panel {
  position: absolute;
  right: 208px;
  bottom: 52px;
  width: 210px;
  padding: 12px;
  border: 1px solid #ffffff24;
  border-radius: 10px;
  background: #172028f2;
  box-shadow: 0 8px 24px #0008;
}
#brightness-panel label {
  display: block;
  margin-bottom: 8px;
  color: #e7edf1;
  font-size: 13px;
}
#brightness-range {
  display: block;
  width: 100%;
  accent-color: #98e4b9;
}
#sleep-timer-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  background: transparent;
  color: #e7edf1;
  text-align: left;
}
#sleep-timer-status {
  margin: 0 0 4px;
  padding: 8px 14px;
  border-bottom: 1px solid #ffffff24;
  color: #98e4b9;
  font-size: 13px;
  white-space: nowrap;
}
#sleep-timer-menu button:hover,
#sleep-timer-menu button:focus-visible {
  background: #ffffff1a;
}
#sleep-timer-menu button[data-cancel] {
  margin-top: 4px;
  border-top: 1px solid #ffffff24;
  color: #ffb7b7;
}
#player.controls-hidden {
  cursor: none;
}
/* 脚本判定静置后同时隐藏视觉和点击目标，避免不可见按钮仍误接触摸。 */
#player.controls-hidden #controls {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
h2 {
  margin: 24px 0 8px;
  font-size: 22px;
}
#next {
  margin-top: 0;
}
details {
  margin-top: 24px;
  border-top: 1px solid #29343e;
}
summary {
  padding: 18px 0;
  cursor: pointer;
  color: #a7b4bf;
}
ol {
  margin-top: 0;
  padding-left: 28px;
}
li {
  padding: 12px 8px;
  border-bottom: 1px solid #29343e;
  line-height: 1.5;
}
li.active {
  color: #98e4b9;
}
/* 全屏时填满浏览器提供的区域，解除普通页面中的固定宽高比。 */
#player:fullscreen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
}
/* 网页全屏不调用浏览器全屏 API，仅让播放器覆盖当前页面视口。 */
body.player-expanded {
  overflow: hidden;
}
#player.page-fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  aspect-ratio: auto;
  border-radius: 0;
}
/* 手机上的视频抵消正文边距贴边显示；其他内容仍保留阅读边距。 */
@media (max-width: 600px) {
  main {
    padding: 16px;
  }
  header {
    gap: 12px;
    margin-bottom: 16px;
  }
  header h1 {
    font-size: 20px;
  }
  header span {
    font-size: 10px;
    letter-spacing: 1px;
  }
  #player:not(:fullscreen):not(.page-fullscreen) {
    margin-inline: -16px;
    width: calc(100% + 32px);
    border-radius: 0;
  }
  #status {
    font-size: 12px;
  }
  h2 {
    margin-top: 20px;
    font-size: 19px;
  }
}
/* 手机触控界面只保留一种全屏入口，并按剩余按钮重新对齐弹层。 */
@media (hover: none) and (pointer: coarse) and (max-width: 600px),
  (hover: none) and (pointer: coarse) and (max-height: 600px) and (max-width: 900px) {
  #picture-in-picture,
  #page-fullscreen {
    display: none;
  }
  #sleep-timer-menu {
    right: 52px;
  }
  #brightness-panel {
    right: 104px;
  }
}
/* 尊重系统减少动态效果的偏好，关闭播放控制的显隐过渡。 */
@media (prefers-reduced-motion: reduce) {
  #controls {
    transition: none;
  }
}

/* 点播操作在播放器内，全屏时仍可拖动进度和返回直播。 */
#vod-controls {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  background: #172028e8;
}
#vod-controls[hidden] {
  display: none;
}
#vod-controls button,
#vod-form button {
  padding: 8px;
  border-radius: 6px;
  background: #98e4b9;
  color: #13251c;
  white-space: nowrap;
}
#vod-progress {
  flex: 1;
  min-width: 24px;
  accent-color: #98e4b9;
}
#vod-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#vod-form label {
  width: 100%;
}
#vod-path {
  flex: 1;
  min-width: 160px;
  padding: 10px;
  border: 1px solid #52616d;
  border-radius: 6px;
  font: inherit;
}
#current {
  overflow-wrap: anywhere;
}
