/* ==========================================================================
   比对台 · Data Diff
   ========================================================================== */

:root {
  --bg: #f4f1e8;
  --bg-deep: #ece7da;
  --surface: #fffdf8;
  --surface-2: #faf7ef;
  --surface-3: #f3efe4;
  --ink: #18211d;
  --ink-2: #303a34;
  --muted: #6c7770;
  --muted-2: #748078;
  --line: #e3ded1;
  --line-strong: #cec7b7;
  --jade: #0f6b59;
  --jade-2: #0a5647;
  --jade-soft: #e7f2ee;
  --blue: #2f66c8;
  --blue-soft: #edf3fd;
  --rust: #b45c33;
  --rust-soft: #fbefe8;
  --amber: #9d6511;
  --amber-soft: #fbf1dc;
  --red: #ae3b3b;
  --red-soft: #fbeceb;
  --green: #177a5f;
  --green-soft: #e8f4ef;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(24, 33, 29, .04), 0 18px 44px -22px rgba(24, 33, 29, .24);
  --shadow-sm: 0 1px 2px rgba(24, 33, 29, .05), 0 8px 20px -14px rgba(24, 33, 29, .2);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 8% -5%, rgba(15, 107, 89, .075), transparent 65%),
    radial-gradient(760px 460px at 96% 3%, rgba(180, 92, 51, .06), transparent 62%),
    var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .35;
  background-image: radial-gradient(rgba(24, 33, 29, .16) .55px, transparent .55px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 55%);
}

body:has(dialog[open]) { overflow: hidden; }

::selection { background: rgba(15, 107, 89, .18); }

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
img { max-width: 100%; }

.wrap { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   顶栏
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 66px;
  border-bottom: 1px solid rgba(206, 199, 183, .55);
  background: rgba(244, 241, 232, .82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px -3px rgba(24, 33, 29, .55);
}
.brand-mark svg { width: 24px; height: 24px; }

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-weight: 750;
  font-size: 18px;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.brand-text small {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--muted-2);
}

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

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(15, 107, 89, .2);
  border-radius: 999px;
  background: rgba(255, 253, 248, .62);
  color: var(--jade);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.privacy-pill svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   按钮 / 表单基础
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--btn-bd);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  --btn-bg: var(--jade);
  --btn-fg: #fffdf8;
  --btn-bd: var(--jade);
  box-shadow: 0 6px 16px -8px rgba(15, 107, 89, .65);
}
.btn-primary:hover { --btn-bg: var(--jade-2); --btn-bd: var(--jade-2); }

.btn-ghost {
  --btn-bg: rgba(255, 253, 248, .55);
  --btn-bd: var(--line-strong);
}
.btn-ghost:hover { --btn-bg: var(--surface); border-color: var(--ink); }

.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 15px; border-radius: 12px; }

.text-btn {
  border: 0;
  padding: 2px 0;
  background: none;
  color: var(--jade);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-color: rgba(15, 107, 89, .3);
  text-underline-offset: 3px;
}
.text-btn:hover { color: var(--jade-2); text-decoration-color: currentColor; }
.text-btn.muted { color: var(--muted); text-decoration-color: transparent; }
.text-btn.muted:hover { color: var(--ink); }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }

input[type="number"],
input[type="text"],
select {
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  padding: 0 10px;
  font-size: 13px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(15, 107, 89, .12);
}

.fineprint { color: var(--muted-2); font-size: 12px; line-height: 1.6; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}
.eyebrow-line { width: 28px; height: 1px; background: var(--line-strong); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero { padding: 72px 0 40px; }

.hero h1 {
  margin: 16px 0 20px;
  max-width: 900px;
  font-family: var(--serif);
  font-size: clamp(48px, 7.6vw, 92px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.055em;
}
.hero h1 em {
  font-style: normal;
  color: var(--jade);
  background: linear-gradient(180deg, transparent 73%, rgba(15, 107, 89, .16) 73%);
}

.hero-sub {
  max-width: 660px;
  color: var(--ink-2);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.85;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}
.hero-chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, .55);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 550;
}
.hero-chips svg { width: 14px; height: 14px; color: var(--jade); }

