/* 商品上架工作台 · 演示版样式
   暖灰单色 + 单一强调色的编辑式界面 */

:root {
  --canvas: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #FBFBFA;
  --line: #EAEAEA;
  --line-strong: #E0DFDB;
  --ink: #111111;
  --ink-2: #2F3437;
  --muted: #787774;
  --faint: #A8A6A1;
  --ok-bg: #EDF3EC;
  --ok-ink: #346538;
  --warn-bg: #FBF3DB;
  --warn-ink: #956400;
  --info-bg: #E1F3FE;
  --info-ink: #1F6C9F;
  --err-bg: #FDEBEC;
  --err-ink: #9F2F2D;
  --neutral-bg: #F0EFEC;
  --neutral-ink: #5F5E5B;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-soft: 0 1px 2px rgba(17, 17, 17, .03), 0 8px 24px -16px rgba(17, 17, 17, .10);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
button:disabled { cursor: not-allowed; }
[aria-busy="true"] { cursor: progress; }
[data-mounted-icon] { display: inline-flex; flex: none; }

html, body { margin: 0; padding: 0; }

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

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D8D7D3; border-radius: 8px; border: 2px solid var(--canvas); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局骨架 ---------- */

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  padding: 20px 14px 16px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  flex: none;
}

.brand-text { display: grid; line-height: 1.3; min-width: 0; }
.brand-text strong { font-size: 14px; letter-spacing: -.01em; }
.brand-text small { font-size: 11px; color: var(--muted); }
.sidebar-close { margin-left: auto; flex-shrink: 0; }

.nav { display: grid; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}

.nav-item:hover { background: var(--neutral-bg); color: var(--ink); }

.nav-item.active { background: var(--ink); color: #FFFFFF; }

.nav-ico { display: grid; place-items: center; width: 16px; height: 16px; flex: none; }

.nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--neutral-bg);
  color: var(--neutral-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.nav-item.active .nav-count { background: rgba(255, 255, 255, .18); color: #FFFFFF; }

.side-foot { margin-top: auto; display: grid; gap: 12px; padding-top: 18px; }

.robot-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.robot-head { display: flex; align-items: center; gap: 8px; }
.robot-name { font-size: 12.5px; font-weight: 600; }
.robot-head .switch { margin-left: auto; }

.robot-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
}

.robot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.robot-row label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.robot-row select {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
  transition: background .3s var(--ease);
}

.dot.on { background: #3E7A45; animation: pulse 2.6s var(--ease) infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62, 122, 69, .35); }
  55% { box-shadow: 0 0 0 5px rgba(62, 122, 69, 0); }
}

.switch { position: relative; display: inline-flex; cursor: pointer; }

.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }

.switch .track {
  display: inline-flex;
  align-items: center;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #D8D7D3;
  padding: 2px;
  transition: background .25s var(--ease);
}

.switch .thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(17, 17, 17, .18);
  transition: transform .25s var(--ease);
}

.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track .thumb { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }

.side-actions { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.side-ver { color: var(--faint); font-size: 11px; }

.link-btn {
  border: 0;
  background: none;
  padding: 2px 0;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.link-btn:hover { color: var(--ink); border-color: var(--line-strong); }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 243, .88);
  backdrop-filter: blur(10px);
}

.topbar-title { display: grid; gap: 1px; min-width: 0; }
.topbar-title h1 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.topbar-title p { font-size: 12px; color: var(--muted); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.views { flex: 1; min-width: 0; }

.connection-banner { margin: 12px 28px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 12px; }
.connection-banner.warn { border-color: var(--warn-ink); }
.connection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.connection-actions input { max-width: 100%; }
.token-reveal { overflow-wrap: anywhere; }

.view { display: none; padding: 24px 28px 40px; }

.view.active { display: block; animation: viewIn .5s var(--ease); }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 通用组件 ---------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 { font-size: 13.5px; font-weight: 600; }
.goods-head {
  position: sticky;
  top: 64px;
  z-index: 5;
  margin: -4px 0 14px;
  padding: 4px 0 10px;
  background: var(--surface);
}

.panel-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}

