/* ==============================================
   查重功能弹窗样式 - 独立模块，不影响原有编辑器
   ============================================== */

/* 遮罩层 */
.dup-check-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
  display: none;
}

.dup-check-mask.active {
  display: block;
}

/* 查重主容器 */
.dup-check-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #F5F6F8;
  z-index: 99999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.dup-check-container.active {
  display: flex;
}

/* ========== 顶部操作栏 ========== */
.dup-check-header {
  flex-shrink: 0;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* 显式覆盖 style2.css 里 .dup-check-header 的 margin-bottom:14px，
     保证 summary 上边距统一由 dupCheck.css 控制（.dup-check-summary margin-top:8px），
     避免测试环境因 style2.css 残留 14px 而叠加成 22px */
  margin-bottom: 0;
}

.dup-check-header-title {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A2E;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dup-check-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

/* 顶部主操作按钮（导出报告 / 返回修改）加大尺寸，区别于小号审计按钮 */
.dup-check-header-actions .dup-check-btn {
  padding: 6px 20px;
  height: 32px;
  line-height: 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  min-width: 100px;
  white-space: nowrap;
}

.dup-check-btn {
  padding: 4px 12px;
  height: 26px;
  line-height: 18px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #D1D5DB;
  background: #fff;
  color: #374151;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.dup-check-btn:hover {
  border-color: #4F6EF7;
  color: #4F6EF7;
}

/* 撤销/重做按钮 */
.dup-check-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #D1D5DB;
  background: #F3F4F6;
  color: #9CA3AF;
}
.dup-check-btn:disabled:hover {
  border-color: #D1D5DB;
  color: #9CA3AF;
}

.dup-check-btn-primary {
  background: #4F6EF7;
  border-color: #4F6EF7;
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 110, 247, 0.25);
}

.dup-check-btn-primary:hover {
  background: #3F5AE0;
  border-color: #3F5AE0;
  color: #fff;
  box-shadow: 0 2px 6px rgba(79, 110, 247, 0.35);
  transform: translateY(-1px);
}