/* --------------------------------------------------------------------------
   步骤条
   -------------------------------------------------------------------------- */

.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, .62);
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  opacity: .52;
  transition: opacity .2s;
}
.step-num {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
}
.step-copy { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.step-copy strong { font-size: 12.5px; font-weight: 650; }
.step-copy small { font-size: 10.5px; color: var(--muted-2); }
.step-line { flex: 1; height: 1px; background: var(--line); min-width: 20px; }
.step.is-active { opacity: 1; }
.step.is-active .step-num { background: var(--ink); border-color: var(--ink); color: #fff; }
.step.is-done { opacity: .9; }
.step.is-done .step-num { background: var(--jade-soft); border-color: rgba(15, 107, 89, .35); color: var(--jade); font-size: 0; }
.step.is-done .step-num::after { content: "✓"; font-size: 12px; }

/* --------------------------------------------------------------------------
   上传卡片
   -------------------------------------------------------------------------- */

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
}

.upload-card {
  --side: var(--blue);
  --side-soft: var(--blue-soft);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 330px;
  padding: 20px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: inset 0 3px 0 var(--side), var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
}
.upload-card.side-b { --side: var(--rust); --side-soft: var(--rust-soft); }
.upload-card:focus-within { border-color: var(--line-strong); box-shadow: inset 0 3px 0 var(--side), var(--shadow); }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.side-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.side-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--side); box-shadow: 0 0 0 3px var(--side-soft); }
.side-hint { font-size: 11px; color: var(--muted-2); }

.card-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.dropzone {
  flex: 1;
  min-height: 246px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 26px 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(250, 247, 239, .3), rgba(250, 247, 239, .65));
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--side);
  background: var(--side-soft);
}
.dropzone.is-drag { transform: scale(.995); }
.drop-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border-radius: 14px;
  background: var(--side-soft);
  color: var(--side);
}
.drop-icon svg { width: 25px; height: 25px; }
.drop-title { font-size: 14px; font-weight: 650; }
.drop-sub { font-size: 11.5px; color: var(--muted-2); }
.drop-formats { display: flex; gap: 5px; margin-top: 5px; }
.drop-formats span {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 253, 248, .7);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.upload-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--muted-2);
  font-size: 11px;
  min-height: 20px;
}
.upload-foot .ok-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--green); }
.upload-foot .warn-dot { background: var(--amber); }
.upload-foot .err-dot { background: var(--red); }

.file-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.file-badge {
  width: 44px;
  height: 52px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--side);
  position: relative;
}
.file-badge::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-width: 0 9px 9px 0;
  border-style: solid;
  border-color: transparent var(--surface) transparent transparent;
}
.file-main { min-width: 0; flex: 1; }
.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}
.file-meta { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.file-meta .sep { margin: 0 5px; color: var(--line-strong); }
.file-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
  overflow: hidden;
}
.file-stats > div { min-width: 0; padding: 7px 10px; background: var(--surface-2); }
.file-stats span { display: block; color: var(--muted-2); font-size: 9.5px; line-height: 1.4; }
.file-stats strong {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--jade-soft);
  color: var(--jade);
  font-size: 10px;
  font-weight: 650;
}
.file-tag.warn { background: var(--amber-soft); color: var(--amber); }

.file-controls {
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 10px;
  margin-top: 12px;
}
.file-controls.single { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.field select, .field input { width: 100%; height: 36px; background: var(--surface-2); font-size: 12px; }
.field input[type="number"] { text-align: center; }

.preview { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.preview summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 5px;
}
.preview summary::-webkit-details-marker { display: none; }
.preview summary::before { content: "＋"; font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.preview[open] summary::before { content: "－"; }
.preview-scroll { overflow-x: auto; margin-top: 9px; border: 1px solid var(--line); border-radius: 8px; }
.mini-table { border-collapse: collapse; width: 100%; font-size: 10.5px; white-space: nowrap; }
.mini-table th, .mini-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.mini-table th { background: var(--surface-2); color: var(--muted); font-weight: 650; position: sticky; top: 0; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table td { color: var(--ink-2); }

.card-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(174, 59, 59, .25);
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.55;
}
.card-error strong { display: block; margin-bottom: 2px; }

.card-loading {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12.5px;
}
.card-loading .spinner { width: 26px; height: 26px; border-width: 2px; }

/* --------------------------------------------------------------------------
   隐私提示
   -------------------------------------------------------------------------- */

.privacy-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(15, 107, 89, .16);
  border-radius: 13px;
  background: rgba(231, 242, 238, .46);
}
.privacy-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface);
  color: var(--jade);
}
.privacy-icon svg { width: 20px; height: 20px; }
.privacy-strip p { flex: 1; font-size: 12.5px; color: var(--ink-2); }
.privacy-strip strong { color: var(--ink); }
.privacy-strip .text-btn { white-space: nowrap; }

