/* E·STAR 布局 — 侧边栏 + 页面壳 */
:root {
  --vv-h: 100%;
  --vv-top: 0px;
  --sidebar-w-expanded: 172px;
  --sidebar-w-collapsed: 0px;
  --sidebar-w: var(--sidebar-w-expanded);
  --sidebar-bg: #1a2332;
  --sidebar-border: rgba(255,255,255,0.08);
  --sidebar-nav-bg: rgba(255,255,255,0.07);
  --sidebar-nav-bg-hover: rgba(255,255,255,0.12);
  --sidebar-nav-bg-on: rgba(21,101,192,0.32);
  --sidebar-nav-border: rgba(255,255,255,0.08);
  --sidebar-lbl: rgba(255,255,255,0.9);
  --sidebar-lbl-muted: rgba(255,255,255,0.45);
  --sidebar-lbl-on: #e3f2fd;
  --red: #dc2626;
  --red-l: #fef2f2;
  --green: #16a34a;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.18);
  --r: 14px;
  --r-sm: 10px;
  --transition: 0.15s ease;
}

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

html, body {
  margin: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden; /* 禁止文档级滚动：底漏白 → 顶被顶出 */
  overscroll-behavior: none;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  background: var(--bg, #f5f7fb);
  color: var(--text, #1a2332);
}

#mainApp {
  display: none;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  align-self: stretch;
  height: auto;
  min-height: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px 8px;
  border-right: 1px solid var(--sidebar-border);
  transition: width 0.22s ease;
  overflow: hidden;
}

.sidebar--collapsed {
  --sidebar-w: var(--sidebar-w-collapsed);
  width: 0;
  padding: 0;
  border-right: none;
  opacity: 0;
  pointer-events: none;
}

.sidebar-expand-fab {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 120;
  width: 28px;
  height: 52px;
  border-radius: 0 10px 10px 0;
  border: 1px solid var(--sidebar-border);
  border-left: none;
  background: var(--sidebar-bg);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.18);
  transition: background 0.15s;
}

.sidebar-expand-fab:not([hidden]) {
  display: flex;
}

.sidebar-expand-fab:hover {
  background: #243044;
}

.sidebar-scrim {
  display: none;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 4px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar--collapsed .sidebar-head {
  flex-direction: column;
  gap: 8px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-lbl-muted);
  padding: 4px 10px 6px;
  flex-shrink: 0;
}

.sidebar--collapsed .sidebar-section-title {
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.78);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: background var(--transition), border-color var(--transition);
}

.sidebar-toggle:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
  color: #fff;
}

.sidebar--collapsed .sidebar-toggle-ic {
  transform: rotate(180deg);
}

.sidebar .logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0;
  flex-shrink: 0;
}

.sidebar .nav {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  margin: 0;
  border: 1px solid var(--sidebar-nav-border);
  border-radius: 11px;
  background: var(--sidebar-nav-bg);
  color: var(--sidebar-lbl-muted);
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-size: 12px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  position: relative;
}

.sidebar--collapsed .nav {
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  min-height: 52px;
}

.sidebar .nav .nav-lbl {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--sidebar-lbl);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  transition: opacity 0.18s ease;
}

.sidebar--collapsed .nav .nav-lbl {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
  max-width: 100%;
  text-align: center;
}

.sidebar .nav[data-shortcut]::after {
  content: attr(data-shortcut);
  position: absolute;
  top: 3px;
  right: 5px;
  min-width: 14px;
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.75);
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

/* 快捷键角标：仅当前页显示（取消悬停伪聚焦） */
.sidebar .nav.on::after {
  opacity: 1;
}

.sidebar .nav .ic { font-size: 18px; }

/* 悬停不冒充 .on / 焦点框；仅极弱反馈 */
.sidebar .nav:hover:not(.on) {
  background: var(--sidebar-nav-bg);
  border-color: var(--sidebar-nav-border);
  color: var(--sidebar-lbl-muted);
  outline: none;
}
.sidebar .nav:hover:not(.on) .nav-lbl {
  color: var(--sidebar-lbl);
}

.sidebar .nav.on {
  background: var(--sidebar-nav-bg-on);
  border-color: rgba(144,202,249,0.45);
  color: var(--sidebar-lbl-on);
  box-shadow: inset 0 0 0 1px rgba(21,101,192,0.15);
}

.sidebar .nav.on .nav-lbl {
  color: var(--sidebar-lbl-on);
}

