/* cleanup-embedded.css — 3-panel AI PDF Cleanup workbench (premium light · indigo/violet)
   Palette aligned with the page brand: brand #4F46E5 · ai #7C3AED · ink #1f2430 · surface #fff */
.cw-workbench {
  --c-bg: #f6f7fb;
  --c-surface: #ffffff;
  --c-surface-2: #fbfbfd;
  --c-border: #e9eaf1;
  --c-border-strong: #dfe1ea;
  --c-text: #1f2430;
  --c-muted: #6b7280;
  --c-faint: #9aa1ad;
  --c-brand: #4F46E5;
  --c-brand-2: #7C3AED;
  --c-brand-soft: #eef2ff;
  --c-brand-soft-2: #f5f3ff;
  --c-grad: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  --c-shadow-sm: 0 1px 3px rgba(16, 24, 40, .06);
  --c-shadow: 0 8px 28px rgba(16, 24, 40, .08);
  --c-shadow-lg: 0 14px 44px rgba(79, 70, 229, .18);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--c-text);
  position: relative;
}

/* ---------- Step indicator (connected progress) ---------- */
.cw-steps {
  display: flex; align-items: center; gap: 0; list-style: none;
  padding: 0; margin: 0 0 26px; counter-reset: step; flex-wrap: wrap;
}
.cw-step {
  position: relative; display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--c-faint); padding: 6px 4px; font-weight: 500;
  transition: color .3s ease;
}
.cw-step:not(:last-child)::after {
  content: ""; width: 26px; height: 2px; margin: 0 10px;
  background: var(--c-border-strong); border-radius: 2px; transition: background .3s ease;
}
.cw-step span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--c-border); color: var(--c-faint); font-size: 12px; font-weight: 700;
  transition: all .3s ease;
}
.cw-step.is-active { color: var(--c-brand); }
.cw-step.is-active span { background: var(--c-grad); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.35); }
.cw-step.is-done { color: var(--c-brand-2); }
.cw-step.is-done span { background: var(--c-brand-2); color: #fff; }
.cw-step.is-done:not(:last-child)::after { background: var(--c-brand-2); }

/* ---------- Upload zone ---------- */
.cw-upload-zone {
  position: relative; border: 2px dashed var(--c-border-strong); border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  padding: 56px 24px; text-align: center; cursor: pointer;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
  margin-bottom: 20px; overflow: hidden;
}
.cw-upload-zone::before {
  content: ""; position: absolute; inset: -2px; border-radius: 20px; padding: 2px;
  background: var(--c-grad); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .25s ease;
}
.cw-upload-zone:hover, .cw-upload-zone.cw-dragover {
  border-color: transparent; box-shadow: var(--c-shadow-lg); transform: translateY(-2px);
}
.cw-upload-zone:hover::before, .cw-upload-zone.cw-dragover::before { opacity: 1; }
.cw-upload-icon {
  font-size: 44px; margin-bottom: 10px; display: inline-flex; align-items: center; justify-content: center;
  width: 76px; height: 76px; border-radius: 50%; background: var(--c-brand-soft);
  box-shadow: inset 0 2px 8px rgba(79,70,229,.12);
}
.cw-upload-zone h3 { margin: 6px 0; font-size: 20px; font-weight: 700; color: var(--c-text); letter-spacing: -.01em; }
.cw-upload-zone p { margin: 6px 0 18px; color: var(--c-muted); font-size: 13.5px; }
.cw-upload-zone input[type=file] { display: none; }

/* ---------- Panels grid ---------- */
.cw-panels {
  display: grid; grid-template-columns: 230px minmax(0, 1fr) 350px;
  gap: 18px; align-items: start; margin-bottom: 20px;
  animation: cwFadeUp .45s ease both;
}
@keyframes cwFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cw-panel {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 18px; padding: 16px; box-shadow: var(--c-shadow-sm);
}

/* ---------- Left: meta + thumbnails ---------- */
.cw-file-meta { font-size: 13px; margin-bottom: 14px; }
.cw-meta-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--c-border); }
.cw-meta-row:last-child { border-bottom: none; }
.cw-meta-row span { color: var(--c-faint); }
.cw-meta-row b { color: var(--c-text); font-weight: 600; word-break: break-all; }
.cw-thumb-head { font-size: 12.5px; color: var(--c-muted); margin: 4px 0 10px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cw-analyzed-note { color: var(--c-brand); font-weight: 500; }
.cw-thumbnails {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
  max-height: 560px; overflow-y: auto; padding: 4px 4px 4px 0;
}
.cw-thumb {
  position: relative; border: 2px solid var(--c-border); border-radius: 10px; overflow: hidden;
  background: var(--c-surface-2); cursor: pointer; padding: 0; aspect-ratio: 1 / 1.32;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.cw-thumb:hover { border-color: var(--c-brand-light, #6366F1); transform: translateY(-2px); box-shadow: var(--c-shadow); }
.cw-thumb.is-current { border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(79,70,229,.18); transform: translateY(-1px); }
.cw-thumb-canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-thumb-num {
  position: absolute; left: 5px; bottom: 5px; background: rgba(17,24,39,.66); color: #fff;
  font-size: 10px; padding: 1px 6px; border-radius: 5px; font-weight: 600; backdrop-filter: blur(2px);
}
.cw-thumb-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--c-faint); background: var(--c-surface-2);
}

/* ---------- Center: preview + boxes ---------- */
.cw-center { display: flex; flex-direction: column; }
.cw-preview-wrap {
  position: relative; background:
    radial-gradient(circle at 50% 0%, #ffffff 0%, #eef0f6 100%);
  border-radius: 12px; padding: 14px;
  display: flex; align-items: center; justify-content: center; min-height: 440px;
  border: 1px solid var(--c-border);
}
.cw-preview-canvas {
  max-width: 100%; height: auto; border-radius: 6px;
  box-shadow: 0 6px 22px rgba(16,24,40,.14); background: #fff;
}
.cw-box-overlay { position: absolute; inset: 14px; pointer-events: none; }
.cw-box {
  position: absolute; border: 2px solid; border-radius: 4px; pointer-events: auto;
  cursor: pointer; transition: box-shadow .2s ease, filter .2s ease; box-sizing: border-box;
}
.cw-box:hover { box-shadow: 0 0 0 3px rgba(255,255,255,.85); filter: brightness(1.05); }
.cw-box.is-flash { animation: cwFlash 1.2s ease; }
@keyframes cwFlash { 0%,100% { filter: none; } 30% { filter: brightness(1.5); } }
.cw-box-label {
  position: absolute; top: -19px; left: -2px; font-size: 10px; font-weight: 700; color: #fff;
  padding: 1px 6px; border-radius: 4px; white-space: nowrap; background: rgba(17,24,39,.7);
  backdrop-filter: blur(2px);
}
.cw-box-purple { border-color: #8b5cf6; background: rgba(139,92,246,.14); }
.cw-box-purple .cw-box-label { background: #7c3aed; }
.cw-box-red { border-color: #ef4444; background: rgba(239,68,68,.14); }
.cw-box-red .cw-box-label { background: #dc2626; }
.cw-box-yellow { border-color: #eab308; background: rgba(234,179,8,.16); }
.cw-box-yellow .cw-box-label { background: #b45309; }
.cw-box-blue { border-color: #3b82f6; background: rgba(59,130,246,.14); }
.cw-box-blue .cw-box-label { background: #2563eb; }
.cw-box-gray { border-color: #9ca3af; background: rgba(156,163,175,.16); }
.cw-box-gray .cw-box-label { background: #4b5563; }
.cw-analyze-mask {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(246,247,251,.86); backdrop-filter: blur(3px); border-radius: 12px;
  color: var(--c-brand); font-weight: 700; font-size: 15px; gap: 12px;
}
.cw-analyze-mask::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--c-brand-soft); border-top-color: var(--c-brand);
  animation: cwSpin .8s linear infinite;
}
@keyframes cwSpin { to { transform: rotate(360deg); } }
.cw-preview-caption { text-align: center; font-size: 12.5px; color: var(--c-muted); margin-top: 10px; font-weight: 500; }

/* ---------- Right: results ---------- */
.cw-analysis-status { font-size: 13.5px; font-weight: 700; color: var(--c-text); margin-bottom: 12px; }
.cw-results-list { display: flex; flex-direction: column; gap: 12px; max-height: 540px; overflow-y: auto; padding: 4px 4px 4px 0; }
.cw-no-elements { color: #059669; font-size: 14px; padding: 14px; text-align: center; background: #ecfdf5; border-radius: 12px; font-weight: 600; }
.cw-cat-group {
  border: 1px solid var(--c-border); border-radius: 14px; padding: 12px;
  background: var(--c-surface-2); transition: border-color .2s ease;
}
.cw-cat-group:hover { border-color: var(--c-border-strong); }
.cw-cat-group:not(.expanded) .cw-elems { display: none; }
.cw-cat-toggle {
  display: block; margin: 8px 0 0 28px; padding: 3px 9px;
  border: 1px solid var(--c-border); border-radius: 999px; background: #fff;
  color: var(--c-brand); font-size: 11px; font-weight: 700; cursor: pointer;
}
.cw-cat-toggle:hover { background: #f5f3ff; border-color: #c7b8f5; }
.cw-cat-head { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; font-weight: 700; user-select: none; }
.cw-cat-head.cw-disabled { opacity: .65; }
.cw-cat-head input[type=checkbox] {
  width: 18px; height: 18px; accent-color: var(--c-brand); cursor: pointer; flex-shrink: 0;
}
.cw-cat-label { flex: 1; display: flex; align-items: center; gap: 8px; }
.cw-cat-count { font-size: 12px; color: var(--c-faint); font-weight: 500; }
.cw-cat-count b { color: var(--c-brand); font-size: 14px; font-weight: 800; margin-right: 2px; }
.cw-badge { font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 700; letter-spacing: .02em; }
.cw-badge-free { background: #e7f8ef; color: #047857; }
.cw-badge-pro { background: #f3e8ff; color: #6d28d9; }
.cw-badge-mixed { background: #fef3c7; color: #b45309; }
.cw-badge-warning { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.cw-lock-hint { display: block; font-size: 11.5px; color: #7c3aed; margin: 6px 0 0 28px; font-weight: 500; }
.cw-elems { margin: 10px 0 0 28px; display: flex; flex-direction: column; gap: 7px; }
.cw-elem {
  border: 1px solid var(--c-border); border-radius: 10px; padding: 8px 10px; background: #fff; cursor: pointer;
  transition: all .18s ease; font-size: 12.5px;
}
.cw-elem:hover { border-color: #c7b8f5; background: #faf8ff; transform: translateX(2px); box-shadow: var(--c-shadow-sm); }
.cw-elem.is-hl { border-color: var(--c-brand); background: #f5f3ff; box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.cw-elem.is-pro { border-left: 3px solid #7c3aed; }
.cw-elem-info { display: flex; justify-content: space-between; margin-bottom: 3px; }
.cw-elem-type { font-weight: 700; color: var(--c-text); }
.cw-elem-page { color: var(--c-faint); font-size: 11.5px; }
.cw-elem-desc { color: #555b66; line-height: 1.45; max-height: 2.9em; overflow: hidden; }
.cw-elem-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.cw-confidence { color: var(--c-faint); font-size: 11px; }
.cw-tag-pro { background: #f3e8ff; color: #6d28d9; font-size: 10px; padding: 0 6px; border-radius: 4px; font-weight: 700; }
.cw-tag-free { background: #e7f8ef; color: #047857; font-size: 10px; padding: 0 6px; border-radius: 4px; font-weight: 700; }
.cw-elem.is-free-complex { border-left: 3px solid #047857; background: #f4fbf8; }
.cw-elem.is-free-complex:hover { border-color: #34d399; background: #ecfdf5; }

/* 结果型付费墙横幅（免费用户可见，明确「能免费处理几个 / 剩下几个要升级」） */
.cw-free-complex-banner {
  background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 100%);
  border: 1px solid #ddd6fe; border-radius: 12px; padding: 11px 14px; margin: 0 0 14px;
  font-size: 13px; color: #4338ca; line-height: 1.55;
}
.cw-free-complex-banner b { color: #6d28d9; font-variant-numeric: tabular-nums; }
.cw-banner-cta { display: inline-block; margin-left: 6px; background: #4f46e5; color: #fff !important; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 99px; text-decoration: none; transition: background .2s ease, transform .2s ease; }
.cw-banner-cta:hover { background: #4338ca; transform: translateY(-1px); }
.cw-elems-more { font-size: 11px; color: var(--c-faint); padding: 5px 0; }

/* ---------- Buttons ---------- */
.cw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 12px; padding: 12px 20px; font-size: 14.5px; font-weight: 700;
  cursor: pointer; transition: all .2s ease; font-family: inherit;
}
.cw-btn-primary { background: var(--c-grad); color: #fff; width: 100%; margin-top: 14px; box-shadow: 0 8px 22px rgba(79,70,229,.28); }
.cw-btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(79,70,229,.36); }
.cw-btn-primary:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.cw-btn-ghost { background: #fff; color: var(--c-text); border: 1px solid var(--c-border-strong); }
.cw-btn-ghost:hover { border-color: var(--c-brand); color: var(--c-brand); }

/* ---------- Result / comparison ---------- */
.cw-result-stage {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 18px;
  padding: 24px; margin-bottom: 20px; box-shadow: var(--c-shadow);
  animation: cwFadeUp .45s ease both;
}
.cw-result-title { margin: 0 0 18px; font-size: 19px; font-weight: 800; color: var(--c-text); letter-spacing: -.01em; }
.cw-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cw-compare-col { margin: 0; }
.cw-compare-col figcaption { font-size: 12.5px; color: var(--c-muted); margin-bottom: 8px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.cw-compare-col:first-child figcaption::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.cw-compare-col:last-child figcaption::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #7c3aed; }
.cw-compare-canvas { width: 100%; height: auto; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface-2); }
.cw-result-text { margin: 18px 0; font-size: 14.5px; color: var(--c-text); font-weight: 700; line-height: 1.6; }
.cw-result-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cw-result-actions .cw-btn-ghost { flex: 0 0 auto; width: auto; margin-top: 0; }

/* ---------- Detection summary card ---------- */
.cw-summary-card {
  background: linear-gradient(180deg, var(--c-brand-soft) 0%, #fff 60%);
  border: 1px solid #dbe2ff; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px;
}
.cw-summary-head { font-size: 13.5px; font-weight: 800; color: var(--c-brand); margin-bottom: 10px; letter-spacing: -.01em; }
.cw-sum-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-top: 1px dashed #e4e8f5;
}
.cw-sum-row:first-of-type { border-top: none; }
.cw-sum-label { font-size: 13.5px; font-weight: 600; color: var(--c-text); flex: 1 1 auto; }
.cw-sum-count { font-size: 20px; font-weight: 800; color: var(--c-brand); font-variant-numeric: tabular-nums; line-height: 1; }
.cw-sum-unit { font-size: 12px; color: var(--c-faint); margin-right: 8px; }
.cw-sum-total { font-size: 16px; color: var(--c-brand); font-weight: 800; }
.cw-sum-all {
  border: 1px solid var(--c-border-strong); background: #fff; color: var(--c-brand);
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  transition: all .18s ease; flex: 0 0 auto;
}
.cw-sum-all:hover { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }
.cw-sum-all.is-on { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }
.cw-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cw-sum-all-toggle {
  border: 1px solid var(--c-brand); background: #fff; color: var(--c-brand);
  font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 999px; cursor: pointer;
  transition: all .18s ease; flex: 0 0 auto;
}
.cw-sum-all-toggle:hover { background: var(--c-brand); color: #fff; }
.cw-sum-all-toggle.is-on { background: var(--c-brand); color: #fff; }
.cw-sum-section { font-size: 11.5px; font-weight: 700; color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 4px; padding-top: 8px; border-top: 1px dashed #e4e8f5; }
.cw-sum-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.cw-sum-section-risk { color: #b45309; }

/* ---------- Results sections: clean vs compliance ---------- */
.cw-results-section { display: flex; flex-direction: column; gap: 10px; }
.cw-results-section-risk { border: 1px solid #fde68a; border-radius: 14px; padding: 12px; background: linear-gradient(180deg, #fffbeb 0%, #fff 60%); margin-top: 4px; }
.cw-results-section-title { font-size: 13px; font-weight: 800; color: var(--c-text); margin-bottom: 2px; }
.cw-results-section-risk .cw-results-section-title { color: #b45309; }
.cw-cat-group-report { background: #fffbeb; border-color: #fde68a; opacity: .98; }
.cw-cat-group-report:hover { border-color: #fcd34d; }
.cw-badge-info { background: #e0f2fe; color: #0369a1; }

/* ---------- Compare toggle + overlay ---------- */
.cw-compare { display: block; }
.cw-compare-toggle {
  display: inline-flex; gap: 6px; margin-bottom: 14px; background: var(--c-surface-2);
  padding: 4px; border-radius: 999px; border: 1px solid var(--c-border);
}
.cw-compare-toggle button {
  border: none; background: transparent; color: var(--c-muted); font-size: 13px; font-weight: 600;
  padding: 7px 16px; border-radius: 999px; cursor: pointer; transition: all .18s ease; font-family: inherit;
}
.cw-compare-toggle button.active { background: #fff; color: var(--c-brand); box-shadow: 0 2px 8px rgba(79,70,229,.16); }
.cw-compare-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; --pos: 50%; }
.cw-compare-stage.mode-overlay { display: block; position: relative; }
.cw-compare-stage.mode-overlay .cw-col-orig {
  position: absolute; top: 0; left: 0; width: 100%; z-index: 2;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.cw-compare-stage.mode-overlay .cw-col-orig figcaption,
.cw-compare-stage.mode-overlay .cw-col-cleaned figcaption { display: none; }
.cw-compare-stage.mode-overlay .cw-col-cleaned { position: relative; z-index: 1; }
.cw-canvas-box { position: relative; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 10px; overflow: hidden; }
.cw-compare-canvas { width: 100%; height: auto; display: block; border: none; background: transparent; border-radius: 0; }
.cw-compare-slider { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.cw-slider-tag { font-size: 12px; color: var(--c-muted); font-weight: 600; white-space: nowrap; }
.cw-compare-slider input[type="range"] { flex: 1 1 auto; accent-color: var(--c-brand); height: 4px; }

/* ---------- Compare page nav + diff stats ---------- */
.cw-compare-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 12px; font-size: 12.5px; color: var(--c-muted); font-weight: 600; }
.cw-compare-nav button { width: 30px; height: 30px; border: 1px solid var(--c-border); background: #fff; color: var(--c-text); border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1; transition: background .15s ease, border-color .15s ease; }
.cw-compare-nav button:hover { background: #f1f5f9; border-color: #cbd5e1; }
.cw-compare-nav span { min-width: 90px; text-align: center; }
.cw-diff-stats { margin: 14px 0 0; background: var(--c-surface-2, #f8fafc); border: 1px solid var(--c-border); border-radius: 12px; padding: 12px 16px; }
.cw-diff-head { font-size: 12px; font-weight: 700; color: var(--c-muted); letter-spacing: .5px; margin-bottom: 8px; }
.cw-diff-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; padding: 4px 0; border-top: 1px dashed var(--c-border); }
.cw-diff-row:first-of-type { border-top: none; }
.cw-diff-label { color: var(--c-muted); }
.cw-diff-nums b { color: var(--c-text); font-variant-numeric: tabular-nums; }
.cw-diff-delta { font-size: 12px; font-weight: 600; white-space: nowrap; }
.cw-diff-delta.good { color: #16a34a; }
.cw-diff-delta.bad { color: #dc2626; }
.cw-diff-delta.same { color: var(--c-muted); }
.cw-diff-delta.warn { color: #d97706; }
.cw-diff-sep { height: 8px; }
/* 复杂对象提示：诚实报告未清干净的部分，比假装 100% 更专业 */
.cw-diff-note {
  margin-top: 10px; padding: 9px 11px; font-size: 12px; line-height: 1.6;
  color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 9px;
}

/* ---------- Phase 2：文档身份行 ---------- */
.cw-doc-line { font-size: 11.5px; color: var(--c-faint, #94a3b8); margin: 0 0 10px; font-variant-numeric: tabular-nums; }

/* ---------- Quality report ---------- */
.cw-quality-report {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px;
  padding: 16px 18px; margin-top: 18px;
}
.cw-qr-head { font-size: 14px; font-weight: 800; color: var(--c-text); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cw-qr-head::before {
  content: "✓"; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: #dcfce7; color: #16a34a; font-size: 12px;
}
.cw-qr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cw-qr-item { background: var(--c-surface-2); border-radius: 10px; padding: 12px; text-align: center; }
.cw-qr-k { font-size: 12px; color: var(--c-muted); font-weight: 600; }
.cw-qr-v { font-size: 18px; font-weight: 800; color: var(--c-text); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.cw-qr-note { font-size: 11px; color: var(--c-muted); }
.cw-qr-warns { margin-top: 12px; border-top: 1px dashed var(--c-border); padding-top: 10px; }
.cw-qr-warns-head { font-size: 12.5px; font-weight: 700; color: var(--c-text); margin-bottom: 6px; }
.cw-qr-warn { font-size: 12.5px; color: #b45309; line-height: 1.6; padding: 3px 0; }

/* ---------- Free → Pro upsell banner (conversion hook) ---------- */
.cw-pro-upsell {
  display: flex; align-items: center; gap: 16px; margin-top: 16px;
  padding: 18px 20px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(79,70,229,.10), rgba(236,72,153,.12));
  border: 1px solid rgba(79,70,229,.28);
  box-shadow: 0 10px 30px rgba(79,70,229,.12);
  animation: cwUp 0.35s ease both;
}
@keyframes cwUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.cw-pro-upsell-ico {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: linear-gradient(135deg, #4f46e5, #ec4899); color: #fff;
  box-shadow: 0 8px 18px rgba(79,70,229,.35);
}
.cw-pro-upsell-body { flex: 1 1 auto; min-width: 0; }
.cw-pro-upsell-title { font-size: 15px; font-weight: 800; color: var(--c-text); }
.cw-pro-upsell-title span { color: #ec4899; font-variant-numeric: tabular-nums; }
.cw-pro-upsell-sub { font-size: 12.5px; color: var(--c-muted); line-height: 1.55; margin-top: 3px; }
.cw-pro-upsell-free { font-size: 12.5px; color: #047857; font-weight: 700; line-height: 1.5; margin-top: 8px; padding: 8px 10px; background: #e7f8ef; border-radius: 10px; border: 1px solid #a7f3d0; }
.cw-btn-upgrade {
  flex: 0 0 auto; width: auto; margin-top: 0; padding: 11px 20px;
  background: linear-gradient(135deg, #4f46e5, #ec4899); color: #fff; font-weight: 700;
  border: none; box-shadow: 0 8px 22px rgba(79,70,229,.34);
}
.cw-btn-upgrade:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(79,70,229,.42); }
@media (max-width: 560px) {
  .cw-pro-upsell { flex-wrap: wrap; }
  .cw-btn-upgrade { width: 100%; }
}

/* ---------- Batch hint + toast ---------- */
.cw-batch-hint { font-size: 12.5px; color: var(--c-muted); text-align: center; margin: 12px 0; padding: 12px; background: var(--c-brand-soft); border: 1px solid #dbe2ff; border-radius: 12px; }
.cw-batch-hint a { color: var(--c-brand); font-weight: 600; }
.cw-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--c-text); color: #fff; padding: 12px 22px; border-radius: 12px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 9999; max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.cw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.cw-toast.error { background: #dc2626; }
.cw-toast.success { background: #059669; }
.cw-toast.info { background: #2563eb; }

/* ---------- Loading overlay (parse / process) ---------- */
.cw-loading {
  position: fixed; inset: 0; z-index: 9998; display: none;
  align-items: center; justify-content: center;
  background: rgba(246, 247, 251, .72); backdrop-filter: blur(6px);
}
.cw-loading.show { display: flex; animation: cwFade .2s ease both; }
@keyframes cwFade { from { opacity: 0; } to { opacity: 1; } }
.cw-loading-card {
  background: #fff; border: 1px solid var(--c-border); border-radius: 20px;
  padding: 34px 38px; text-align: center; min-width: 300px; max-width: 90vw;
  box-shadow: var(--c-shadow-lg);
}
.cw-spinner {
  width: 48px; height: 48px; margin: 0 auto 18px; border-radius: 50%;
  border: 4px solid var(--c-brand-soft); border-top-color: var(--c-brand);
  animation: cwSpin .8s linear infinite;
}
.cw-loading-title { font-size: 16px; font-weight: 700; color: var(--c-text); margin-bottom: 6px; }
.cw-loading-sub { font-size: 13px; color: var(--c-muted); margin-bottom: 16px; }
.cw-loading-bar { height: 6px; border-radius: 999px; background: #eef0f6; overflow: hidden; }
.cw-loading-fill { height: 100%; width: 8%; border-radius: 999px; background: var(--c-grad); transition: width .4s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .cw-panels { grid-template-columns: 1fr; }
  .cw-thumbnails { grid-template-columns: repeat(4, 1fr); max-height: 220px; }
  .cw-compare { grid-template-columns: 1fr; }
  .cw-results-list { max-height: none; }
  .cw-qr-grid { grid-template-columns: 1fr; }
  .cw-compare-stage { grid-template-columns: 1fr; }
  .cw-compare-stage.mode-overlay .cw-col-orig { position: relative; clip-path: none; }
  .cw-summary-card { padding: 12px; }
}

/* ---------- 深度清理开关 ---------- */
.cw-deepclean {
  margin: 16px 0 4px; padding: 13px 15px; border-radius: 14px;
  border: 1px solid var(--c-border);
  background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(255,107,107,0.06));
  transition: border-color .25s ease, box-shadow .25s ease;
}
.cw-deepclean:has(.cw-dc-label input:checked) {
  border-color: #4f46e5;
  box-shadow: 0 6px 22px rgba(79,70,229,0.14);
}
.cw-dc-label { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.cw-dc-label input { width: 17px; height: 17px; accent-color: #4f46e5; cursor: pointer; }
.cw-dc-text { font-size: 14px; color: var(--c-text); }
.cw-dc-text strong { color: #4f46e5; font-weight: 800; }
.cw-dc-note { margin: 7px 0 0 26px; font-size: 12px; color: var(--c-muted); line-height: 1.55; }
.cw-dc-lock { margin: 8px 0 0 26px; font-size: 12px; color: #b45309; line-height: 1.55; font-weight: 600; }

/* 自定义水印文字输入（Phase B 原生删除补充） */
.cw-wmterms { margin: 12px 0 4px; padding: 12px 15px; border-radius: 14px; border: 1px solid var(--c-border); background: rgba(255,255,255,0.04); backdrop-filter: blur(12px); }
.cw-wt-label { display: block; font-size: 13px; font-weight: 700; color: var(--c-text); margin-bottom: 7px; }
.cw-wt-input {
  width: 100%; box-sizing: border-box; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text);
  font-size: 14px; outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.cw-wt-input:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.16); }
.cw-wt-input::placeholder { color: var(--c-muted); opacity: .8; }
.cw-wt-note { margin: 7px 0 0; font-size: 12px; color: var(--c-muted); line-height: 1.55; }

/* ---------- 处理位置提示（本地 / 服务端）----------
   隐私是这个产品最硬的卖点，但过去用户无从判断「这次到底传没传」。
   把答案钉在「一键处理」按钮正上方，比 FAQ 里写十行承诺有用。 */
.cw-proc-where {
  display: flex; align-items: flex-start; gap: 11px;
  margin: 12px 0 4px; padding: 12px 15px;
  border-radius: 14px; border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  transition: border-color .3s cubic-bezier(.16,1,.3,1),
              background .3s cubic-bezier(.16,1,.3,1),
              box-shadow .3s cubic-bezier(.16,1,.3,1);
  animation: cwPwIn .34s cubic-bezier(.16,1,.3,1) both;
}
@keyframes cwPwIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.cw-pw-icon {
  flex: 0 0 auto; font-size: 16px; line-height: 1.35;
  filter: saturate(1.15);
}
.cw-pw-body { display: block; min-width: 0; }
.cw-pw-body b {
  display: block; font-size: 13.5px; font-weight: 800;
  letter-spacing: -.01em; margin-bottom: 3px;
}
.cw-pw-body em {
  display: block; font-style: normal;
  font-size: 12px; line-height: 1.6; color: var(--c-muted);
}

/* 本地处理：绿色 = 安全、不出设备 */
.cw-proc-where.is-local {
  border-color: rgba(16, 185, 129, .32);
  background: linear-gradient(135deg, rgba(16,185,129,.07), rgba(16,185,129,.02));
}
.cw-proc-where.is-local .cw-pw-body b { color: #047857; }

/* 本地 + 大文件：琥珀色 = 能做，但会慢，给个诚实预警 */
.cw-proc-where.is-heavy {
  border-color: rgba(245, 158, 11, .38);
  background: linear-gradient(135deg, rgba(245,158,11,.09), rgba(245,158,11,.02));
}
.cw-proc-where.is-heavy .cw-pw-body b { color: #b45309; }

/* 上传服务端：品牌靛蓝 = 主动告知，不做隐瞒 */
.cw-proc-where.is-server {
  border-color: rgba(79, 70, 229, .34);
  background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(124,58,237,.03));
  box-shadow: 0 4px 18px rgba(79, 70, 229, .10);
}
.cw-proc-where.is-server .cw-pw-body b { color: #4338ca; }

@media (max-width: 560px) {
  .cw-proc-where { padding: 11px 13px; gap: 9px; }
  .cw-pw-body em { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .cw-proc-where { animation: none; }
}

/* ============ PDF Risk Scan Report ============ */
.cw-risk-report {
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 18px 18px 20px;
  margin-bottom: 18px;
}
.cw-risk-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cw-risk-head-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cw-risk-score {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 96px; height: 96px; border-radius: 14px; flex: 0 0 auto;
  border: 2px solid currentColor;
}
.cw-risk-score .cw-risk-num { font-size: 38px; font-weight: 800; line-height: 1; }
.cw-risk-score .cw-risk-den { font-size: 13px; opacity: .6; }
.cw-risk-score label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-top: 4px; }
.cw-risk-high { color: #ff6b6b; }
.cw-risk-medium { color: #ffb84d; }
.cw-risk-low { color: #4dd07a; }
.cw-risk-overview { flex: 1 1 200px; min-width: 180px; }
.cw-risk-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.cw-risk-found { font-size: 13px; opacity: .8; margin-bottom: 8px; }
.cw-risk-found b { font-size: 15px; }
.cw-risk-levels { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-risk-pill {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14); opacity: .4;
}
.cw-risk-pill.on { opacity: 1; }
.cw-risk-pill.cw-risk-high.on { background: rgba(255,107,107,.16); border-color: rgba(255,107,107,.5); }
.cw-risk-pill.cw-risk-medium.on { background: rgba(255,184,77,.16); border-color: rgba(255,184,77,.5); }
.cw-risk-pill.cw-risk-low.on { background: rgba(77,208,122,.16); border-color: rgba(77,208,122,.5); }
.cw-ai-explain-btn {
  flex: 0 0 auto; align-self: center; cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border: none;
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(99,102,241,.35); transition: transform .15s ease, opacity .15s ease;
}
.cw-ai-explain-btn:hover:not(:disabled) { transform: translateY(-1px); }
.cw-ai-explain-btn:disabled { opacity: .5; cursor: default; }
.cw-risk-toggle-all {
  flex: 0 0 auto; align-self: center; cursor: pointer;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.14);
  padding: 9px 14px; border-radius: 10px; font-size: 12px; font-weight: 600;
  transition: background .15s ease, transform .15s ease;
}
.cw-risk-toggle-all:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.cw-risk-buckets { display: grid; gap: 12px; margin-top: 16px; }
.cw-risk-bucket {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 12px 14px;
}
.cw-risk-bucket-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer; user-select: none;
}
.cw-risk-bucket-head:hover { opacity: .92; }
.cw-risk-bucket-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cw-risk-bucket-head h4 { margin: 0; font-size: 14px; font-weight: 700; }
.cw-risk-bucket-meta { display: flex; align-items: center; gap: 10px; }
.cw-risk-bucket-count { font-size: 12px; opacity: .65; white-space: nowrap; }
.cw-risk-bucket-toggle {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.8); border-radius: 8px; padding: 4px 10px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background .15s ease;
}
.cw-risk-bucket-toggle:hover { background: rgba(255,255,255,.14); }
.cw-risk-badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.cw-risk-badge.cw-risk-high { background: rgba(255,107,107,.18); color: #ff8a8a; }
.cw-risk-badge.cw-risk-medium { background: rgba(255,184,77,.18); color: #ffc878; }
.cw-risk-badge.cw-risk-low { background: rgba(77,208,122,.18); color: #7fe0a3; }
.cw-risk-bucket-sub { font-size: 12px; opacity: .6; margin: 4px 0 0; }
.cw-risk-bucket:not(.expanded) .cw-risk-items { display: none; }
.cw-risk-bucket.expanded .cw-risk-items { display: grid; gap: 6px; margin-top: 10px; }
.cw-risk-item {
  border-left: 3px solid rgba(255,255,255,.12); padding: 6px 10px; border-radius: 0 8px 8px 0;
  background: rgba(255,255,255,.02);
}
.cw-risk-item-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .75; margin-right: 8px; }
.cw-risk-item-page { font-size: 11px; opacity: .55; margin-right: 8px; }
.cw-risk-item-desc { font-size: 13px; }
.cw-risk-item-desc b { color: #ffd479; }
.cw-risk-exp { margin-top: 8px; }
.cw-exp-card {
  border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.55;
  border: 1px solid rgba(255,255,255,.10);
}
.cw-exp-card.cw-risk-high { background: rgba(255,107,107,.10); }
.cw-exp-card.cw-risk-medium { background: rgba(255,184,77,.10); }
.cw-exp-card.cw-risk-low { background: rgba(77,208,122,.10); }
.cw-exp-level { display: inline-block; font-weight: 700; margin-bottom: 4px; }
.cw-exp-row { margin-top: 2px; }
.cw-exp-row b { opacity: .7; margin-right: 4px; }
.cw-risk-ai-note { margin-top: 10px; font-size: 11px; opacity: .55; }

/* ============ Cleanup Verification Result ============ */
.cw-verify-block {
  background: rgba(77,208,122,.06); border: 1px solid rgba(77,208,122,.22);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.cw-verify-head { font-size: 13px; font-weight: 700; color: #7fe0a3; margin-bottom: 6px; letter-spacing: .02em; }
.cw-verify-line { font-size: 14px; margin-bottom: 8px; }
.cw-verify-line b { font-size: 16px; }
.cw-verify-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cw-verify-check { font-size: 12px; opacity: .85; }
.cw-verify-check.ok { color: #7fe0a3; }
.cw-verify-check.no { opacity: .4; }

/* ============ Risk-Driven Pro CTA (二次钩子) ============ */
.cw-risk-cta {
  margin-top: 16px;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(79,70,229,.35), rgba(109,40,217,.25), rgba(79,70,229,.35));
  background-size: 200% 200%;
  animation: cwCtaShimmer 4s ease-in-out infinite;
}
@keyframes cwCtaShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.cw-risk-cta-body {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(15,12,30,.92);
  border-radius: 13px;
  padding: 14px 16px;
}
.cw-risk-cta-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}
.cw-risk-cta-icon.cw-risk-high { filter: drop-shadow(0 0 6px rgba(255,107,107,.4)); }
.cw-risk-cta-icon.cw-risk-medium { filter: drop-shadow(0 0 6px rgba(255,184,77,.4)); }
.cw-risk-cta-icon.cw-risk-low { filter: drop-shadow(0 0 6px rgba(77,208,122,.4)); }
.cw-risk-cta-text {
  flex: 1 1 240px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,.88);
}
.cw-risk-cta-text b {
  color: #ffd479;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.cw-risk-cta-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease;
  box-shadow: 0 2px 12px rgba(99,102,241,.3);
}
.cw-risk-cta-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 20px rgba(99,102,241,.45);
}
.cw-risk-cta-btn:active {
  transform: translateY(0) scale(.98);
}

/* Pro 已启用徽章 */
.cw-risk-pro-badge {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(77,208,122,.08);
  border: 1px solid rgba(77,208,122,.22);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: rgba(127,224,163,.9);
}

/* ============ Light theme overrides for risk CTA ============ */
.cw-theme-light .cw-risk-cta-body {
  background: rgba(255,255,255,.95);
}
.cw-theme-light .cw-risk-cta-text {
  color: rgba(30,30,50,.88);
}
.cw-theme-light .cw-risk-cta-text b {
  color: #6d28d9;
}
.cw-theme-light .cw-risk-pro-badge {
  background: rgba(77,208,122,.06);
  color: #15803d;
}

/* === Security Report Button (Pro) === */
.cw-security-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 10px 20px;
  border: 1px solid rgba(99,102,241,.3);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(124,58,237,.08));
  color: #a5b4fc;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s cubic-bezier(.16,1,.3,1);
  backdrop-filter: blur(8px);
}
.cw-security-report-btn .cw-sr-icon {
  font-size: 16px;
  line-height: 1;
}
.cw-security-report-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.6);
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(124,58,237,.15));
  box-shadow: 0 4px 20px rgba(99,102,241,.2);
}
.cw-security-report-btn:active {
  transform: translateY(0);
}
.cw-theme-light .cw-security-report-btn {
  background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(124,58,237,.06));
  color: #4f46e5;
  border-color: rgba(99,102,241,.2);
}
.cw-theme-light .cw-security-report-btn:hover {
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(124,58,237,.1));
  box-shadow: 0 4px 16px rgba(99,102,241,.12);
}

/* ============================================================
   PREMIUM RESULTS REDESIGN (2026-08-18)
   Summary hero + category cards + confidence bars
   ============================================================ */
.cw-summary-card {
  background: linear-gradient(180deg, rgba(99,102,241,.10) 0%, var(--c-surface) 62%);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  padding: 18px 18px 16px;
  margin-bottom: 18px;
  box-shadow: var(--c-shadow-sm);
  position: relative;
  overflow: hidden;
}
.cw-summary-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--c-grad); opacity: .9;
}
.cw-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cw-summary-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cw-summary-emoji {
  display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 12px; font-size: 20px;
  background: var(--c-grad); box-shadow: 0 6px 16px rgba(79,70,229,.3);
}
.cw-summary-txt { min-width: 0; }
.cw-summary-label { font-size: 14px; font-weight: 800; color: var(--c-text); letter-spacing: -.01em; }
.cw-summary-sub { font-size: 12.5px; color: var(--c-muted); margin-top: 2px; }
.cw-sum-total { color: var(--c-brand); font-weight: 800; font-variant-numeric: tabular-nums; }
.cw-sum-all-toggle {
  flex: 0 0 auto; border: 1px solid var(--c-brand); background: #fff; color: var(--c-brand);
  font-size: 12.5px; font-weight: 700; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  transition: all .18s ease;
}
.cw-sum-all-toggle:hover { background: var(--c-brand); color: #fff; transform: translateY(-1px); }
.cw-sum-all-toggle.is-on { background: var(--c-brand); color: #fff; }

.cw-sum-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.cw-sum-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 13px 9px 10px; border-radius: 13px; cursor: pointer;
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  transition: all .18s ease; text-align: left; font-family: inherit;
}
.cw-sum-chip:hover { transform: translateY(-2px); border-color: var(--c-brand); box-shadow: var(--c-shadow-sm); }
.cw-sum-chip.is-risk { border-color: #fcd34d; background: linear-gradient(180deg, #fffbeb, var(--c-surface-2)); }
.cw-sum-chip.is-risk:hover { border-color: #f59e0b; }
.cw-chip-ico {
  display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 9px; font-size: 16px; background: #fff; border: 1px solid var(--c-border);
}
.cw-sum-chip.is-risk .cw-chip-ico { background: #fff7e6; border-color: #fde68a; }
.cw-chip-meta { display: flex; flex-direction: column; line-height: 1.1; }
.cw-chip-count { font-size: 17px; font-weight: 800; color: var(--c-brand); font-variant-numeric: tabular-nums; }
.cw-sum-chip.is-risk .cw-chip-count { color: #b45309; }
.cw-chip-label { font-size: 11.5px; color: var(--c-muted); font-weight: 600; }

/* ---- category cards ---- */
.cw-cat-group {
  border: 1px solid var(--c-border); border-left: 4px solid var(--cat-accent, var(--c-brand));
  border-radius: 14px; padding: 13px 14px; background: var(--c-surface-2);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.cw-cat-group:hover { box-shadow: var(--c-shadow-sm); border-color: var(--c-border-strong); }
.cw-cat-head { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; font-weight: 700; user-select: none; }
.cw-cat-head.cw-disabled { opacity: .65; }
.cw-cat-head input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--c-brand); cursor: pointer; flex-shrink: 0; }
.cw-cat-ico {
  display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto;
  border-radius: 8px; font-size: 14px; background: #fff; border: 1px solid var(--c-border);
}
.cw-cat-label { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cw-cat-count { font-size: 12px; color: var(--c-faint); font-weight: 500; }
.cw-cat-count b { color: var(--cat-accent, var(--c-brand)); font-size: 15px; font-weight: 800; margin-right: 2px; }
.cw-cat-toggle {
  display: block; margin: 9px 0 0 36px; padding: 4px 11px;
  border: 1px solid var(--c-border); border-radius: 999px; background: #fff;
  color: var(--c-brand); font-size: 11px; font-weight: 700; cursor: pointer; transition: all .18s ease;
}
.cw-cat-toggle:hover { background: #f5f3ff; border-color: #c7b8f5; }

.cw-elems { margin: 10px 0 0 36px; display: flex; flex-direction: column; gap: 8px; }
.cw-elem {
  border: 1px solid var(--c-border); border-radius: 12px; padding: 10px 12px; background: #fff;
  cursor: pointer; transition: all .18s ease; font-size: 12.5px;
}
.cw-elem:hover { border-color: #c7b8f5; background: #faf8ff; transform: translateX(3px); box-shadow: var(--c-shadow-sm); }
.cw-elem.is-hl { border-color: var(--c-brand); background: #f5f3ff; box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.cw-elem.is-pro { border-left: 3px solid #7c3aed; }
.cw-elem.is-free-complex { border-left: 3px solid #047857; background: #f4fbf8; }
.cw-elem.is-free-complex:hover { border-color: #34d399; background: #ecfdf5; }
.cw-elem-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 8px; }
.cw-elem-type { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--c-text); }
.cw-elem-ico { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 12px; background: var(--c-surface-2); border: 1px solid var(--c-border); }
.cw-elem-page { color: var(--c-faint); font-size: 11.5px; flex: 0 0 auto; }
.cw-elem-desc { color: #555b66; line-height: 1.5; max-height: 3.2em; overflow: hidden; margin-bottom: 6px; }
.cw-elem-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- confidence bar ---- */
.cw-conf { display: inline-flex; align-items: center; gap: 7px; }
.cw-conf-track { width: 64px; height: 6px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; border: 1px solid var(--c-border); }
.cw-conf-bar { height: 100%; border-radius: 999px; transition: width .4s ease; }
.cw-conf-hi { background: linear-gradient(90deg, #34d399, #059669); }
.cw-conf-mid { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.cw-conf-low { background: linear-gradient(90deg, #f87171, #ef4444); }
.cw-confidence { color: var(--c-faint); font-size: 11px; white-space: nowrap; }

.cw-tag-pro { background: #f3e8ff; color: #6d28d9; font-size: 10px; padding: 1px 7px; border-radius: 5px; font-weight: 700; }
.cw-tag-free { background: #e7f8ef; color: #047857; font-size: 10px; padding: 1px 7px; border-radius: 5px; font-weight: 700; }
.cw-cross-preview { border: 1px solid #c4b5fd; background: #f5f3ff; color: #6d28d9; border-radius: 999px; padding: 3px 8px; font: inherit; font-size: 10.5px; font-weight: 700; cursor: pointer; }
.cw-cross-preview:hover { background: #ede9fe; border-color: #8b5cf6; }
.cw-cross-modal {
  position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center;
  padding: 20px; background: rgba(15, 23, 42, .52); backdrop-filter: blur(5px);
}
.cw-cross-modal-card {
  width: min(520px, 96vw); max-height: min(90vh, 900px); display: flex; flex-direction: column;
  overflow: hidden; border: 1px solid rgba(99, 102, 241, .28); border-radius: 18px;
  background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}
.cw-cross-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 15px 18px 12px; border-bottom: 1px solid #ebe9f5;
}
.cw-cross-modal-head b { display: block; color: #202238; font-size: 15px; }
.cw-cross-modal-head span { display: block; margin-top: 4px; color: #7b8192; font-size: 11.5px; }
.cw-cross-modal-close {
  width: 30px; height: 30px; border: 0; border-radius: 9px; background: #f5f3ff;
  color: #5b21b6; font-size: 22px; line-height: 1; cursor: pointer;
}
.cw-cross-modal-close:hover { background: #ede9fe; }
.cw-cross-modal-body { overflow: auto; padding: 14px; background: #f7f7fb; }
.cw-cross-modal-body canvas { display: block; width: 100%; height: auto; border: 1px solid #e6e3f4; border-radius: 12px; background: #fff; }
.cw-cross-modal-foot { padding: 11px 18px 14px; color: #6b7280; font-size: 11.5px; line-height: 1.55; }
.cw-elems-more { font-size: 11px; color: var(--c-faint); padding: 5px 0; }

/* risk section already tinted amber via cw-results-section-risk */
.cw-results-section-risk { border: 1px solid #fde68a; border-radius: 16px; padding: 14px; background: linear-gradient(180deg, #fffbeb 0%, var(--c-surface) 70%); margin-top: 4px; }
.cw-sec-ico { margin-right: 6px; }
.cw-results-section-title { font-size: 13.5px; font-weight: 800; color: var(--c-text); margin-bottom: 6px; display: flex; align-items: center; }
.cw-results-section-risk .cw-results-section-title { color: #b45309; }

/* 清理后预览渲染失败时的友好降级提示 */
.cw-cleaned-fallback {
  padding: 18px 16px; border: 1px dashed #f59e0b; border-radius: 12px;
  background: linear-gradient(180deg, #fffbeb, #fff); color: #92400e;
  font-size: 13px; line-height: 1.6; margin-top: 6px;
}

/* ============ 结果页 UI 层级优化（不改变清理逻辑） ============ */
.cw-results-list { gap: 9px; }
.cw-results-section { gap: 9px; }
.cw-results-section-title { justify-content: space-between; gap: 12px; }
.cw-results-section-title > span { display: inline-flex; align-items: center; min-width: 0; }
.cw-results-section-title small {
  color: var(--c-faint); font-size: 11px; font-weight: 500; line-height: 1.4; text-align: right;
}
.cw-cat-head { cursor: default; min-height: 30px; }
.cw-cat-choice {
  display: inline-flex; align-items: center; gap: 9px; flex: 1 1 auto; min-width: 0;
  cursor: pointer;
}
.cw-cat-choice input[type=checkbox] { margin: 0; }
.cw-cat-choice .cw-cat-label { flex: 1 1 auto; }
.cw-cat-head .cw-cat-count { flex: 0 0 auto; }
.cw-cat-head .cw-cat-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  margin: 0; white-space: nowrap;
}
.cw-elems { margin-top: 9px; }
.cw-elem-desc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}

/* 风险详情默认收起，避免首次进入结果页信息过载。 */
.cw-risk-details { display: none; }
.cw-risk-report.is-details-open .cw-risk-details { display: block; }
.cw-risk-details-toggle {
  flex: 0 0 auto; align-self: center; cursor: pointer;
  background: #fff; color: #4f46e5; border: 1px solid #c7d2fe;
  padding: 9px 13px; border-radius: 10px; font-size: 12px; font-weight: 700;
  transition: background .15s ease, transform .15s ease;
}
.cw-risk-details-toggle:hover { background: #eef2ff; transform: translateY(-1px); }

/* 风险报告位于浅色工作台时，覆盖旧版深色主题规则。 */
.cw-risk-report {
  background: linear-gradient(135deg, #f8fafc, #fff);
  border-color: #e2e8f0; color: #1f2937;
}
.cw-risk-title { color: #111827; }
.cw-risk-found { color: #64748b; opacity: 1; }
.cw-risk-pill { border-color: #e2e8f0; color: #64748b; opacity: .55; }
.cw-risk-pill.on { opacity: 1; }
.cw-risk-pill.cw-risk-high.on { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.cw-risk-pill.cw-risk-medium.on { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.cw-risk-pill.cw-risk-low.on { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.cw-risk-bucket { background: #fff; border-color: #e2e8f0; }
.cw-risk-bucket-head h4 { color: #1f2937; }
.cw-risk-bucket-count, .cw-risk-bucket-sub { color: #64748b; opacity: 1; }
.cw-risk-bucket-toggle, .cw-risk-toggle-all {
  background: #fff; color: #4f46e5; border-color: #c7d2fe;
}
.cw-risk-bucket-toggle:hover, .cw-risk-toggle-all:hover { background: #eef2ff; }
.cw-risk-item { background: #f8fafc; border-color: #e2e8f0; }
.cw-risk-item-type, .cw-risk-item-page { color: #64748b; opacity: 1; }
.cw-risk-item-desc { color: #334155; }
.cw-risk-item-desc b { color: #b45309; }
.cw-risk-ai-note { color: #64748b; opacity: 1; }
.cw-risk-cta-body { background: #fff; }
.cw-risk-cta-text { color: #334155; }
.cw-risk-pro-badge { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }

/* 清理完成后的单份文档下一步，明确连接 AI 合规与 FlowSync。 */
.cw-next-step-actions {
  display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding: 14px;
  border: 1px solid #e0e7ff; border-radius: 14px;
  background: linear-gradient(135deg, #fafaff, #f5f3ff);
}
.cw-next-step-head { display: flex; flex-direction: column; gap: 3px; }
.cw-next-step-head b { color: #312e81; font-size: 14px; }
.cw-next-step-head span { color: #64748b; font-size: 11.5px; }
.cw-next-step-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-next-step-buttons .cw-btn { width: auto; margin-top: 0; }

@media (max-width: 560px) {
  .cw-results-section-title { align-items: flex-start; flex-direction: column; }
  .cw-results-section-title small { text-align: left; }
  .cw-cat-head { align-items: flex-start; }
  .cw-cat-count { margin-left: auto; }
  .cw-cat-head .cw-cat-toggle { font-size: 10.5px; padding: 3px 8px; }
  .cw-next-step-buttons .cw-btn { width: 100%; }
}

/* ---------- 检测结论面板（结论优先） ---------- */
.cw-conclusion {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #f5f3ff, #f0fdf4);
  border: 1px solid #ddd6fe; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
}
.cw-conclusion-main { display: flex; align-items: flex-start; gap: 10px; }
.cw-conclusion-signal {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--c-brand, #4f46e5); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 900;
}
.cw-conclusion strong { font-size: 13.5px; color: var(--c-text, #1e293b); }
.cw-conclusion p { margin: 4px 0 0; color: var(--c-muted, #64748b); font-size: 11.5px; line-height: 1.6; }
.cw-conclusion-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cw-tag { border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.cw-tag-safe { background: #e7f8ef; color: #047857; }
.cw-tag-review { background: #fff7ed; color: #b45309; }
.cw-tag-keep { background: #f1f5f9; color: #64748b; }

/* ---------- 三组：可安全清理 / 建议人工确认 / 默认保留 ---------- */
.cw-results-section-review {
  border: 1px solid #fed7aa; border-radius: 14px; padding: 12px;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 60%); margin-top: 4px;
}
.cw-results-section-review .cw-results-section-title { color: #b45309; }
.cw-results-section-keep {
  border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 60%); margin-top: 4px;
}
.cw-results-section-keep .cw-results-section-title { color: #64748b; }

/* ---------- 输出验证 ---------- */
.cw-validation { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cw-val {
  border: 1px solid #e2e8f0; border-radius: 11px; padding: 10px 8px;
  display: flex; gap: 7px; align-items: flex-start; background: #fcfdfd;
}
.cw-val-mark {
  flex: none; width: 18px; height: 18px; border-radius: 50%; background: #dcfce7; color: #16a34a;
  display: grid; place-items: center; font-size: 11px; font-weight: 900; margin-top: 1px;
}
.cw-val.is-fail .cw-val-mark { background: #fee2e2; color: #dc2626; }
.cw-val-k { font-size: 11px; font-weight: 700; color: #1e293b; line-height: 1.3; }
.cw-val-note { font-size: 9.5px; color: #94a3b8; margin-top: 2px; }
.cw-val.is-fail .cw-val-k { color: #b91c1c; }

/* ---------- 完成页下一步：三卡片 ---------- */
.cw-next-step-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; width: 100%; }
.cw-next-step-head { display: flex; flex-direction: column; gap: 3px; }
.cw-next-step-head b { color: #312e81; font-size: 14px; }
.cw-next-step-head span { color: #64748b; font-size: 11.5px; }
.cw-next-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.cw-next-card {
  border: 1px solid #e2e8f0; border-radius: 14px; padding: 15px;
  background: #fff; display: flex; flex-direction: column; gap: 8px;
}
.cw-next-card h3 { font-size: 13px; margin: 0; color: #1e293b; }
.cw-next-card p { font-size: 11px; color: #64748b; line-height: 1.55; margin: 0; flex: 1 1 auto; }
.cw-next-label { font-size: 9.5px; color: #4f46e5; font-weight: 800; letter-spacing: .02em; }
.cw-next-recommended { background: linear-gradient(135deg, #f5f3ff, #fff); border-color: #ddd6fe; }
.cw-next-flow { background: #f5f3ff; border-color: #ddd6fe; }
.cw-next-chips { display: flex; flex-direction: column; gap: 7px; }
.cw-next-chips .cw-btn { width: 100%; margin-top: 0; justify-content: flex-start; padding: 9px 12px; font-size: 12.5px; }
.cw-next-note { font-size: 9.5px; color: #94a3b8; font-weight: 600; margin-left: 4px; }
.cw-next-btn { width: 100%; margin-top: 0; }

@media (max-width: 560px) {
  .cw-validation { grid-template-columns: 1fr 1fr; }
  .cw-next-grid { grid-template-columns: 1fr; }
  .cw-conclusion { flex-direction: column; align-items: flex-start; }
  .cw-conclusion-tags { justify-content: flex-start; }
}

/* ---------- Clean Workspace 工作态：隐藏长篇营销 / SEO / GEO / FAQ / 场景 ----------
   内容不删除，只在 body.cw-workspace-active（已上传进入工作台）时下沉隐藏。 */
body.cw-workspace-active .hero,
body.cw-workspace-active .capabilities,
body.cw-workspace-active .steps,
body.cw-workspace-active .comparison,
body.cw-workspace-active .scenarios,
body.cw-workspace-active .guide-cluster,
body.cw-workspace-active .tiers-section,
body.cw-workspace-active .content-section,
body.cw-workspace-active .faq,
body.cw-workspace-active .disclaimer,
body.cw-workspace-active .compliance-cta,
body.cw-workspace-active .cta-section,
body.cw-workspace-active .related,
body.cw-workspace-active .footer { display: none; }
