/* MCW 服装素材 · SPU/SKC 管理（样式源自分销 admin md-spu，适配墨绿 MCW 主题） */
:root {
  --bg: #faf9f7;
  --panel: #fff;
  --line: #e8e4dc;
  --line-soft: #f0ede6;
  --text: #2b332e;
  --muted: #7a847c;
  --brand: #2f6b4f;
  --brand-hover: #254a40;
  --brand-soft: #e4efeb;
  --row-hover: #f7f5f0;
  --row-sel-bg: #dce8e2;
  --row-sel-hover: #c8ddd4;
  --row-sel-bar: inset 3px 0 0 var(--brand);
  --danger: #b42318;
  --danger-soft: #fef2f2;
  --ok: #2f6b4f;
  --warn: #9a6b1a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 2px rgba(43, 51, 46, 0.06);
  --fs-page: 18px;
  --fs-card: 16px;
  --fs-body: 14px;
  --fs-aux: 12px;
  --sp-1: 8px;
  --sp-2: 12px;
  --font: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
body { padding: 16px 20px 40px; }

#app {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
}

/* 左右分栏：左 SPU · 右 SKC */
.garment-split {
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
  min-height: 0;
  align-items: stretch;
}

.garment-split.hidden {
  display: none !important;
}

.garment-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.garment-pane-spu {
  flex: 0 0 36%;
  min-width: 220px;
  max-width: 400px;
  container-type: inline-size;
  container-name: spu-pane;
}

.garment-pane-skc {
  flex: 1 1 auto;
  min-width: 0;
}

.pane-head {
  margin-bottom: 6px;
  flex-shrink: 0;
}

.pane-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.pane-sub {
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.35;
  word-break: break-all;
}

.pane-hint {
  margin: 0 0 6px;
  font-size: 12px;
  flex-shrink: 0;
}

.pane-actions {
  margin-bottom: 6px;
  flex-shrink: 0;
}

.spu-list-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.spu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spu-list-card {
  border-radius: var(--radius-sm);
}

.spu-list-card.active .spu-list-item {
  background: var(--row-sel-bg);
  border-color: var(--brand);
  box-shadow: var(--row-sel-bar);
}

.spu-list-card .spu-list-item-actions {
  display: none;
  flex-wrap: nowrap;
  align-items: center;
  padding: 4px 8px 6px 60px;
  gap: 6px;
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.spu-list-card .spu-list-item-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.spu-list-card.active .spu-list-item-actions {
  display: flex;
}

.spu-list-empty {
  margin: 8px 4px;
  font-size: 13px;
}

.spu-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.spu-list-item:hover {
  background: var(--row-hover);
  border-color: var(--line);
}

.spu-list-item.active {
  background: var(--row-sel-bg);
  border-color: var(--brand);
  box-shadow: var(--row-sel-bar);
}

.spu-list-item .thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--line-soft);
}

.spu-list-item .tag.warn {
  font-size: 10px;
  padding: 1px 5px;
}

.btn.btn-warn {
  border-color: #e8c77a;
  color: var(--warn);
  background: #fffaf0;
}

.batch-chart-body { margin-top: 4px; }
.batch-chart-unify {
  gap: 8px;
  margin: 12px 0 16px;
  flex-wrap: wrap;
  align-items: center;
}
.batch-chart-unify .batch-unify-cat { min-width: 88px; }
.batch-chart-unify .batch-unify-chart { min-width: 200px; flex: 1; }
.batch-chart-table { width: 100%; margin-top: 8px; }
.batch-chart-table select { min-width: 180px; }

.spu-list-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.spu-list-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spu-list-sub {
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.35;
}

.spu-list-tags {
  flex-shrink: 0;
  align-self: flex-start;
}

.skc-empty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
  padding: 24px 16px;
  text-align: center;
}

.skc-empty p {
  margin: 0;
  font-size: 13px;
}

.entry-title-compact {
  font-size: 14px;
  font-weight: 600;
}

/* 嵌入商家控制台 iframe：去重标题区，纵向撑满 */
html.mc-embed,
html.mc-embed body {
  height: 100%;
  min-height: 0;
}

html.mc-embed body {
  padding: 0;
  background: transparent;
}

html.mc-embed #app {
  min-height: 100%;
  height: 100%;
}

html.mc-embed .garment-split {
  flex: 1 1 auto;
  min-height: 0;
}

html.mc-embed .card {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
}

html.mc-embed .garment-pane {
  margin-bottom: 0;
}

html.mc-embed .toolbar {
  margin-bottom: 6px;
  gap: 6px;
  flex-shrink: 0;
}