/* --------------------------------------------------------------------------
   配置面板
   -------------------------------------------------------------------------- */

.config-panel {
  margin-top: 26px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise .38s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.config-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.config-head h2 { margin: 10px 0 5px; font-size: clamp(24px, 2.7vw, 31px); line-height: 1.25; letter-spacing: -.03em; font-weight: 750; }
.config-head p { color: var(--muted); font-size: 13px; }

.config-top { display: grid; grid-template-columns: 1.12fr .88fr; gap: 16px; align-items: start; }

.panel {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
  padding: 18px 19px;
  min-width: 0;
}
.panel-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.panel-head h3 { font-size: 14px; font-weight: 750; letter-spacing: -.01em; }
.panel-head .hint { color: var(--muted-2); font-size: 11px; }
.panel-head .text-btn { margin-left: auto; white-space: nowrap; }

.key-rows { display: flex; flex-direction: column; gap: 8px; }
.key-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 24px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 6px;
}
.key-index { font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); text-align: center; }
.key-link { text-align: center; color: var(--muted-2); font-size: 13px; }
.key-row select { width: 100%; height: 42px; background: var(--surface); font-size: 12.5px; }
.key-row .icon-btn { width: 28px; height: 28px; font-size: 17px; }
.key-row .icon-btn:hover { background: var(--red-soft); color: var(--red); }
.key-empty {
  padding: 16px;
  border: 1px dashed rgba(174, 59, 59, .35);
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}
.key-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.key-note { color: var(--muted-2); font-size: 11px; line-height: 1.5; }
.key-note.warn { color: var(--amber); }

.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.option-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.option-toggle:hover { border-color: var(--line-strong); }
.option-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.option-toggle .tick {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: transparent;
  font-size: 10px;
  transition: background .15s, border-color .15s, color .15s;
}
.option-toggle input:checked + .tick { background: var(--jade); border-color: var(--jade); color: #fff; }
.option-toggle input:focus-visible + .tick { outline: 2px solid var(--jade); outline-offset: 2px; }
.option-toggle span:last-child { font-size: 11.5px; line-height: 1.3; color: var(--ink-2); }
.option-toggle:has(input:checked) { border-color: rgba(15, 107, 89, .22); background: rgba(231, 242, 238, .42); }
.options-panel .fineprint { margin-top: 11px; }

.mapping-panel { margin-top: 16px; }
.mapping-head-bar { margin-bottom: 10px; flex-wrap: wrap; }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mini-check { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; cursor: pointer; }
.mini-check input { accent-color: var(--jade); width: 13px; height: 13px; }
.mapping-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  gap: 8px;
  padding: 0 10px 6px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.mapping-head span:nth-child(3) { padding-left: 2px; }
.mapping-rows {
  max-height: 292px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.map-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}
.map-row:last-child { border-bottom: 0; }
.map-row:hover { background: rgba(250, 247, 239, .7); }
.map-a { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; color: var(--ink-2); }
.map-a .map-dot { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: var(--blue); }
.map-a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-arrow { color: var(--line-strong); text-align: center; font-size: 12px; }
.map-row select { width: 100%; height: 34px; background: var(--surface-2); font-size: 11.5px; }
.map-row.is-off { opacity: .55; }
.map-row.is-off select { color: var(--muted); }
.map-empty { padding: 20px; text-align: center; color: var(--muted-2); font-size: 12px; }
.mapping-panel .fineprint { margin-top: 9px; }

.run-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--ink);
  color: #fffdf8;
}
.run-copy { min-width: 0; }
.run-summary { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.run-sub { margin-top: 3px; color: rgba(255, 253, 248, .58); font-size: 11.5px; }
.run-bar .btn-primary { --btn-bg: #fffdf8; --btn-fg: var(--ink); --btn-bd: #fffdf8; box-shadow: none; }
.run-bar .btn-primary:hover { --btn-bg: var(--jade-soft); --btn-bd: var(--jade-soft); }
.run-bar .btn-primary:disabled { --btn-bg: rgba(255, 253, 248, .35); --btn-fg: rgba(24, 33, 29, .5); --btn-bd: transparent; }

/* --------------------------------------------------------------------------
   结果页
   -------------------------------------------------------------------------- */

body.is-result .hero,
body.is-result .how { display: none; }
body.is-result .workspace { padding-top: 24px; }

#results-view { animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }

.result-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 20px;
}
.result-head h2 {
  margin: 8px 0 6px;
  font-size: clamp(26px, 3.1vw, 38px);
  line-height: 1.2;
  letter-spacing: -.035em;
  font-weight: 750;
}
.result-head h2 strong { color: var(--jade); font-weight: 800; }
.result-head p { color: var(--muted); font-size: 12.5px; }
.result-head p .sep { margin: 0 7px; color: var(--line-strong); }
.result-actions { display: flex; gap: 9px; flex-shrink: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
  position: relative;
  min-width: 0;
  padding: 15px 17px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--jade)); opacity: .85; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.stat-card:active { transform: translateY(0); }
