/* 播放页：≥1200px 播放器左、355px 侧栏右（片名 → 选集 → 工具列）；以下改上下堆叠（片名 → 工具列 → 选集）。
   选集为 widget/playlist 共用样式（main.css），这里只覆写侧栏内的紧凑版 */
.dg-play-main .dg-module-title {
  font-size: 24px;
}

.dg-pw-stage {
  margin-bottom: 40px;
}

.dg-pw-player {
  background: #000;
}

.dg-player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

/* 第三方播放器常带固定宽高内联样式，强制填满容器 */
.dg-player-box > * {
  width: 100% !important;
  height: 100% !important;
}

.dg-pw-side {
  display: flex;
  flex-direction: column;
}

.dg-pw-info {
  position: relative;
  order: 1;
  padding: 20px 0 20px 25px;
}

.dg-pw-info::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 0;
  width: 5px;
  height: 34px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.dg-pw-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  line-height: 34px;
}

.dg-pw-title a {
  color: inherit;
}

.dg-pw-title a:hover {
  color: var(--accent-tab);
}

.dg-pw-ep {
  margin-left: 10px;
  color: var(--text-muted);
  font-size: 0.75em;
  font-weight: 400;
}

/* 沿用详情页 tag 样式，但手机版详情页是置中，这里维持靠左 */
.dg-pw-tags.dg-vd-tags {
  justify-content: flex-start;
}

.dg-pw-score {
  color: var(--score-green);
  font-weight: 700;
}

/* 工具列：图示在上、文字在下，平均分配宽度 */
.dg-pw-tools {
  display: flex;
  order: 2;
  gap: 10px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

.dg-pw-tools li {
  flex: 1;
  min-width: 0;
}

.dg-pw-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 60px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s;
}

.dg-pw-tool .mac-icon {
  font-size: 18px;
}

.dg-pw-tool:hover {
  color: var(--accent-tab);
}

.dg-pw-tool--disabled,
.dg-pw-tool--disabled:hover {
  color: var(--text-muted);
  opacity: 0.5;
  cursor: not-allowed;
}

.dg-pw-side .dg-playlist {
  order: 3;
}

/* ===== 桌机：侧栏与播放器等高（contain:size 让侧栏不撑高整列），选集在侧栏内滚动 ===== */
@media (min-width: 1200px) {
  .dg-pw-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 355px;
    overflow: hidden;
    border-radius: 0 18px 18px 0;
    background: var(--bg-white);
  }

  .dg-pw-side {
    contain: size;
    overflow: hidden;
  }

  .dg-pw-info {
    flex-shrink: 0;
    padding: 20px;
    border-radius: 0 18px 0 0;
    background: var(--bg-elev);
  }

  .dg-pw-info::before {
    height: 28px;
  }

  .dg-pw-title {
    font-size: 20px;
    line-height: 28px;
  }

  .dg-pw-side .dg-playlist {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    margin: 0;
  }

  .dg-pw-side .dg-playlist .dg-module-hd {
    flex-shrink: 0;
    min-height: 41px;
    padding-left: 20px;
    background: var(--bg-elev);
  }

  .dg-pw-side .dg-playlist .dg-module-title {
    font-size: 14px;
  }

  .dg-pw-side .dg-playlist-sort {
    height: 26px;
    padding: 0 8px;
    font-size: 12px;
  }

  .dg-pw-side .dg-source-tab {
    height: 41px;
    padding: 0 12px;
  }

  .dg-pw-side .dg-playlist-empty {
    margin: 15px 20px;
  }

  .dg-pw-side .dg-playlist-panel.dg-active {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 15px 15px 15px 20px;
    border-radius: 0;
    background: none;
  }

  .dg-pw-side .dg-playlist-episodes-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
  }

  .dg-pw-side .dg-playlist-episodes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dg-pw-side .dg-playlist-episodes--long {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dg-pw-side .dg-playlist-episodes--long .dg-episode {
    padding: 6px;
    font-size: 13px;
  }

  .dg-pw-tools {
    flex-shrink: 0;
    order: 4;
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--bg-elev);
  }

  .dg-pw-tool {
    border-radius: 0;
    background: none;
  }
}

@media (max-width: 767px) {
  .dg-play-main .dg-module-title {
    font-size: 20px;
  }

  /* 手机播放器贴齐屏幕两侧 */
  .dg-pw-player {
    margin: 0 -15px;
  }

  .dg-pw-info {
    padding: 15px 0 15px 15px;
  }

  .dg-pw-info::before {
    top: 15px;
    height: 28px;
  }

  .dg-pw-title {
    font-size: 20px;
    line-height: 28px;
  }

  .dg-pw-tools {
    gap: 6px;
  }

  .dg-pw-tool {
    height: 52px;
    font-size: 11px;
  }
}
