/* 下载页：基础信息与面包屑样式在 main.css（与详情页共用），这里只有下载列表 */

.dg-down-main .dg-module-title {
  font-size: 24px;
}

/* 标题列：右侧来源页签与下方面板相接（同选集播放） */
.dg-down-hd {
  align-items: flex-end;
  margin-bottom: 0;
}

.dg-down-hd .dg-module-title {
  align-self: center;
  margin-right: auto;
}

.dg-down-sources {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.dg-down-sources::-webkit-scrollbar {
  display: none;
}

.dg-down-sources > li {
  flex-shrink: 0;
}

.dg-down-src-tab {
  flex-shrink: 0;
  height: 45px;
  padding: 0 15px;
  border: none;
  border-radius: 6px 6px 0 0;
  background: none;
  color: var(--text-light);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.dg-down-src-tab:hover {
  color: var(--text);
}

.dg-down-src-tab.dg-active {
  background: var(--bg-white);
  color: var(--accent-tab);
  font-weight: 700;
}

.dg-down-empty {
  margin: 17px 0 0;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.dg-down-empty a {
  color: var(--accent-tab);
}

.dg-down-panel {
  display: none;
  padding: 20px;
  border-radius: var(--radius) 0 var(--radius) var(--radius);
  background: var(--bg-white);
}

.dg-down-panel.dg-active {
  display: block;
}

.dg-down-tip {
  margin: 0 0 15px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== 下载项：勾选 + 集名 + 链接 + 动作按钮 ===== */
/* 桌机超过 15 条、手机超过约 5 条在框内滚动 */
.dg-down-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(50px * 15 + 8px * 14);
  margin: 0;
  padding: 0 5px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #666 transparent;
  scrollbar-width: thin;
  list-style: none;
}

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

.dg-down-list::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: #666;
}

.dg-down-item {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg);
}

.dg-di-check,
.dg-di-check-all {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.dg-di-ep {
  flex-shrink: 0;
  min-width: 70px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.dg-di-link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dg-di-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.dg-di-btn {
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, opacity 0.15s;
}

.dg-di-btn:hover {
  color: var(--accent-tab);
}

.dg-di-btn--main {
  background: var(--grad-play);
  color: #fff;
  font-weight: 700;
}

.dg-di-btn--main:hover {
  color: #fff;
  opacity: 0.88;
}

.dg-down-list-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 0 12px;
}

.dg-di-check-all-label {
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.dg-di-batch-btn {
  margin-left: auto;
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--accent-tab);
  font-size: 12px;
  cursor: pointer;
}

.dg-di-batch-btn:hover {
  opacity: 0.85;
}

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

  .dg-down-hd {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .dg-down-sources {
    order: 3;
    width: 100%;
  }

  .dg-down-src-tab {
    height: 40px;
    font-size: 13px;
  }

  .dg-down-list {
    max-height: 600px;
  }

  .dg-down-panel {
    padding: 15px;
    border-radius: 0 var(--radius) var(--radius) var(--radius);
  }

  /* 手机：集名与链接一列，按钮换到下一列 */
  .dg-down-item {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .dg-di-link {
    flex-basis: calc(100% - 120px);
  }

  .dg-di-actions {
    width: 100%;
    padding-left: 28px;
  }

  .dg-di-btn {
    flex: 1;
    padding: 0 8px;
  }
}
