/* AI商品模特图 — 独立页面样式，不依赖 suite.css */

:root {
  --wear-text: #173552;
  --wear-muted: #647b92;
  --wear-line: rgba(61, 125, 203, .18);
  --wear-blue: #1769e8;
  --wear-cyan: #08a4c7;
  --wear-violet: #6252df;
}

[data-wear-shell].suite-main-shell {
  width: min(100%, 1280px);
  margin: 0 auto;
  color: var(--wear-text);
}

[data-wear-shell].suite-main-shell *,
[data-wear-shell].suite-main-shell *::before,
[data-wear-shell].suite-main-shell *::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

[data-wear-shell] .suite-main-hero {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 14px 0;
  text-align: center;
}

[data-wear-shell] .suite-main-hero > * { margin: 0; }

[data-wear-shell] .suite-main-kicker {
  color: transparent;
  background: linear-gradient(110deg, var(--wear-blue), var(--wear-cyan) 52%, var(--wear-violet));
  background-clip: text;
  -webkit-background-clip: text;
  font-size: 12px;
  font-weight: 800;
}

[data-wear-shell] .suite-main-hero h1 {
  color: transparent;
  background: linear-gradient(110deg, #1769e8, #08a4c7 35%, #5147df 70%, #a855b8);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 7px 12px rgba(57, 99, 205, .16));
  font-size: 38px;
  line-height: 1.2;
}

[data-wear-shell] .suite-main-hero > p:last-child {
  color: #50677f;
  font-size: 14px;
  line-height: 1.55;
}

[data-wear-shell] .suite-main-view[hidden] { display: none !important; }

[data-wear-shell] .suite-main-upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
  align-items: start;
  gap: 60px;
  width: 100%;
  margin-block: 60px;
}