/* 「返回保存」按钮：暖色渐变 + 轻微脉冲动画，提示用户需要返回保存 */
.dup-check-btn-save {
  background: linear-gradient(135deg, #F97316 0%, #EF4444 100%);
  border-color: #EF4444;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
  animation: dupSavePulse 1.8s ease-in-out infinite;
}

.dup-check-btn-save:hover {
  background: linear-gradient(135deg, #EA580C 0%, #DC2626 100%);
  border-color: #DC2626;
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
  animation-play-state: paused;
}

@keyframes dupSavePulse {
  0%, 100% {
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
  }
  50% {
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35), 0 0 0 4px rgba(239, 68, 68, 0.12);
  }
}

.dup-check-btn-success {
  background: #10B981;
  border-color: #10B981;
  color: #fff;
}

.dup-check-btn-success:hover {
  background: #059669;
  border-color: #059669;
  color: #fff;
}

.dup-check-btn-sm {
  padding: 2px 10px;
  height: 22px;
  line-height: 18px;
  font-size: 11px;
  border-radius: 4px;
}

.dup-check-btn-xs {
  padding: 1px 9px;
  height: 22px;
  line-height: 20px;
  font-size: 11px;
  border-radius: 4px;
  box-sizing: border-box;
  cursor: pointer;
}

.dup-check-btn-xs[disabled] {
  cursor: not-allowed;
}

.dup-check-btn-outline {
  background: #fff;
  border-color: #D1D5DB;
  color: #4B5563;
}

.dup-check-btn-outline:hover:not([disabled]) {
  border-color: #6B7280;
  color: #111827;
  background: #F9FAFB;
}

.dup-check-btn-warn {
  background: #F59E0B;
  border-color: #F59E0B;
  color: #fff;
}

.dup-check-btn-warn:hover:not([disabled]) {
  background: #D97706;
  border-color: #D97706;
  color: #fff;
}

/* ========== 摘要信息卡片 ========== */
.dup-check-summary {
  flex-shrink: 0;
  margin: 8px 16px 0;
  padding: 12px 18px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: stretch;
  gap: 16px;
}

.dup-check-summary-rate {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-right: 16px;
  border-right: 1px solid #E5E7EB;
  min-width: 100px;
  max-width: 112px;
}

.dup-check-rate-value {
  font-size: 28px;
  font-weight: 700;
  color: #9CA3AF;
  line-height: 1;
  background: transparent;
  border: none;
  box-shadow: none;
  text-shadow: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
}

.dup-check-rate-label {
  font-size: 11px;
  color: #8A95B2;
  margin-top: 4px;
  letter-spacing: 0.1px;
  line-height: 1.2;
}

.dup-check-rate-value.lv90 { color: #CC0000; }
.dup-check-rate-value.lv70 { color: #FF4444; }
.dup-check-rate-value.lv50 { color: #FF6B8A; }
.dup-check-rate-value.low { color: #E8758C; }
.dup-check-rate-value.safe { color: #10B981; }

.dup-check-summary-info {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 6px;
}

.dup-check-info-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
}

.dup-check-info-label {
  font-size: 11px;
  color: #8A95B2;
  margin-bottom: 4px;
  line-height: 1.2;
  letter-spacing: 0.1px;
}

.dup-check-info-value {
  font-size: 13px;
  color: #1A1A2E;
  font-weight: 500;
  line-height: 1.35;
  min-width: 0;
  word-break: break-all;
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.dup-check-info-item[data-role="title"] .dup-check-info-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  position: relative;
  cursor: default;
  padding: 4px 0;
}

.dup-check-info-item[data-role="sourceCount"] .dup-check-info-value {
  padding: 4px 0;
  cursor: default;
}

.dup-check-info-item[data-role="checkTime"] .dup-check-info-value {
  padding: 4px 0;
  cursor: default;
  text-align: right;
  white-space: nowrap;
}

/* 「查重时间」label + 值同宽右对齐：stretch 撑满 + 子元素 text-align */
.dup-check-info-item[data-role="checkTime"] {
  justify-self: end;
  align-items: stretch;
  text-align: right;
}
.dup-check-info-item[data-role="checkTime"] .dup-check-info-label {
  text-align: right;
}

/* 「站内重复 / 简历排除」居右：label 与 value 行同宽、右边对齐 */
.dup-check-info-item[data-role="flags"] {
  justify-self: end;
  align-items: stretch;
  text-align: right;
}
.dup-check-info-item[data-role="flags"] .dup-check-info-label {
  text-align: right;
}
.dup-check-info-item[data-role="flags"] .dup-check-info-value {
  padding: 4px 0;
  cursor: default;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* 自定义全局 tooltip（插入到 body，固定定位，避开父级 overflow 裁切） */
.dup-check-info-tip {
  position: fixed;
  z-index: 2147483640;
  background: rgba(26, 26, 46, 0.97);
  color: #FFFFFF;
  padding: 8px 11px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  white-space: normal;
  word-break: break-all;
  word-wrap: break-word;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  max-width: min(620px, calc(100vw - 24px));
}
.dup-check-info-tip::before {
  content: '';
  position: absolute;
  left: 20px;
  top: -6px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(26, 26, 46, 0.97);
}
.dup-check-info-tip.dup-check-tip-above::before {
  top: auto;
  bottom: -6px;
  left: 20px;
  border-bottom: none;
  border-top: 6px solid rgba(26, 26, 46, 0.97);
}

.dup-check-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 500;
}

.dup-check-tag-on {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.dup-check-tag-off {
  background: #F3F4F6;
  color: #6B7280;
  border: 1px solid #E5E7EB;
}

/* ========== 双端验证流程 ========== */
.dup-check-audit {
  flex-shrink: 0;
  margin: 8px 24px 0;
  padding: 8px 16px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 0;
}

.dup-check-audit-flow {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.dup-check-audit-label {
  font-size: 12px;
  font-weight: 600;
  color: #1A1A2E;
  margin-right: 10px;
  flex-shrink: 0;
}

.dup-check-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 14px;
  background: #F3F4F6;
  color: #6B7280;
  font-size: 11px;
  line-height: 1;
  height: 22px;
  box-sizing: border-box;
}

.dup-check-step.active {
  background: #FEF3C7;
  color: #D97706;
  font-weight: 500;
}

.dup-check-step.done {
  background: #ECFDF5;
  color: #059669;
  font-weight: 500;
}

.dup-check-step-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #D1D5DB;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
}

.dup-check-step.done .dup-check-step-icon {
  background: #10B981;
}

.dup-check-step.active .dup-check-step-icon {
  background: #F59E0B;
}

.dup-check-step-arrow {
  color: #D1D5DB;
  font-size: 11px;
  line-height: 1;
}

.dup-check-step-time {
  font-size: 10px;
  color: #9CA3AF;
  margin-left: 3px;
  line-height: 1;
}

/* 右侧操作按钮与 audit 行高匹配 */
.dup-check-audit .dup-check-actions button {
  padding: 2px 10px;
  height: 22px;
  line-height: 18px;
  font-size: 11px;
  border-radius: 4px;
}

.dup-check-audit-actions {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.dup-check-step {
  cursor: default;
}

.dup-check-step[data-step="medical"],
.dup-check-step[data-step="enterprise"] {
  cursor: pointer;
}

.dup-check-step[data-step="medical"]:hover:not(.done),
.dup-check-step[data-step="enterprise"]:hover:not(.done) {
  border-color: rgba(79, 110, 247, 0.35);
  box-shadow: 0 1px 4px rgba(79, 110, 247, 0.12);
}

.dup-check-btn-disabled {
  cursor: not-allowed;
  background: #F3F4F6 !important;
  color: #9CA3AF !important;
  border-color: #E5E7EB !important;
  box-shadow: none !important;
}

/* ========== 三栏内容主体 ========== */
.dup-check-body {
  flex: 1;
  margin: 12px 24px 16px;
  display: grid;
  grid-template-columns: calc(33.333% - 10px) calc(33.333% - 10px) calc(33.333% - 10px);
  gap: 15px;
  min-height: 0;
  overflow: hidden;
}

/* 每列卡片 */
.dup-check-panel {
  background: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.dup-check-panel-header {
  flex-shrink: 0;
  padding: 8px 18px;
  border-bottom: 1px solid #F3F4F6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dup-check-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A2E;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dup-check-panel-title-icon {
  font-size: 14px;
}

.dup-check-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  background: #F3F4F6;
  color: #6B7280;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  flex-shrink: 0;
  position: relative;
  top: 1px;
}

.dup-check-help-icon svg {
  display: block;
  flex-shrink: 0;
}

.dup-check-help-icon:hover {
  background: #4F6EF7;
  color: #fff;
}

.dup-check-help-popup {
  position: absolute;
  z-index: 100000;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 14px 16px;
  min-width: 240px;
  max-width: 320px;
  font-size: 12px;
  color: #374151;
  line-height: 1.6;
}

.dup-check-help-popup-title {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A2E;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F3F4F6;
}

.dup-check-help-popup-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.dup-check-help-popup-swatch {
  display: inline-block;
  width: 24px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.dup-check-help-popup-label {
  font-size: 12px;
  color: #374151;
}

.dup-check-help-popup-desc {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #F3F4F6;
  font-size: 11px;
  color: #6B7280;
  line-height: 1.5;
}

.dup-check-panel-extra {
  font-size: 12px;
  color: #6B7280;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========== 总体重复率说明图标 ========== */
.dup-check-total-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  color: #9CA3AF;
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.15s;
}

.dup-check-total-help-icon:hover {
  color: #4F6EF7;
}

/* ========== 总体重复率说明弹窗 ========== */
.dup-check-total-help-popup {
  position: absolute;
  z-index: 100000;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 16px 18px;
  width: 320px;
  font-size: 12px;
  color: #374151;
  line-height: 1.7;
}

.dup-check-total-help-popup-title {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A2E;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #F3F4F6;
}

.dup-check-total-help-popup-section {
  margin-bottom: 12px;
}

.dup-check-total-help-popup-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
}

.dup-check-total-help-popup-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #EEF2FF;
  color: #4F6EF7;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.dup-check-total-help-popup-text {
  flex: 1;
  font-size: 12px;
  color: #374151;
}

.dup-check-total-help-popup-text b {
  color: #1A1A2E;
}

.dup-check-total-help-popup-text u {
  color: #DC2626;
  font-weight: 600;
  text-decoration: underline;
}

.dup-check-total-help-popup-example {
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #4B5563;
  line-height: 1.6;
}

.dup-check-total-help-popup-note {
  padding-top: 8px;
  border-top: 1px solid #F3F4F6;
  font-size: 11px;
  color: #6B7280;
}

.dup-check-center-wordcount {
  font-size: 11px;
  color: #9CA3AF;
  margin-left: 2px;
}

.dup-check-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  min-height: 0;
}

.dup-check-panel-body::-webkit-scrollbar {
  width: 6px;
}

.dup-check-panel-body::-webkit-scrollbar-track {
  background: transparent;
}

.dup-check-panel-body::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 3px;
}

.dup-check-panel-body::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

/* ========== 左侧：原始编辑器内容预览 ========== */
.dup-original-content {
  font-size: 14px;
  line-height: 1.8;
  color: #374151;
  word-wrap: break-word;
}

.dup-original-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
}

.dup-original-content p {
  margin: 0 0 12px 0;
}

.dup-original-content h1,
.dup-original-content h2,
.dup-original-content h3 {
  margin: 16px 0 10px 0;
  font-weight: 600;
  color: #1A1A2E;
}

.dup-original-content h1 { font-size: 20px; }
.dup-original-content h2 { font-size: 17px; }
.dup-original-content h3 { font-size: 15px; }

.dup-original-content a {
  color: #4F6EF7;
  text-decoration: none;
}

.dup-original-content ul,
.dup-original-content ol {
  padding-left: 24px;
  margin: 8px 0;
}

.dup-original-content blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  background: #F9FAFB;
  border-left: 3px solid #D1D5DB;
  color: #6B7280;
}

/* ========== 中间：查重高亮内容 ========== */
.dup-highlight-content {
  font-size: 14px;
  line-height: 1.8;
  color: #374151;
  word-wrap: break-word;
  outline: none;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: pre-wrap;
  word-break: break-word;
  transition: border-color 0.2s ease, background 0.2s ease;
  /* 编辑态光标始终用高对比蓝色，避免在高亮片段（白字/浅色背景）上光标不可见 */
  caret-color: #2563EB;
}

.dup-highlight-content.dup-editing {
  background: #FAFBFC;
  border-color: #DBEAFE;
  cursor: text;
}
/* 编辑态下高亮片段也显示 I-beam 光标，提示用户此处可点击定位/编辑（覆盖默认 pointer 手型） */
.dup-highlight-content.dup-editing .dup-hl {
  cursor: text;
}

/* 自定义光标指示器：编辑态下无论光标位于高亮区还是普通区，都渲染一条可见的蓝色闪烁竖线 */
#dupCaretIndicator {
  animation: dupCaretBlink 1s steps(1) infinite;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}