.nav-bottom {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.page {
  display: none;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.page.active { display: flex; flex-direction: column; }

.tag-pill {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-pill.on {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.pc-actions { display: flex; gap: 4px; align-items: center; }

.pc-check-wrap {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#productsGrid.is-pick-mode .pc-check-wrap,
.search-shell.is-pick-mode #productsGrid .pc-check-wrap {
  display: flex;
}

.product-card.is-pick-selected {
  border-color: #1565C0;
  box-shadow: 0 0 0 1px rgba(21, 101, 192, 0.25);
}
/* 焦态单 outline：禁与选中蓝边/外圈叠双框（estar-os 内联亦有兜底） */
.product-card.kb-focus.is-pick-selected {
  border-color: var(--border, #e2e8f0) !important;
  box-shadow: none !important;
}

.product-card.is-pick-selected .pc-check-wrap {
  background: #1565C0;
}

.pick-select-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: 12px;
}

.pick-select-bar[hidden] { display: none !important; }

.pick-select-lbl { font-size: 12px; color: var(--text2); font-weight: 600; }

.pick-select-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.pick-cancel-btn {
  background: #E53935 !important;
  border-color: #E53935 !important;
  color: #fff !important;
}

.pc-fav {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text3);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.pc-fav.on { color: #e53935; border-color: #fecaca; background: #fff5f5; }

.pc-fav-mark--btn {
  pointer-events: auto;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #E53935 !important;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 5px rgba(229, 57, 53, 0.35);
  z-index: 3;
}

.pc-fav-mark--btn .pc-fav-heart {
  display: block;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.pc-fav-mark--btn:hover {
  background: #fff5f5;
  transform: scale(1.08);
}

.pc-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pc-qty-input {
  width: 48px;
  height: 28px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 0 4px;
  -moz-appearance: textfield;
}

.pc-qty-input::-webkit-outer-spin-button,
.pc-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pc-qty-submit {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: none;
  background: #1565C0 !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}

.pc-qty-submit:hover {
  background: #0D47A1 !important;
  transform: scale(0.93);
}

.page-empty-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.page-empty-wrap .products-grid {
  padding: 16px 20px 24px;
}

.empty-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.empty-page .empty-ic { font-size: 48px; opacity: 0.3; }
.empty-page .empty-title { font-size: 14px; color: var(--text3); margin-top: 12px; }
.empty-page .empty-sub { font-size: 12px; color: var(--text4); margin-top: 4px; }

.hist-list {
  align-items: stretch;
  justify-content: flex-start;
  overflow-y: auto;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.hist-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.hist-item.clickable { cursor: pointer; border-radius: 6px; padding-left: 6px; padding-right: 6px; }
.hist-item.clickable:hover { background: var(--surface2); }

.hist-type { font-weight: 600; color: var(--orange); min-width: 72px; }
.hist-detail { flex: 1; color: var(--text2); }
.hist-time { font-size: 11px; color: var(--text4); }

.tag-warn { background: var(--red-l) !important; color: var(--red) !important; }

.load-more-btn {
  display: block;
  width: calc(100% - 32px);
  max-width: 320px;
  margin: 16px auto 24px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.load-more-btn:hover:not(:disabled) {
  background: var(--surface2);
  border-color: var(--blue);
  color: var(--blue);
}
.load-more-btn:disabled { opacity: .6; cursor: wait; }

.empty-sub { font-size: 12px; color: var(--text4); margin-top: 6px; }

.pc-photo, .pd-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.products-grid:not(.list-view) .pc-photo {
  object-fit: contain;
  object-position: center;
  max-width: 100%;
  max-height: 100%;
}
.pc-img-inner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 48px; overflow: hidden; }
.pc-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.pc-sku {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd-image-wrap { width: 100%; height: 100%; min-height: 168px; display: flex; align-items: center; justify-content: center; font-size: 48px; overflow: hidden; }
.pd-image-wrap .pd-photo { width: 100%; height: 100%; min-height: 168px; object-fit: cover; display: block; border-radius: 0; max-height: none; max-width: none; }

.view-toggle { display: inline-flex; gap: 4px; margin-right: 8px; }
.view-btn {
  width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); cursor: pointer; font-size: 13px; color: var(--text3);
}
.view-btn.on { background: var(--blue-l); border-color: var(--blue); color: var(--blue); }

.products-grid.list-view {
  grid-template-columns: 1fr !important;
  gap: 10px;
}
.products-grid.list-view .product-card {
  flex-direction: row;
  max-height: 96px;
}
.products-grid.list-view .pc-img {
  width: 96px;
  aspect-ratio: 3 / 2;
  height: auto;
  flex-shrink: 0;
}
.products-grid.list-view .pc-body {
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.products-grid.list-view .pc-name {
  min-height: 0;
  max-height: none;
  -webkit-line-clamp: 1;
}

.cart-modal { max-width: 560px; width: calc(100% - 32px); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cart-head h3 { font-size: 16px; margin: 0; }
.cart-body { max-height: 50vh; overflow-y: auto; padding: 4px 0; }
.cart-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.cart-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #e8f1fb 0%, #d9e6f5 100%);
  border: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}
.cart-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cart-thumb-ph {
  font-size: 26px;
  line-height: 1;
  opacity: 0.5;
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}
.cart-thumb.is-empty .cart-thumb-ph {
  display: flex;
}
.cart-row-main { min-width: 0; }
.cart-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  font-size: 12px;
  color: var(--text4);
  margin-top: 4px;
}
.cart-sku { font-variant-numeric: tabular-nums; }
.cart-unit-price { color: var(--text3); }
.cart-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 1px;
}
.cart-row-price {
  font-weight: 700;
  font-size: 15px;
  color: var(--orange);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cart-total {
  padding: 14px 18px;
  text-align: right;
  font-size: 14px;
  color: var(--text3);
}
.cart-total b {
  font-size: 18px;
  color: var(--orange);
  margin-left: 6px;
}
.cart-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border); }
.cart-foot button { padding: 8px 16px; border-radius: 8px; cursor: pointer; }
.cart-foot .sec { background: var(--surface2); border: 1px solid var(--border); }
#cartMask.show { display: flex; }

.page-head { padding: 20px 24px 8px; }
.page-head h2 { font-size: 20px; font-weight: 700; margin: 0; }
.page-sub { font-size: 13px; color: var(--text4); margin-top: 4px; }

.data-dashboard { padding: 16px 24px 32px; max-width: 900px; }
.data-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.data-hint { font-size: 11px; color: var(--text4); font-weight: 400; margin-left: 8px; }
.data-quote-row.clickable { cursor: pointer; transition: background .12s; border-radius: 6px; padding-left: 6px; padding-right: 6px; }
.data-quote-row.clickable:hover { background: var(--surface2); }
.dq-status { font-size: 12px; color: var(--blue); }
.data-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.data-stat.warn .ds-val { color: var(--red); }
.ds-val { font-size: 28px; font-weight: 700; color: var(--blue); }
.ds-lbl { font-size: 12px; color: var(--text4); margin-top: 4px; }
.data-section h3 { font-size: 15px; margin-bottom: 12px; }
.data-quote-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto auto;
  gap: 8px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.dq-amt { font-weight: 600; color: var(--orange); }
.dq-date { color: var(--text4); font-size: 12px; }

.cart-qty { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.cart-qty-val {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cart-qty button {
  width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); cursor: pointer; font-size: 15px; line-height: 1;
  color: var(--text2);
}
.cart-qty button:hover { background: var(--surface); }
.cart-qty .cart-rm {
  width: auto; padding: 0 10px; font-size: 11px; margin-left: 4px;
  color: var(--text4);
}
.cart-qty .cart-rm:hover { color: var(--red); border-color: #fecaca; background: #fff5f5; }
.cart-foot #cartSubmitBtn {
  background: var(--blue); color: #fff; border: none; font-weight: 600;
}
.cart-foot #cartSubmitBtn:disabled { opacity: .5; cursor: not-allowed; }

.cpc-img .pc-photo { width: 100%; height: 100%; min-height: 120px; object-fit: cover; display: block; }

.quote-modal { max-width: 520px; width: calc(100% - 32px); }
.quote-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.quote-head h3 { margin: 0; font-size: 16px; }
.qd-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text4); }
.qd-status-tag { color: var(--blue); font-weight: 600; }
.quote-body { padding: 16px 18px; max-height: 50vh; overflow-y: auto; }
.qd-summary { margin-bottom: 16px; }
.qd-amt-label { font-size: 12px; color: var(--text4); }
.qd-amt-val { font-size: 24px; font-weight: 700; color: var(--orange); }
.qd-remark { font-size: 12px; color: var(--text3); margin-top: 6px; }
.qd-lines-title { font-size: 13px; margin: 12px 0 8px; }
.qd-line { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.qd-line-amt { font-weight: 600; color: var(--orange); }
.quote-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border); }
.quote-foot button { padding: 8px 14px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); background: var(--surface2); }
.quote-foot #qdConvertBtn { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
.order-modal .qd-amt-val { color: var(--green); }
.data-section + .data-section { margin-top: 20px; }
.data-order-row .dq-status { color: var(--green); }
.doc-pipeline {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  padding: 16px; margin-bottom: 20px; background: linear-gradient(90deg, #eef2fb, #f5f8ff);
  border-radius: 12px; border: 1px solid var(--border);
}
.dp-step { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 14px;
  background: var(--surface); border-radius: 10px; cursor: pointer; font-size: 12px; min-width: 72px;
  border: 1px solid var(--border); transition: transform .12s; }
.dp-step:hover { transform: translateY(-2px); border-color: var(--blue); }
.dp-ic { font-size: 20px; }
.dp-arrow { color: var(--text4); font-size: 14px; }

.cart-options { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.cart-opt-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text3); }
.cart-opt-select, .cart-opt-input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.clickable-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.partner-shell {
  display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
  background: var(--bg);
}
.partner-topbar {
  flex-shrink: 0; padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.partner-topbar-head h2 { font-size: 20px; font-weight: 700; margin: 0; }
.partner-topbar-head .page-sub { font-size: 13px; color: var(--text4); margin-top: 4px; }
.partner-topbar-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px;
}
.partner-body {
  flex: 1; min-height: 0; overflow: auto;
  padding: 16px 24px 28px;
}
.partner-search {
  flex: 1; min-width: 200px; max-width: 420px;
  padding: 9px 12px 9px 34px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 13px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3-3'/%3E%3C/svg%3E") no-repeat 11px center;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.partner-search:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-m); }
.partner-count {
  font-size: 12px; color: var(--text4); padding: 6px 10px;
  background: var(--surface2); border-radius: 8px; white-space: nowrap;
}
.partner-list {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--surface);
}
.partner-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) 120px minmax(160px, 1.2fr) 40px;
  gap: 12px; align-items: center;
  padding: 14px 16px; border-top: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.partner-row:first-child { border-top: none; }
.partner-row:not(.partner-row--head):hover { background: var(--surface2); }
.partner-row--head {
  background: var(--surface2); cursor: default;
  font-size: 12px; font-weight: 600; color: var(--text3);
  padding: 10px 16px;
}
.partner-row--supplier:not(.partner-row--head) { border-left: 3px solid #7B1FA2; }
.partner-row--customer:not(.partner-row--head) { border-left: 3px solid #1565C0; }
.partner-cell--main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.partner-avatar {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--surface2);
}
.partner-row--supplier .partner-avatar { background: #F3E5F5; }
.partner-row--customer .partner-avatar { background: #EEF2FB; }
.partner-main-text { min-width: 0; }
.partner-name {
  font-weight: 700; font-size: 14px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.partner-sub {
  font-size: 12px; color: var(--text3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.partner-cell--code {
  font-size: 12px; font-family: ui-monospace, monospace; color: var(--text3);
}
.partner-cell--info {
  font-size: 12px; color: var(--text3); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.partner-cell--action { text-align: right; color: var(--text4); font-size: 18px; }

.customer-modal { max-width: 480px; }
.cu-profile {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.cu-avatar {
  width: 52px; height: 52px; border-radius: 14px; background: #EEF2FB;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.cu-name { font-size: 18px; font-weight: 700; color: var(--text); }
.cu-code-badge {
  display: inline-block; margin-top: 6px; font-size: 11px; font-family: ui-monospace, monospace;
  padding: 3px 8px; border-radius: 6px; background: var(--surface2); color: var(--text3);
}
.cu-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px;
}
.cu-item { display: flex; flex-direction: column; gap: 4px; }
.cu-item--full { grid-column: 1 / -1; }
.cu-label { font-size: 11px; color: var(--text4); font-weight: 600; }
.cu-value { font-size: 14px; color: var(--text); line-height: 1.45; word-break: break-word; }

.account-modal { max-width: 480px; }
.acct-session {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px;
  margin-bottom: 16px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border);
}
.acct-session-item { display: flex; flex-direction: column; gap: 4px; }
.acct-hint { margin: 14px 0 0; font-size: 12px; color: var(--text4); line-height: 1.5; }

.partner-more {
  display: flex; justify-content: center; padding: 16px 0 4px;
}
.partner-more .sec { min-width: 140px; }

@media (max-width: 720px) {
  .partner-topbar { padding: 16px 16px 12px; }
  .partner-body { padding: 12px 16px 24px; }
  .partner-row {
    grid-template-columns: 1fr 40px;
    grid-template-rows: auto auto;
    gap: 6px 10px;
  }
  .partner-row--head { display: none; }
  .partner-cell--code, .partner-cell--info { grid-column: 1; font-size: 11px; }
  .partner-cell--action { grid-row: 1 / span 2; align-self: center; }
  .cu-grid { grid-template-columns: 1fr; }
}

.sys-panel { background: var(--surface2); border-radius: 10px; padding: 12px 14px; }
.sys-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.sys-row:last-of-type { border-bottom: none; }
.sys-ok { color: var(--green); font-weight: 600; }
.sys-warn { color: var(--red); }
.sys-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sys-actions button { padding: 8px 12px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); font-size: 12px; }

.od-related { margin-top: 16px; }
.od-rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.od-rel-item { background: var(--surface2); border-radius: 8px; padding: 10px; text-align: center; font-size: 12px; }
.od-rel-item strong { display: block; font-size: 18px; margin-top: 4px; color: var(--blue); }
.od-maker-wrap { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.od-maker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.od-maker-select { flex: 1; min-width: 160px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; }
.od-maker-row button { padding: 8px 14px; border-radius: 8px; background: var(--blue); color: #fff; border: none; cursor: pointer; font-weight: 600; }
.od-maker-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.od-maker-link { font-size: 12px !important; padding: 4px 10px !important; }
.data-maker-row .dq-status { color: #7b1fa2; }
.maker-modal .qd-amt-val { color: #7b1fa2; }

.inventory-wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 24px; }
.inv-source-bar {
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  border-bottom: 1px solid var(--border);
}
.inv-source-bar .search-source-btn.inv-src-local.on {
  background: #fff5f5;
  border-color: #e53935;
  color: #c62828;
}
.inv-source-bar .search-source-btn.inv-src-warehouse.on {
  background: #fff8e7;
  border-color: #f5a623;
  color: #c47d00;
}
.inv-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.inv-search { flex: 1; min-width: 140px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.inv-toolbar .sec.on { background: var(--orange-l); border-color: var(--orange); color: var(--orange-dark); }
.inv-meta { font-size: 12px; color: var(--text4); margin-left: auto; }
.inv-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.inv-head, .inv-row {
  display: grid;
  grid-template-columns: 72px minmax(88px, 1fr) minmax(120px, 1.4fr) 0.55fr 0.55fr 0.65fr minmax(80px, 1fr) auto;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  align-items: center;
}
.inv-head { background: var(--surface2); font-weight: 600; font-size: 12px; color: var(--text3); }
.inv-row { border-top: 1px solid var(--border); min-height: 88px; }
.inv-row.inv-low { background: #fff8f0; }
.inv-row.inv-low .inv-qty { color: var(--red); font-weight: 700; }
.inv-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #EEF2FB, #F5F8FF);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.inv-thumb-inner,
.inv-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  font-size: 28px;
}
.inv-thumb-inner img,
.inv-thumb .pc-photo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}
.inv-sku, .inv-name, .inv-remark {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-name { font-weight: 600; color: var(--text); }
.inv-price { font-weight: 600; color: var(--orange); white-space: nowrap; }
.inv-link { font-size: 12px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap; }
.inv-link:hover { border-color: var(--blue); color: var(--blue); }

@media (max-width: 900px) {
  .inv-head, .inv-row {
    grid-template-columns: 72px 1fr 0.6fr 0.6fr auto;
    grid-template-areas:
      "thumb sku sku action"
      "thumb name name action"
      "thumb unit qty action"
      "thumb price remark action";
  }
  .inv-head { display: none; }
  .inv-row > :nth-child(1) { grid-area: thumb; }
  .inv-row > :nth-child(2) { grid-area: sku; }
  .inv-row > :nth-child(3) { grid-area: name; }
  .inv-row > :nth-child(4) { grid-area: unit; }
  .inv-row > :nth-child(5) { grid-area: qty; }
  .inv-row > :nth-child(6) { grid-area: price; }
  .inv-row > :nth-child(7) { grid-area: remark; }
  .inv-row > :nth-child(8) { grid-area: action; }
}

@media (max-width: 720px) {
  .data-stats { grid-template-columns: repeat(2, 1fr); }
  .data-quote-row { grid-template-columns: 1fr 1fr; }
}

/* 登录页样式见 estar-os.html 内联 .ls-* */

.ls-status.err { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }

.sec {
  background: var(--surface);
  color: var(--text2);
  border: 1.5px solid var(--border);
  padding: 8px 14px;
  font-size: 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.w094-edge-catch { display: none; }

@media (max-width: 820px) {
  /* 手机：壳高跟随 visualViewport，键盘弹出时输入区贴在键盘上方 */
  html, body {
    position: fixed;
    width: 100%;
    left: 0;
    top: var(--vv-top, 0px);
    height: var(--vv-h, 100%);
    overflow: hidden;
  }
  /* KA-WECOM-SIDEBAR：主屏钉死，永不跟侧栏位移 */
  html, body, #mainApp {
    transform: none !important;
    translate: none !important;
    left: 0 !important;
    margin-left: 0 !important;
    padding-left: 0;
    padding-right: 0;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }
  /* 手机：侧栏默认藏在屏外，需要时当抽屉打开；主区全宽 */
  #mainApp {
    --sidebar-w: 0px;
    height: 100%;
    max-height: 100%;
  }
  .sidebar {
    position: fixed;
    top: var(--vv-top, 0px);
    left: 0 !important;
    right: auto !important;
    bottom: auto;
    height: var(--vv-h, 100%);
    z-index: 240;
    width: min(78vw, 280px);
    --sidebar-w: min(78vw, 280px);
    margin: 0;
    padding: 10px 8px;
    padding-left: calc(8px + env(safe-area-inset-left, 0px));
    border-right: 1px solid var(--sidebar-border);
    opacity: 1;
    transform: translate3d(-105%, 0, 0);
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.18s ease;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  .sidebar.sidebar--collapsed,
  .sidebar.sidebar--expanded {
    width: min(78vw, 280px);
    padding: 10px 8px;
    padding-left: calc(8px + env(safe-area-inset-left, 0px));
    opacity: 1;
    border-right: 1px solid var(--sidebar-border);
  }
  body.sidebar-mobile-open .sidebar {
    transform: translate3d(0, 0, 0) !important;
    left: 0 !important;
    pointer-events: auto;
    visibility: visible;
  }
  body:not(.sidebar-mobile-open) .sidebar {
    transform: translate3d(-105%, 0, 0) !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
  /* KA.E9：开栏后隐藏 ☰ */
  body.sidebar-mobile-open .sidebar-expand-fab {
    display: none !important;
    pointer-events: none;
  }
  /* KA.E8：企微里不自建退出 */
  html.estar-wecom .sidebar-exit {
    display: none !important;
  }
  /* KA.E10：左缘 catch 开栏后仍可点、z 高于侧栏 */
  .w094-edge-catch {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 36px;
    z-index: 250;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    background: transparent;
    pointer-events: auto;
  }
  .sidebar-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 230;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.46);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  body.sidebar-mobile-open .sidebar-scrim {
    display: block;
  }
  .sidebar-expand-fab:not([hidden]) {
    left: max(8px, env(safe-area-inset-left));
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 18px;
    border-left: 1px solid var(--sidebar-border);
  }
}

html.estar-mobile-nav .w094-edge-catch {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 36px;
  z-index: 250;
  touch-action: none;
  pointer-events: auto;
  background: transparent;
}

/* 快捷键帮助 */
.shortcut-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15,23,42,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.shortcut-mask.show { display: flex; }

.shortcut-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  padding: 20px 22px;
}

.shortcut-panel h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.shortcut-panel p {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text3);
}

.shortcut-list {
  display: grid;
  gap: 6px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text2);
}

.shortcut-row kbd {
  display: inline-block;
  min-width: 52px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 11px;
  font-family: inherit;
  text-align: center;
  color: var(--text);
}

.shortcut-panel .sec {
  margin-top: 14px;
  width: 100%;
}

/* ── 经营驾驶舱 ─────────────────────────────────────── */
.cockpit-page.active {
  overflow: hidden;
  background: #060d18;
  display: flex;
  flex-direction: column;
}

.cockpit-dashboard {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, #0d2847 0%, #060d18 55%, #040810 100%);
}

.ck-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  color: #7eb8ff;
  gap: 16px;
}

.ck-loading-radar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(64, 196, 255, 0.25);
  position: relative;
  animation: ckRadarSpin 2.4s linear infinite;
}

.ck-loading-radar::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(64, 196, 255, 0.55) 60deg, transparent 120deg);
}

@keyframes ckRadarSpin { to { transform: rotate(360deg); } }

.ck-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
  color: #c8dff7;
  font-size: 13px;
}

.ck-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(64, 196, 255, 0.15);
  flex-shrink: 0;
}

.ck-header-l { display: flex; align-items: center; gap: 14px; }

.ck-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 0 24px rgba(21, 101, 192, 0.45);
}

.ck-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #e8f4ff;
  text-shadow: 0 0 20px rgba(64, 196, 255, 0.35);
}

.ck-sub { margin: 4px 0 0; font-size: 12px; color: #6a9cc4; }

.ck-header-r { display: flex; align-items: center; gap: 16px; }

.ck-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ff6b6b;
}

.ck-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4444;
  box-shadow: 0 0 8px #ff4444;
  animation: ckPulse 1.2s ease-in-out infinite;
}