.btn:active { transform: scale(.98); }
.btn .ico { display: grid; place-items: center; width: 14px; height: 14px; }

.btn-primary { background: var(--ink); color: #FFFFFF; }
.btn-primary:hover { background: #333333; }

.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-secondary:hover { background: var(--canvas); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--neutral-bg); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); }
.btn-primary:disabled:hover { background: var(--ink); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
}

.icon-btn:hover { color: var(--ink); background: var(--canvas); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge-neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
.badge-yellow { background: var(--warn-bg); color: var(--warn-ink); }
.badge-blue { background: var(--info-bg); color: var(--info-ink); }
.badge-green { background: var(--ok-bg); color: var(--ok-ink); }
.badge-red { background: var(--err-bg); color: var(--err-ink); }

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 36px 20px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.empty .ico { color: var(--faint); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.input, .select {
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.input:focus, .select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .06);
}

.input::placeholder, textarea::placeholder { color: var(--faint); }

.input-search { width: 220px; }

.count-note { font-size: 12px; color: var(--muted); }

/* ---------- 表格 ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

.table { width: 100%; border-collapse: collapse; min-width: 760px; }

.table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  background: var(--surface-2);
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid #F2F1EE;
  font-size: 13px;
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }

.thumb {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--neutral-bg);
  flex: none;
}

.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-text { display: grid; gap: 1px; min-width: 0; }
.cell-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { font-size: 11.5px; color: var(--muted); }
.cell-sub.mono { font-family: var(--font-mono); }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ---------- 工作台 ---------- */

.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-12 { grid-column: span 12; }

.stat-row { display: flex; gap: 28px; margin-bottom: 16px; }
.stat { display: grid; gap: 2px; }
.stat-num { font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-size: 11.5px; color: var(--muted); }

.bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--neutral-bg); }

.bar-seg { height: 100%; transition: width .5s var(--ease); }
.seg-pending { background: #D9A93C; }
.seg-active { background: #4E93C4; }
.seg-success { background: #5E9367; }
.seg-failed { background: #C4706E; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

.mini-list { display: grid; gap: 2px; }

.mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  transition: background .15s var(--ease);
}

.mini-item:hover { background: var(--surface-2); }
.mini-item .cell-text { flex: 1; }

.note-list { display: grid; gap: 8px; }

.note-list li {
  position: relative;
  padding-left: 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

.note-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--faint);
}

.note-list strong { color: var(--ink-2); }

.log-line { display: flex; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm); }
.log-line:hover { background: var(--surface-2); }
.log-time { font-family: var(--font-mono); font-size: 11px; color: var(--faint); white-space: nowrap; padding-top: 1px; }
.log-text { font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.log-text .muted { font-size: 11.5px; }

/* ---------- 商品录入表单 ---------- */

.entry-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field label { font-size: 12px; color: var(--muted); }
.field label em { color: var(--err-ink); font-style: normal; }

.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.field textarea { resize: vertical; min-height: 88px; }

.field .err { font-size: 12px; color: var(--err-ink); min-height: 0; display: none; }
.field .err.show { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--err-ink); }

.field-foot { display: flex; justify-content: space-between; gap: 10px; }
.hint { font-size: 11.5px; color: var(--faint); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.form-note { font-size: 12.5px; color: var(--muted); }
.form-note.ok { color: var(--ok-ink); }
.form-note.warn { color: var(--err-ink); }

.entry-side { display: grid; gap: 16px; }

/* ---------- 任务看板 ---------- */

.kanban-wrap { overflow-x: auto; padding-bottom: 6px; }

.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; align-items: start; }

.kcol { display: grid; gap: 10px; min-width: 0; }

.kcol-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line);
}

.kcol-head h3 { font-size: 12.5px; font-weight: 600; }
.kcol-count { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.kcol-body { display: grid; gap: 10px; }

.kcard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 13px;
  display: grid;
  gap: 7px;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}

