/**
 * Hope Video 选集播放器
 * 兼容旧 class，对齐 Conch 主题强调色
 */
:root {
  --video-accent: #ff5f00;
  --video-accent-hover: #e55500;
  --video-bg: #fff;
  --video-surface: #f6f7f9;
  --video-surface-2: #e9ecef;
  --video-text: #333;
  --video-text-muted: #888;
  --video-border: #eee;
  --video-stage: #0b0b0d;
  --video-now: #111;
}

body.hope-mode-black,
html[data-theme-resolved="dark"] {
  --video-bg: #1e1e1e;
  --video-surface: #2a2a2a;
  --video-surface-2: #333;
  --video-text: #ddd;
  --video-text-muted: #999;
  --video-border: #333;
  --video-stage: #000;
  --video-now: #161616;
}

.ichen-video,
.hope-video-episode-player {
  margin: 0 0 16px;
  color: var(--video-text);
  background: var(--video-bg);
  border-radius: 8px;
  overflow: hidden;
}

.hope-video-stage {
  background: var(--video-stage);
}

.hope-video-now,
#playtitle.hope-video-now,
.hope-video-episode-player > #playtitle {
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #eee;
  background: var(--video-now);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hope-video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.hope-video-frame iframe,
.hope-video-frame #play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.hope-video-plist,
.ichen-video .hope-video-plist {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--video-border);
}

.ichen-video .heading,
.hope-video-episode-player .heading {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.ichen-video .heading .title,
.hope-video-episode-player .heading .title {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 0 8px;
  border-bottom: 2px solid var(--video-accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--video-text);
  line-height: 1.2;
}

.ichen-video .heading .tab,
.hope-video-episode-player .heading .tab {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin: 0;
  background: var(--video-surface-2);
  border-radius: 8px;
}

.ichen-video .heading .tab a,
.hope-video-episode-player .heading .tab a,
.hope-video-tab {
  float: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px !important;
  margin: 0 !important;
  border-radius: 6px !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--video-text-muted) !important;
  text-decoration: none !important;
  background: transparent;
  transition: background .15s ease, color .15s ease;
}

.ichen-video .heading .tab a:hover,
.hope-video-tab:hover {
  color: var(--video-accent) !important;
}

.ichen-video .heading .tab a.on,
.hope-video-tab.on {
  background: var(--video-bg) !important;
  color: var(--video-accent) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.ichen-video .content,
.hope-video-episode-player .content {
  margin: 0 !important;
  max-height: 280px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ichen-video .content::after,
.hope-video-episode-player .content::after {
  content: "";
  display: table;
  clear: both;
}

.hope-video-eps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.hope-video-eps.is-hidden,
.hope-video-eps[hidden] {
  display: none !important;
}

.ichen-video .content .playlink,
.hope-video-episode-player .content .playlink {
  float: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0 !important;
  min-height: 40px;
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 6px !important;
  background: var(--video-surface) !important;
  color: var(--video-text) !important;
  text-decoration: none !important;
  text-align: center;
  line-height: 1.3 !important;
  font-size: 13px;
  box-sizing: border-box;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}

.ichen-video .content .playlink span,
.hope-video-episode-player .content .playlink span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ichen-video .content .playlink:hover,
.hope-video-episode-player .content .playlink:hover {
  background: var(--video-accent) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.ichen-video .content .playlink.active,
.hope-video-episode-player .content .playlink.active,
.ichen-video .content .active {
  background: var(--video-accent) !important;
  color: #fff !important;
  font-weight: 700;
}

.ichen-video .content a:before {
  content: none !important;
  margin: 0 !important;
}

@media (max-width: 559px) {
  .hope-video-eps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ichen-video .heading .tab a,
  .hope-video-tab {
    padding: 6px 10px !important;
    font-size: 12px;
  }
}