@keyframes ckPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.ck-clock {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 13px;
  color: #40c4ff;
  padding: 6px 12px;
  border: 1px solid rgba(64, 196, 255, 0.25);
  border-radius: 8px;
  background: rgba(0, 20, 40, 0.5);
}

.ck-body {
  flex: 1;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 252px;
  gap: 12px;
  min-height: 0;
  margin-bottom: 10px;
}

.ck-kpi-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
}

.ck-kpi {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(64, 196, 255, 0.18);
  background: rgba(8, 28, 52, 0.75);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  color: inherit;
}

.ck-kpi:hover {
  border-color: rgba(64, 196, 255, 0.45);
  box-shadow: 0 0 16px rgba(64, 196, 255, 0.12);
  transform: translateX(2px);
}

/* 看板：新增只靠红 pill；KPI/流水线数字一律浅蓝（禁橘黄 warn） */
.ck-kpi { position: relative; }
.ck-kpi .ck-kpi-val { color: #40c4ff !important; }
.ck-kpi-warn,
.ck-kpi.ck-kpi-warn {
  border-color: rgba(64, 196, 255, 0.18) !important;
  box-shadow: none;
}
.ck-pipe-step { position: relative; }
.ck-pipe-step.ck-pipe-warn {
  border-color: rgba(64, 196, 255, 0.18) !important;
}
.ck-pipe-step.ck-pipe-warn .ck-pipe-val {
  color: #40c4ff !important;
}
.ck-new-pill {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 18px;
  padding: 0 5px;
  height: 16px;
  line-height: 16px;
  border-radius: 999px;
  background: #E53935;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  z-index: 2;
}
.ck-node .ck-new-pill {
  top: -6px;
  right: -6px;
}
.ck-new-pill--sm {
  top: 2px;
  right: 2px;
  height: 14px;
  line-height: 14px;
  font-size: 8px;
  min-width: 14px;
  padding: 0 3px;
}
/* S07：KPI 边栏永久无光标（仅 Tab 逻辑位）；地图节点仍可 kb-focus */
.ck-kpi-col.kb-zone {
  outline: none !important;
  box-shadow: none !important;
}
.ck-kpi.kb-focus,
.ck-kpi:focus,
.ck-kpi:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.ck-kpi-val { font-size: 22px; font-weight: 800; color: #40c4ff !important; line-height: 1.1; }
.ck-kpi-lbl { font-size: 11px; color: #8ab4d9; margin-top: 3px; }
.ck-kpi-sub { font-size: 10px; color: #5a8ab0; margin-top: 2px; }

.ck-map-col {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 14px;
  /* L1 方格轮廓：蓝（原黄边取消） */
  border: 1.5px solid rgba(66, 165, 245, 0.55);
  box-shadow: inset 0 0 0 1px rgba(64, 196, 255, 0.14), 0 0 28px rgba(66, 165, 245, 0.12);
  background: rgba(4, 16, 32, 0.9);
  overflow: hidden;
}
.ck-map-col.kb-zone {
  /* 永久：禁地图区长外框与节点光标叠双框；保留列默认蓝边 */
  outline: none !important;
}

.ck-inline-backdrop {
  position: absolute;
  inset: 0;
  z-index: 5;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: default;
}
.ck-inline-backdrop[hidden] {
  display: none !important;
}

.ck-inline-sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 72px;
  z-index: 6;
  max-height: min(380px, 48vh);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid rgba(64, 196, 255, 0.35);
  background: rgba(6, 22, 42, 0.96);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.ck-inline-sheet[hidden] {
  display: none !important;
}

.ck-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #40c4ff;
  border-bottom: 1px solid rgba(64, 196, 255, 0.15);
  flex-shrink: 0;
}

.ck-inline-close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #8ab4d9;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
}

.ck-inline-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.ck-inline-body {
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
}

/* S07 样品速览：缩略图网格（取代货号文案列表） */
.ck-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
}
.ck-thumb-card {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(64, 196, 255, 0.28);
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: block;
  width: 100%;
  color: inherit;
}
.ck-thumb-card:hover {
  border-color: rgba(64, 196, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(64, 196, 255, 0.25);
}
.ck-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ck-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  background: rgba(15, 23, 42, 0.5);
}

.cockpit-dashboard.page-empty-wrap {
  overflow: hidden;
}

.ck-map-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 420px;
  padding-bottom: 24px;
  box-sizing: border-box;
}

