/* ============================================================
   代账数据迁移助手 · 控制台样式
   ============================================================ */

:root {
  --paper: #f4f5f2;
  --paper-deep: #eceee9;
  --panel: #ffffff;
  --ink: #12181c;
  --ink-2: #39454d;
  --muted: #77828a;
  --faint: #9aa4ab;
  --line: #e4e7e2;
  --line-strong: #d2d8d1;
  --accent: #006be6;
  --accent-ink: #0052b4;
  --accent-soft: #e8f1ff;
  --ok: #0f7b63;
  --ok-ink: #0a5a48;
  --ok-soft: #e4f3ee;
  --amber: #a9701c;
  --amber-soft: #fbf1de;
  --red: #b23a28;
  --red-soft: #fbece9;
  --blue: #2d5b93;
  --blue-soft: #eaf0f8;
  --rail: #0f161a;
  --rail-line: rgba(255, 255, 255, 0.08);
  --rail-ink: #e8edeb;
  --rail-muted: #8d9aa1;
  --radius-lg: 18px;
  --radius: 13px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 28, 0.05);
  --shadow-md: 0 18px 40px -28px rgba(16, 24, 28, 0.35);
  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

.app-shell {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------------- Rail ---------------- */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 26px 20px 22px;
  background:
    radial-gradient(120% 60% at 20% 0%, rgba(0, 107, 230, 0.22), transparent 60%),
    var(--rail);
  color: var(--rail-ink);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 2px 4px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #d9fff2;
  background: linear-gradient(150deg, #2d8cff, #0048a8);
  box-shadow: 0 6px 18px -6px rgba(0, 107, 230, 0.8);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: 0.02em; }
.brand-text small { font-size: 11px; color: var(--rail-muted); letter-spacing: 0.04em; }

.steps { display: flex; flex-direction: column; gap: 4px; }

.step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--rail-muted);
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.step:hover { background: rgba(255, 255, 255, 0.05); color: var(--rail-ink); }

.step-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.step-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step-body b { font-size: 13px; font-weight: 600; color: inherit; }
.step-body small { font-size: 11px; color: var(--rail-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.step.is-active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--accent);
}
.step.is-active .step-index { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.is-active small { color: rgba(255, 255, 255, 0.62); }

.step.is-done .step-index { border-color: rgba(0, 107, 230, 0.6); color: #8fc2ff; }
.step.is-done .step-body b { color: rgba(255, 255, 255, 0.82); }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.rail-card {
  border: 1px solid var(--rail-line);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-card-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rail-muted); }
.rail-card strong { font-size: 13px; font-weight: 600; }
.rail-mode { font-size: 11px; color: #8fc2ff; }

.rail-note { margin: 4px 4px 0; font-size: 10.5px; line-height: 1.5; color: #6d7a80; }

/* ---------------- Main ---------------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 44px 20px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 100% at 100% 0%, rgba(0, 107, 230, 0.07), transparent 70%),
    var(--paper);
}

.topbar-title { display: flex; flex-direction: column; gap: 5px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.topbar h1 { font-size: 25px; line-height: 1.2; letter-spacing: -0.02em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.view { padding: 28px 44px 60px; max-width: 1280px; width: 100%; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
  white-space: nowrap;
}
.btn:hover { border-color: #b9c2ba; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px -12px rgba(0, 107, 230, 0.9);
}
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }

.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(16, 24, 28, 0.05); color: var(--ink); }

.btn-danger { color: var(--red); border-color: #ebc9c2; background: #fff; }
.btn-danger:hover { background: var(--red-soft); border-color: #dfb0a6; }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14px; border-radius: 11px; }
.btn svg { width: 15px; height: 15px; }

/* ---------------- Panels & cards ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.panel-pad { padding: 22px 24px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 15px; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------- Step 1 ---------------- */
.hero { display: flex; flex-direction: column; gap: 22px; }

.lede {
  max-width: 720px;
  font-size: 15px;
  color: var(--ink-2);
}
.lede b { color: var(--ink); }

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.platform-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: left;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.platform-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--platform-accent, var(--accent));
  opacity: 0.9;
}
.platform-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 36px -28px rgba(16, 24, 28, 0.45);
}
.platform-card.is-selected { border-color: var(--platform-accent); box-shadow: 0 0 0 1px var(--platform-accent) inset; }