.kcard:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); border-color: var(--line-strong); }
.kcard-top { display: flex; align-items: center; gap: 8px; }
.kcard-title { font-size: 12.5px; font-weight: 500; line-height: 1.45; }
.kcard-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }

.kcard-err {
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  background: var(--err-bg);
  color: var(--err-ink);
  font-size: 11.5px;
  line-height: 1.5;
}

.kcard-time { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }

/* ---------- 抽屉 ---------- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(17, 17, 17, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}

.drawer-overlay.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(500px, 100vw);
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  transform: translateX(102%);
  transition: transform .35s var(--ease);
  display: flex;
  flex-direction: column;
}

.drawer.open { transform: none; }

.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.drawer-title .id { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.drawer-head .icon-btn { margin-left: auto; }

.drawer-body { padding: 18px 20px 28px; overflow-y: auto; display: grid; gap: 18px; align-content: start; }

.drawer-sec { display: grid; gap: 10px; }
.drawer-sec h4 { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.meta-item { display: grid; gap: 2px; }
.meta-label { font-size: 11px; color: var(--faint); }
.meta-value { font-size: 12.5px; }

.code-block {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow-x: auto;
}

.code-block code { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7; color: var(--ink-2); white-space: pre; }

.timeline { display: grid; gap: 0; }

.tl-item { display: flex; gap: 10px; padding: 7px 0; position: relative; }

.tl-item::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 20px;
  bottom: -7px;
  width: 1px;
  background: var(--line);
}

.tl-item:last-child::before { display: none; }

.tl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-top: 6px; flex: none; }
.tl-dot.info { background: #8FB8D6; }
.tl-dot.warn { background: #D9A93C; }
.tl-dot.error { background: #C4706E; }

.tl-body { display: grid; gap: 1px; min-width: 0; }
.tl-step { font-size: 12.5px; font-weight: 500; }
.tl-msg { font-size: 12px; color: var(--muted); line-height: 1.55; }
.tl-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }

/* ---------- 对接说明 ---------- */