.stat-card .stat-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.stat-card .stat-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent, var(--jade)); }
.stat-card .stat-value { display: block; margin: 5px 0 1px; font-family: var(--mono); font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; line-height: 1.15; letter-spacing: -.04em; color: var(--ink); }
.stat-card .stat-sub { display: block; color: var(--muted-2); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card.s-both { --accent: var(--jade); }
.stat-card.s-a { --accent: var(--blue); }
.stat-card.s-b { --accent: var(--rust); }
.stat-card.s-diff { --accent: var(--amber); }

.result-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.result-tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px 13px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); }
.tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.tab .count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}
.tab.is-active .count { background: var(--ink); color: #fff; }
.tab.tab-a .count { background: var(--blue-soft); color: var(--blue); }
.tab.tab-b .count { background: var(--rust-soft); color: var(--rust); }
.tab.tab-diff .count { background: var(--amber-soft); color: var(--amber); }

/* 概览 ------------------------------------------------------------------ */

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr);
  gap: 16px;
  align-items: start;
}
.ov-main, .ov-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.ov-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 20px 22px;
  min-width: 0;
}
.ov-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ov-card-head h3 { font-size: 14px; font-weight: 750; letter-spacing: -.01em; }
.ov-card-head .sub { color: var(--muted-2); font-size: 11px; }

