/* fitting-widget v0 — 渠道中立量体表单 + 荐码（E0-K2，无 3D） */

.fitting-widget-host {
  min-width: 0;
  max-width: 100%;
  --fw-bg: var(--fitting-bg, #f6f4f1);
  --fw-card: var(--fitting-card, #ffffff);
  --fw-text: var(--fitting-text, #1f1f1f);
  --fw-muted: var(--fitting-muted, #6b6b6b);
  --fw-accent: var(--fitting-accent, #2f5d50);
  --fw-accent-light: var(--fitting-accent-light, #e8f2ee);
  --fw-border: var(--fitting-border, #e5e1db);
  --fw-warn: var(--fitting-warn, #9a6b1a);
  --fw-bad: var(--fitting-bad, #a33b3b);
  --fw-radius: var(--fitting-radius, 12px);
  font-family: var(--fitting-font, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif);
  color: var(--fw-text);
  background: var(--fw-bg);
}

.fw-root {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.fw-section {
  min-width: 0;
  background: var(--fw-card);
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius);
  padding: 1rem;
  overflow: visible;
}

.fw-heading {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  line-height: 1.4;
  overflow: visible;
}

.fw-subheading {
  margin: 1rem 0 0.5rem;
  font-size: 0.9rem;
}

.fw-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.fw-product {
  display: grid;
  gap: 0.25rem;
  text-align: left;
  padding: 0.6rem;
  border: 2px solid var(--fw-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.fw-product--selected {
  border-color: var(--fw-accent);
  background: var(--fw-accent-light);
}

.fw-product-thumb {
  display: grid;
  place-items: center;
  height: 64px;
  border-radius: 6px;
  background: linear-gradient(135deg, #dfe8e3, #c5d4cc);
  color: var(--fw-accent);
  font-weight: 700;
  font-size: 0.8rem;
}

.fw-product-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.fw-product-desc {
  font-size: 0.75rem;
  color: var(--fw-muted);
}

.fw-form {
  display: grid;
  gap: 0.75rem;
}

.fw-form-hint {
  margin: -0.35rem 0 0.25rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--fw-muted);
  overflow: visible;
  word-break: break-word;
}

.fw-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.fw-photo-slot {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px dashed var(--fw-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.fw-photo-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 200px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--fw-border);
}

.fw-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.fw-result-visual {
  min-height: 200px;
  margin: 0.5rem 0 0.75rem;
}

.fw-root--photo-result .fw-result-visual {
  min-height: auto;
}

.fw-figure-pending {
  margin: 0.75rem 0;
  text-align: center;
}

.fw-preview .fw-figure {
  margin-top: 1rem;
  margin-bottom: 0;
}

.fw-preview .fw-figure .fw-figure-frame {
  min-height: 160px;
}

.fw-figure {
  margin: 0.35rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--fw-border, #e5e2dc);
  border-radius: 10px;
  background: #faf8f5;
}

.fw-figure-title {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.fw-figure-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.fw-figure-slot {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.fw-figure-frame {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--fw-border, #e5e2dc);
}

.fw-figure-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fw-figure-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--fw-muted, #666);
}

.fw-figure-empty[hidden],
.fw-figure-frame img[hidden] {
  display: none;
}

.fw-photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--fw-muted);
  background: repeating-linear-gradient(
    -45deg,
    #f8fafc,
    #f8fafc 8px,
    #f1f5f9 8px,
    #f1f5f9 16px
  );
}

.fw-photo-slot--filled {
  border-style: solid;
}

.fw-photo-slot input[type="file"] {
  width: 100%;
  min-width: 0;
  font-size: 0.75rem;
}

.fw-photo-name {
  font-size: 0.72rem;
  color: var(--fw-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fw-photo-status {
  margin: 0.65rem 0 0.35rem;
  padding: 0.2rem 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--fw-muted);
  min-height: 1.5em;
  overflow: visible;
  word-break: break-word;
  white-space: normal;
}

.fw-step-badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--fw-accent-light);
  color: var(--fw-accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.fw-photo-badge {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.75rem;
}

.fw-photo-badge--ok {
  background: #e7f6ee;
  color: #1f7a45;
}

.fw-photo-badge--bad {
  background: #fdecec;
  color: var(--fw-bad);
}

.fw-photo-slot--ok {
  border-color: #1f7a45;
}

.fw-photo-slot--bad {
  border-color: var(--fw-bad);
}

.fw-pose-errors {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--fw-bad);
  font-size: 0.85rem;
}

.fw-model-id {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: var(--fw-accent-light);
  color: var(--fw-accent);
  font-size: 0.9rem;
  word-break: break-all;
}

/* 默认首屏：仅步骤1 上传三视图；步骤2/商品在开始量体后再展开 */
.fw-root[data-fw-flow-stage="capture"] [data-fw-refine],
.fw-root[data-fw-flow-stage="capture"] [data-fw-products-section],
.fw-root[data-fw-flow-stage="photos"] [data-fw-refine],
.fw-root[data-fw-flow-stage="photos"] [data-fw-products-section] {
  display: none !important;
}

/* 步骤3：生成成功（preview/saved/confirmed）前不显示 */
.fw-root:not([data-fw-flow-stage="preview"]):not([data-fw-flow-stage="saved"]):not([data-fw-flow-stage="confirmed"]) [data-fw-preview-section] {
  display: none !important;
}

.fw-capture-basics {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.75rem 0;
  min-width: 0;
}

.fw-capture-gender {
  max-width: 12rem;
}

.fw-capture-hw {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
}

.fw-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.fw-modal[hidden] {
  display: none !important;
}

.fw-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.fw-modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 1.1rem 1.2rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  display: grid;
  gap: 0.65rem;
}

/* 拍照采集可选勾选 */
.fw-photo-opt-in {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--fw-text, #1e293b);
  cursor: pointer;
}

.fw-photo-opt-in input[type="checkbox"] {
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.fw-photo-grid[hidden] {
  display: none !important;
}

/* 修改参数：步骤1无三视图，仅性别/身高/体重 */
.fw-photos--basics-only .fw-photo-grid,
.fw-photos--basics-only [data-fw-actions-capture],
.fw-photos--basics-only [data-fw-photo-status],
.fw-photos--basics-only [data-fw-pose-errors] {
  display: none !important;
}

.fw-photos--basics-only .fw-capture-basics {
  margin-top: 0;
}

.fw-photos--compact .fw-form-hint,
.fw-photos--compact .fw-actions,
.fw-photos--compact .fw-photo-slot input[type="file"],
.fw-photos--compact .fw-photo-name,
.fw-photos--compact .fw-photo-placeholder {
  display: none;
}

.fw-photos--compact .fw-photo-grid {
  margin-bottom: 0.35rem;
}

.fw-photos--compact .fw-photo-preview {
  aspect-ratio: 1 / 1;
}

.fw-photos--compact .fw-photo-slot {
  padding: 0.35rem;
}

/* 步骤2 允许原地改基础参数重跑：提示与「重新量体」按钮要留着。
   结果页那几步仍按 compact 收起来 —— 那里由「返回修改」负责。 */
.fw-root[data-fw-flow-stage="measures"] .fw-photos--compact .fw-form-hint {
  display: block;
}

.fw-root[data-fw-flow-stage="measures"] .fw-photos--compact .fw-actions {
  display: flex;
}

@media (max-width: 720px) {
  .fw-photo-grid {
    grid-template-columns: 1fr;
  }
}

.fw-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.fw-measure-list {
  display: flex;
  flex-direction: column;
  /* 2026-11-12 主人令：行距收到原来的约 2/3（0.65 → 0.42rem） */
  gap: 0.42rem;
  min-width: 0;
}

/* ── 2026-11-12 主人令：实测值/估算值行 + 步骤2 两组 tab ───────── */

.fw-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.1rem 0 0.55rem;
}

.fw-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--fw-border);
  border-radius: 999px;
  background: #fff;
  color: var(--fw-muted);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.3;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fw-tab.is-active {
  border-color: var(--fw-accent);
  background: var(--fw-accent);
  color: #fff;
  font-weight: 600;
}

.fw-step-row {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
}

.fw-step-label {
  font-size: 0.82rem;
  color: var(--fw-muted);
  white-space: nowrap;
}

.fw-step-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

/* 估算值：系统算出来的参考值，一直显示在实测值上面，不随 ± 变动 */
.fw-step-est {
  font-size: 0.68rem;
  line-height: 1.15;
  color: var(--fw-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fw-step-controls {
  display: grid;
  grid-template-columns: auto auto minmax(3.2rem, 1fr) auto auto auto;
  align-items: center;
  gap: 0.28rem;
}

/* 加减按钮：彩色小图标按钮（2026-11-12 主人令：文字按钮改小图片按钮、要彩色）。
   减＝暖红、加＝青绿，颜色即方向；粗调（±1）双折线深底、微调（±0.1）单折线白底。 */
.fw-step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.fw-step-btn:active {
  transform: scale(0.94);
}

.fw-step-btn:focus-visible {
  outline: 2px solid var(--fw-accent);
  outline-offset: 1px;
}

.fw-step-icon {
  display: block;
  width: 0.95rem;
  height: 0.95rem;
}

.fw-step-btn--dec {
  color: #d13b3f;
}

.fw-step-btn--inc {
  color: #14895a;
}

/* 粗调（±1）：实心彩色块 + 白色符号，一眼看出是「大步」 */
.fw-step-btn--coarse .fw-step-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.fw-step-btn--coarse.fw-step-btn--dec {
  background: #e3524f;
  border-color: #d94643;
  color: #fff;
  box-shadow: 0 1px 2px rgba(211, 59, 63, 0.25);
}

.fw-step-btn--coarse.fw-step-btn--dec:active {
  background: #c93f3c;
  border-color: #bf3a37;
}

.fw-step-btn--coarse.fw-step-btn--inc {
  background: #21a06a;
  border-color: #1a8f5e;
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 137, 90, 0.25);
}

.fw-step-btn--coarse.fw-step-btn--inc:active {
  background: #1b8b5c;
  border-color: #167a51;
}

/* 微调（±0.1）：白底细描边，符号本身带颜色 */
.fw-step-btn--fine .fw-step-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.fw-step-btn--fine.fw-step-btn--dec {
  background: #fff;
  border-color: #f2c4c4;
}

.fw-step-btn--fine.fw-step-btn--dec:active {
  background: #fdf0f0;
}

.fw-step-btn--fine.fw-step-btn--inc {
  background: #fff;
  border-color: #b9e0c9;
}

.fw-step-btn--fine.fw-step-btn--inc:active {
  background: #eef8f2;
}

.fw-step-controls input[type="number"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.32rem 0.2rem;
  border: 1px solid var(--fw-border);
  border-radius: 8px;
  background: #fff;
  color: var(--fw-text);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fw-step-unit {
  font-size: 0.72rem;
  color: var(--fw-muted);
}

.fw-root--h5 .fw-step-controls input[type="number"] {
  min-height: 2.3rem;
  font-size: 16px;
}

.fw-root--h5 .fw-step-btn {
  width: 2.3rem;
  height: 2.3rem;
  min-width: 2.3rem;
  min-height: 2.3rem;
}

.fw-root--h5 .fw-step-icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* 单行：标签 | 滑块 | 数值 | 单位 */
.fw-slider-field.fw-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
}

.fw-slider-field .fw-label {
  flex: 0 0 2.75rem;
  margin: 0;
  white-space: nowrap;
  color: var(--fw-muted);
}

.fw-slider-value {
  font-variant-numeric: tabular-nums;
  color: var(--fw-text);
  font-weight: 600;
}

.fw-slider-unit {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--fw-muted);
  min-width: 1.5rem;
}

.fw-range {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  accent-color: var(--fw-accent);
  cursor: pointer;
}

/* 覆盖 .fw-field input { width:100% }，避免数字框撑满一行 */
.fw-slider-field.fw-field input[type="number"] {
  flex: 0 0 4.25rem;
  box-sizing: border-box;
  width: 4.25rem;
  max-width: 4.25rem;
  min-width: 0;
  padding: 0.4rem 0.35rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
  .fw-row {
    grid-template-columns: 1fr;
  }
}

.fw-field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.fw-label {
  color: var(--fw-muted);
}

.fw-field input,
.fw-field select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--fw-border);
  border-radius: 8px;
  font: inherit;
  color: var(--fw-text);
  background: #fff;
}

.fw-field select option {
  color: var(--fw-text);
  background: #fff;
}

.fw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fw-btn {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
}

.fw-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fw-btn--primary {
  background: var(--fw-accent);
  color: #fff;
}

.fw-btn--secondary {
  background: #fff;
  border-color: var(--fw-border);
  color: var(--fw-text);
}

.fw-error {
  margin: 0;
  color: var(--fw-bad);
  font-size: 0.85rem;
}

.fw-error:not([hidden]) {
  margin: 0.5rem 0;
  padding: 0.65rem 0.75rem;
  background: #fef2f2;
  border: 1px solid var(--fw-bad);
  border-radius: var(--fw-radius);
  font-size: 0.9rem;
  line-height: 1.45;
}

.fw-status {
  margin: 0 0 0.5rem;
  color: var(--fw-muted);
  font-size: 0.85rem;
}

.fw-result-primary {
  margin: 0 0 0.25rem;
}

.fw-result-score,
.fw-result-alt,
.fw-result-note,
.fw-result-est {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.fw-result-est {
  color: var(--fw-muted);
  font-size: 0.8rem;
}

.fw-result-list {
  margin: 0.25rem 0 0.5rem 1.1rem;
  padding: 0;
  font-size: 0.85rem;
}

.fw-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: var(--fw-accent-light);
  color: var(--fw-accent);
}

.fw-tag--warn {
  background: #f8f0df;
  color: var(--fw-warn);
}

.fw-tag--bad {
  background: #faeaea;
  color: var(--fw-bad);
}

.fw-debug {
  margin: 0;
  font-size: 0.75rem;
  color: var(--fw-muted);
}

[hidden] {
  display: none !important;
}

.fw-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.fw-layout-main,
.fw-layout-preview {
  min-width: 0;
  max-width: 100%;
}

.fw-section.fw-preview {
  position: relative;
  z-index: 0;
  overflow: hidden;
}



/* ── H5 / 手机嵌入 ───────────────────────────────────── */

.fitting-widget-host--h5,
.fw-root--h5 {
  -webkit-tap-highlight-color: transparent;
}

.fitting-widget-host--h5 {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.fw-root--h5 .fw-actions-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  /* 勿用负底边距，否则会盖住同卡片内的状态文案 */
  margin: 0.5rem -0.85rem 0;
  padding: 0.75rem 0.85rem 0.85rem;
  background: linear-gradient(180deg, rgba(246, 244, 241, 0) 0%, var(--fw-card) 28%);
  flex-direction: column;
  overflow: visible;
}

.fw-root--h5 .fw-section {
  padding: 0.85rem;
  padding-bottom: 1rem;
  border-radius: 10px;
  overflow: visible;
}

.fw-root--h5 .fw-photo-status {
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 0.25rem 0.1rem;
}

.fw-root--h5 .fw-products {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 0.15rem;
}

.fw-root--h5 .fw-product {
  flex: 0 0 9.5rem;
  scroll-snap-align: start;
}

.fw-root--h5 .fw-row {
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.fw-root--h5 .fw-slider-field.fw-field {
  gap: 0.45rem;
}

.fw-root--h5 .fw-range {
  min-height: 1.5rem;
}

.fw-root--h5 .fw-slider-field.fw-field input[type="number"] {
  flex: 0 0 4.5rem;
  width: 4.5rem;
  max-width: 4.5rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.4rem;
  font-size: 16px;
}

.fw-root--h5 .fw-field input:not([type="number"]),
.fw-root--h5 .fw-field select {
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  font-size: 16px;
}

.fw-root--h5 .fw-btn {
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  font-size: 1rem;
}

.fw-root--h5 .fw-actions-bar .fw-btn {
  width: 100%;
}

.fw-exit-panel {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: #eef6ef;
  border: 1px solid #cfe3d2;
}

.fw-exit-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: #1f6b3a;
}

.fw-exit-hint {
  margin: 0 0 0.65rem;
  color: var(--fw-muted);
  font-size: 0.9rem;
}

.fw-root--h5 .fw-layout {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* 量体表单/生成按钮在上，三维模型在下 */
.fw-root--h5 .fw-layout-main {
  order: 1;
}

.fw-root--h5 .fw-layout-preview {
  order: 2;
}

.fw-root--h5 .fw-preview-host {
  height: min(42vh, 360px);
  min-height: 240px;
}

.fw-root--h5 .fw-debug {
  display: none;
}

@media (max-width: 768px) {
  .fitting-widget-host:not(.fitting-widget-host--h5) .fw-row {
    grid-template-columns: 1fr;
  }

  .fitting-widget-host:not(.fitting-widget-host--h5) .fw-field input,
  .fitting-widget-host:not(.fitting-widget-host--h5) .fw-field select {
    font-size: 16px;
    min-height: 2.75rem;
  }

  .fitting-widget-host:not(.fitting-widget-host--h5) .fw-btn {
    min-height: 2.75rem;
  }
}

.fw-preview-hint {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--fw-muted);
}

.fw-preview-host {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: min(52vh, 420px);
  min-height: 320px;
  border: 1px solid var(--fw-border);
  border-radius: 10px;
  overflow: hidden;
  contain: layout paint;
  background: linear-gradient(180deg, #f4efe8 0%, #e5ddd2 100%);
  user-select: none;
}

.fw-preview-actions {
  margin-top: 0.5rem;
}

/* 步骤3 底部：保存 / 修正 */
.fw-actions-preview {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fw-preview-host .mesh-drag-hint {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(47, 93, 80, 0.88);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 2;
}

.fw-preview-host .mesh-viewer-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--fw-bad);
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.85rem;
  text-align: center;
  z-index: 3;
}

.fw-preview-host .mesh-viewer-note {
  position: absolute;
  left: 0.6rem;
  bottom: 0.45rem;
  margin: 0;
  pointer-events: none;
  z-index: 2;
  font-size: 0.75rem;
  color: var(--fw-muted);
  text-shadow: 0 1px 0 #fff;
}

.fw-preview-host canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  cursor: grab;
  touch-action: none;
}