.doc { display: grid; gap: 16px; max-width: 980px; }
.doc-block { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px 24px; display: grid; gap: 12px; }
.doc-block h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.doc-block h3 { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.doc-block p { font-size: 13px; color: var(--ink-2); }
.doc-note { font-size: 12px; color: var(--muted); }

.flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flow-sub { margin-top: 4px; }

.flow-node {
  display: grid;
  gap: 1px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12.5px;
  text-align: center;
}

.flow-node small { font-size: 10.5px; color: var(--muted); }
.flow-node.flow-ok { background: var(--ok-bg); border-color: transparent; color: var(--ok-ink); }
.flow-node.flow-ok small { color: var(--ok-ink); opacity: .75; }
.flow-node.flow-err { background: var(--err-bg); border-color: transparent; color: var(--err-ink); }
.flow-node.flow-err small { color: var(--err-ink); opacity: .75; }

.flow-arrow { color: var(--faint); font-size: 13px; }

/* ---------- 模态与提示 ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}

.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal {
  width: min(400px, calc(100vw - 40px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  gap: 10px;
  transform: translateY(8px) scale(.98);
  transition: transform .25s var(--ease);
}

.modal-overlay.show .modal { transform: none; }

.modal-title { font-size: 14px; font-weight: 600; }
.modal-msg { font-size: 13px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.toast {
  padding: 10px 15px;
  border-radius: 8px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 12.5px;
  box-shadow: 0 10px 30px -12px rgba(17, 17, 17, .35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  max-width: 360px;
}

.toast.show { opacity: 1; transform: none; }
.toast.err { background: #7E2B29; }

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

@media (max-width: 1100px) {
  .entry-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-12 > * { grid-column: span 12; }
}

@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    width: 260px;
    transform: translateX(-102%);
    transition: transform .3s var(--ease);
    box-shadow: none;
  }

  .sidebar.open { transform: none; box-shadow: 0 20px 60px -20px rgba(17, 17, 17, .25); }

  .menu-btn { display: grid; }
  .view { padding: 18px 16px 32px; }
  .connection-banner { margin: 12px 16px 0; }
  .topbar { padding: 12px 16px; }
  .kanban { grid-template-columns: repeat(5, 220px); }
}

@media (min-width: 981px) {
  .menu-btn, .sidebar-close { display: none; }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field.span-2 { grid-column: span 1; }
  .stat-row { gap: 18px; }
  .input-search { width: 100%; }
  .toolbar-left { width: 100%; }
  .robot-row { grid-template-columns: 1fr; }
}

/* ---------- 两阶段流程新增样式 ---------- */

.seg-blocked { background: #C4706E; }

.thumb.tile { display: grid; place-items: center; color: var(--faint); }

.field input:disabled, .field select:disabled, .field textarea:disabled {
  opacity: .5; cursor: not-allowed; background: var(--surface-2);
}

.shop-checks { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.shop-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.shop-check input { width: 15px; height: 15px; accent-color: var(--ink); flex: none; }
.shop-check .mono { color: var(--muted); font-size: 11.5px; margin-left: auto; }

.folder-chips { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.folder-chip { display: inline-flex; gap: 4px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 11px; color: var(--muted); }
.folder-chip b { color: var(--ink); font-weight: 600; font-family: var(--font-mono); }
.folder-chip.zero { border-style: dashed; color: var(--err-ink); }
.folder-chip.zero b { color: var(--err-ink); }

.spec-block { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 8px; }
.spec-block summary { padding: 9px 12px; cursor: pointer; font-size: 12.5px; background: var(--surface-2); display: flex; gap: 10px; align-items: center; list-style: none; }
.spec-block summary::-webkit-details-marker { display: none; }
.spec-block summary::before { content: "▸"; color: var(--faint); font-size: 10px; transition: transform .2s var(--ease); }
.spec-block[open] summary::before { transform: rotate(90deg); }
.spec-block[open] summary { border-bottom: 1px solid var(--line); }
.path-list { padding: 8px 12px 10px; display: grid; gap: 3px; max-height: 240px; overflow-y: auto; }
.path-row { font-family: var(--font-mono); font-size: 11px; color: var(--muted); word-break: break-all; line-height: 1.5; }
.path-row b { color: var(--ink-2); font-weight: 600; }

.issue-list { display: grid; gap: 8px; }
.issue-item { border: 1px solid var(--line); border-left: 3px solid var(--err-ink); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 4px; background: var(--surface-2); }
.issue-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.issue-detail { font-size: 12px; color: var(--muted); line-height: 1.6; }
.issue-folder { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); word-break: break-all; }

.chain { display: grid; gap: 6px; }
.chain-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12px; background: var(--surface-2); }
.chain-item .mono { font-size: 11.5px; }
.chain-item .muted { margin-left: auto; font-size: 11.5px; }

.kcard-warn { padding: 6px 9px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-ink); font-size: 11.5px; line-height: 1.5; }

.doc-block a.link-btn { font-size: 12.5px; }

.shop-add-panel { margin-bottom: 16px; }
.shop-add-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.shop-add-form .input { flex: 1; min-width: 140px; }
.shop-add-form .select { width: auto; min-width: 90px; }
.shop-add-form .err.show { display: block; margin-top: 8px; }

.shop-add-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; }
.shop-add-link .ico { display: inline-flex; }