.venn-card { padding-bottom: 16px; }
.venn-wrap { display: flex; align-items: center; gap: 18px; }
.venn-svg { width: min(100%, 520px); height: auto; flex: 1; min-width: 0; }
.venn-svg .v-circle-a { fill: var(--blue); fill-opacity: .1; stroke: var(--blue); stroke-opacity: .5; }
.venn-svg .v-circle-b { fill: var(--rust); fill-opacity: .1; stroke: var(--rust); stroke-opacity: .5; }
.venn-svg .v-label-a, .venn-svg .v-count-a { fill: var(--blue); }
.venn-svg .v-label-b, .venn-svg .v-count-b { fill: var(--rust); }
.venn-svg .v-label-mid { fill: var(--muted); }
.venn-svg .v-count-main { fill: var(--jade); }
.venn-legend { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }
.venn-legend span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.venn-legend i { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; }
.venn-legend b { margin-left: auto; color: var(--ink); font-family: var(--mono); font-size: 11px; }
.rate-block { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.rate-title { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: var(--muted); font-size: 10.5px; }
.rate-title b { color: var(--ink); font-family: var(--mono); font-weight: 650; }
.rate-track { height: 5px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.rate-track span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.rate-block > div:last-child .rate-track span { background: var(--rust); }

.quality-list { display: flex; flex-direction: column; gap: 8px; }
.quality-item { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border-radius: 9px; background: var(--surface-2); font-size: 11.5px; line-height: 1.5; color: var(--ink-2); }
.quality-item .q-icon { width: 17px; height: 17px; flex: 0 0 17px; display: grid; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 700; }
.quality-item.warn { background: var(--amber-soft); }
.quality-item.warn .q-icon { background: rgba(157, 101, 17, .16); color: var(--amber); }
.quality-item.bad { background: var(--red-soft); }
.quality-item.bad .q-icon { background: rgba(174, 59, 59, .14); color: var(--red); }
.quality-item.ok { background: var(--green-soft); }
.quality-item.ok .q-icon { background: rgba(23, 122, 95, .14); color: var(--green); }
.quality-item .q-action { margin-left: auto; flex-shrink: 0; }
.quality-empty { color: var(--muted-2); font-size: 11.5px; }

.column-bars { display: flex; flex-direction: column; gap: 10px; }
.col-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 10px; align-items: center; }
.col-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--ink-2); }
.col-bar-name small { color: var(--muted-2); font-size: 10px; }
.col-bar-track { grid-column: 1 / -1; height: 4px; margin-top: -5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.col-bar-track span { display: block; height: 100%; border-radius: inherit; background: var(--amber); opacity: .8; }
.col-bar-count { text-align: right; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.col-empty { color: var(--muted-2); font-size: 11.5px; }

.export-list { display: flex; flex-direction: column; gap: 2px; }
.export-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.export-row:last-child { border-bottom: 0; }
.export-row .e-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.export-row .e-count { margin-left: auto; color: var(--muted-2); font-family: var(--mono); font-size: 10.5px; white-space: nowrap; }
.export-row .text-btn { white-space: nowrap; }
.export-all { width: 100%; margin-bottom: 8px; }

.recap { display: flex; flex-direction: column; gap: 9px; }
.recap-row { display: flex; gap: 12px; font-size: 11.5px; line-height: 1.55; }
.recap-row > span:first-child { width: 64px; flex: 0 0 64px; color: var(--muted-2); }
.recap-row > span:last-child { color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.recap-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.recap-chips span { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); font-size: 10px; }

/* 数据表 ------------------------------------------------------------------ */

.data-panel { min-width: 0; }

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: var(--surface);
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.search-box { position: relative; display: flex; align-items: center; min-width: 220px; flex: 1; max-width: 330px; }
.search-box svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted-2); pointer-events: none; }
.search-box input { width: 100%; height: 36px; padding-left: 31px; border-color: var(--line); background: var(--surface-2); font-size: 12px; }
.search-box input::placeholder { color: var(--muted-2); }
.search-clear { position: absolute; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--muted-2); font-size: 15px; line-height: 1; display: grid; place-items: center; }
.search-clear:hover { background: var(--surface-3); color: var(--ink); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.segmented button { height: 28px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.segmented button:hover { color: var(--ink); }
.segmented button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(24, 33, 29, .08); }

.select-sm { height: 32px; padding: 0 7px; font-size: 11px; border-color: var(--line); background: var(--surface-2); color: var(--muted); }
.toolbar-note { color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.toolbar-note b { color: var(--ink); font-family: var(--mono); }
.toolbar-right .btn { min-height: 34px; }

.result-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: rgba(250, 247, 239, .62);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.result-note strong { color: var(--ink-2); font-weight: 650; }
.result-note .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.table-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface);
}
.result-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.result-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .03em;
  text-align: left;
  white-space: nowrap;
}
.result-table th:first-child { padding-left: 14px; }
.result-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
  max-width: 280px;
}
.result-table td:first-child { padding-left: 14px; }
.result-table tbody tr:hover td { background: #fcfaf4; }
.result-table tbody tr:last-child td { border-bottom: 0; }
.result-table .num-cell { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.result-table .row-idx { color: var(--muted-2); font-family: var(--mono); font-size: 10px; }
.cell-truncate { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-empty { color: var(--muted-2); font-style: italic; }
.key-text { font-weight: 650; color: var(--ink); }
.key-text .cell-truncate { max-width: 220px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.tag-ok { background: var(--green-soft); color: var(--green); }
.tag-diff { background: var(--amber-soft); color: var(--amber); }
.tag-a { background: var(--blue-soft); color: var(--blue); }
.tag-b { background: var(--rust-soft); color: var(--rust); }
.tag-note { background: var(--surface-3); color: var(--muted); font-weight: 500; }
.tag-warn { background: var(--red-soft); color: var(--red); }

.diff-chips { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.diff-chip { display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 6px; border-radius: 4px; background: var(--amber-soft); color: var(--amber); font-size: 9.5px; }
.diff-more { color: var(--muted-2); font-size: 9.5px; }

.value-a { color: var(--blue); }
.value-b { color: var(--rust); }
.value-diff-a { background: var(--blue-soft); border-radius: 4px; padding: 1px 4px; }
.value-diff-b { background: var(--rust-soft); border-radius: 4px; padding: 1px 4px; }

.row-action { border: 0; background: none; color: var(--jade); font-size: 11px; font-weight: 650; padding: 3px 0; white-space: nowrap; text-decoration: underline; text-decoration-color: rgba(15, 107, 89, .3); text-underline-offset: 2px; }
.row-action:hover { color: var(--jade-2); text-decoration-color: currentColor; }

.table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 220px;
  padding: 32px 18px;
  color: var(--muted);
  text-align: center;
}
.table-empty .empty-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--muted-2); font-size: 18px; }
.table-empty strong { font-size: 13px; color: var(--ink-2); }
.table-empty span { font-size: 11.5px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  background: var(--surface);
}
.page-info { color: var(--muted); font-size: 11px; }
.page-info b { color: var(--ink-2); font-family: var(--mono); font-weight: 600; }
.page-controls { display: flex; align-items: center; gap: 4px; }
.page-btn { min-width: 29px; height: 29px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.page-btn:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.page-btn.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-ellipsis { color: var(--muted-2); font-size: 10px; padding: 0 2px; }
.page-size { display: flex; align-items: center; gap: 5px; color: var(--muted-2); font-size: 10.5px; }
.page-size select { height: 29px; padding: 0 4px; border-color: var(--line); font-size: 10.5px; }

/* --------------------------------------------------------------------------
   弹窗
   -------------------------------------------------------------------------- */

dialog.modal {
  width: min(760px, calc(100vw - 32px));
  max-height: 86vh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 90px -30px rgba(24, 33, 29, .5);
  overflow: hidden;
}
dialog.modal::backdrop { background: rgba(24, 33, 29, .46); backdrop-filter: blur(3px); }
dialog.modal[open] { display: flex; flex-direction: column; animation: pop .18s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.dialog-head h3 { margin-top: 3px; font-size: 20px; letter-spacing: -.02em; }
.dialog-body { padding: 20px 24px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }

.prose { color: var(--ink-2); font-size: 13px; line-height: 1.8; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin: 3px 0; }
.prose details { border-top: 1px solid var(--line); padding: 11px 0 4px; }
.prose details:last-child { border-bottom: 1px solid var(--line); }
.prose summary { cursor: pointer; font-weight: 650; font-size: 12.5px; color: var(--ink); }
.prose details p { margin: 8px 0 6px; color: var(--muted); font-size: 12px; line-height: 1.75; }

.detail-modal { width: min(860px, calc(100vw - 32px)); }
.detail-key {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 12px;
}
.detail-key span { color: var(--muted-2); font-size: 10.5px; flex: 0 0 auto; }
.detail-key strong { font-size: 15px; overflow-wrap: anywhere; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; color: var(--muted); font-size: 11.5px; }
.detail-meta b { color: var(--ink-2); font-family: var(--mono); font-weight: 600; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.detail-table th, .detail-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.detail-table th { background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 650; position: sticky; top: 0; }
.detail-table td { max-width: 300px; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-table td:first-child { color: var(--muted); width: 26%; }
.detail-table tr.is-diff td { background: rgba(251, 241, 220, .5); }
.detail-table tr.is-diff td:first-child { color: var(--amber); font-weight: 650; }
.detail-table .cell-empty { color: var(--muted-2); }
.detail-section { margin-top: 18px; }
.detail-section h4 { font-size: 12px; margin-bottom: 8px; color: var(--muted); font-weight: 650; }
.detail-extra { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--surface-2); font-size: 11px; color: var(--muted); }
.detail-extra div { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.detail-extra div:last-child { border-bottom: 0; }
.detail-extra b { flex: 0 0 120px; color: var(--ink-2); font-weight: 550; overflow-wrap: anywhere; }

.dup-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dup-table th, .dup-table td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left; }
.dup-table th { background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 650; }
.dup-table td:first-child { max-width: 260px; overflow-wrap: anywhere; }
.dup-table .mono { font-size: 11px; }

/* --------------------------------------------------------------------------
   Toast / Loading
   -------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 253, 248, .12);
  border-radius: 10px;
  background: var(--ink);
  color: #fffdf8;
  font-size: 12.5px;
  box-shadow: 0 12px 35px -15px rgba(24, 33, 29, .6);
  animation: toastIn .22s ease both;
}
.toast::before { content: "✓"; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 253, 248, .16); font-size: 9px; }
.toast.is-error::before { content: "!"; background: rgba(255, 120, 120, .25); }
.toast.is-warn::before { content: "!"; background: rgba(255, 190, 90, .22); }
.toast.is-out { animation: toastOut .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

.loading {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(244, 241, 232, .74);
  backdrop-filter: blur(5px);
}
.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.loading-card strong { font-size: 14px; }
.loading-card span { color: var(--muted); font-size: 11.5px; }
.spinner {
  width: 30px;
  height: 30px;
  border: 2.5px solid rgba(15, 107, 89, .18);
  border-top-color: var(--jade);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
  text-align: center;
}

/* --------------------------------------------------------------------------
   说明区 / 页脚
   -------------------------------------------------------------------------- */

.how { padding: 76px 0 70px; }
.how-head { max-width: 620px; margin-bottom: 28px; }
.how-head h2 { margin-top: 10px; font-family: var(--serif); font-size: clamp(30px, 4vw, 44px); line-height: 1.15; letter-spacing: -.04em; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--line); }
.how-grid article { padding: 24px; background: rgba(255, 253, 248, .72); }
.how-num { font-family: var(--mono); font-size: 10px; color: var(--jade); letter-spacing: .08em; }
.how-grid h3 { margin: 10px 0 7px; font-size: 15px; font-weight: 750; }
.how-grid p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.feature-strip { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 253, 248, .5); }
.feature-strip span { color: var(--muted); font-size: 11px; }
.feature-strip strong { color: var(--ink-2); font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); background: rgba(255, 253, 248, .35); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 20px 0 24px; color: var(--muted-2); font-size: 10.5px; }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .config-top { grid-template-columns: 1fr; }
  .options-panel .option-grid { grid-template-columns: repeat(4, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .ov-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .ov-side .ov-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .wrap { width: min(100% - 32px, 720px); }
  .hero { padding: 50px 0 30px; }
  .hero h1 { font-size: clamp(44px, 10vw, 68px); }
  .upload-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .venn-wrap { flex-direction: column; align-items: stretch; }
  .venn-svg { flex: none; width: 100%; }
  .venn-svg svg { width: 100%; height: auto; }
  .venn-legend { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
  .venn-svg .v-label { font-size: 14px; }
  .venn-svg .v-count { font-size: 24px; }
  .venn-svg .v-count-main { font-size: 27px; }
  .venn-legend b { margin-left: 2px; }
  .result-head { align-items: flex-start; flex-direction: column; }
  .result-actions { width: 100%; }
  .result-actions .btn { flex: 1; }
  .step-copy small { display: none; }
  .options-panel .option-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .privacy-pill { display: none; }
  .toast-stack { left: 50%; right: auto; transform: translateX(-50%); align-items: center; }
  .header-inner { gap: 10px; }
  .brand-text small { display: none; }
  .stepper { gap: 8px; padding: 11px 12px; }
  .step-copy strong { font-size: 11px; }
  .step-num { width: 24px; height: 24px; flex-basis: 24px; font-size: 9px; }
  .config-panel { padding: 20px 16px; border-radius: 18px; }
  .config-head { flex-direction: column; gap: 10px; }
  .run-bar { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; }
  .run-bar .btn { width: 100%; }
  .privacy-strip { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: 8px 12px; }
  .privacy-icon { grid-row: 1 / span 2; }
  .privacy-strip p { grid-column: 2; min-width: 0; }
  .privacy-strip .text-btn { grid-column: 2; margin-left: 0; justify-self: start; text-align: left; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .search-box { max-width: none; flex: 1 0 100%; }
  .toolbar-left .toolbar-note { flex: 0 0 100%; }
  .toolbar-right { justify-content: space-between; margin-top: 8px; }
  .table-toolbar { padding: 10px; display: block; }
  .result-note { padding: 8px 10px; flex-wrap: wrap; }
  .pagination { justify-content: center; }
  .page-info { width: 100%; text-align: center; }
  .ov-side { display: flex; flex-direction: column; align-items: stretch; }
  .ov-side .ov-card { width: 100%; }
  .dialog-body { padding: 16px; }
  .dialog-head { padding: 16px; }
  .dialog-foot { padding: 12px 16px; }
  .how { padding: 52px 0; }
  .feature-strip { gap: 8px 16px; }
}

@media (max-width: 520px) {
  .wrap { width: calc(100% - 24px); }
  .site-header { height: 58px; }
  .brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  .brand-text { font-size: 16px; }
  .hero { padding: 36px 0 24px; }
  .hero h1 { font-size: clamp(38px, 12.5vw, 54px); letter-spacing: -.06em; }
  .hero-sub { font-size: 13.5px; line-height: 1.75; }
  .hero-chips span { font-size: 10.5px; padding: 5px 9px; }
  .upload-card { padding: 16px 14px 14px; }
  .side-hint { display: none; }
  .dropzone { min-height: 210px; }
  .file-controls { grid-template-columns: 1fr 86px; }
  .stat-grid { gap: 8px; }
  .stat-card { padding: 12px 12px 11px; }
  .stat-card .stat-value { font-size: 22px; }
  .stat-card .stat-sub { white-space: normal; }
  .tab { padding: 10px 9px 12px; font-size: 11.5px; }
  .tab .count { font-size: 9px; }
  .result-tabs { flex-wrap: wrap; overflow: visible; }
  .tab { padding: 9px 7px 11px; font-size: 11px; gap: 4px; }
  .tab .count { min-width: 17px; padding: 1px 4px; font-size: 9px; }
  .result-head h2 { font-size: 25px; }
  .ov-card { padding: 16px 14px; }
  .rate-block { grid-template-columns: 1fr; gap: 9px; }
  .mapping-head { display: none; }
  .map-row { grid-template-columns: 1fr; gap: 5px; padding: 9px 10px; }
  .map-arrow { display: none; }
  .map-row select { height: 34px; }
  .key-row { grid-template-columns: 18px minmax(0, 1fr) 16px minmax(0, 1fr) 24px; gap: 4px; }
  .key-row select { height: 38px; font-size: 11.5px; }
  .option-grid { grid-template-columns: 1fr 1fr !important; gap: 5px; }
  .option-toggle { padding: 7px; }
  .option-toggle span:last-child { font-size: 10.5px; }
  .table-wrap { max-height: 56vh; }
  .result-table th, .result-table td { padding: 7px 8px; }
  .result-table th:first-child, .result-table td:first-child { padding-left: 10px; }
  .cell-truncate { max-width: 180px; }
  .result-table .hide-sm { display: none; }
  .both-table th:nth-child(3), .both-table td:nth-child(3),
  .both-table th:nth-child(4), .both-table td:nth-child(4),
  .diff-table th:nth-child(6), .diff-table td:nth-child(6) { display: none; }
  .scroll-tip { color: var(--jade); font-weight: 600; }
  .page-controls { flex-wrap: wrap; justify-content: center; }
  .detail-key { flex-direction: column; gap: 3px; }
  .detail-table td:first-child { width: 30%; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (max-width: 360px) {
  .tab .count { display: none; }
  .tab { padding: 9px 10px 11px; }
  .venn-svg .v-label { font-size: 17px; }
  .venn-svg .v-count { font-size: 28px; }
  .venn-svg .v-count-main { font-size: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