@keyframes dupCaretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.35; }
}

.dup-highlight-content.dup-editing:focus {
  outline: none;
  border-color: #4F6EF7;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(79,110,247,0.08);
}

.dup-highlight-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
}

.dup-highlight-content p {
  margin: 0 0 12px 0;
}

.dup-highlight-content h1,
.dup-highlight-content h2,
.dup-highlight-content h3 {
  margin: 16px 0 10px 0;
  font-weight: 600;
  color: #1A1A2E;
}

.dup-highlight-content h1 { font-size: 20px; }
.dup-highlight-content h2 { font-size: 17px; }
.dup-highlight-content h3 { font-size: 15px; }

.dup-highlight-content ul,
.dup-highlight-content ol {
  padding-left: 24px;
  margin: 8px 0;
}

.dup-highlight-content blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  background: #F9FAFB;
  border-left: 3px solid #D1D5DB;
  color: #6B7280;
}

/* 查重高亮 - 多种颜色区分不同来源 */
.dup-hl {
  border-radius: 3px;
  padding: 1px 0;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
  /* 编辑态下高亮片段内也保持高对比光标，避免深色背景上白光标不可见 */
  caret-color: #2563EB;
  /* 关键：让 inline 元素的背景/边框在换行时正确闭合，
     避免每行文字后面都挂一个"悬浮"红块 */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.dup-hl:hover {
  box-shadow: 0 0 0 2px rgba(79, 110, 247, 0.3);
}

.dup-hl.source-0 { background: rgba(251, 191, 36, 0.28); border: 1px solid rgba(251, 191, 36, 0.5); }
.dup-hl.source-1 { background: rgba(248, 113, 113, 0.25); border: 1px solid rgba(248, 113, 113, 0.5); }
.dup-hl.source-2 { background: rgba(96, 165, 250, 0.25); border: 1px solid rgba(96, 165, 250, 0.5); }
.dup-hl.source-3 { background: rgba(52, 211, 153, 0.25); border: 1px solid rgba(52, 211, 153, 0.5); }
.dup-hl.source-4 { background: rgba(192, 132, 252, 0.25); border: 1px solid rgba(192, 132, 252, 0.5); }
.dup-hl.source-5 { background: rgba(251, 146, 60, 0.25); border: 1px solid rgba(251, 146, 60, 0.5); }

/* ===== 按重复比例分级着色 ===== */
/* 重复率 ≥ 90%：深红 #CC0000 + 白色粗体（与来源标签 lv90 对齐） */
.dup-hl.dup-hl-lv-90 {
  background: #CC0000;
  color: #fff;
  font-weight: 700;
  border: 1px solid #990000;
}
/* 重复率 70%~90%：红色 #FF4444 + 白色粗体（与来源标签 lv70 对齐） */
.dup-hl.dup-hl-lv-70 {
  background: #FF4444;
  color: #fff;
  font-weight: 700;
  border: 1px solid #CC0000;
}
/* 重复率 50%~70%：粉色 #FF6B8A + 白色粗体（与来源标签 lv50 对齐） */
.dup-hl.dup-hl-lv-50 {
  background: #FF6B8A;
  color: #fff;
  font-weight: 700;
  border: 1px solid #E04E6E;
}
/* 重复率 5%~50%：浅粉 #FFD4DC + 深粉粗体（与来源标签 low 对齐） */
.dup-hl.dup-hl-lv-low {
  background: #FFD4DC;
  color: #C74A62;
  font-weight: 700;
  border: 1px solid #E8758C;
}
/* 重复率 < 5%：浅绿 #D1FAE5 + 深绿粗体（安全档，与来源标签 safe 对齐） */
.dup-hl.dup-hl-lv-safe {
  background: #D1FAE5;
  color: #059669;
  font-weight: 700;
  border: 1px solid #10B981;
}
/* 基准文章：浅绿 #D9EAD3 */
.dup-hl.dup-hl-base {
  background: #D9EAD3;
  color: #1F3D20;
  border: 1px solid #A9C9A0;
}
/* 空壳文章：灰色背景 */
.dup-hl.dup-hl-empty {
  background: #D9D9D9;
  color: #666;
  border: 1px solid #BFBFBF;
}

.dup-hl.active {
  box-shadow: 0 0 0 2px rgba(79, 110, 247, 0.5);
  background: rgba(79, 110, 247, 0.18) !important;
}

/* 算法说明卡片 */
.dup-algorithm-desc {
  margin-top: 16px;
  padding: 14px 16px;
  background: #FAFBFC;
  border-radius: 8px;
  border: 1px solid #F3F4F6;
}

.dup-algorithm-desc .algo-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.dup-algorithm-desc .algo-line {
  font-size: 11px;
  color: #6B7280;
  line-height: 1.7;
}

/* ========== 右侧：命中来源列表 ========== */
.dup-source-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dup-source-item {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.dup-source-item:hover {
  border-color: #4F6EF7;
  background: #F9FAFF;
}

.dup-source-item.active {
  border-color: #4F6EF7;
  background: #EFF4FF;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
}

.dup-source-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 10px;
}

.dup-source-title {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A2E;
  line-height: 1.5;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dup-source-rate {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: #F3F4F6;
  color: #6B7280;
}

.dup-source-rate.lv90 { background: #CC0000; color: #fff; font-weight: 700; }
.dup-source-rate.lv70 { background: #FF4444; color: #fff; font-weight: 700; }
.dup-source-rate.lv50 { background: #FF6B8A; color: #fff; font-weight: 700; }
.dup-source-rate.low { background: #FFD4DC; color: #C74A62; font-weight: 700; }
.dup-source-rate.safe { background: #D1FAE5; color: #059669; font-weight: 700; }

.dup-source-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: #6B7280;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.dup-source-meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.dup-source-meta-item.dup-status-published {
  color: #059669;
  font-weight: 500;
}

.dup-source-meta-item.dup-status-unpublished {
  color: #D97706;
  font-weight: 500;
}

.dup-source-id {
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 10px;
  color: #6B7280;
  background: #F3F4F6;
  padding: 1px 6px;
  border-radius: 3px;
}

.dup-source-preview {
  padding: 10px 12px;
  background: #F9FAFB;
  border-radius: 6px;
  margin-bottom: 10px;
}

.dup-source-preview-row {
  margin-bottom: 8px;
}

.dup-source-preview-row:last-child {
  margin-bottom: 0;
}

.dup-source-preview-label {
  font-size: 10px;
  color: #9CA3AF;
  margin-bottom: 3px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dup-source-preview-text {
  font-size: 12px;
  color: #4B5563;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dup-source-preview-text .dup-hl-inline {
  background: rgba(251, 191, 36, 0.3);
  border-radius: 2px;
  padding: 0 1px;
}

.dup-source-jump {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #4F6EF7;
  font-weight: 500;
}

.dup-source-jump:hover {
  text-decoration: underline;
}

.dup-source-empty {
  padding: 40px 20px;
  text-align: center;
  color: #9CA3AF;
  font-size: 13px;
}

.dup-source-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ========== 加载中状态 ========== */
.dup-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.dup-loading-overlay.active {
  display: flex;
}

.dup-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #E5E7EB;
  border-top-color: #4F6EF7;
  border-radius: 50%;
  animation: dup-spin 0.8s linear infinite;
}

@keyframes dup-spin {
  to { transform: rotate(360deg); }
}

.dup-loading-text {
  margin-top: 16px;
  font-size: 14px;
  color: #4B5563;
}

.dup-loading-sub {
  margin-top: 6px;
  font-size: 12px;
  color: #9CA3AF;
}

.dup-loading-meta {
  margin-top: 6px;
  font-size: 11px;
  color: #9CA3AF;
}

/* 倒计时 / 取消按钮：水平并列，统一视觉 */
.dup-loading-skip,
.dup-loading-cancel {
  margin-top: 18px;
  padding: 6px 18px;
  height: 32px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 18px;
  box-sizing: border-box;
}

/* 「立即检测」：主色按钮，鼓励用户跳过等待 */
.dup-loading-skip {
  background: #4F6EF7;
  border-color: #4F6EF7;
  color: #fff;
  box-shadow: 0 2px 6px rgba(79, 110, 247, 0.25);
}

.dup-loading-skip:hover {
  background: #3F5AE0;
  border-color: #3F5AE0;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(79, 110, 247, 0.35);
}

/* 「取消检测」：次级按钮，弱化视觉权重 */
.dup-loading-cancel {
  margin-left: 10px;
  background: #fff;
  border-color: #D1D5DB;
  color: #6B7280;
}

.dup-loading-cancel:hover {
  background: #F9FAFB;
  border-color: #9CA3AF;
  color: #374151;
}

/* ========== 5s 去重 - 顶部倒计时 banner（缓存模式专用，不遮盖内容） ========== */
.dup-refresh-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border-bottom: 1px solid #BFDBFE;
  color: #1E40AF;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  animation: dupBannerSlideDown 0.25s ease;
}

@keyframes dupBannerSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dup-refresh-banner-icon {
  font-size: 14px;
  animation: dupBannerPulse 1s ease-in-out infinite;
}

@keyframes dupBannerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.dup-refresh-banner-text {
  flex: 1;
  text-align: center;
  font-weight: 500;
}

.dup-refresh-banner-skip {
  padding: 4px 14px;
  height: 26px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  background: #4F6EF7;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dup-refresh-banner-skip:hover {
  background: #3F5AE0;
  transform: translateY(-1px);
}

.dup-refresh-banner-close {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #6B7280;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.dup-refresh-banner-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
}

/* 响应式调整 */
@media (max-width: 1400px) {
  .dup-check-body {
    grid-template-columns: calc(30% - 10px) calc(40% - 10px) calc(30% - 10px);
  }
}

/* ========== 自定义二次确认弹框（不依赖第三方 confirm，保证一定能弹出） ========== */
.dup-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dup-confirm-box {
  width: 400px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  padding: 22px 24px 18px;
  box-sizing: border-box;
}
.dup-confirm-title {
  font-size: 16px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 12px;
}
.dup-confirm-content {
  font-size: 13px;
  color: #4B5563;
  line-height: 1.7;
  margin-bottom: 20px;
  max-height: 240px;
  overflow-y: auto;
}
.dup-confirm-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.dup-confirm-btn {
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.4;
}
.dup-confirm-btn-primary {
  background: #4F6EF7;
  color: #fff;
}
.dup-confirm-btn-danger {
  background: #fff;
  color: #EF4444;
  border: 1px solid #FCA5A5;
}
.dup-confirm-btn-default {
  background: #F3F4F6;
  color: #374151;
}

/* ========== 操作说明文档图标（顶部标题旁） ========== */
.dup-check-doc-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #9CA3AF;
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.15s;
}

.dup-check-doc-help-icon:hover {
  color: #4F6EF7;
}

/* ========== 操作说明文档弹窗 ========== */
.dup-doc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: dupDocFadeIn 0.15s ease;
}

@keyframes dupDocFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dup-doc-modal {
  width: 680px;
  max-width: calc(100vw - 40px);
  height: 80vh;
  max-height: 800px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dup-doc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
  background: #FAFAFA;
}

.dup-doc-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A2E;
}

.dup-doc-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #6B7280;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.dup-doc-modal-close:hover {
  background: #F3F4F6;
  color: #EF4444;
}

.dup-doc-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  font-size: 13px;
  color: #374151;
  line-height: 1.75;
}

