/* 详情页专属样式；基础信息（.dg-vd-*）与选集列表为详情/下载/播放页共用，放 main.css */

.dg-detail-main .dg-module-title {
  font-size: 26px;
}

/* ===== 分集剧情：只列前 3 集摘要，整条可点（强制1.2/9.3） ===== */
.dg-ep-plot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dg-ep-plot-link {
  display: block;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.6;
  transition: color 0.15s;
}

.dg-ep-plot-link:hover .dg-ep-plot-ep {
  color: var(--accent-tab);
}

.dg-ep-plot-ep {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 700;
}

.dg-ep-plot-desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===== 关联系列：收起时只显示第一行（vod_detail.js 标记 .dg-rel-hidden，不用 overflow 裁切） ===== */
.dg-rel-series-grid > .dg-rel-hidden {
  display: none;
}

/* ===== 角色信息：名片列表（方块圆角头像＋名字＋身份标签），超过约 3 排在框内上下滚动；
   不锁滚轮（不设 overscroll-behavior），滚到底会接回整页，避免小框卡住页面滚动 ===== */
.dg-cast-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
  max-height: calc(52px * 3 + 8px * 2 + 26px);
  margin: 0;
  padding: 0 5px 0 0;
  overflow-y: auto;
  scrollbar-color: var(--scrollbar) transparent;
  scrollbar-width: thin;
  list-style: none;
}

.dg-cast-list::-webkit-scrollbar {
  width: 5px;
}

.dg-cast-list::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: var(--scrollbar);
}

.dg-cast-item {
  min-width: 0;
}

.dg-cast-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: background 0.3s ease-in;
}

.dg-cast-avatar {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-tag);
}

.dg-cast-avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dg-cast-initial {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.dg-cast-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.dg-cast-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.3s ease-in;
}

.dg-cast-role {
  padding: 0 6px;
  border-radius: 4px;
  background: var(--bg-tag);
  color: var(--text-muted);
  font-size: 10px;
  line-height: 15px;
  white-space: nowrap;
}

.dg-cast-role--dir {
  background: var(--grad-accent);
  color: var(--white);
}

.dg-cast-link:hover {
  background: var(--bg-hover);
}

.dg-cast-link:hover .dg-cast-name {
  color: var(--accent);
}

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

  .dg-ep-plot-link {
    padding: 12px 15px;
  }

  .dg-cast-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: calc(60px * 3 + 8px * 2 + 30px);
  }

  .dg-cast-link {
    gap: 8px;
    padding: 8px 10px 8px 8px;
  }

  .dg-cast-avatar {
    width: 38px;
    height: 38px;
  }
}
