/* 播放器加载态：纯黑背景 +「視頻加載中...」（对照 需求/11.18 PC-01/PC-02） */

.ys-play-page .ys2-detail-player,
.ys-play-page .ys-player-box,
.ys2-detail-player.ys-player-box,
.ys2-player-stage .ys-player-box {
  background: #000 !important;
}

.ys-play-page .ys2-detail-player .MacPlayer,
.ys-player-box .MacPlayer,
.MacPlayer {
  background: #000 !important;
}

.ys-play-page .ys2-detail-player video,
.ys-player-box video,
.MacPlayer video {
  background: #000 !important;
}

.ys-player-box {
  position: relative;
}

.ys-player-loading {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: #000;
  color: rgba(255, 255, 255, 0.92);
  font: 14px/1.4 "PingFang SC", "Microsoft YaHei", sans-serif;
  pointer-events: none;
}

.ys-player-loading--poster {
  background-color: #000;
  background-image: linear-gradient(rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.38)),
    var(--ys-player-poster);
  background-position: center;
  background-size: cover;
}

/* 只有第一次加载用实色遮罩，点击后立刻进入播放器 */
.ys-player-loading--blocking {
  background: #000;
  pointer-events: auto;
  cursor: pointer;
}

/* 已经进入播放器之后的缓冲：透明底，换一套字，不挡进度条 */
.ys-player-loading--later {
  background: transparent;
  pointer-events: none;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.ys-player-loading--later .ys-player-loading__text {
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.ys-player-loading[hidden] {
  display: none;
}

.ys-player-loading__spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ys-player-loading-spin 0.8s linear infinite;
}

.ys-player-loading__text {
  letter-spacing: 0.02em;
}

.ys-play-page .ys2-detail-player.ys-player-box,
.ys2-video-detail-page .ys2-detail-player {
  overflow: hidden;
}

.ys-player-play {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 50%;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ys-player-play:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.ys-player-play__icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 0.2rem;
  border-style: solid;
  border-width: 0.7rem 0 0.7rem 1.15rem;
  border-color: transparent transparent transparent #fff;
}

.MacPlayer video::-webkit-media-controls-overlay-play-button {
  display: none !important;
}

/* —— 对齐旧站 DPlayer / mac-player-controls（自建控制条） —— */
.MacPlayer {
  /* 旧站定制 DPlayer theme 为 #ffffff（非上游默认 #b7daff） */
  --ys-mac-theme: #ffffff;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
}

.MacPlayer video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.MacPlayer.is-hide-controller {
  cursor: none;
}

.ys-mac-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  height: 98px;
  pointer-events: none;
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==")
    repeat-x bottom;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ys-mac-controller {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  height: 41px;
  padding: 0 20px;
  box-sizing: border-box;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.MacPlayer.is-hide-controller .ys-mac-mask,
.MacPlayer.is-hide-controller .ys-mac-controller,
.MacPlayer.is-hide-controller .ys-mac-corner {
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
}

.ys-mac-notice {
  position: absolute;
  bottom: 60px;
  left: 20px;
  z-index: 40;
  padding: 7px 20px;
  border-radius: 2px;
  background: rgba(28, 28, 28, 0.9);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.ys-mac-notice.is-visible {
  opacity: 1;
}

/* 控制条隐藏时仍显示快进/快退提示 */
.MacPlayer.is-hide-controller .ys-mac-notice.is-visible {
  opacity: 1;
}

.ys-mac-bar-wrap {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 40px;
  height: 4px;
  padding: 5px 0;
  cursor: pointer;
  box-sizing: content-box;
}

.ys-mac-bar-time {
  position: absolute;
  top: -20px;
  left: 0;
  z-index: 2;
  padding: 5px 7px;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 12px;
  text-align: center;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.1s ease-in-out;
  white-space: nowrap;
}

.ys-mac-bar-time.is-hidden {
  opacity: 0;
}

.ys-mac-bar {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 5px;
  background: hsla(0, 0%, 100%, 0.2);
}

.ys-mac-loaded,
.ys-mac-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  height: 4px;
  border-radius: 5px;
  pointer-events: none;
}

.ys-mac-loaded {
  background: hsla(0, 0%, 100%, 0.4);
}

.ys-mac-played {
  background: var(--ys-mac-theme);
}

.ys-mac-thumb {
  position: absolute;
  top: 0;
  right: 5px;
  width: 11px;
  height: 11px;
  margin-top: -4px;
  margin-right: -10px;
  border-radius: 50%;
  background: var(--ys-mac-theme);
  transform: scale(0);
  transition: transform 0.3s ease-in-out;
  pointer-events: none;
}

.ys-mac-bar-wrap:hover .ys-mac-thumb,
.MacPlayer.is-seeking .ys-mac-thumb {
  transform: scale(1);
}

.ys-mac-icons {
  display: flex;
  align-items: center;
  height: 40px;
  min-width: 0;
}

.ys-mac-icons-left {
  flex: 1 1 auto;
  gap: 0;
}

.ys-mac-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ys-mac-btn:focus-visible {
  outline: 2px solid #8ac7ff;
  outline-offset: -2px;
}

.ys-mac-btn svg {
  display: block;
  width: 22px;
  height: 22px;
  opacity: 0.85;
  pointer-events: none;
  fill: currentColor;
}

.ys-mac-btn svg path:not([fill='none']) {
  fill: currentColor;
}

.ys-mac-btn:hover svg {
  opacity: 1;
}

/* 旧站控制栏 iconfont：播放/暂停/±10/音量 */
.ys-mac-btn .iconfont {
  display: block;
  font-size: 22px;
  line-height: 1;
  color: #fff;
  opacity: 0.85;
  pointer-events: none;
}

.ys-mac-btn:hover .iconfont {
  opacity: 1;
}

.ys-mac-btn.ys-mac-play .iconfont,
.ys-mac-btn.ys-mac-volume-btn .iconfont {
  font-size: 26px;
}

.ys-mac-time {
  min-width: 0;
  margin-left: 4px;
  overflow: hidden;
  color: #eee;
  font: 13px/40px Arial, "Microsoft YaHei", sans-serif;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

.ys-mac-time__dur {
  color: #ffffff80;
}

/* 对齐旧站 .dplayer-volume：inline-block + bar top:17px，与图标同一水平线 */
.ys-mac-volume {
  position: relative;
  display: inline-block;
  height: 40px;
  cursor: pointer;
  vertical-align: top;
}

.ys-mac-volume .ys-mac-volume-btn {
  display: inline-flex;
  vertical-align: middle;
  width: 43px;
}

.ys-mac-volume-bar-wrap {
  display: inline-block;
  height: 100%;
  margin: 0 10px 0 -5px;
  vertical-align: middle;
}

.ys-mac-volume-bar {
  position: relative;
  top: 17px;
  width: 0;
  height: 3px;
  /* 勿 overflow:hidden，否则音量圆点会被裁掉 */
  overflow: visible;
  background: #aaa;
  transition: width 0.3s ease-in-out;
  cursor: pointer;
}

.ys-mac-volume:hover .ys-mac-volume-bar,
.ys-mac-volume.is-open .ys-mac-volume-bar {
  width: 45px;
}

.ys-mac-volume-inner {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 100%;
  background: var(--ys-mac-theme);
  transition: width 0.1s ease;
  will-change: width;
}

.ys-mac-volume-thumb {
  position: absolute;
  top: 0;
  right: 5px;
  width: 11px;
  height: 11px;
  margin-top: -4px;
  margin-right: -10px;
  border-radius: 50%;
  background: var(--ys-mac-theme);
  /* 旧站：音量条展开时圆点常显 scale(1) */
  transform: scale(0);
  transition: transform 0.3s ease-in-out;
  pointer-events: none;
}

.ys-mac-volume:hover .ys-mac-volume-thumb,
.ys-mac-volume.is-open .ys-mac-volume-thumb {
  transform: scale(1);
}

.ys-mac-corner {
  position: absolute;
  right: 20px;
  bottom: 5px;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 30px;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ys-mac-corner > * {
  pointer-events: auto;
}

.ys-mac-speed,
.ys-mac-full {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.ys-mac-speed {
  margin-right: 8px;
}

.ys-mac-speed svg,
.ys-mac-full svg {
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #fff;
}

.ys-mac-full svg path {
  fill: #fff;
}

.ys-mac-speed svg path {
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.ys-mac-speed svg circle {
  fill: #fff;
  stroke: none;
}

.ys-mac-speed-menu {
  position: absolute;
  right: 30px;
  bottom: 38px;
  z-index: 110;
  width: 128px;
}

.ys-mac-speed-menu[hidden] {
  display: none !important;
}

.ys-mac-speed-dialog {
  box-sizing: border-box;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(35, 35, 38, 0.96);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.ys-mac-speed-dialog button {
  display: block;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: 13px -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.ys-mac-speed-dialog button[aria-checked="true"] {
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

.ys-mac-speed-dialog button[aria-checked="true"]::after {
  content: "✓";
  float: right;
}

.MacPlayer.is-speed-open .ys-mac-mask,
.MacPlayer.is-speed-open .ys-mac-controller,
.MacPlayer.is-speed-open .ys-mac-corner {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
}

@keyframes ys-player-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ys-player-loading__spinner {
    animation-duration: 2s;
  }
}

.ys-player-error {
  position: absolute;
  z-index: 25;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.72);
  color: rgba(255, 255, 255, 0.92);
  font: 14px/1.45 "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: center;
}

.ys-player-error__msg {
  margin: 0;
  max-width: 28rem;
}

.ys-player-error__action,
.ys-player-error__form button {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 0.5rem;
  padding: 0.55rem 1.1rem;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.ys-player-error__action:hover,
.ys-player-error__form button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.ys-player-error__form {
  display: grid;
  gap: 0.5rem;
  width: min(100%, 22rem);
  text-align: left;
}

.ys-player-error__form label {
  font-size: 13px;
  opacity: 0.9;
}

.ys-player-error__form textarea {
  min-height: 5rem;
  padding: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  resize: vertical;
  font: inherit;
}

.ys-player-error__form button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ys-player-error__status {
  margin: 0;
  max-width: 22rem;
  font-size: 13px;
}

/* Keep large playback-page sections below the player out of rendering work until they approach the viewport. */
@supports (content-visibility: auto) {
  .ys-play-page .ys2-detail-copy,
  .ys-play-page .ys2-playlist,
  .ys-play-page .ys2-detail-related,
  .ys-play-page .ys2-detail-recommend {
    content-visibility: auto;
    contain-intrinsic-size: auto 360px;
  }
}