html.mc-embed h3,
html.mc-embed .card h3 {
  margin: 0 0 6px;
}

html.mc-embed #skc-list-host {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#spu-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#skc-list-host {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

h1 { font-size: var(--fs-page); margin: 0 0 4px; font-weight: 600; }
h2, .card h2 { margin: 0 0 12px; font-size: var(--fs-card); font-weight: 600; }
h3, .card h3 { margin: 0 0 10px; font-size: var(--fs-body); font-weight: 600; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  align-items: center;
  margin-bottom: 8px;
}
.toolbar .spacer { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.btn:hover { background: var(--row-hover); border-color: #c4bdb3; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 26px; padding: 0 10px; font-size: var(--fs-aux); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input:not([type=checkbox]):not([type=radio]):not([type=file]),
select,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  height: 32px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
textarea { height: auto; padding: 8px 10px; min-height: 72px; width: 100%; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: var(--fs-aux); color: var(--muted); margin-bottom: 4px; }

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.field-label-row label {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.field-label-row .btn {
  flex: 0 0 auto;
}

.table-scroll { overflow: auto; max-height: min(42vh, 320px); min-width: 0; }
/* SKC 列表（表格）模式：不限制高度，随内容伸展 */
.table-scroll.skc-list-scroll {
  max-height: none;
  min-height: 0;
  overflow-x: auto;
  overflow-y: visible;
  flex: 0 0 auto;
}
.garment-pane-skc:has(#skc-list-host > .table-scroll) {
  overflow: visible;
}
.garment-pane-skc:has(#skc-list-host > .table-scroll) #skc-list-host {
  flex: 0 1 auto;
}
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 8px 10px; text-align: left; vertical-align: middle; }
table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: var(--fs-aux);
  background: #f7f5f0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
table.data td { border-bottom: 1px solid var(--line-soft); }
table.data tbody tr:hover td { background: var(--row-hover); }
table.data tr.row-clickable { cursor: pointer; }
table.data tr.row-active td { background: var(--row-sel-bg); }
table.data tr.row-active td:first-child { box-shadow: var(--row-sel-bar); }
table.data tr.row-active:hover td { background: var(--row-sel-hover); }

img.thumb {
  width: 48px;
  height: 64px;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #f0ede6;
  display: block;
}
img.thumb-lg {
  max-width: 220px;
  max-height: 280px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f0ede6;
  display: block;
  margin: 6px 0 12px;
}

.skc-pending-preview {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #faf8f4;
}

.skc-pending-preview.is-hidden {
  display: none;
}

.skc-pending-img {
  margin-bottom: 0;
}

.skc-upload-bar {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.thumb-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb-item { width: 100px; font-size: 11px; text-align: center; }
.thumb-item img.thumb { width: 92px; height: 122px; margin: 0 auto; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: var(--fs-aux);
  background: #eee;
}
.tag.ok { background: var(--brand-soft); color: var(--ok); }
.tag.warn { background: #fdf3e0; color: var(--warn); }

.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--danger); }
.ok { color: var(--ok); }
.hidden { display: none !important; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(43, 51, 46, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  overscroll-behavior: contain;
}
.modal {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px 22px;
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 16px 40px rgba(43, 51, 46, 0.16);
}
.modal.wide { max-width: min(720px, calc(100vw - 24px)); }
.wait-modal-mask { z-index: 100010; cursor: wait; }
.wait-modal { text-align: center; max-width: 360px; }
.wait-modal-spin {
  width: 36px;
  height: 36px;
  margin: 8px auto 14px;
  border: 3px solid #e4efeb;
  border-top-color: #2f6b4f;
  border-radius: 50%;
  animation: wait-spin 0.8s linear infinite;
}
@keyframes wait-spin {
  to { transform: rotate(360deg); }
}
.wait-modal-msg {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.modal h3 { margin: 0 0 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1f2937;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100010;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

.dg-float-tip {
  position: fixed;
  z-index: 100020;
  max-width: min(280px, calc(100vw - 16px));
  padding: 6px 10px;
  border-radius: 6px;
  background: #1f2937;
  color: #f9fafb;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  white-space: normal;
  text-align: left;
}
.dg-float-tip.show {
  opacity: 1;
  visibility: visible;
}

/* SKC 视图切换 + 卡片网格 */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle .btn {
  border: none;
  border-radius: 0;
  margin: 0;
  border-right: 1px solid var(--line);
}

.view-toggle .btn:last-child {
  border-right: none;
}

.view-toggle .btn.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
  border-color: var(--brand);
}

/* 切换组不用实心主按钮，避免白字落在浅底 */
.view-toggle .btn.primary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.view-toggle .btn.primary.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
}

.skc-list-scroll {
  flex: 1 1 auto;
  min-height: 120px;
  overflow: auto;
}

.skc-card-scroll {
  padding: 2px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.skc-card-scroll .skc-card-grid {
  flex: 1 1 auto;
  align-content: start;
}

.skc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 10px;
  align-content: start;
}

.skc-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skc-card-cover {
  aspect-ratio: 3 / 4;
  background: #f0ede6;
  overflow: hidden;
}

.skc-cover-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.skc-cover-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.35;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
  pointer-events: none;
}

.skc-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.skc-meta-k {
  font-size: var(--fs-aux);
  color: var(--muted);
  flex: 0 0 auto;
}

.skc-meta-k-code {
  margin-left: 4px;
}

.skc-meta-in {
  flex: 1 1 120px;
  min-width: 100px;
  max-width: 200px;
}

.skc-meta-in.mono-xs {
  max-width: 220px;
  font-size: 11px;
}

.skc-edit-hint {
  margin: 0 0 8px;
  font-size: var(--fs-aux);
}

.field-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.field-row input[readonly] {
  flex: 1;
  min-width: 160px;
}

.chart-pick-section {
  margin-top: 12px;
}

.chart-pick-title {
  margin: 0 0 8px;
  font-size: var(--fs-body);
}

.chart-pick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .chart-pick-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

.chart-pick-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

.chart-pick-card.active {
  border-color: var(--accent, #2f6fed);
  box-shadow: 0 0 0 1px var(--accent, #2f6fed);
}

.chart-pick-name {
  font-weight: 600;
  font-size: var(--fs-body);
}

.chart-pick-summary {
  font-size: 0.78rem;
  line-height: 1.35;
}

.chart-pick-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  line-height: 1.3;
}

.chart-pick-table th,
.chart-pick-table td {
  border: 1px solid var(--line);
  padding: 3px 5px;
  text-align: center;
  white-space: nowrap;
}

.chart-pick-table th {
  background: #f6f7f9;
  font-weight: 600;
}

.chart-pick-meta {
  font-size: 0.72rem;
}

.color-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.color-pick-swatch {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 72px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
}

.color-pick-name {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.82);
  padding: 2px 6px;
  border-radius: 4px;
}

.skc-card-cover {
  aspect-ratio: 3 / 4;
  background: #f0ede6;
  overflow: hidden;
}

.skc-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.skc-cover-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: var(--fs-aux);
  color: var(--muted);
}

.skc-card-body {
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.skc-card-color {
  font-size: var(--fs-body);
  font-weight: 600;
}

.skc-card-code {
  font-size: 10px;
  margin-top: 2px;
  word-break: break-all;
}

.mono-xs {
  font-size: 10px;
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
}

.skc-card-plot {
  font-size: 11px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skc-card-tags {
  margin-top: 2px;
}

.skc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.skc-actions .btn {
  flex: 1 1 auto;
  min-width: 3rem;
  padding: 0 5px;
  font-size: 11px;
}

.spu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entry-head {
  margin-bottom: 8px;
  gap: 10px;
}

.entry-head .entry-title {
  margin: 0;
  font-size: var(--fs-card);
  font-weight: 600;
  flex: 1;
}

.spu-filters {
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 10px;
  align-items: center;
}

.spu-filters .spacer {
  display: none;
}

.spu-filters .spu-kw {
  flex: 1 1 100%;
  min-width: 0;
  max-width: none;
}

.spu-actions {
  flex: 1 1 100%;
  justify-content: flex-start;
}

.spu-filter-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: var(--fs-aux);
  user-select: none;
}

.spu-filter-chk input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0;
}

.spu-status {
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: var(--fs-aux);
}

/* 宽屏单列全宽时：搜索与操作可同一行 */
@container spu-pane (min-width: 520px) {
  .spu-filters .spu-kw {
    flex: 1 1 12rem;
    min-width: 8rem;
    max-width: 22rem;
  }

  .spu-actions {
    flex: 0 1 auto;
    margin-left: auto;
    justify-content: flex-end;
  }
}

@container spu-pane (max-width: 519px) {
  .spu-filter-chk {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.entry-lead {
  margin: 0 0 12px;
}

/* `entry=plot`（分销台 SKC 详情内嵌的「剧情档案与带货设置」）：窄版单列，编辑靠模态 */
.plot-entry-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.plot-entry-box .muted {
  margin: 0;
}

/* 快速登记 / 平台导入：单列窄版，适配手机竖屏 */
#entry-panel {
  width: 100%;
  max-width: 26rem;
  margin-right: auto;
}

#entry-panel.import-entry-mode {
  max-width: none;
  margin-right: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 1.5rem);
  overflow: hidden;
}

