/* ============================================================
   Scan Code Studio · Web Edition
   纯前端样式表 —— 浅色仓储数据工作台
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --bg-soft: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --border: #e4e9f2;
  --border-strong: #d6deea;
  --text: #1c2637;
  --text-2: #43506a;
  --muted: #7b879d;
  --faint: #9aa6b8;

  --primary: #405888;
  --primary-deep: #2f4573;
  --primary-light: #6b86c4;
  --primary-soft: #eaf0fb;
  --success: #189a68;
  --success-soft: #e6f6ee;
  --danger: #d34b4b;
  --danger-soft: #fdecec;
  --warning: #d9862a;
  --warning-soft: #fdf3e3;

  --shadow-sm: 0 1px 2px rgba(25, 40, 75, .04), 0 2px 8px rgba(25, 40, 75, .035);
  --shadow: 0 1px 2px rgba(25, 40, 75, .04), 0 10px 30px rgba(25, 40, 75, .06);
  --shadow-lg: 0 24px 64px rgba(20, 34, 66, .18);
  --radius: 16px;
  --radius-sm: 10px;

  --sans: "Inter", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 12% -8%, #e7edfb 0%, transparent 62%),
    radial-gradient(900px 520px at 96% 4%, #eaf0fb 0%, transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.55;
}
button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--mono); }
kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255,255,255,.7);
  font: 600 10.5px/1.5 var(--mono);
  color: var(--muted);
  letter-spacing: .02em;
}
code {
  font: 12px/1.4 var(--mono);
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--primary);
}

/* ---------------- Layout shell ---------------- */
.app-shell { max-width: 1560px; margin: 0 auto; padding: 0 32px 12px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 2px 22px;
}
.brand { display: flex; align-items: center; gap: 15px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #43609e, #2f4573);
  box-shadow: 0 8px 18px rgba(47, 69, 115, .24), inset 0 1px 0 rgba(255,255,255,.18);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.brand-sep { color: var(--primary-light); font-weight: 400; margin: 0 2px; }
.brand-text p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); letter-spacing: .03em; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.mode-pill, .gun-status {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.mode-pill { background: var(--primary-soft); color: var(--primary-deep); border: 1px solid #d9e4f8; }
.mode-pill.triple { background: #eeeafd; color: #6544b8; border-color: #e2d9fb; }
.mode-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.mode-pill.triple .mode-dot { background: #7a55d6; }
.gun-status { background: #fff; border: 1px solid var(--border); color: var(--text-2); font-weight: 500; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(24,154,104,.13); }
.live-dot.big { width: 9px; height: 9px; }
.live-dot.pulse { animation: livePulse 1s ease infinite; }
@keyframes livePulse { 0%,100% { box-shadow: 0 0 0 3px rgba(24,154,104,.13); } 50% { box-shadow: 0 0 0 7px rgba(24,154,104,.05); } }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  transition: .18s ease;
}
.icon-btn:hover { border-color: var(--primary-light); color: var(--primary); transform: translateY(-1px); }
.icon-btn .ico-off { display: none; }
.icon-btn.muted { color: var(--faint); background: var(--surface-2); }
.icon-btn.muted .ico-on { display: none; }
.icon-btn.muted .ico-off { display: block; }

/* ---------------- Tabs ---------------- */
.tabs {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 24px;
}
.tab-group { display: flex; gap: 4px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px 13px; border: 0; background: transparent;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: .18s ease;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary-deep); border-bottom-color: var(--primary); }
.tab-hint { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); padding-bottom: 3px; }
.tab-hint i { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); margin: 0 2px; }

.tab-panel { display: none; animation: panelIn .28s ease both; }
.tab-panel.active { display: block; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- Cards ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-head h2, .stats-card h2, .mini-card h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.card-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---------------- Workspace ---------------- */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 20px; align-items: start; }
.main-col, .side-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  padding: 26px 28px 20px;
  color: #fff; border: 0;
  background: linear-gradient(122deg, #2c4274 0%, #3d578e 52%, #5876b7 100%);
  box-shadow: 0 16px 36px rgba(41, 63, 110, .2), inset 0 1px 0 rgba(255,255,255,.12);
}
.hero::after {
  content: ""; position: absolute; right: -70px; top: -120px;
  width: 320px; height: 320px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 0 0 46px rgba(255,255,255,.025), 0 0 0 92px rgba(255,255,255,.018);
  pointer-events: none;
}
.hero-glow {
  position: absolute; left: -80px; bottom: -180px; width: 340px; height: 260px;
  background: radial-gradient(circle, rgba(120,160,240,.3), transparent 65%);
  pointer-events: none;
}
.hero-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.eyebrow { font-size: 10.5px; letter-spacing: .16em; font-weight: 600; color: rgba(255,255,255,.58); }
.eyebrow span { margin: 0 5px; opacity: .5; }
.hero-title {
  margin-top: 7px; font-size: 30px; font-weight: 700; letter-spacing: -.025em;
  line-height: 1.25; word-break: break-all;
  text-shadow: 0 2px 12px rgba(0,0,0,.09);
}
.hero-title.waiting { color: rgba(255,255,255,.72); font-weight: 500; font-size: 24px; }
.hero-badge {
  flex: none; margin-top: 4px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.11);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  backdrop-filter: blur(6px);
}
.hero-badge.live { background: rgba(120, 230, 175, .18); border-color: rgba(150,240,195,.4); color: #d3ffe8; }
.hero-metrics {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: 22px; padding: 15px 0 16px;
  border-top: 1px solid rgba(255,255,255,.13);
  border-bottom: 1px solid rgba(255,255,255,.13);
}
.metric { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.metric-label { font-size: 11px; color: rgba(255,255,255,.6); }
.metric strong { font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.metric strong small { font-size: 11px; font-weight: 500; opacity: .7; }
.metric .mono { font-size: 15px; letter-spacing: -.02em; }
.length-note { position: relative; margin-top: 13px; font-size: 11.5px; color: rgba(255,255,255,.68); transition: color .2s; }
.length-note.flash { color: #ffd7a8; font-weight: 600; }

/* ---------------- Triple flow ---------------- */
.triple-flow { padding: 20px 24px 22px; }
.triple-flow[hidden] { display: none; }
.flow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.flow-head h2 { margin: 0; font-size: 14px; }
.flow-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.flow-tag {
  flex: none; padding: 5px 11px; border-radius: 7px; font-size: 11px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary-deep);
}
.flow-steps { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.flow-step {
  flex: 1; display: flex; align-items: center; gap: 11px; min-width: 0;
  padding: 12px 14px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2);
  opacity: .62; transition: .25s ease;
}
.flow-step .step-num {
  width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: #e6ebf4; color: var(--muted); font: 700 12px var(--mono);
}
.flow-step strong { display: block; font-size: 12.5px; }
.flow-step small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.flow-step.active { opacity: 1; border-color: #b7c9ee; background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(64,88,136,.06); }
.flow-step.active .step-num { background: var(--primary); color: #fff; }
.flow-step.done { opacity: 1; border-color: #bfe6d2; background: var(--success-soft); }
.flow-step.done .step-num { background: var(--success); color: #fff; }
.flow-step.done small { color: var(--success); font-weight: 600; }
.flow-arrow { color: var(--border-strong); font-size: 16px; flex: none; }

/* ---------------- Table ---------------- */
.table-card { padding: 22px 24px 12px; overflow: hidden; }
.legend { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; background: #d9f0e2; border: 1px solid #b9e2cc; }
.table-wrap { margin-top: 16px; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 10px 14px;
  background: var(--primary-soft); color: var(--primary-deep);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  border-bottom: 1px solid #d9e3f5;
}
thead th:first-child { border-radius: 8px 0 0 8px; }
thead th:last-child { border-radius: 0 8px 8px 0; }
.col-id { width: 96px; text-align: center !important; }
.col-count { width: 130px; text-align: center !important; }
.col-time { width: 190px; }
tbody td {
  padding: 11px 14px; border-bottom: 1px solid #edf1f7;
  color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
tbody td.col-id, tbody td.col-count { text-align: center; }
tbody td.col-id { font-family: var(--mono); font-weight: 600; color: var(--primary); }
tbody td.col-count { font-family: var(--mono); font-weight: 600; }
tbody td.col-time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
tbody tr { animation: rowIn .22s ease both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
tbody tr.current { background: var(--success-soft); }
tbody tr.current td { border-bottom-color: #d5ecdf; }
.batch-id-cell { display: inline-flex; align-items: center; gap: 6px; }
.current-tag { font: 600 9.5px var(--sans); padding: 1px 6px; border-radius: 4px; background: var(--success); color: #fff; }
.product-cell { font-family: var(--mono); font-weight: 600; color: var(--text); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 46px 12px 52px; color: var(--faint); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state svg { width: 42px; height: 42px; color: #c9d3e4; margin-bottom: 6px; }
.empty-state strong { font-size: 13px; color: var(--muted); font-weight: 600; }
.empty-state span { font-size: 11.5px; }

/* ---------------- Buttons ---------------- */
.action-bar { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 17px; border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #fff; color: var(--text-2);
  font-size: 13px; font-weight: 600;
  transition: .18s ease; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); border-color: var(--primary-light); box-shadow: var(--shadow-sm); color: var(--primary-deep); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--primary); border-color: var(--primary-deep); color: #fff; box-shadow: 0 5px 14px rgba(64,88,136,.2); }
.btn.primary:hover { background: #4b66a0; color: #fff; }
.btn.primary kbd { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.24); }
.btn.ghost-danger { color: #a95252; }
.btn.ghost-danger:hover { color: var(--danger); border-color: #e9b8b8; background: var(--danger-soft); }
.btn.danger { background: var(--danger); border-color: #b83c3c; color: #fff; }
.btn.danger:hover { background: #c54343; color: #fff; }
.btn.subtle { background: var(--surface-2); }
.btn.full { width: 100%; margin-top: 6px; }

/* ---------------- Sidebar ---------------- */
.buffer-card, .result-card, .stats-card, .hint-card { padding: 20px 20px 18px; }
.buffer-card.scanning { border-color: #b7c9ee; box-shadow: 0 0 0 3px rgba(64,88,136,.06); }
.buffer-screen {
  margin-top: 15px; min-height: 66px; padding: 12px 13px;
  border-radius: 10px; border: 1px solid var(--border);
  background: #fbfcfe; color: #5a6780;
  font: 12px/1.7 var(--mono); word-break: break-all;
}
.caret { display: inline-block; width: 6px; height: 14px; vertical-align: -2px; background: var(--primary-light); opacity: .55; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.buffer-track { height: 3px; margin-top: 12px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; }
.buffer-fill { height: 100%; width: 0%; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--primary-light)); transition: width .08s linear; }
.buffer-tip { margin: 10px 0 0; font-size: 11px; color: var(--faint); }

.result-card { transition: border-color .2s, background .2s; }
.result-card.error { border-color: #f0c9c9; background: #fffbfb; }
.result-card.success { border-color: #c7e8d6; }
.result-card.info { border-color: #cfdcf5; }
.result-tag { flex: none; padding: 3px 9px; border-radius: 6px; font-size: 10.5px; font-weight: 700; background: var(--bg-soft); color: var(--muted); }
.result-tag.error { background: var(--danger-soft); color: var(--danger); }
.result-tag.success { background: var(--success-soft); color: var(--success); }
.result-tag.info { background: var(--primary-soft); color: var(--primary); }
.result-body {
  margin-top: 14px; min-height: 74px; padding: 12px 13px;
  border-radius: 10px; background: var(--surface-2);
  font: 11.5px/1.85 var(--mono); color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.result-card.error .result-body { background: var(--danger-soft); color: #a63f3f; }
.result-card.success .result-body { background: var(--success-soft); color: #176b4c; }
.result-card.info .result-body { background: var(--primary-soft); color: var(--primary-deep); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stat { padding: 12px 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid #eef2f8; }
.stat strong { display: block; font: 700 22px/1.2 var(--mono); color: var(--primary-deep); letter-spacing: -.03em; }
.stat strong.stat-text { font-size: 14px; padding: 4px 0 3px; font-family: var(--sans); }
.stat span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--muted); }

.hint-card { display: flex; gap: 12px; align-items: flex-start; background: #fbfcff; }
.hint-icon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--warning-soft); color: var(--warning); }
.hint-icon svg { width: 17px; height: 17px; }
.hint-card p { margin: 2px 0 0; font-size: 11.5px; line-height: 1.75; color: var(--muted); }

/* ---------------- Settings ---------------- */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.settings-main, .settings-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.settings-card { padding: 24px 26px 26px; }
.settings-head { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.section-num { font: 700 12px var(--mono); color: var(--primary-light); padding-top: 3px; letter-spacing: .05em; }
.settings-head h2 { margin: 0; font-size: 16px; }
.settings-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 22px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.unit { font: 500 10.5px var(--mono); color: var(--faint); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }
.field input[type="text"], .field input[type="number"] {
  width: 100%; height: 40px; padding: 0 13px;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: #fff; color: var(--text); outline: none;
  transition: .18s ease; font-size: 13px;
}
.field input.mono { font-family: var(--mono); font-size: 12.5px; }
.field input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(64,88,136,.09); }
.field input.invalid { border-color: #e2a2a2; background: #fff5f5; box-shadow: 0 0 0 3px rgba(211,75,75,.07); }
.field small { font-size: 11px; color: var(--muted); line-height: 1.6; }
.field small.field-error { display: none; color: var(--danger); font-weight: 600; }
.field input.invalid ~ small.field-error { display: block; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 16px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; transition: .18s;
}
.switch-row:hover { border-color: #c8d5ec; }
.switch-copy strong { display: block; font-size: 13px; }
.switch-copy small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.switch { position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { display: block; width: 44px; height: 25px; border-radius: 999px; background: #cfd8e6; transition: .22s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.16); transition: .22s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(64,88,136,.22); }
.triple-fields { margin-top: 20px; grid-template-columns: repeat(3, 1fr); }
.triple-fields.is-off { opacity: .45; pointer-events: none; }
.inline-note {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 20px;
  padding: 12px 14px; border-radius: 10px;
  background: #f7f9fd; border: 1px dashed var(--border-strong);
  font-size: 11.5px; line-height: 1.7; color: var(--muted);
}
.inline-note svg { width: 16px; height: 16px; color: var(--primary-light); margin-top: 1px; }
.mini-card { padding: 22px 22px 20px; }
.mini-card h3 { font-size: 13.5px; }
.config-list { margin: 18px 0 14px; }
.config-list div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.config-list div:last-child { border-bottom: 0; }
.config-list dt { font-size: 11.5px; color: var(--muted); }
.config-list dd { margin: 0; font-size: 12px; font-weight: 600; color: var(--text-2); text-align: right; }
.mini-card.soft { background: #fbfcff; }
.mini-card.soft p { margin: 9px 0 0; font-size: 11.5px; line-height: 1.8; color: var(--muted); }

/* ---------------- Help ---------------- */
.help-layout { display: flex; flex-direction: column; gap: 18px; max-width: 1180px; }
.help-intro { display: flex; align-items: center; gap: 20px; padding: 26px 28px; background: linear-gradient(110deg, #fff, #f8faff); }
.help-intro-icon { width: 54px; height: 54px; flex: none; border-radius: 15px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.help-intro-icon svg { width: 30px; height: 30px; }
.help-intro h2 { margin: 0; font-size: 19px; }
.help-intro p { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.8; max-width: 760px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.help-card { padding: 24px 26px 26px; }
.help-tag { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; background: var(--primary-soft); color: var(--primary-deep); }
.help-tag.accent { background: #eeeafd; color: #6544b8; }
.step-list { list-style: none; margin: 20px 0 0; padding: 0; }
.step-list li { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px dashed var(--border); }
.step-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.step-list li > span { flex: none; font: 700 13px var(--mono); color: var(--primary-light); padding-top: 1px; }
.step-list strong { display: block; font-size: 13px; }
.step-list p { margin: 4px 0 0; font-size: 11.5px; line-height: 1.8; color: var(--muted); }
.help-note { padding: 18px 22px; background: #fbfcff; }
.help-note strong { font-size: 12.5px; color: var(--primary-deep); }
.help-note p { margin: 6px 0 0; font-size: 11.5px; line-height: 1.85; color: var(--muted); }

/* ---------------- Footer ---------------- */
.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 24px 2px 12px; margin-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--faint);
}

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 24px;
  background: rgba(24, 35, 58, .42);
  backdrop-filter: blur(4px);
  animation: fadeIn .18s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(620px, 100%); border-radius: 18px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow-lg);
  animation: modalIn .24s cubic-bezier(.2,.8,.3,1) both;
}
.modal.small { width: min(440px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.modal-close { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); display: grid; place-items: center; transition: .18s; }
.modal-close:hover { color: var(--danger); border-color: #e9b8b8; background: var(--danger-soft); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: 20px 24px; }
.sample-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.sample-chips > span { font-size: 11px; color: var(--faint); margin-right: 2px; }
.sample-chips button { padding: 4px 10px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 11px; color: var(--text-2); transition: .16s; }
.sample-chips button:hover { border-color: var(--primary-light); color: var(--primary); background: var(--primary-soft); }
#simInput {
  width: 100%; height: 190px; resize: vertical; padding: 14px;
  border: 1px solid var(--border-strong); border-radius: 11px;
  background: #fbfcfe; outline: none; font-size: 12.5px; line-height: 1.8;
  white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
#simInput:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(64,88,136,.09); background: #fff; }
.modal-tip { margin: 10px 0 0; font-size: 11px; color: var(--faint); line-height: 1.7; }
.confirm-note { padding: 14px 16px; border-radius: 10px; background: var(--danger-soft); color: #a63f3f; font-size: 12.5px; line-height: 1.8; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; }

/* ---------------- Toast ---------------- */
.toast-stack { position: fixed; right: 26px; bottom: 26px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px;
  padding: 13px 16px; border-radius: 11px;
  background: #fff; border: 1px solid var(--border);
  box-shadow: 0 12px 34px rgba(24,38,70,.16);
  font-size: 12.5px; color: var(--text-2);
  animation: toastIn .25s cubic-bezier(.2,.8,.3,1) both;
}
.toast.out { animation: toastOut .22s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(18px); } }
.toast .toast-icon { width: 24px; height: 24px; flex: none; border-radius: 7px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.toast.success .toast-icon { background: var(--success-soft); color: var(--success); }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast.info .toast-icon { background: var(--primary-soft); color: var(--primary); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1240px) {
  .app-shell { padding: 0 22px 12px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 1020px) {
  .workspace, .settings-layout { grid-template-columns: 1fr; }
  .side-col { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .settings-side { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
}
@media (max-width: 760px) {
  .app-shell { padding: 0 14px 10px; }
  .topbar { flex-wrap: wrap; gap: 14px; padding: 18px 2px; }
  .topbar-right { width: 100%; }
  .tabs { overflow-x: auto; }
  .tab { padding: 11px 12px; font-size: 12.5px; }
  .tab-hint { display: none; }
  .side-col, .settings-side, .help-grid, .field-grid, .triple-fields { grid-template-columns: 1fr; }
  .hero { padding: 22px 20px 18px; }
  .hero-title { font-size: 24px; }
  .flow-steps { flex-direction: column; align-items: stretch; }
  .flow-arrow { transform: rotate(90deg); text-align: center; }
  .action-bar .btn { flex: 1 1 44%; }
  .table-card { padding: 18px 14px 10px; }
  thead th, tbody td { padding: 9px 8px; }
  .footer { flex-direction: column; }
}