.shop-tree-head { margin-bottom: 16px; }
.shop-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 16px 14px; font-size: 12.5px; }
.shop-crumb-item { padding: 0; }
.shop-crumb-sep { color: var(--muted); }
.shop-crumb-current { color: var(--ink); font-weight: 600; }
.shop-bind-line { padding: 0 16px 14px; font-size: 12.5px; color: var(--ink-2); }
.shop-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.shop-card {
  display: grid; gap: 8px; text-align: left;
  padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; color: inherit;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.shop-card:hover { border-color: var(--ink); box-shadow: 0 8px 20px rgba(0,0,0,.04); }
.shop-card-kicker { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.shop-card-title { font-size: 16px; font-weight: 650; }
.shop-card-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; color: var(--ink-2); }
.shop-card-note { display: flex; gap: 6px; }

.dev-panel { margin-bottom: 16px; }
.dev-panel-robot { margin-top: 28px; }
.dev-panel .panel-sub { color: var(--muted); }
.conn-form { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 16px; display: grid; gap: 14px; }
.conn-form.show { display: grid; }
.conn-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.conn-form-row .field { flex: 1; min-width: 160px; }
.conn-form-row .field span { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.conn-form-row .field em { color: var(--err-ink); font-style: normal; }
.conn-form-row .field input, .conn-form-row .field select {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 13px; color: var(--ink); transition: border-color .2s var(--ease);
}
.conn-form-row .field input:focus, .conn-form-row .field select:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,17,17,.06);
}
.conn-form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn-form-actions .form-note { font-size: 12.5px; }
.conn-form-actions .form-note.ok { color: var(--ok-ink); }
.conn-form-actions .form-note.warn { color: var(--err-ink); }

.robot-kinds { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; min-height: 38px; }
.robot-kinds .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.robot-api-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 38px; }