#entry-panel.import-entry-mode .entry-lead {
  flex-shrink: 0;
}

#entry-panel.import-entry-mode .entry-head {
  flex-shrink: 0;
}

#entry-panel .entry-grid {
  grid-template-columns: 1fr;
}

.import-panel-main {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.import-collect-row {
  --import-phone-w: 390px;
  --import-collect-w: 22rem;
  --import-params-w: 20rem;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 14px;
  align-items: stretch;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 10.5rem);
  min-height: 18rem;
}

.import-collect-column {
  flex: 0 0 var(--import-collect-w);
  width: var(--import-collect-w);
  max-width: var(--import-collect-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.import-collect-column > .import-collect-card {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
}

.import-params-column {
  flex: 0 0 var(--import-params-w);
  width: var(--import-params-w);
  max-width: var(--import-params-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.import-params-column > .import-params-card,
.import-collect-column > .import-params-card,
.import-preview-pane > .import-params-card {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
}

.import-param-meta {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
}

.import-param-meta p {
  margin: 0;
}

.import-params-card input[readonly],
.import-params-card select:disabled {
  background: #f3f4f6;
  color: #6b7280;
  cursor: default;
}

.import-collect-column > .entry-more {
  flex: 0 0 auto;
  margin-top: 0;
}

.import-preview-pane {
  flex: 0 0 var(--import-phone-w);
  width: var(--import-phone-w);
  max-width: var(--import-phone-w);
  min-width: 0;
  min-height: 12rem;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
  position: relative;
}

.import-mall-preview-wrap {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.import-preview-actions {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 10px 0 4px;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
}

.import-mall-preview-wrap .mdp-shell {
  max-height: none;
}

.import-mall-preview-wrap .mdp-page {
  max-height: none;
}

.import-page-preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.import-page-preview-empty {
  padding: 28px 20px;
  text-align: center;
}

.ipp-empty-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}

.ipp-empty-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
}

.ipp-empty-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.ipp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #faf9f7;
}

.ipp-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 2px 8px;
}

.ipp-head-sub {
  font-size: 11px;
}

.ipp-hero {
  aspect-ratio: 3 / 4;
  background: #f3f4f2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.ipp-hero-placeholder {
  font-size: 13px;
}

.ipp-title {
  margin: 12px 14px 4px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
}

.ipp-meta {
  margin: 0 14px 6px;
  font-size: 12px;
}

.ipp-price {
  margin: 0 14px 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
}

.ipp-section {
  padding: 0 14px 12px;
}

.ipp-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.ipp-color-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ipp-color-chip {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.ipp-gallery-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.ipp-gallery-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.ipp-gallery-thumb.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.ipp-gallery-more {
  align-self: center;
  font-size: 12px;
  padding: 0 4px;
}

.ipp-sku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ipp-sku-table th,
.ipp-sku-table td {
  border: 1px solid var(--line-soft);
  padding: 4px 6px;
  text-align: left;
}

.ipp-sku-table th {
  background: #faf9f7;
  color: var(--muted);
  font-weight: 600;
}

.ipp-points {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
}

.ipp-plot {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.ipp-status {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  margin-top: 2px;
}

.ipp-status p {
  margin: 0 0 4px;
  font-size: 12px;
}

.ipp-more-hint {
  margin: 6px 0 0;
  font-size: 11px;
}

@media (max-width: 720px) {
  .import-collect-row {
    flex-direction: column;
    flex-wrap: nowrap;
    max-height: none;
    height: auto;
  }

  .import-collect-column {
    flex: 0 0 auto;
    width: 100%;
    max-width: var(--import-collect-w);
    max-height: min(52vh, 28rem);
  }

  .import-params-column {
    flex: 0 0 auto;
    width: 100%;
    max-width: var(--import-params-w);
    max-height: none;
  }

  .import-preview-pane {
    flex: 0 0 auto;
    width: min(100%, var(--import-phone-w));
    max-width: var(--import-phone-w);
    margin: 0 auto;
    max-height: min(58vh, 36rem);
  }

  #entry-panel.import-entry-mode {
    max-height: none;
    overflow: visible;
  }
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
}

.entry-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}

.entry-card-title {
  margin: 0 0 6px;
  font-size: var(--fs-card);
  color: var(--brand);
}

.entry-card-hint {
  margin: 0 0 10px;
  font-size: var(--fs-aux);
}

.entry-card .field {
  margin-bottom: 10px;
}

.entry-card .field:last-child {
  margin-bottom: 0;
}

.entry-card label {
  display: block;
  font-size: var(--fs-aux);
  color: var(--muted);
  margin-bottom: 4px;
}

.entry-card input.full,
.entry-card select.full,
.entry-card textarea.full {
  width: 100%;
  box-sizing: border-box;
}

.entry-card textarea {
  width: 100%;
  resize: vertical;
  min-height: 4rem;
  font-family: inherit;
}

.entry-card textarea.mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.entry-actions {
  margin-top: 14px;
  justify-content: flex-end;
}

.entry-quick .entry-card-title {
  font-size: 14px;
}

.entry-more {
  margin-top: 4px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #faf9f7;
}

.entry-more > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  user-select: none;
}

