* {
  margin: 0; padding: 0; box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Lucida Grande", Tahoma, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
  padding: 20px 24px;
  max-width: 80%;
  margin: 0 auto;
}

.dlHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #009933;
}

.dlHeaderRight {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dlNavLink {
  font-size: 12px;
  font-weight: 400;
  color: #999;
  cursor: pointer;
  text-decoration: none;
  transition: color .2s;
}
.dlNavLink:hover { color: #009933; }
.dlNavCurrent { font-size: 12px; font-weight: 500; color: #333; cursor: default; }

.dlNavSep {
  font-size: 12px;
  color: #ddd;
}

/* ========================================================
   PROGRESS
   ======================================================== */

.dlProgress { margin-bottom: 16px; }
.dlProgressText { font-size: 13px; color: #666; margin-bottom: 6px; }
.dlProgressBar { height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; }
.dlProgressBar.dlProgressRunning { animation: dlPulse 1.2s ease-in-out infinite; }
.dlProgressFill { height: 100%; background: #009933; border-radius: 3px; width: 0%; transition: width .3s; }
@keyframes dlPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ========================================================
   QUEUE PANEL
   ======================================================== */

.dlQueueToggle {
  font-size: 11px; color: #888; cursor: pointer;
  margin-top: 4px; user-select: none;
}
.dlQueueToggle:hover { color: #555; }
.dlQueueArrow { font-size: 10px; }

.dlQueuePanel {
  margin-top: 6px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.dlDomainRow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 11px;
}
.dlDomainRow:last-child { border-bottom: none; }
.dlDomainDone { opacity: .5; }

.dlDomainName {
  width: 160px; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #555;
}
.dlDomainCount { width: 36px; flex-shrink: 0; color: #888; text-align: right; }
.dlDomainBar {
  flex: 1; height: 4px; background: #e8e8e8; border-radius: 2px; overflow: hidden;
}
.dlDomainFill {
  height: 100%; background: #009933; border-radius: 2px; transition: width .3s;
}

/* ========================================================
   TOOLBAR
   ======================================================== */

.dlToolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.dlSummary { font-size: 12px; color: #888; }

.dlBtns { display: flex; gap: 6px; }

.dlBtn {
  padding: 5px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  color: #555;
  transition: all .15s;
}
.dlBtn:hover { border-color: #aaa; color: #333; }

.dlDanger {
  border-color: #fcc; color: #c00;
}
.dlDanger:hover { background: #fff5f5; border-color: #faa; }

/* ---- Font Awesome 图标对齐 ---- */
.iconTitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.iconTitle .fa-solid { font-size: 18px; }

.iconTitle .fa-link-slash { color: #e67e00; }
.iconTitle .fa-magnifying-glass { color: #8e44ad; }
.iconTitle .fa-clock-rotate-left { color: #2196F3; }
.iconTitle .fa-clock { color: #e67e00; }

.dlBtn .fa-solid {
  margin-right: 4px;
  vertical-align: -1px;
}
.dlBtn .fa-arrows-rotate { color: #1565c0; }
.dlTitle .fa-solid {
  margin-right: 4px;
  vertical-align: -1px;
}
.dlEmpty.ok .fa-solid { margin-right: 4px; }
.dlEmpty.ok .fa-circle-check { color: #2e7d32; }

/* ========================================================
   GROUPS
   ======================================================== */

.dlGroup {
  background: #fff;
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}

.dlGroupHead {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  gap: 6px;
  transition: background .1s;
}
.dlGroupHead:hover { background: #f0f0f0; }

.dlGroupArrow { font-size: 10px; color: #aaa; width: 12px; text-align: center; flex-shrink: 0; }
.dlGroupIcon { font-size: 13px; flex-shrink: 0; }
.dlGroupLabel { font-size: 13px; font-weight: 600; color: #333; flex: 1; }

.dlGroupIcon .fa-link { color: #8e44ad; }
.dlGroupIcon .fa-folder { color: #2e7d32; }

.dlGroupHead[data-group="404"] .dlGroupIcon,
.dlGroupHead[data-group="410"] .dlGroupIcon,
.dlGroupHead[data-group="5xx"] .dlGroupIcon { color: #b42318; }

.dlGroupHead[data-group="network"] .dlGroupIcon,
.dlGroupHead[data-group="timeout"] .dlGroupIcon { color: #e67e00; }

.dlGroupHead[data-group="405"] .dlGroupIcon,
.dlGroupHead[data-group="429"] .dlGroupIcon,
.dlGroupHead[data-group="4xx_other"] .dlGroupIcon { color: #e67e00; }

.dlGroupHead[data-group="get_pass"] .dlGroupIcon { color: #2e7d32; }
.dlGroupHead[data-group="local"] .dlGroupIcon { color: #6b7280; }

.dlGroupCheck {
  font-size: 11px; color: #888;
  display: flex; align-items: center; gap: 3px;
  cursor: pointer; flex-shrink: 0;
}
.dlGroupCheck input { accent-color: #009933; }

/* ========================================================
   ROWS
   ======================================================== */

.dlRow {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid #f5f5f5;
  gap: 8px;
  transition: background .1s;
}
.dlRow:hover { background: #fafafa; }
.dlRow:last-child { border-bottom: none; }

.dlCheck {
  width: 16px; height: 16px;
  flex-shrink: 0;
  accent-color: #009933;
  cursor: pointer;
}

.dlInfo { flex: 1; min-width: 0; }

.dlTitle {
  font-size: 13px; font-weight: 500;
  color: #2196F3;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  word-break: break-all;
}
.dlTitle:hover { color: #0d6efd; }

.dlPath { font-size: 11px; color: #888; margin-top: 1px; }
.dlUrlWrap { display: flex; align-items: center; gap: 6px; margin-top: 1px; }

.dlUrl { font-size: 11px; color: #999; word-break: break-all; }

.dlEditBtn {
  width: 20px; height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  border-radius: 3px;
  color: #ccc;
  flex-shrink: 0;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.dlEditBtn:hover { color: #333; background: #e8e8e8; }

.dlDelBtn {
  width: 20px; height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  border-radius: 3px;
  color: #ccc;
  flex-shrink: 0;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.dlDelBtn:hover { color: #c00; background: #fff0f0; }

.dlEditBtn { color: #1565c0; }
.dlEditBtn:hover { color: #0d47a1; background: #e3f2fd; }
.dlDelBtn { color: #b42318; }
.dlDelBtn:hover { background: #fdecec; color: #b42318; }

.dlEditInput {
  flex: 1;
  border: 1px solid #009933;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 12px;
  outline: none;
}

.dlEditSave, .dlEditCancel {
  padding: 2px 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}
.dlEditSave { color: #009933; border-color: #b7ebc8; }
.dlEditSave:hover { background: #f0fff5; }
.dlEditCancel { color: #999; }
.dlEditCancel:hover { background: #f5f5f5; }

/* ========================================================
   STATUS BADGES
   ======================================================== */

.dlStatus {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.dlStatusDead { background: #ffeaea; color: #c00; }
.dlStatusSuspect { background: #fff8e6; color: #b8860b; }
.dlStatusLocal { background: #f0f0f0; color: #888; }

.dlDupBadge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #e8e8ff;
  color: #555;
  flex-shrink: 0;
  white-space: nowrap;
  cursor: help;
}

/* ========================================================
   EMPTY STATE
   ======================================================== */

.dlEmpty {
  padding: 40px; text-align: center; color: #ccc; font-size: 13px;
}
.dlEmpty.ok { color: #009933; }
.dlEmpty .fa-arrows-rotate {
  color: #1565c0;
  vertical-align: -1px;
  margin-right: 3px;
}

/* ========================================================
   CUSTOM MODAL
   ======================================================== */

.dlModalOverlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.3); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.dlModalPanel {
  background: #fff; border-radius: 8px; padding: 20px 24px;
  min-width: 320px; max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,.15);
}
.dlModalTitle {
  font-size: 15px; font-weight: 600; color: #333; margin-bottom: 8px;
}
.dlModalBody {
  font-size: 13px; color: #666; margin-bottom: 14px; line-height: 1.5;
}
.dlModalInput {
  width: 100%; height: 34px; border: 1px solid #ddd; border-radius: 4px;
  padding: 0 10px; font-size: 13px; outline: none; margin-bottom: 14px;
  box-sizing: border-box;
}
.dlModalInput:focus { border-color: #009933; }

.dlModalActions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.dlModalBtn {
  height: 32px; padding: 0 18px; border-radius: 4px; font-size: 13px;
  cursor: pointer; transition: all .15s; border: 1px solid #ddd;
  background: #fff; color: #555;
}
.dlModalBtn:hover { background: #f5f5f5; }
.dlModalBtn.primary {
  background: #009933; color: #fff; border-color: #00802b;
}
.dlModalBtn.primary:hover { background: #00802b; }

/* loading 旋转器 */
.dlModalSpinner {
  width: 32px; height: 32px; margin: 4px auto 0;
  border: 3px solid #e0e0e0; border-top-color: #009933;
  border-radius: 50%; animation: dlModalSpin .8s linear infinite;
}
@keyframes dlModalSpin { to { transform: rotate(360deg); } }

/* Toast */
.dlToast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; padding: 8px 20px; border-radius: 6px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.dlToast.show { opacity: 1; pointer-events: auto; }
.dlToast.success { background: #f0fff5; color: #009933; border: 1px solid #b7ebc8; }
.dlToast.error { background: #fff5f5; color: #c00; border: 1px solid #fcc; }
.dlToast.info { background: #f8f8f8; color: #555; border: 1px solid #ddd; }