.ck-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(64, 196, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 196, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.ck-radar {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(420px, 72%);
  height: min(420px, 72%);
  margin: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(64, 196, 255, 0.1) 40deg, transparent 80deg);
  animation: ckRadarSpin 4s linear infinite;
  pointer-events: none;
}

.ck-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ck-link {
  stroke: rgba(64, 196, 255, 0.25);
  stroke-width: 0.4;
  stroke-dasharray: 2 2;
  animation: ckLinkFlow 3s linear infinite;
}

@keyframes ckLinkFlow { to { stroke-dashoffset: -8; } }

.ck-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  min-width: 72px;
  border-radius: 12px;
  border: 1px solid rgba(64, 196, 255, 0.35);
  background: rgba(8, 32, 58, 0.9);
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  color: #c8dff7;
  z-index: 2;
}

.ck-node:hover, .ck-node-active {
  border-color: #40c4ff;
  box-shadow: 0 0 20px rgba(64, 196, 255, 0.35);
  transform: translate(-50%, -50%) scale(1.05);
}
.ck-node.kb-focus {
  outline: 2px solid #42a5f5;
  outline-offset: 3px;
  /* 单框：禁再改 border + 外圈 shadow */
  z-index: 4;
}

.ck-node-lg {
  min-width: 88px;
  padding: 12px 14px;
  border-color: rgba(255, 200, 80, 0.5);
  background: rgba(32, 24, 8, 0.85);
}

