/* ============================================================================
   lulu Seller Central — Production Product Publishing Workbench Styles
   Enterprise 3-Column Merchant Workbench (Left Assistant · Center Form · Right Live Preview)
   ============================================================================ */

/* Expand seller container cleanly when publisher workbench is active */
.seller-container.is-publisher-mode {
  max-width: 1560px;
  padding: 0 16px 96px 16px;
  margin-top: 12px;
}

/* Top Workbench Command & Category Status Bar */
.pub-top-bar {
  background: #ffffff;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.pub-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pub-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  background: #002f36;
  padding: 5px 12px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

.pub-mode-badge.is-edit {
  background: #1d4ed8;
}

.pub-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  padding: 4px 10px;
  border-radius: 99px;
}

.pub-status-chip.is-dirty {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.pub-cat-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  border-radius: 6px;
  flex-wrap: wrap;
}

.pub-cat-banner strong {
  color: #0f172a;
}

.pub-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.pub-btn:hover {
  border-color: #008296;
  color: #008296;
  background: #f0fdfa;
}

.pub-btn-primary {
  background: #002f36;
  border-color: #002f36;
  color: #ffffff;
}
.pub-btn-primary:hover {
  background: #004752;
  border-color: #004752;
  color: #ffffff;
}

.pub-btn-cta {
  background: #ffd814;
  border-color: #eab308;
  color: #0f172a;
  font-weight: 700;
}
.pub-btn-cta:hover {
  background: #facc15;
  border-color: #ca8a04;
  color: #0f172a;
}

.pub-btn-teal {
  background: #008296;
  border-color: #008296;
  color: #ffffff;
}
.pub-btn-teal:hover {
  background: #006d7d;
  border-color: #006d7d;
  color: #ffffff;
}

.pub-btn-danger {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff;
}
.pub-btn-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
}

.pub-btn-sm {
  padding: 4px 9px;
  font-size: 12px;
}

.pub-btn-xs {
  padding: 2px 7px;
  font-size: 11px;
}

.pub-dot-badge {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  display: inline-block;
}

.pub-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
}

/* ============================================================================
   3-Column Main Workbench Grid
   ============================================================================ */
.pub-workbench-grid {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

.pub-workbench-grid.preview-collapsed {
  grid-template-columns: 246px minmax(0, 1fr);
}

.pub-workbench-grid.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.pub-workbench-grid.sidebar-collapsed.preview-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

/* ============================================================================
   LEFT ASSISTANT SIDEBAR (Optimization Score + Contextual Rules)
   ============================================================================ */
.pub-left-rail {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: 2px;
}

.pub-rail-card {
  background: #ffffff;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.pub-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  user-select: none;
}

.pub-rail-body {
  padding: 12px;
}

/* Quality Score Meter */
.pub-score-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.pub-score-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
  border: 4px solid #e2e8f0;
}

.pub-score-ring.score-high {
  border-color: #16a34a;
  color: #15803d;
  background: #f0fdf4;
}
.pub-score-ring.score-mid {
  border-color: #f59e0b;
  color: #b45309;
  background: #fffbeb;
}
.pub-score-ring.score-low {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fef2f2;
}

.pub-score-ring small {
  font-size: 9px;
  font-weight: 600;
  margin-top: 2px;
}

.pub-score-bar-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.pub-score-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.25s ease;
}

.pub-opt-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}

.pub-opt-item {
  padding: 8px 9px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.14s ease;
  font-size: 12px;
}

.pub-opt-item:hover {
  border-color: #008296;
  background: #f0fdfa;
}

.pub-opt-item.is-required {
  border-color: #fecaca;
  background: #fef2f2;
}

.pub-opt-item.is-required:hover {
  border-color: #ef4444;
}

.pub-opt-title {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.pub-opt-impact {
  margin-top: 3px;
  font-size: 11px;
  color: #0369a1;
  font-weight: 600;
}

.pub-opt-item.is-required .pub-opt-impact {
  color: #dc2626;
}

.pub-rule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

.pub-rule-list li {
  position: relative;
  padding-left: 14px;
}

.pub-rule-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #008296;
}

