.down-main {
  padding: 16px 0 48px;
  background: var(--bg-light);
}
.down-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.down-content {
  flex: 1;
  min-width: 0;
}
.down-sidebar {
  width: 220px;
  flex-shrink: 0;
  min-width: 0;
}

/* ===== 线路标题列 ===== */
.down-source-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-white);
  padding: 12px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 6px;
}
.down-source-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.down-source-tip {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 下载列表 ===== */
.down-list {
  background: var(--bg-white);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.down-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.down-item:hover { background: var(--bg-elev); }

/* checkbox */
.di-check {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-mid);
  border-radius: 3px;
  background: var(--bg-white);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.di-check:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.di-check:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* 集数名（橘色）*/
.di-ep {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 100px;
  cursor: pointer;
}

/* 连结文字（灰色截断）*/
.di-link {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  padding: 4px 8px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.di-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.di-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 4px;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.di-btn:hover { opacity: 0.82; }
.di-btn--blue   { background: #3b82f6; color: #fff; }
.di-btn--orange { background: var(--accent); color: #fff; }
.di-btn--gray   { background: #9ca3af; color: #fff; }

/* 底部：全选 + 批量下载 */
.down-list-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.di-check-all {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-mid);
  border-radius: 3px;
  background: var(--bg-white);
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.di-check-all:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.di-check-all:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.di-check-all:indeterminate {
  background: var(--accent);
  border-color: var(--accent);
}
.di-check-all:indeterminate::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 6px;
  width: 10px;
  height: 2px;
  background: #fff;
}
.di-check-all-label {
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.di-batch-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.di-batch-btn:hover { color: var(--accent-active); }

/* ===== 剧情介绍 ===== */
.down-desc-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.down-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
/* desc-body / desc-expand-btn 使用 main.css 的共用样式 */

/* ===== 相关推荐 ===== */
.down-related-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.down-related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
}
.down-related-grid .vod-card {
  flex: 0 0 calc(20% - 8px);
}

/* ===== 推荐阅读 ===== */
.down-read-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.down-read-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.down-read-more { font-size: 12px; color: var(--text-muted); }
.down-read-more:hover { color: var(--accent); }
.read-card { border-bottom: 1px solid var(--border); cursor: pointer; }
.read-card:last-child { border-bottom: none; }
.read-card a { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.read-info { flex: 1; min-width: 0; }
.read-info h4 { font-size: 13px; color: var(--text); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.read-card:hover .read-info h4 { color: var(--accent); }
.read-cat { font-size: 11px; color: var(--text-muted); }
.read-thumb { width: 80px; height: 56px; border-radius: 4px; overflow: hidden; flex-shrink: 0; margin: 0; }
.read-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== 右侧 Sidebar ===== */
.dsb-block {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dsb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}
.dsb-more { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.dsb-more:hover { color: var(--accent); }
.dsb-rank-list { list-style: none; padding: 6px 0; }
.dsb-rank-list > li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  transition: background 0.15s;
}
.dsb-rank-list > li:hover { background: var(--accent-light); }
.dsb-rank-list > li:hover .dsb-name { color: var(--accent); }
.dsb-rank-list > li:last-child { border-bottom: none; }
.dsb-rank-top { flex-direction: column; align-items: flex-start !important; padding-bottom: 10px !important; }
.dsb-rank-top > a { display: flex; gap: 10px; width: 100%; }
.dsb-rank-thumb { width: 46px; aspect-ratio: 3/4; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.dsb-rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dsb-rank-info { display: flex; gap: 6px; flex: 1; min-width: 0; align-items: flex-start; }
.dsb-rank-info h5 { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.dsb-rank-info p { font-size: 10px; color: var(--text-muted); }
.dsb-rn {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-elev); color: var(--text-muted);
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dsb-rn--1 { background: var(--accent); color: #fff; }
.dsb-rn--2 { background: #f5a623; color: #fff; }
.dsb-rn--3 { background: #9c6c14; color: #fff; }
.dsb-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.dsb-cnt { font-size: 10px; color: var(--text-muted); flex-shrink: 0; margin-left: auto; }

/* ===== RWD ===== */

/* sidebar 预设只桌机显示 */
.down-sidebar { display: none; }
@media (min-width: 1025px) {
  .down-sidebar { display: block; }
}

/* 平板 */
@media (max-width: 1024px) {
  .down-related-grid .vod-card { flex: 0 0 calc(25% - 8px); }
  .di-btn { font-size: 10px; padding: 3px 7px; }
}

/* 手机 */
@media (max-width: 767px) {
  .down-main { padding: 10px 0 68px; }
  .down-container { padding: 0 10px; flex-direction: column; align-items: stretch; gap: 10px; }

  /* 片头 */
  .plot-hero { padding: 12px; gap: 10px; }
  .plot-hero-title { font-size: 13px; }

  /* 下载列表：按钮缩小 */
  .di-btn { font-size: 10px; padding: 3px 7px; }
  .di-name { font-size: 12px; }

  /* 相关推荐 3栏 */
  .down-related-grid .vod-card { flex: 0 0 calc(33.333% - 7px); }
  .down-related-grid { gap: 6px; }
}

/* 小手机 */
@media (max-width: 479px) {
  .down-related-grid .vod-card { flex: 0 0 calc(33.333% - 5px); }
}

/* 手机版下载列表调整 */
@media (max-width: 767px) {
  .down-source-header { flex-direction: column; align-items: flex-start; }
  .down-source-tip { font-size: 11px; }
  .down-item { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
  .di-link { width: 100%; order: 3; }
  .di-actions { order: 4; width: 100%; justify-content: flex-end; }
  .di-ep { order: 2; }
  .di-check { order: 1; }
  .di-btn { font-size: 11px; padding: 4px 8px; }
}