/* ---------- 影刀开放平台卡片 ---------- */
.yd-credentials {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 12.5px;
}
.yd-credentials > span:first-child { color: var(--muted); flex: none; }
.yd-credentials.ok { border-color: var(--ok-ink); }
.yd-credentials.warn { border-color: var(--err-ink); }
.yd-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.yd-checks label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.yd-checks input[type="checkbox"] { width: auto; }
.yd-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 12.5px; color: var(--muted); }
/* ---------- 影刀运行记录 ---------- */
.yd-jobs { display: grid; gap: 10px; }
.yd-jobs-title { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.yd-jobs .cell-sub { display: block; max-width: 340px; color: var(--muted); font-size: 12px; }
.yd-jobs table td { vertical-align: top; }
.yd-job-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.yd-job-actions .btn { padding: 3px 8px; }
/* 影刀运行徽章 */
.nav-yingdao {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: -4px;
  font-size: 11px;
  opacity: 0.85;
}
.nav-yingdao .nav-count {
  background: #1f6c9f;
  color: white;
  padding: 0 4px;
  border-radius: 3px;
  min-width: 14px;
  text-align: center;
}

.spec-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.spec-row input { flex: 1; }
.spec-row button { padding: 2px 6px; font-size: 12px; }

.channel-top { margin-bottom: 16px; }
.platform-switch, .module-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-tab, .module-tab {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px;
}
.platform-tab.active, .module-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.channel-hint { margin: 10px 0 14px; font-size: 12.5px; }
.module-switch { margin-bottom: 8px; }
.queue-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 0 4px 10px; }
.queue-actions { display: flex; gap: 10px; align-items: center; }
.status-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.status-legend .badge { margin-left: 8px; }
.status-legend .badge:first-child { margin-left: 0; }
.process-section {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.process-section-head, .queue-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.process-section-head { margin-bottom: 12px; }
.process-section-head h3, .queue-detail-head h3 { font-size: 13.5px; font-weight: 600; }
.stage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.stage-module {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.stage-module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.stage-title { display: flex; gap: 9px; min-width: 0; }
.stage-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  background: var(--neutral-bg);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}
.stage-title h4 { margin: 1px 0 1px; font-size: 13px; font-weight: 600; }
.stage-title p { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-module > .badge { flex: none; }
.stage-progress { height: 6px; margin: 17px 0 10px; overflow: hidden; border-radius: 99px; background: var(--neutral-bg); }
.stage-progress span { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width .2s var(--ease); }
.stage-done .stage-progress span { background: var(--ok-ink); }
.stage-running .stage-progress span { background: var(--info-ink); }
.stage-failed .stage-progress span { background: var(--err-ink); }
.stage-partial_failed .stage-progress span { background: var(--warn-ink); }
.stage-module-foot { display: flex; align-items: baseline; gap: 5px; color: var(--muted); font-size: 11px; }
.stage-module-foot strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.stage-counts { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.stage-counts span { white-space: nowrap; }
.stage-counts b { margin-right: 2px; color: var(--ink-2); font-weight: 600; }
.queue-detail { margin-top: 16px; }
.queue-detail-head { margin: 0 4px 9px; }

.queue-auto { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.admin-channel-bar { padding: 12px 16px 0; }
#queue-table tr[data-task] { cursor: pointer; }

/* ---------- 影刀接口点选查询 ---------- */
.yd-panel-groups { display: grid; gap: 10px; margin: 10px 0 8px; }
.yd-panel-group { display: grid; gap: 6px; }
.yd-panel-group-title { font-size: 12px; color: var(--muted); }
.yd-panel-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.yd-panel-btns .btn.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.yd-panel-result { display: grid; gap: 8px; }
.yd-panel-meta { font-size: 12px; color: var(--muted); }
.yd-panel-table-wrap { max-height: 360px; overflow: auto; }
.yd-panel-table { min-width: 0; }
.yd-panel-table th, .yd-panel-table td { white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.yd-panel-json {
  margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-family: var(--font-mono); font-size: 12px;
  overflow: auto; max-height: 280px; white-space: pre-wrap; word-break: break-word;
}
.yd-panel-raw summary { cursor: pointer; color: var(--muted); font-size: 12px; }
#yingdao-panel { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

.img-count { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: top; }
.img-list-cell { vertical-align: top; }
.img-list { min-width: 180px; max-width: 280px; max-height: 168px; overflow: auto; font-size: 12px; line-height: 1.45; white-space: nowrap; }
.img-list a { color: var(--info-ink); }
.img-table { min-width: 1280px; }

.spec-table tbody tr.sku-tone-0 td { background: #e8eef6; }
.spec-table tbody tr.sku-tone-1 td { background: #e7f0e4; }
.spec-table tbody tr.sku-tone-2 td { background: #f8efdc; }
.spec-table tbody tr.sku-tone-3 td { background: #e7eef6; }
.spec-table tbody tr.sku-tone-4 td { background: #f6e8ee; }
.spec-table tbody tr.sku-tone-5 td { background: #eee8f6; }
.spec-table tbody tr.sku-tone-6 td { background: #e5f2ef; }
.spec-table tbody tr.sku-tone-7 td { background: #f3eee6; }
.spec-table tbody tr.sku-tone-0:hover td { background: #dce6f2; }
.spec-table tbody tr.sku-tone-1:hover td { background: #dce8d8; }
.spec-table tbody tr.sku-tone-2:hover td { background: #f0e4cb; }
.spec-table tbody tr.sku-tone-3:hover td { background: #dbe6f1; }
.spec-table tbody tr.sku-tone-4:hover td { background: #eedce4; }
.spec-table tbody tr.sku-tone-5:hover td { background: #e4dcf0; }
.spec-table tbody tr.sku-tone-6:hover td { background: #d7eae6; }
.spec-table tbody tr.sku-tone-7:hover td { background: #e8e1d6; }
.spec-table td.spec-cell { min-width: 220px; font-size: 14px; font-weight: 600; color: var(--ink); }
.spec-table td.shop-cell { min-width: 150px; font-size: 13px; color: var(--ink-2); }
.spec-table tbody tr.shop-start > td { border-top: 1px dashed var(--line-strong); }
.spec-table td { vertical-align: top; }
.spec-table td.merge-cell {
  vertical-align: top;
  text-align: left;
  border-right: 1px solid var(--line);
  padding-top: 14px;
}
.spec-table tbody tr.product-start > td { border-top: 1px solid #d9d7d2; }
.img-table td { padding-top: 16px; padding-bottom: 16px; }

.queue-exception { color: var(--err-ink); font-size: 12px; margin-top: 4px; }