.ck-node-pulse { animation: ckNodeGlow 2.8s ease-in-out infinite; }

@keyframes ckNodeGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 200, 80, 0.2); }
  50% { box-shadow: 0 0 24px rgba(255, 200, 80, 0.45); }
}

.ck-node-warn { border-color: rgba(64, 196, 255, 0.22); }

.ck-node-ic { font-size: 20px; line-height: 1; }
.ck-node-lg .ck-node-ic { font-size: 26px; }
.ck-node-lbl { font-size: 10px; color: #8ab4d9; white-space: nowrap; }
.ck-node-val {
  font-size: 14px;
  font-weight: 800;
  color: #40c4ff;
  font-family: 'SF Mono', 'Menlo', monospace;
}

.ck-map-caption {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: #4a7a9a;
  pointer-events: none;
}

.ck-feed-col {
  display: none;
}

.ck-right-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.ck-right-col .ck-queue-fold:has(.ck-queue-fold-body:not([hidden])) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ck-right-col .ck-queue-fold-body:not([hidden]) {
  flex: 1;
  min-height: 88px;
  max-height: min(420px, 46vh);
  overflow-y: auto;
  padding: 6px 8px 8px;
}

[data-panel="feed"] .ck-feed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 100px;
}

.ck-kpi.ck-kpi-active {
  border-color: rgba(64, 196, 255, 0.55);
  box-shadow: 0 0 18px rgba(64, 196, 255, 0.18);
}