.entry-grid-compact {
  margin-top: 8px;
  gap: 8px;
}

.entry-note {
  margin: 8px 0 0;
  font-size: 12px;
}

.tag.muted {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #e5e7eb;
}

html.mc-embed .entry-grid {
  grid-template-columns: 1fr;
}

html.mc-embed #entry-panel.import-entry-mode {
  max-width: none;
  max-height: 100%;
  height: 100%;
}

html.mc-embed .import-collect-row {
  --import-collect-w: 20rem;
  --import-params-w: 18rem;
  --import-phone-w: 375px;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  max-height: calc(100vh - 6.5rem);
}

html.mc-embed .import-collect-column {
  flex: 0 0 var(--import-collect-w);
  width: var(--import-collect-w);
  max-width: var(--import-collect-w);
}

html.mc-embed .import-params-column {
  flex: 0 0 var(--import-params-w);
  width: var(--import-params-w);
  max-width: var(--import-params-w);
}

html.mc-embed .import-preview-pane {
  flex: 0 0 var(--import-phone-w);
  width: var(--import-phone-w);
  max-width: var(--import-phone-w);
}

@media (max-width: 720px) {
  html.mc-embed .import-collect-row {
    flex-direction: column;
    max-height: none;
  }

  html.mc-embed .import-collect-column {
    width: 100%;
    max-width: var(--import-collect-w);
  }

  html.mc-embed .import-params-column {
    width: 100%;
    max-width: var(--import-params-w);
  }

  html.mc-embed .import-preview-pane {
    width: min(100%, var(--import-phone-w));
    max-width: var(--import-phone-w);
  }
}

