/*
 * 咔游网盘下载选择弹窗样式
 * 匹配参考截图：模态框 + 防爬提示条 + 卡片式网盘列表 + 显示二维码按钮
 * 主色跟随 --theme-color（#0EA5E9）
 */

/* ===== 弹窗遮罩 ===== */
.dl-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  padding: 16px;
}
.dl-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ===== 弹窗主体 ===== */
.dl-modal {
  background: linear-gradient(170deg, #f7fbff 0%, #eaf3fd 100%);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .18), 0 8px 24px rgba(0, 0, 0, .12);
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(.97);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
.dl-modal-backdrop.active .dl-modal {
  transform: translateY(0) scale(1);
}

/* ===== 弹窗标题栏 ===== */
.dl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.dl-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  line-height: 1.4;
}
.dl-demo-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
  color: #92400e;
  background: linear-gradient(135deg, #fde68a, #fcd34d);
}
.dl-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
  flex-shrink: 0;
  line-height: 1;
}
.dl-modal-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* ===== 防爬提示条 ===== */
.dl-modal-warning {
  margin: 16px 20px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(245, 158, 11, .25);
}
.dl-modal-warning-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: #f59e0b;
}
.dl-modal-warning-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: #92400e;
}

/* ===== 网盘卡片列表 ===== */
.dl-modal-list {
  padding: 8px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 单个网盘卡片 */
.dl-drive-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid #e8ecf1;
  border-radius: 12px;
  cursor: pointer;
  transition: all .18s ease;
  background: #fff;
  position: relative;
  user-select: none;
}
.dl-drive-card:hover {
  border-color: var(--theme-color, #0EA5E9);
  background: #fafffe;
}
.dl-drive-card.selected {
  border-color: var(--theme-color, #0EA5E9);
  background: linear-gradient(135deg, #f0faff 0%, #e8fdff 100%);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .10);
}

/* 左侧：单选圆 + 图标 */
.dl-drive-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

/* 单选指示器 */
.dl-drive-radio {
  width: 22px;
  height: 22px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .18s ease;
}
.dl-drive-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: background .18s ease;
}
.dl-drive-card.selected .dl-drive-radio {
  border-color: var(--theme-color, #0EA5E9);
}
.dl-drive-card.selected .dl-drive-radio::after {
  background: var(--theme-color, #0EA5E9);
}

/* 网盘图标（带品牌色的文字徽标 / 真实 logo 图片） */
.dl-drive-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  background: var(--theme-color, #0EA5E9);
}
.dl-drive-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* 网盘信息 */
.dl-drive-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dl-drive-name {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
}
.dl-drive-pwd {
  font-size: 12px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.dl-drive-pwd-code {
  background: #f1f5f9;
  padding: 1px 7px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 11.5px;
  color: #475569;
  cursor: pointer;
  transition: background .15s ease;
}
.dl-drive-pwd-code:hover {
  background: #e2e8f0;
}

/* 右侧按钮 */
.dl-drive-action {
  flex-shrink: 0;
}
.dl-btn-qrcode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border: 1.5px solid var(--theme-color, #0EA5E9);
  border-radius: 8px;
  background: transparent;
  color: var(--theme-color, #0EA5E9);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
  line-height: 1.4;
  font-family: inherit;
}
.dl-btn-qrcode:hover {
  background: var(--theme-color, #0EA5E9);
  color: #fff;
}

/* ===== 二维码弹出层 ===== */
.dl-qrcode-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .15);
  padding: 20px;
  z-index: 10;
  min-width: 200px;
  text-align: center;
  border: 1px solid #e8ecf1;
}
.dl-qrcode-popup.show { display: block; }
.dl-qrcode-popup img {
  width: 160px;
  height: 160px;
  border-radius: 8px;
}
.dl-qrcode-popup p {
  margin: 10px 0 0;
  font-size: 13px;
  color: #64748b;
}

/* ===== 底部操作区 ===== */
.dl-modal-footer {
  padding: 0 20px 20px;
}
.dl-btn-download {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--theme-color, #0EA5E9);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s ease;
  font-family: inherit;
  letter-spacing: .3px;
}
.dl-btn-download:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 20px rgba(14, 165, 233, .35);
}
.dl-btn-download:active {
  transform: scale(.98);
}

/* ===== 空状态 ===== */
.dl-modal-empty {
  padding: 40px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 14.5px;
}

/* ===== 移动端适配 ===== */
@media (max-width: 540px) {
  .dl-modal {
    max-width: 100%;
    border-radius: 14px;
    max-height: 88vh;
  }
  .dl-modal-header { padding: 16px 18px 0; }
  .dl-modal-warning { margin: 12px 14px; padding: 10px 14px; }
  .dl-modal-list { padding: 6px 14px 14px; gap: 8px; }
  .dl-drive-card { padding: 12px 13px; gap: 11px; }
  .dl-drive-icon { width: 33px; height: 33px; font-size: 20px; }
  .dl-drive-name { font-size: 14.5px; }
  .dl-btn-qrcode { padding: 7px 13px; font-size: 13px; }
  .dl-modal-footer { padding: 0 14px 16px; }
  .dl-btn-download { padding: 13px; font-size: 15.5px; }
  .dl-modal-close { width: 30px; height: 30px; font-size: 17px; }
}

/* ===== 尊重减弱动效偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  .dl-modal-backdrop,
  .dl-modal,
  .dl-drive-card,
  .dl-btn-qrcode,
  .dl-btn-download,
  .dl-modal-close,
  .dl-drive-radio,
  .dl-drive-radio::after { transition: none !important; }
}