.platform-top { display: flex; align-items: center; gap: 12px; }
.platform-brand { min-height: 46px; display: flex; align-items: center; gap: 10px; }
.platform-brand.has-bg {
  background: var(--logo-bg, #0a2540);
  padding: 9px 12px;
  border-radius: 10px;
}
.platform-brand.has-bg .platform-logo-image { max-height: 38px; max-width: 190px; }
.platform-logo-image { max-height: 46px; max-width: 218px; object-fit: contain; display: block; }
.platform-logo-extra { max-height: 42px; max-width: 128px; object-fit: contain; display: block; }
.platform-logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 600; color: #fff;
  background: var(--platform-accent, var(--accent));
  letter-spacing: 0;
}
.platform-name { display: flex; flex-direction: column; gap: 1px; }
.platform-name strong { font-size: 15.5px; }
.platform-name small { color: var(--muted); font-size: 11.5px; }

.platform-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.platform-desc { color: var(--ink-2); font-size: 12.5px; min-height: 38px; }
.platform-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--paper-deep);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip--demo { background: var(--amber-soft); color: var(--amber); }
.chip--live { background: var(--accent-soft); color: var(--accent-ink); }
.chip--ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.chip--filter { border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.chip--filter:hover { color: var(--ink-2); border-color: var(--line-strong); }
.chip--filter.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbf9;
  overflow: hidden;
}
.flow-step { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-right: 1px dashed var(--line); }
.flow-step:last-child { border-right: 0; }
.flow-num { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.flow-step b { font-size: 12.5px; font-weight: 600; display: block; }
.flow-step small { color: var(--muted); font-size: 11px; }

.target-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #ffffff, #fafbf8);
}
.target-strip .target-badge {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
}
.target-strip strong { font-size: 13.5px; }
.target-strip p { margin: 0; color: var(--muted); font-size: 12px; }
.target-strip .spacer { flex: 1; }

/* ---------------- Login card ---------------- */
.login-card { display: flex; flex-direction: column; gap: 16px; }
.login-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 4px rgba(154, 164, 171, 0.12);
}
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(15, 123, 99, 0.14); }
.status-dot.warn { background: var(--amber); box-shadow: 0 0 0 4px rgba(169, 112, 28, 0.14); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 0 4px rgba(178, 58, 40, 0.14); }
.status-dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