@media (min-width: 900px) {
  .entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 平板/手机：上下分栏 */
@media (max-width: 900px) {
  .garment-split {
    flex-direction: column;
  }

  .garment-pane-spu {
    flex: 0 0 auto;
    max-width: none;
    min-width: 0;
    max-height: min(42vh, 360px);
  }

  .garment-pane-skc {
    flex: 1 1 auto;
    min-height: min(48vh, 480px);
  }

  .spu-filters .spu-kw {
    flex: 1 1 100%;
    min-width: 0;
  }

  .skc-empty {
    min-height: 8rem;
  }
}

@media (max-width: 600px) {
  body:not(.mc-embed) {
    padding: 10px 12px 24px;
  }

  #entry-panel {
    max-width: 100%;
    padding: 10px 12px;
  }

  .modal {
    width: calc(100% - 20px);
    padding: 16px;
  }

  .entry-head {
    flex-wrap: wrap;
  }

  .spu-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .skc-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  }
}

/* 服装页 · 主 Tab（货盘 / 下游上货） */
.dg-page-head {
  margin-bottom: 12px;
}

.dg-main-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dg-main-tab {
  font: inherit;
  font-size: var(--fs-body);
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.dg-main-tab:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.dg-main-tab.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-hover);
  font-weight: 600;
}

.dg-main-tab.hidden {
  display: none;
}

#panel-catalog.hidden,
#panel-downstream.hidden {
  display: none !important;
}

.dg-downstream-wrap h2 {
  margin: 0 0 8px;
  font-size: var(--fs-page);
}

.dg-downstream-hint {
  margin: 0 0 16px;
}

.dg-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.dg-section h3 {
  margin: 0 0 8px;
  font-size: var(--fs-card);
}

.dg-block {
  margin: 12px 0;
}

.dg-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.dg-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-aux);
  color: var(--muted);
}

.dg-form-grid input,
.dg-form-grid select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--panel);
}

.dg-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.dg-checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
}

.dg-spu-line {
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--line-soft);
}

.dg-skc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px 12px;
}

.warn-text {
  color: var(--warn);
}

.dg-downstream-toast.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.dg-downstream-toast.toast.show {
  opacity: 1;
}

.dg-downstream-toast.toast.err {
  background: var(--danger);
}