/* ============================================================================
   CENTER MAIN COLUMN (Sticky Section Anchor Bar + 8 Form Cards)
   ============================================================================ */
.pub-center-col {
  min-width: 0;
}

.pub-anchor-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.pub-anchor-tab {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.14s ease;
}

.pub-anchor-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.pub-anchor-tab.active {
  background: #002f36;
  color: #ffffff;
}

.pub-tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pub-tab-dot.ok { background: #16a34a; }
.pub-tab-dot.warn { background: #f59e0b; }
.pub-tab-dot.err { background: #ef4444; }

/* Section Cards */
.pub-card {
  background: #ffffff;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  scroll-margin-top: 64px;
}

.pub-card.is-highlighted {
  border-color: #008296;
  box-shadow: 0 0 0 3px rgba(0, 130, 150, 0.18);
}

.pub-card-header {
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.pub-card-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #002f36;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pub-card-sub {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.pub-card-body {
  padding: 18px;
}

/* Form Grids & Field Ergonomics */
.pub-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

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

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

.pub-span-2 {
  grid-column: span 2;
}

.pub-span-all {
  grid-column: 1 / -1;
}

.pub-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pub-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-label-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pub-req {
  color: #dc2626;
  font-weight: 800;
}

.pub-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  cursor: help;
}

.pub-counter {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}
.pub-counter.is-good { color: #15803d; }
.pub-counter.is-warn { color: #d97706; }
.pub-counter.is-over { color: #dc2626; }

.pub-input,
.pub-select,
.pub-textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.pub-input:focus,
.pub-select:focus,
.pub-textarea:focus {
  border-color: #008296;
  box-shadow: 0 0 0 3px rgba(0, 130, 150, 0.14);
}

.pub-input:disabled,
.pub-select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.pub-field.has-error .pub-input,
.pub-field.has-error .pub-select,
.pub-field.has-error .pub-textarea {
  border-color: #ef4444;
  background: #fff5f5;
}

.pub-field-error {
  font-size: 11.5px;
  color: #dc2626;
  font-weight: 600;
}

.pub-field-hint {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
}

/* Composite Input (Prefix/Suffix) */
.pub-input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.pub-input-addon {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pub-input-addon.left {
  border-right: none;
  border-radius: 6px 0 0 6px;
}

.pub-input-addon.right {
  border-left: none;
  border-radius: 0 6px 6px 0;
}

.pub-input-group .pub-input.has-left {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.pub-input-group .pub-input.has-right {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* Info Alert Strips */
.pub-alert-info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0c4a6e;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pub-alert-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12px;
}

/* Segmented Tabs / Mode Switchers */
.pub-seg-group {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.pub-seg-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.14s;
}

.pub-seg-btn.active {
  background: #ffffff;
  color: #002f36;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

/* Marketplace Check Pills & Certification Checkboxes */
.pub-check-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
  transition: all 0.14s;
}

.pub-check-pill.is-checked {
  border-color: #008296;
  background: #f0fdfa;
  color: #002f36;
}

/* ============================================================================
   MEDIA GALLERY & VIDEO UPLOADER (Drag-and-Drop Reorder + Spec Badges)
   ============================================================================ */
.pub-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.pub-media-tile {
  position: relative;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: grab;
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}

.pub-media-tile:active {
  cursor: grabbing;
}

.pub-media-tile.is-main {
  border: 2px solid #008296;
  box-shadow: 0 0 0 2px rgba(0, 130, 150, 0.14);
}

.pub-media-tile.drag-over {
  border: 2px dashed #2563eb;
  transform: scale(1.03);
}

.pub-media-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  overflow: hidden;
}

.pub-media-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pub-media-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: rgba(0, 47, 54, 0.88);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.pub-media-badge.main {
  background: #008296;
}

.pub-media-dim {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}
.pub-media-dim.low-res {
  background: rgba(180, 83, 9, 0.9);
}

.pub-media-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: none;
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-media-foot {
  padding: 5px 6px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 10.5px;
}

.pub-media-upload-tile {
  aspect-ratio: 1 / 1;
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: #475569;
  text-align: center;
  padding: 10px;
  transition: all 0.14s;
}

.pub-media-upload-tile:hover {
  border-color: #008296;
  background: #f0fdfa;
  color: #002f36;
}

/* Video Box */
.pub-video-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 14px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-top: 14px;
}

.pub-video-slot {
  height: 118px;
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.pub-video-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================================
   VARIANT ATTRIBUTE BUILDER & HIGH-DENSITY SKU MATRIX TABLE
   ============================================================================ */
.pub-var-group {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.pub-var-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-var-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pub-var-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  width: 245px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.pub-var-card-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pub-color-swatch-input {
  width: 30px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
  background: #ffffff;
}

/* Batch Toolbar (JD Jingmai Style) */
.pub-batch-bar {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-batch-bar .pub-input,
.pub-batch-bar .pub-select {
  padding: 5px 8px;
  font-size: 12px;
  width: auto;
}

/* Quick Column Jump Bar */
.pub-col-jump-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: #64748b;
}

.pub-col-jump-pill {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}
.pub-col-jump-pill:hover {
  border-color: #008296;
  color: #008296;
  background: #f0fdfa;
}

/* High-Density SKU Matrix Table with Frozen Left Column */
.pub-sku-scroll {
  overflow-x: auto;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #ffffff;
  max-height: 460px;
}

.pub-sku-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.pub-sku-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 9px 10px;
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
  text-align: left;
}

.pub-sku-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  vertical-align: middle;
  background: #ffffff;
}

.pub-sku-table tr.is-disabled td {
  background: #f8fafc;
  opacity: 0.65;
}

.pub-sku-table th.sticky-col,
.pub-sku-table td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 170px;
  max-width: 210px;
  box-shadow: 2px 0 6px rgba(15, 23, 42, 0.06);
}

.pub-sku-table thead th.sticky-col {
  z-index: 5;
  background: #e2e8f0;
}

.pub-sku-cell-input {
  width: 100%;
  min-width: 78px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 12px;
  font-family: inherit;
}

.pub-sku-cell-input:focus {
  border-color: #008296;
  outline: none;
}

.pub-sku-img-btn {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  border: 1px dashed #94a3b8;
  background: #f8fafc;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.pub-sku-img-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub-sku-warn {
  font-size: 10.5px;
  color: #d97706;
  margin-top: 2px;
  white-space: nowrap;
}

.pub-margin-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.pub-margin-badge.good { background: #dcfce7; color: #166534; }
.pub-margin-badge.mid { background: #fef3c7; color: #92400e; }
.pub-margin-badge.bad { background: #fee2e2; color: #991b1b; }

/* Modern Toggle Switch */
.pub-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.pub-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.pub-switch-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 99px;
  cursor: pointer;
  transition: 0.18s;
}
.pub-switch-slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.18s;
}
.pub-switch input:checked + .pub-switch-slider {
  background: #008296;
}
.pub-switch input:checked + .pub-switch-slider::before {
  transform: translateX(16px);
}

/* Fullscreen Matrix Overlay */
.pub-matrix-fullscreen {
  position: fixed !important;
  inset: 18px !important;
  z-index: 2200 !important;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pub-matrix-fullscreen .pub-sku-scroll {
  flex: 1;
  max-height: none;
}

/* ============================================================================
   SPLIT-PANE DETAIL FLOOR EDITOR (JD Jingmai Style)
   ============================================================================ */
.pub-detail-split {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pub-detail-phone {
  border: 2px solid #1e293b;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.pub-detail-phone-bar {
  background: #0f172a;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pub-detail-phone-body {
  height: 440px;
  overflow-y: auto;
  background: #f8fafc;
}

.pub-detail-phone-body img {
  display: block;
  width: 100%;
  height: auto;
}

.pub-detail-phone-text {
  padding: 10px 12px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  line-height: 1.5;
  color: #1e293b;
}

.pub-detail-phone-text.style-highlight {
  background: #f0fdfa;
  border-left: 3px solid #008296;
}

.pub-detail-phone-text.style-notice {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
}

.pub-floors-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 4px;
}

.pub-floor-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  cursor: grab;
  transition: border-color 0.14s, background 0.14s;
}

.pub-floor-card.drag-over {
  border: 2px dashed #2563eb;
  background: #eff6ff;
}

.pub-floor-num {
  min-width: 30px;
  height: 24px;
  border-radius: 5px;
  background: #002f36;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pub-floor-thumb {
  width: 68px;
  height: 52px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  flex-shrink: 0;
  cursor: zoom-in;
}

.pub-floor-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================================
   LOGISTICS FULFILLMENT CARDS & LIVE PROFITABILITY CALCULATOR
   ============================================================================ */
.pub-fulfill-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.pub-fulfill-card {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.14s;
}

.pub-fulfill-card.active {
  border-color: #008296;
  background: #f0fdfa;
}

.pub-profit-panel {
  margin-top: 16px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #f0f9ff 100%);
  padding: 14px 16px;
}

.pub-profit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.pub-profit-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
}

.pub-profit-cell .lbl {
  font-size: 11px;
  color: #64748b;
}

.pub-profit-cell .val {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2px;
}

.pub-profit-cell.net-good {
  border-color: #86efac;
  background: #f0fdf4;
}
.pub-profit-cell.net-good .val { color: #15803d; }

.pub-profit-cell.net-warn {
  border-color: #fde68a;
  background: #fffbeb;
}
.pub-profit-cell.net-warn .val { color: #b45309; }

.pub-profit-cell.net-bad {
  border-color: #fca5a5;
  background: #fef2f2;
}
.pub-profit-cell.net-bad .val { color: #dc2626; }

/* Collapsible Feature Accordion */
.pub-accordion {
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  overflow: hidden;
  margin-top: 12px;
}
.pub-accordion-head {
  padding: 10px 14px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
}
.pub-accordion-body {
  padding: 14px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

/* ============================================================================
   RIGHT LIVE STOREFRONT PREVIEW PANEL (JD `图片前台预览` + Search Card)
   ============================================================================ */
.pub-right-preview {
  position: sticky;
  top: 12px;
  background: #ffffff;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}

.pub-preview-head {
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pub-preview-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.pub-phone-frame {
  border: 2px solid #0f172a;
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.pub-phone-status {
  background: #131921;
  color: #ffffff;
  padding: 6px 12px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pub-phone-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  overflow: hidden;
}

.pub-phone-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pub-phone-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.55);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.pub-phone-nav-btn.prev { left: 8px; }
.pub-phone-nav-btn.next { right: 8px; }

.pub-phone-counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

.pub-phone-content {
  padding: 12px;
}

.pub-phone-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.pub-phone-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.38;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-phone-cta-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* ============================================================================
   STICKY BOTTOM SUBMIT ACTION BAR
   ============================================================================ */
.pub-sticky-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid #cbd5e1;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  padding: 10px 24px;
}

.pub-sticky-footer-inner {
  max-width: 1520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pub-validation-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.pub-validation-pill.is-valid {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.pub-validation-pill.is-invalid {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.pub-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Dynamic Key-Value Spec Rows & B2B Tier Table */
.pub-kv-row {
  display: grid;
  grid-template-columns: 200px 1fr 34px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.pub-bullet-row {
  display: grid;
  grid-template-columns: 26px 1fr 56px 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.pub-b2b-row {
  display: grid;
  grid-template-columns: 110px 110px 1fr 120px 34px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */
@media (max-width: 1320px) {
  .pub-workbench-grid {
    grid-template-columns: 224px minmax(0, 1fr) 295px;
  }
}

@media (max-width: 1120px) {
  .pub-workbench-grid,
  .pub-workbench-grid.preview-collapsed {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .pub-right-preview {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }
  .pub-detail-split {
    grid-template-columns: 1fr;
  }
  .pub-profit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .pub-workbench-grid,
  .pub-workbench-grid.preview-collapsed,
  .pub-workbench-grid.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .pub-left-rail {
    position: static;
    max-height: none;
  }
  .pub-grid-2,
  .pub-grid-3,
  .pub-grid-4,
  .pub-fulfill-cards,
  .pub-video-row,
  .pub-kv-row,
  .pub-b2b-row {
    grid-template-columns: 1fr;
  }
  .pub-span-2 {
    grid-column: auto;
  }
}