.login-title { display: flex; flex-direction: column; gap: 3px; }
.login-title strong { font-size: 14px; }
.login-title span { color: var(--muted); font-size: 12.5px; }
.login-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.hint {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 13px;
  border-radius: 10px;
  background: #f8f9f6;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.55;
}
.hint svg { flex: 0 0 auto; margin-top: 1px; color: var(--muted); width: 16px; height: 16px; }
.hint > div { min-width: 0; flex: 1; }
.hint.warn { background: var(--amber-soft); border-color: #efdfc2; color: #7a5213; }
.hint.ok { background: var(--ok-soft); border-color: #cfe9e0; color: var(--ok-ink); }
.hint.bad { background: var(--red-soft); border-color: #f0d3cd; color: #8c2f20; }

/* ---------------- Toolbar ---------------- */
.toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.toolbar-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-filter-label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }
.toolbar .spacer { flex: 1; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.toolbar-actions .btn { height: 32px; }
.toolbar-title { display: flex; flex-direction: column; gap: 2px; margin-right: 8px; }
.toolbar-title strong { font-size: 14px; }
.toolbar-title span { color: var(--muted); font-size: 11.5px; }

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg { position: absolute; left: 11px; color: var(--faint); width: 14px; height: 14px; }
.search input {
  width: 240px;
  height: 34px;
  padding: 0 12px 0 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fbfbf9;
  font-size: 12.5px;
  outline: none;
  transition: border-color 140ms ease, background 140ms ease;
}
.search input:focus { border-color: var(--accent); background: #fff; }

.match-summary { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- Table ---------------- */
.table-wrap { width: 100%; overflow: auto; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.grid th {
  position: sticky; top: 0; z-index: 2;
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #fafbf8;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.grid td {
  padding: 10px 14px;
  border-bottom: 1px solid #eef0eb;
  vertical-align: middle;
}
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: #fbfcf9; }
table.grid tbody tr.is-selected { background: #f2f8f5; }
table.grid tbody tr.is-selected:hover { background: #edf6f1; }

.cell-company { display: flex; flex-direction: column; gap: 2px; min-width: 240px; }
.cell-company b { font-weight: 600; font-size: 13px; }
.cell-company small { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: 0.02em; }
.name-ok { display: inline-flex; margin-left: 5px; color: var(--ok); vertical-align: -2px; }
.name-ok svg { width: 13px; height: 13px; }

.cell-sub { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--faint); margin-top: 1px; letter-spacing: 0; }

.num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.num--zero { color: var(--faint); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; }
.pill--ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill--warn { background: var(--amber-soft); color: var(--amber); }
.pill--bad { background: var(--red-soft); color: var(--red); }
.pill--muted { background: #f0f2ee; color: var(--muted); }
.pill--blue { background: var(--blue-soft); color: var(--blue); }

.check {
  width: 17px; height: 17px; accent-color: var(--accent);
  cursor: pointer;
}
.check:disabled { cursor: not-allowed; opacity: 0.35; }

.table-empty, .table-loading {
  padding: 64px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); text-align: center;
}
.table-empty strong { color: var(--ink-2); font-size: 14px; }
.table-empty p { margin: 0; font-size: 12.5px; max-width: 420px; }
.table-loading .spinner { margin-bottom: 6px; }

.sync-state {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 72px 24px; text-align: center;
}
.sync-state strong { font-size: 15px; }
.sync-state p { margin: 0; color: var(--muted); font-size: 12.5px; max-width: 520px; line-height: 1.6; }
.spinner-lg { width: 30px; height: 30px; border-width: 3px; }
.sync-progress { width: min(380px, 72%); height: 4px; border-radius: 999px; background: #e9ece7; overflow: hidden; }
.sync-progress span {
  display: block; width: 38%; height: 100%; border-radius: 999px; background: var(--accent);
  animation: sync-slide 1.15s ease-in-out infinite;
}
@keyframes sync-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(300%); } }
.sync-timer { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton-line {
  height: 10px; border-radius: 6px;
  background: linear-gradient(90deg, #eef0eb 25%, #f7f8f4 50%, #eef0eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- Pagination & footer bar ---------------- */
.pagination {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.pagination .spacer { flex: 1; }
.page-btn {
  min-width: 30px; height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
}
.page-btn.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.action-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 -12px 30px -28px rgba(16, 24, 28, 0.5);
}
.action-bar .selection { display: flex; align-items: baseline; gap: 7px; }
.action-bar .selection b { font-size: 18px; font-variant-numeric: tabular-nums; }
.action-bar .selection span { color: var(--muted); font-size: 12px; }
.action-bar .spacer { flex: 1; }
.action-bar--static { position: static; margin-top: 4px; }
.action-bar--static + * { margin-top: 0; }

/* ---------------- Progress ---------------- */
.progress-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fbfcf9;
}
.progress-top { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.progress-top strong { font-variant-numeric: tabular-nums; }
.progress-top .spacer { flex: 1; color: var(--muted); font-size: 11.5px; }
.progress-track { height: 6px; border-radius: 999px; background: #e7eae4; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 220ms ease; }

/* ---------------- Summary stats ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex; flex-direction: column; gap: 3px;
}
.stat-label { font-size: 11.5px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat-sub { font-size: 11px; color: var(--faint); }
.stat--accent { border-color: #cfe0fb; background: linear-gradient(180deg, #f3f8ff, #fff); }
.stat--warn { border-color: #eadfc8; background: linear-gradient(180deg, #fdf8ef, #fff); }
.stat--bad { border-color: #efd6d0; background: linear-gradient(180deg, #fdf3f1, #fff); }

/* ---------------- Step 3 ---------------- */
.batch-table-wrap { max-height: 426px; }
.migrate-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 18px; align-items: start; }

.batch-table td { padding: 10px 14px; }

.console-panel { display: flex; flex-direction: column; overflow: hidden; }
.console {
  flex: 1;
  min-height: 260px;
  max-height: 440px;
  overflow: auto;
  padding: 14px 16px;
  background: #0e1518;
  color: #c5d3ce;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
}
.log-line { display: grid; grid-template-columns: 58px 14px minmax(0, 1fr); gap: 8px; align-items: start; }
.log-time { color: #5e6f6b; }
.log-mark { text-align: center; }
.log-line[data-level="success"] .log-mark { color: #52d3ae; }
.log-line[data-level="error"] .log-mark { color: #ff8068; }
.log-line[data-level="warn"] .log-mark { color: #f0c169; }
.log-line[data-level="info"] .log-mark { color: #6d8f9c; }
.log-msg { word-break: break-word; white-space: pre-wrap; }
.log-empty { color: #5e6f6b; }

.console-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: #131d21;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #7d8d88;
  font-size: 11px;
}
.console-foot .spacer { flex: 1; }

.options-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 13px 20px; border-top: 1px solid var(--line); background: #fbfcf9; }
.panel-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 13px 20px; border-top: 1px solid var(--line); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 34px; height: 20px; border-radius: 999px; background: #dfe3dd;
  position: relative; transition: background 160ms ease; flex: 0 0 auto;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform 160ms ease; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }

.select {
  height: 32px; padding: 0 28px 0 10px;
  border-radius: 8px; border: 1px solid var(--line);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2377828a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
  font-size: 12.5px; appearance: none; outline: none;
}

/* ---------------- Report ---------------- */
.report-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 26px 28px;
}
.ring {
  --p: 0;
  --ring-color: var(--accent);
  position: relative;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--p) * 1%), #ecefe9 0);
  display: grid; place-items: center;
}
.ring::before {
  content: "";
  position: absolute; inset: 11px;
  background: #fff; border-radius: 50%;
}
.ring-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; }
.ring-inner b { font-size: 30px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ring-inner span { font-size: 11px; color: var(--muted); }
.report-headline h2 { font-size: 20px; margin-bottom: 6px; }
.report-headline p { margin: 0; color: var(--muted); font-size: 12.5px; }
.report-headline .meta { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.report-headline .meta div { display: flex; flex-direction: column; gap: 1px; }
.report-headline .meta span { font-size: 11px; color: var(--faint); }
.report-headline .meta b { font-size: 13px; font-weight: 600; }

.report-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }

.report-table td { padding: 10px 14px; }
.report-table .err { color: var(--red); font-size: 12px; max-width: 360px; }

.error-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 20px 20px; }
.error-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  color: #7c2a1c;
  font-size: 12px;
}
.error-item .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(124, 42, 28, 0.1);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.filters { display: flex; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filter-btn {
  height: 28px; padding: 0 11px;
  border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font-size: 12px;
}
.filter-btn:hover { background: #f3f5f1; color: var(--ink-2); }
.filter-btn.is-active { background: var(--ink); color: #fff; }

/* ---------------- Watermark ---------------- */
.watermark-layer {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  place-items: center;
}
.watermark-item {
  transform: rotate(-45deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: rgba(18, 24, 28, 0.13);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  user-select: none;
}
.watermark-item span:nth-child(2) { font-size: 13px; font-weight: 500; }
.watermark-item span:nth-child(3) { font-size: 12.5px; font-weight: 500; }

@media (max-width: 900px) {
  .watermark-layer { grid-template-columns: 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .watermark-item:nth-child(4) { display: none; }
}

/* ---------------- Modal ---------------- */
.modal-layer {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(12, 18, 21, 0.45);
  backdrop-filter: blur(3px);
}
.modal-layer[hidden] { display: none; }
.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: modal-in 180ms ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 14px 22px 4px; display: flex; flex-direction: column; gap: 12px; }
.modal-body p { margin: 0; color: var(--muted); font-size: 12.5px; }
.modal-body textarea {
  width: 100%; min-height: 150px; resize: vertical;
  padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
  background: #fbfbf9; outline: none;
}
.modal-body textarea:focus { border-color: var(--accent); background: #fff; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }

/* ---------------- Toasts ---------------- */
.toast-stack {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 380px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  background: #10181b;
  color: #e9efec;
  font-size: 12.5px;
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.6);
  animation: toast-in 180ms ease;
}
.toast.is-out { animation: toast-out 200ms ease forwards; }
.toast--ok { border-left: 3px solid #37b592; }
.toast--warn { border-left: 3px solid #d9a441; }
.toast--bad { border-left: 3px solid #e0664f; }
.toast svg { flex: 0 0 auto; margin-top: 2px; width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------------- Utility ---------------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

.kv { display: flex; flex-direction: column; gap: 2px; }
.kv span { font-size: 11px; color: var(--faint); }
.kv b { font-size: 13px; font-weight: 600; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
  .platform-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .migrate-layout { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail {
    position: relative; height: auto; flex-direction: row; align-items: center;
    gap: 14px; padding: 14px 18px; overflow-x: auto;
  }
  .brand-text small { display: none; }
  .steps { flex-direction: row; gap: 4px; }
  .step { grid-template-columns: auto; padding: 8px 10px; }
  .step-body small { display: none; }
  .step-body b { font-size: 12px; white-space: nowrap; }
  .step-index { display: none; }
  .rail-foot { display: none; }
  .topbar { padding: 22px 20px 16px; }
  .view { padding: 20px 20px 48px; }
  .platform-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow-step:nth-child(2) { border-right: 0; }
  .report-hero { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search input { width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------- Login ---------------- */
.auth-mode .app-shell { display: block; }
.auth-mode .rail { display: none; }
.auth-mode .topbar { display: none; }
.auth-mode .view { max-width: none; padding: 0; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.95fr);
  background: var(--paper);
}

.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding: 52px 58px;
  overflow: hidden;
  color: #eef4f2;
  background:
    radial-gradient(90% 70% at 10% 0%, rgba(0, 107, 230, 0.55), transparent 62%),
    radial-gradient(70% 60% at 100% 100%, rgba(45, 91, 147, 0.35), transparent 70%),
    #0a2540;
}
.login-hero::after {
  content: "";
  position: absolute;
  right: -140px;
  top: 12%;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 255, 255, 0.025), 0 0 0 84px rgba(255, 255, 255, 0.018);
  pointer-events: none;
}
.login-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 20px;
}
.login-brand strong { display: block; font-size: 15px; }
.login-brand small { display: block; margin-top: 2px; font-size: 11px; color: rgba(238, 244, 242, 0.58); letter-spacing: 0.08em; }
.login-copy { position: relative; z-index: 1; max-width: 560px; }
.login-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: #8fc2ff; }
.login-copy h1 { margin-top: 16px; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.16; letter-spacing: -0.03em; }
.login-copy p { margin: 20px 0 0; max-width: 470px; color: rgba(238, 244, 242, 0.68); font-size: 14px; line-height: 1.8; }
.login-flow { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.login-flow span { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; font-size: 12px; color: rgba(238, 244, 242, 0.78); }
.login-flow b { font-family: var(--font-mono); color: #8fc2ff; font-size: 11px; font-weight: 500; }
.login-hero-foot { position: relative; z-index: 1; margin: 0; color: rgba(238, 244, 242, 0.42); font-size: 11px; letter-spacing: 0.02em; }

.login-panel { display: grid; place-items: center; padding: 44px; }
.login-card { width: min(410px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 28px 60px -40px rgba(10, 37, 64, 0.4); }
.login-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 18px; }
.login-card-head h2 { font-size: 21px; }
.login-card-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; word-break: break-all; }
.login-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.login-field span { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.login-field input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fff; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.login-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 107, 230, 0.12); }
.login-advanced { margin: 2px 0 14px; }
.login-advanced summary { cursor: pointer; font-size: 12px; color: var(--muted); user-select: none; }
.login-advanced .login-field { margin-top: 12px; }
.login-error { margin: 0 0 14px; padding: 10px 12px; border-radius: 9px; background: var(--red-soft); color: var(--red); font-size: 12px; }
.login-submit { width: 100%; height: 46px; justify-content: center; font-size: 14px; }
.login-submit:disabled { opacity: 0.7; cursor: wait; }
.login-hint { margin: 14px 0 0; color: var(--faint); font-size: 11px; line-height: 1.6; text-align: center; }

.user-chip {
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 5px 10px; border-radius: 999px; background: var(--paper-deep);
  color: var(--ink-2); font-size: 11.5px;
}

@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { min-height: 100vh; }
}

/* 登录页背景图 */
.login-page { grid-template-columns: minmax(0, 1.18fr) minmax(430px, 0.82fr); }
.login-hero--image {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.62) 0%, rgba(247, 251, 255, 0) 28%, rgba(247, 251, 255, 0.12) 70%, rgba(247, 251, 255, 0.58) 100%),
    url("/static/img/login-bg.jpg") center center / cover no-repeat;
}
.login-hero--image::after { display: none; }
.login-hero--image .login-brand strong { color: var(--ink); }
.login-hero--image .login-brand small { color: var(--muted); }
.login-hero--image .login-hero-foot { color: rgba(18, 24, 28, 0.48); }
.login-panel { background: var(--paper); }

/* 背景图铺满登录页，表单悬浮在右侧 */
.login-page { display: block; padding: 0; background: url("/static/img/login-bg.jpg") center center / cover no-repeat; }
.login-hero--image {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: 100vh;
  padding: 52px 58px;
  background: none;
  pointer-events: none;
}
.login-panel {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 48px clamp(26px, 7vw, 110px);
  background: linear-gradient(90deg, rgba(244, 247, 250, 0) 52%, rgba(244, 247, 250, 0.5) 100%);
}

.login-panel { align-items: flex-end; padding-bottom: 42px; }

/* 登录页按 0.618 黄金比例左右分割 */
.login-page {
  display: grid;
  grid-template-columns: 61.8fr 38.2fr;
  min-height: 100vh;
  padding: 0;
  background: var(--paper);
}
.login-hero--image {
  position: relative;
  inset: auto;
  z-index: 1;
  min-height: 100vh;
  padding: 52px 48px;
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.62) 0%, rgba(247, 251, 255, 0) 28%, rgba(247, 251, 255, 0.12) 70%, rgba(247, 251, 255, 0.58) 100%),
    url("/static/img/login-bg.jpg") center center / cover no-repeat;
  pointer-events: auto;
}
.login-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--paper);
}

/* 精算家 logo */
.brand-logo-wrap {
  width: 112px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 10px;
  background: #fff;
}
.brand-logo { display: block; width: auto; height: 24px; }
.login-brand-logo { display: block; width: auto; height: 32px; flex: 0 0 auto; }
.login-card-logo { display: block; width: auto; height: 30px; flex: 0 0 auto; }

/* 用户信息 / 退出确认 */
.user-chip { cursor: help; }
.logout-summary {
  margin-top: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.logout-summary strong { font-size: 13px; }
.logout-summary span { color: var(--muted); font-size: 12px; }

/* 顶栏源平台信息卡 */
.source-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.source-card-logo-wrap {
  width: 44px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
}
.source-card-logo { display: block; max-width: 40px; max-height: 26px; object-fit: contain; }
.source-card-mark {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.source-card-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.source-card-text strong { font-size: 12.5px; white-space: nowrap; }
.source-card-text small {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10.5px;
}
.source-card .chip { height: 20px; padding: 0 7px; font-size: 10px; }

/* 顶栏源平台登录状态 */
.topbar-login {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.topbar-login-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 190px;
  line-height: 1.25;
}
.topbar-login-title strong { font-size: 12px; white-space: nowrap; }
.topbar-login-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10.5px;
}
.topbar-login .btn { height: 30px; padding: 0 10px; }

/* 登录环境选择 */
.login-env { margin-bottom: 16px; }
.login-env-title { display: block; margin-bottom: 7px; color: var(--ink-2); font-size: 12px; font-weight: 500; }
.login-env-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.login-env-option {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.login-env-option:hover { border-color: var(--accent); }
.login-env-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.login-env-option input { margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.login-env-option span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.login-env-option strong { font-size: 12px; white-space: nowrap; }
.login-env-option small {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 9.5px;
}