[data-wear-shell] .suite-main-upload-zone,
[data-wear-shell] .suite-white-stage,
[data-wear-shell] .suite-main-config-panel {
  border: 1px solid var(--wear-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 34px rgba(40, 105, 180, .1);
}

[data-wear-shell] .suite-main-upload-zone {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 480px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 34px 24px;
  background: linear-gradient(145deg, rgba(235, 247, 255, .72), rgba(255, 255, 255, .98) 38%, rgba(247, 245, 255, .9) 70%, rgba(232, 252, 248, .72));
}

[data-wear-shell] .suite-main-entry-icon {
  position: relative;
  display: grid;
  width: 104px;
  height: 92px;
  place-items: center;
}

[data-wear-shell] .suite-main-entry-icon > span {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(140deg, #1759e8, #0879ef 52%, #0aaee7);
  box-shadow: 0 16px 28px rgba(25, 103, 224, .24);
  font-size: 32px;
  transform: rotate(-5deg);
}

[data-wear-shell] .suite-main-source-head { text-align: center; }
[data-wear-shell] .suite-main-source-head > div { display: grid; gap: 5px; }
[data-wear-shell] .suite-main-source-head span { color: var(--wear-cyan); font-size: 12px; font-weight: 800; }
[data-wear-shell] .suite-main-source-head h2 { margin: 0; color: #17456f; font-size: 20px; line-height: 1.3; }
[data-wear-shell] .suite-main-source-head p { max-width: 310px; margin: 0; color: var(--wear-muted); font-size: 12px; line-height: 1.6; }

[data-wear-shell] .suite-main-source-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 300px);
}

[data-wear-shell] .suite-main-primary,
[data-wear-shell] .suite-main-secondary {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

[data-wear-shell] .suite-main-primary {
  border: 1px solid rgba(75, 82, 220, .72);
  color: #fff;
  background: linear-gradient(110deg, #2563eb, #0891b2 34%, #4f46e5 68%, #a855b8);
}

[data-wear-shell] .suite-main-secondary {
  border: 1px solid rgba(40, 137, 220, .42);
  color: #2473cd;
  background: #fff;
}

[data-wear-shell] .suite-main-upload-note {
  margin: 10px 0 0;
  color: var(--wear-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

[data-wear-shell] .suite-product-chain-strip,
[data-wear-shell] .suite-home-inspiration {
  border: 1px solid var(--wear-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 30px rgba(35, 82, 138, .08);
}

[data-wear-shell] .suite-product-chain-strip { margin: 22px 0; padding: 16px; }
[data-wear-shell] .suite-main-config-panel { min-width: 0; padding: 18px; }

@media (max-width: 1180px) {
  [data-wear-shell] .suite-main-upload-layout { grid-template-columns: minmax(0, 720px); gap: 32px; padding-inline: 16px; }
}

@media (max-width: 900px) {
  [data-wear-shell] .suite-main-upload-layout { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 22px; margin-block: 40px; }
  [data-wear-shell] .suite-main-upload-card { width: min(100%, 720px); }
}

@media (max-width: 640px) {
  [data-wear-shell] .suite-main-hero h1 { font-size: 30px; }
  [data-wear-shell] .suite-main-upload-layout { margin-block: 30px; padding-inline: 12px; }
  [data-wear-shell] .suite-main-upload-zone { min-height: 400px; padding: 26px 16px; }
  [data-wear-shell] .suite-main-source-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 顶部标题区 ---------- */

/* suite.css 在 data-step 非 upload 时会隐藏 hero；穿戴页始终进入 asset 步，
   这里用更高优先级恢复显示，保证「AI商品穿戴」标题始终可见。 */
[data-wear-shell].suite-main-shell:not([data-step="upload"]) .suite-main-hero,
[data-wear-shell] .suite-main-hero {
  display: grid;
}

/* ---------- 资产链条与上传步 ---------- */

/* ---------- 配置步：左侧实拍图面板 ---------- */

.wear-config-panel .suite-main-config-head {
  gap: 8px;
  padding: 10px 12px;
}

.wear-config-panel .suite-main-config-meta {
  gap: 8px;
}

.wear-config-panel .suite-main-model-select {
  gap: 5px;
}

.wear-config-panel .suite-main-model-select select {
  min-height: 38px;
  padding: 0 38px 0 12px;
  border-radius: 10px;
  font-size: 13px;
}

.wear-config-panel .suite-main-config-parameter-group {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 6px 8px;
}

.wear-config-panel .suite-main-config-parameter-group > span {
  grid-column: 1 / -1;
}

.wear-config-panel .suite-main-config-list {
  gap: 8px;
  padding: 10px 14px 12px;
}

.wear-config-panel .suite-main-config-item {
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
}

[data-wear-shell] .wear-config-panel .suite-main-config-footer {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-top-color: #e6eef7;
  background: #fff;
  box-shadow: 0 -4px 12px rgba(45, 81, 123, .035);
}

[data-wear-shell] .wear-config-panel .suite-main-config-footer-copy {
  width: 100%;
}

[data-wear-shell] .wear-config-panel .suite-main-config-footer-copy p {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #e3eef9;
  border-radius: 8px;
  color: #557b9f;
  background: #f7fbff;
  line-height: 1.45;
}

[data-wear-shell] .wear-config-panel .suite-main-config-footer-copy p::before {
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #64a4e8;
  content: "";
  flex: 0 0 auto;
}

.wear-config-panel .suite-main-config-footer .suite-main-primary {
  min-width: 104px;
  border-color: #1677ff;
  border-radius: 8px;
  background: #1677ff;
  box-shadow: 0 5px 12px rgba(22, 119, 255, .2);
}

.wear-config-panel .suite-main-config-footer .suite-main-primary:hover:not(:disabled) {
  border-color: #0f68df;
  background: #0f68df;
}

.wear-config-panel .suite-main-config-footer .suite-main-primary:disabled {
  border-color: #d8e7f6;
  color: #86a6c5;
  background: #edf5fd;
  box-shadow: none;
  opacity: 1;
}

.wear-footer-actions {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.wear-footer-bbox-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1 1 auto;
  gap: 6px;
}

.wear-footer-actions .suite-main-secondary {
  min-width: 84px;
  padding-inline: 10px;
  border-color: #bfd8f2;
  border-radius: 8px;
  color: #2468a8;
  background: #fff;
  white-space: nowrap;
}

.wear-footer-actions .suite-main-secondary:hover:not(:disabled) {
  border-color: #69a9e8;
  color: #145b9d;
  background: #f1f7fe;
}

.wear-footer-actions .suite-main-secondary:disabled {
  border-color: #e1ebf5;
  color: #9bb1c7;
  background: #fbfdff;
  cursor: not-allowed;
}

.wear-config-panel:has(.wear-reference-stage.has-reference) .suite-main-config-footer-copy {
  display: none;
}

@media (min-width: 1100px) {
  .wear-config-panel .suite-main-config-meta {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
  }

  .wear-config-panel .suite-main-config-parameter-group {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.wear-reference-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-content: start;
}

.wear-reference-inline {
  min-height: 100%;
  gap: 0;
  padding: 0;
  background: transparent;
}

.wear-reference-inline.has-reference {
  min-height: 0;
}

.wear-reference-upload-zone {
  display: grid;
  min-height: 110px;
  flex: 0 0 110px;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px dashed #9bc5f5;
  border-radius: 8px;
  color: #173f6b;
  background: #f7fbff;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.wear-reference-upload-zone:is(:hover, :focus-within) {
  border-color: #3b8ceb;
  background: #eef6ff;
  box-shadow: 0 6px 16px rgba(33, 111, 201, .1);
}

.wear-reference-upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wear-reference-upload-zone .wear-reference-upload-visual {
  width: 64px;
  height: 60px;
  margin: 0;
}

.wear-reference-upload-zone .wear-reference-upload-visual .uni-upload-cloud {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  box-shadow: 0 10px 20px rgba(25, 103, 224, .2), 0 4px 9px rgba(8, 174, 231, .12);
  font-size: 25px;
}

.wear-reference-upload-zone .wear-reference-upload-visual .uni-upload-spark.spark-one {
  top: 1px;
  right: 5px;
  width: 9px;
  height: 9px;
}

.wear-reference-upload-zone .wear-reference-upload-visual .uni-upload-spark.spark-two {
  top: 13px;
  right: -1px;
  width: 6px;
  height: 6px;
}

.wear-reference-upload-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.wear-reference-upload-copy strong {
  color: #1769cf;
  font-size: 14px;
  font-weight: 700;
}

.wear-reference-upload-copy small {
  color: #6d849c;
  font-size: 11px;
  line-height: 1.45;
}

.wear-reference-guide {
  display: grid;
  gap: 6px;
  padding: 12px 4px 0;
  color: #68809a;
  font-size: 12px;
  line-height: 1.55;
}

.wear-reference-guide > strong {
  color: #355474;
  font-size: 12px;
}

.wear-reference-guide ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.wear-reference-stage.has-reference .wear-reference-upload-zone {
  display: none;
}

.wear-reference-item {
  position: relative;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(18, 35, 60, 0.08);
  background: #f4f6fb;
}

.wear-reference-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.wear-reference-item figcaption {
  padding: 4px 36px 4px 6px;
  font-size: 11px;
  text-align: center;
  color: rgba(18, 35, 60, 0.6);
}

.wear-reference-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 0;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(18, 35, 60, 0.72);
  cursor: pointer;
}

#wear-stage-status {
  position: static;
  margin-top: 12px;
}

/* ---------- 进阶档：bbox 商品区域锁定 ---------- */

.wear-bbox-panel[hidden],
.wear-bbox-stage[hidden] {
  display: none;
}

.wear-bbox-panel {
  display: block;
}

.wear-current-reference {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  background: #f5f8fc;
}

.wear-current-reference .wear-bbox-stage {
  min-height: 100%;
  align-content: center;
  justify-items: center;
}

.wear-current-library.has-reference {
  overflow: hidden;
}

.wear-library-pane {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.wear-library-pane[hidden] {
  display: none;
}

.wear-library-pane > .suite-family-library-empty {
  width: 100%;
}

.wear-current-results {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
  background: #f5f8fc;
}

.wear-current-grid:not(.wear-history-grid) {
  height: 100%;
  max-height: none;
  grid-template-columns: repeat(var(--hx-gallery-columns, 5), minmax(0, 1fr));
  grid-auto-rows: 240px;
  align-content: start;
  justify-content: start;
  padding: 0;
}

.wear-current-result-card,
.wear-current-pending {
  min-width: 0;
}

.wear-current-results.wear-history-results {
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.wear-current-grid.wear-history-grid {
  position: relative;
  display: block;
  height: auto;
  max-height: none;
  align-items: start;
  padding: 0 4px 0 0;
  overflow: visible;
}

.wear-history-grid .wear-current-result-card {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  align-self: start;
  border-radius: 8px;
}

.wear-history-grid .wear-current-result-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

body[data-ecommerce-item="wear"] .wear-history-bottom {
  order: 2;
  width: 100%;
  margin-top: 18px;
  padding: 18px 20px 22px;
}

body[data-ecommerce-item="wear"] .wear-history-bottom .suite-main-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

body[data-ecommerce-item="wear"] .wear-history-bottom .suite-main-library-head h2 {
  margin: 0;
  color: #183653;
  font-size: 16px;
}

body[data-ecommerce-item="wear"] .wear-history-bottom .suite-main-library-head p {
  margin: 4px 0 0;
  color: #71849a;
  font-size: 12px;
}

body[data-ecommerce-item="wear"] .wear-history-bottom > .suite-family-library-empty {
  min-height: 110px;
}

body[data-ecommerce-item="wear"] .wear-history-bottom .wear-history-results {
  min-height: 110px;
}

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

.wear-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wear-switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(18, 35, 60, 0.15);
  transition: background 0.2s ease;
}

.wear-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(18, 35, 60, 0.3);
  transition: transform 0.2s ease;
}

.wear-switch input:checked + .wear-switch-track {
  background: #7c5cff;
}

.wear-switch input:checked + .wear-switch-track::after {
  transform: translateX(18px);
}

.wear-switch input:focus-visible + .wear-switch-track {
  outline: 2px solid rgba(124, 92, 255, 0.5);
  outline-offset: 2px;
}

.wear-bbox-stage {
  display: grid;
  gap: 10px;
}

#wear-bbox-canvas {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 620px;
  height: auto;
  border-radius: 10px;
  background: #f4f6fb;
  box-shadow: inset 0 0 0 1px rgba(18, 35, 60, 0.06);
  touch-action: none;
  cursor: crosshair;
}

@media (max-width: 980px) {
  body[data-ecommerce-item="wear"] .create-product-shell .suite-main-showcase.suite-family-library.wear-current-library {
    height: auto !important;
    min-height: 0 !important;
    align-content: start;
  }

  body[data-ecommerce-item="wear"] .wear-current-library > .wear-library-pane {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
  }

  .wear-current-reference {
    padding: 10px;
  }

  .wear-current-results {
    padding: 10px;
  }

  .wear-current-grid:not(.wear-history-grid) {
    grid-template-columns: repeat(var(--hx-gallery-columns, 2), minmax(0, 1fr));
    grid-auto-rows: 190px;
  }

  #wear-bbox-canvas {
    max-height: 410px;
  }
}

.wear-bbox-tools {
  display: flex;
  gap: 8px;
}

/* ---------- 结果步：复用主图结果编辑页骨架 ---------- */

.wear-result-workspace {
  grid-template-columns: minmax(0, 1fr);
  min-height: 620px;
}

.wear-result-workspace > .wear-result-panel {
  grid-column: 1;
}

.wear-active-stage {
  width: min(100%, 820px);
  min-height: clamp(420px, 58vw, 680px);
}

.wear-result-workspace .suite-result-tools button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.wear-result-grid .suite-result-card {
  width: 100%;
}

body.is-wear-result-previewing {
  overflow: hidden;
}

/* ---------- 弹窗 ---------- */

.wear-failure-reason {
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(18, 35, 60, 0.75);
}