.ck-feed-section {
  flex: 1;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid rgba(64, 196, 255, 0.18);
  background: rgba(8, 28, 52, 0.75);
  overflow: hidden;
}

.ck-feed-section .ck-queue-fold-head {
  border-bottom: 1px solid rgba(64, 196, 255, 0.12);
}

.ck-feed-head {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #40c4ff;
  border-bottom: 1px solid rgba(64, 196, 255, 0.12);
  flex-shrink: 0;
}

.ck-feed-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.ck-feed-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid #40c4ff;
  background: rgba(0, 16, 32, 0.6);
  font-size: 11px;
  animation: ckFeedIn 0.35s ease-out;
}

.ck-feed-item.clickable { cursor: pointer; }
.ck-feed-item.clickable:hover { background: rgba(64, 196, 255, 0.1); }

.ck-feed-item.ck-ok { border-left-color: #4caf50; }
.ck-feed-item.ck-warn { border-left-color: #ffb74d; }
.ck-feed-item.ck-alert { border-left-color: #ff7043; }

@keyframes ckFeedIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.ck-feed-time { font-size: 10px; color: #5a8ab0; font-family: monospace; }
.ck-feed-text { color: #b8d4f0; line-height: 1.4; }

.ck-pipeline {
  flex-shrink: 0;
  margin: 0;
  border-top: 1px solid rgba(64, 196, 255, 0.12);
  border-radius: 0;
  background: rgba(0, 10, 24, 0.55);
  padding: 8px 12px 10px;
}

.ck-pipeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #8ab4d9;
  margin-bottom: 10px;
}

.ck-pipeline-head span {
  font-size: 10px;
  font-weight: 500;
  color: #5a8ab0;
  font-family: monospace;
}

.ck-pipeline-track {
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ck-pipe-step {
  flex: 1;
  min-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid rgba(64, 196, 255, 0.12);
  background: rgba(0, 16, 32, 0.55);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ck-pipe-step:hover {
  border-color: rgba(64, 196, 255, 0.35);
  background: rgba(64, 196, 255, 0.08);
}

.ck-pipe-step.ck-pipe-warn {
  border-color: rgba(64, 196, 255, 0.18);
}

.ck-pipe-step.ck-pipe-warn .ck-pipe-val {
  color: #40c4ff;
}

.ck-pipe-ic { font-size: 16px; line-height: 1; }
.ck-pipe-val { font-size: 18px; font-weight: 800; color: #40c4ff; line-height: 1.1; }
.ck-pipe-lbl { font-size: 10px; color: #8ab4d9; white-space: nowrap; }

.ck-pipe-arrow {
  align-self: center;
  color: #3a6a90;
  font-size: 14px;
  flex-shrink: 0;
  padding: 0 2px;
}

.nav-todo-badge,
.nav-fav-badge,
.nav-cart-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #E53935;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  z-index: 2;
  box-sizing: border-box;
}

/* 收藏角标：与看板同款红圈数字；新增时轻微脉冲 */
.nav-fav-badge.is-new,
.nav-todo-badge.is-new,
.nav-cart-badge.is-new {
  animation: nav-fav-pulse 1.1s ease-in-out infinite;
}

@keyframes nav-fav-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.nav-fav-badge.nav-fav-bump {
  animation: nav-fav-bump 0.45s ease-out;
}

@keyframes nav-fav-bump {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* 收藏侧栏勿显示快捷键「8」伪元素，避免当成数量 */
.sidebar .nav[data-page="favorites"]::after {
  display: none !important;
}

/* 检索侧栏勿显示快捷键「3」：与「选品库」新增红标同源，避免 3 vs 0 误读 */
.sidebar .nav[data-page="search"]::after {
  display: none !important;
}

.sidebar-nav .nav { position: relative; }

.ck-queues-fold {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ck-queue-fold {
  border-radius: 10px;
  border: 1px solid rgba(64, 196, 255, 0.15);
  background: rgba(8, 28, 52, 0.65);
  overflow: hidden;
}

.ck-queue-fold-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: #8ab4d9;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.ck-queue-fold-head:hover {
  background: rgba(64, 196, 255, 0.06);
  color: #b8d4f0;
}

.ck-queue-fold-head.open {
  color: #40c4ff;
  border-bottom: 1px solid rgba(64, 196, 255, 0.1);
}

.ck-queue-fold-title { flex: 1; }

.ck-queue-fold-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
  font-size: 11px;
  color: #40c4ff;
}

.ck-queue-chevron {
  display: inline-block;
  font-size: 14px;
  color: #5a8ab0;
  transition: transform 0.15s;
}

.ck-queue-fold-head.open .ck-queue-chevron {
  transform: rotate(90deg);
  color: #40c4ff;
}

.ck-queue-fold-body {
  padding: 6px 8px 8px;
  max-height: 180px;
  overflow-y: auto;
}

.ck-queues {
  display: none;
}

.ck-queue {
  border-radius: 12px;
  border: 1px solid rgba(64, 196, 255, 0.15);
  background: rgba(8, 28, 52, 0.65);
  padding: 10px 12px;
  min-height: 120px;
}

.ck-queue-head {
  font-size: 12px;
  font-weight: 700;
  color: #8ab4d9;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.ck-queue-head span {
  color: #40c4ff;
  font-family: monospace;
}

.ck-queue-empty { font-size: 11px; color: #5a8ab0; margin: 8px 0 0; }

.ck-queue-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(64, 196, 255, 0.08);
  font-size: 11px;
  align-items: center;
}

.ck-queue-row.clickable { cursor: pointer; border-radius: 6px; }
.ck-queue-row.clickable:hover { background: rgba(64, 196, 255, 0.08); }

.ck-q-id { color: #40c4ff; font-family: monospace; }
.ck-q-meta { color: #7a9cb8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-q-amt { color: #ffb74d; font-weight: 600; }

.ck-sys {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(64, 196, 255, 0.12);
  background: rgba(4, 16, 32, 0.6);
  font-size: 11px;
  color: #6a9cc4;
}

.ck-sys-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 10px;
}

.ck-env-local { background: rgba(76, 175, 80, 0.2); color: #81c784; }
.ck-env-prod { background: rgba(255, 152, 0, 0.2); color: #ffb74d; }

.ck-ok { color: #81c784; font-weight: 600; }
.ck-warn { color: #ff8a65; font-weight: 600; }

.ck-sys-btn {
  margin-left: auto;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(64, 196, 255, 0.3);
  background: rgba(64, 196, 255, 0.08);
  color: #40c4ff;
  font-size: 11px;
  cursor: pointer;
}

.ck-sys-btn:hover { background: rgba(64, 196, 255, 0.18); }

/* ── 接口看板 ── */
.ck-probe-mask {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(2, 8, 18, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.ck-probe-sub code.ck-probe-rid,
.ck-probe-rid {
  font-size: 11px;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.ck-probe-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
}

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

.ck-probe-title {
  font-size: 18px;
  font-weight: 800;
  color: #40c4ff;
  margin: 0;
}

.ck-probe-sub {
  font-size: 11px;
  color: #6a9cc4;
  margin: 4px 0 0;
}

.ck-probe-head-r {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ck-probe-summary {
  font-size: 11px;
  font-weight: 700;
  color: #81c784;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(129, 199, 132, 0.12);
}

.ck-probe-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #c8dff7;
  cursor: pointer;
  font-size: 14px;
}

.ck-probe-warn {
  font-size: 11px;
  color: #ff8a65;
  margin: 0 0 12px;
}

.ck-probe-section {
  margin-bottom: 14px;
}

.ck-probe-section h3 {
  font-size: 11px;
  font-weight: 700;
  color: #6a9cc4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}

.ck-probe-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: rgba(8, 28, 52, 0.55);
  border-left: 3px solid transparent;
}

.ck-probe-row.ck-probe-ok { border-left-color: #81c784; }
.ck-probe-row.ck-probe-fail { border-left-color: #ff8a65; }

.ck-probe-label {
  font-size: 12px;
  font-weight: 600;
  display: block;
}

.ck-probe-path {
  font-size: 10px;
  color: #6a9cc4;
  font-family: ui-monospace, monospace;
}

.ck-probe-meta {
  font-size: 10px;
  color: #8fb8d9;
  white-space: nowrap;
}

.ck-probe-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(64, 196, 255, 0.12);
  font-size: 10px;
  color: #6a9cc4;
}

@media (max-width: 1100px) {
  .ck-body { grid-template-columns: 1fr; }
  .ck-kpi-col { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .ck-kpi { flex: 1; min-width: 120px; }
  .ck-map-wrap { min-height: 300px; }
  .ck-right-col { max-height: 280px; }
  .ck-queues-fold { flex-direction: row; flex-wrap: wrap; }
  .ck-queue-fold { flex: 1; min-width: 140px; }
}