.dup-doc-modal-body::-webkit-scrollbar {
  width: 8px;
}
.dup-doc-modal-body::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 4px;
}
.dup-doc-modal-body::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

.dup-doc-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #E5E7EB;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  background: #FAFAFA;
}

.dup-doc-section {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed #E5E7EB;
}

.dup-doc-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.dup-doc-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A2E;
  margin-bottom: 8px;
}

.dup-doc-section p {
  margin: 6px 0;
}

.dup-doc-section ul,
.dup-doc-section ol {
  margin: 6px 0;
  padding-left: 22px;
}

.dup-doc-section li {
  margin: 4px 0;
}

.dup-doc-note {
  color: #6B7280;
  font-size: 12px;
  background: #F9FAFB;
  padding: 6px 10px;
  border-radius: 4px;
  border-left: 3px solid #4F6EF7;
}

.dup-doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
}

.dup-doc-table th,
.dup-doc-table td {
  border: 1px solid #E5E7EB;
  padding: 6px 10px;
  text-align: left;
}

.dup-doc-table th {
  background: #F9FAFB;
  font-weight: 600;
  color: #1A1A2E;
}

.dup-doc-swatch {
  display: inline-block;
  width: 18px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  vertical-align: middle;
  margin-right: 4px;
}

.dup-doc-section code {
  background: #F3F4F6;
  color: #C92A2A;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-family: Menlo, Consolas, monospace;
}

.dup-doc-section pre {
  background: #1F2937;
  color: #E5E7EB;
  padding: 12px 14px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.6;
}

.dup-doc-section pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.dup-doc-section b {
  font-weight: 600;
  color: #1A1A2E;
}
