/* === WORKBENCH SHELL === */

.wb-container { width: min(1280px, calc(100% - 48px)); margin: 0 auto; }

/* TOPBAR */
.wb-top {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  position: sticky; top: 0; z-index: 30;
}
.wb-top-inner {
  display: flex; justify-content: space-between; align-items: center;
  height: 60px;
}
.wb-brand { display: inline-flex; align-items: center; gap: 10px; height: 32px; }
.wb-brand-mark { width: 22px; height: 22px; }
.wb-brand-name {
  font-family: var(--serif);
  font-size: 19px; font-weight: 500;
  letter-spacing: 0.04em; line-height: 1; color: var(--ink);
}
.wb-brand-name .dot { color: var(--accent); margin: 0 1px; }
.wb-top-actions { display: inline-flex; align-items: center; gap: 10px; height: 32px; }
.wb-admin-link {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 12px;
  border-radius: var(--r-md);
  background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 650; text-decoration: none;
}
.wb-admin-link[hidden] { display: none; }
.wb-credit-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff; font-size: 13px;
}
.wb-credit-pill strong { font-feature-settings: "tnum"; }
.wb-account-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff; font-size: 13px;
}
#accountName {
  display: inline-block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-account-chip .avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-tan); color: var(--soft);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}

/* MODE BAR */
.wb-mode-bar {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: relative;
}
.wb-mode-bar::before,
.wb-mode-bar::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 28px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}
.wb-mode-bar::before {
  left: 0;
  background: linear-gradient(to right, #fff, rgba(255,255,255,0));
}
.wb-mode-bar::after {
  right: 0;
  background: linear-gradient(to left, #fff, rgba(255,255,255,0));
}
.wb-mode-bar.has-overflow-start::before { opacity: 1; }
.wb-mode-bar.has-overflow-end::after { opacity: 1; }
.wb-mode-inner {
  display: flex; justify-content: space-between; align-items: center;
  height: 56px;
}
.wb-pills {
  display: inline-flex; gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.wb-pill {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 14px;
  border: 0; border-radius: 5px;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; line-height: 1;
}
.wb-pill.active {
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--line);
}
.wb-pill.full-set { color: var(--ink); }
.wb-pill.full-set.active {
  background: var(--ink); color: #fff;
  box-shadow: none;
}
.wb-batch-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  color: var(--muted); font-size: 13px;
}
.wb-batch-link:hover { color: var(--ink); }

/* MAIN GRID */
.wb-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  padding: 24px 0 96px;
}

/* UPLOAD ZONE */
.wb-upload {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg);
  padding: 32px 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 18px;
}
.wb-upload-info strong { display: block; font-size: 17px; margin-bottom: 4px; }
.wb-upload-info p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.wb-uploaded-list {
  margin-top: 12px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}
.wb-uploaded-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  background-size: cover; background-position: center;
  border: 1px solid var(--line-strong);
}
.wb-uploaded-badge {
  position: absolute; left: 4px; bottom: 4px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
}
.wb-uploaded-remove {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px;
  border: 0; border-radius: 50%;
  background: rgba(10, 10, 10, 0.7);
  color: #fff;
  font-size: 16px; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.12s;
}
.wb-uploaded-thumb:hover .wb-uploaded-remove { opacity: 1; }
.wb-uploaded-remove:hover { background: var(--red); }

/* Sidebar live preview */
.wb-side-live {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.wb-side-live-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  background-size: cover; background-position: center;
  border: 1px solid var(--line);
  background-color: var(--bg);
}
.wb-side-live-thumb .tag {
  position: absolute; left: 3px; bottom: 3px;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 9px; font-weight: 600;
  color: var(--ink);
}
.wb-side-live-thumb.placeholder {
  background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.04) 0 4px, transparent 4px 8px);
  display: grid; place-items: center;
  color: var(--soft); font-size: 11px;
}
.wb-preview-hoverable {
  cursor: zoom-in;
  overflow: hidden;
}
.wb-preview-hoverable:hover {
  border-color: var(--ink);
}
.wb-product-library {
  margin: 0 12px 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
}
.wb-product-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.wb-product-library-head strong {
  font-size: 13px;
}
.wb-product-library-head span {
  color: var(--soft);
  font-size: 11px;
}
.wb-product-list {
  display: grid;
  gap: 8px;
}
.wb-product-empty {
  padding: 10px;
  border-radius: 7px;
  background: var(--bg);
  color: var(--soft);
  font-size: 11.5px;
  line-height: 1.5;
}
.wb-product-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}
.wb-product-cover {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  color: var(--soft);
  cursor: pointer;
}
.wb-product-cover:hover {
  border-color: var(--ink);
}
.wb-product-info {
  min-width: 0;
}
.wb-product-info strong,
.wb-product-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-product-info strong {
  font-size: 12.5px;
}
.wb-product-info span {
  margin-top: 2px;
  color: var(--soft);
  font-size: 11px;
}
.wb-product-actions {
  display: inline-flex;
  gap: 8px;
  margin-top: 5px;
}
.wb-product-actions button {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  padding: 0;
}
.wb-product-actions button:hover {
  color: var(--ink);
}
.wb-side-history {
  padding: 0 12px 12px;
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
}
.wb-side-history-row {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.wb-side-history-row.failed {
  background: #fff8f6;
  border-color: rgba(255, 59, 48, 0.18);
}
.wb-side-history-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}
.wb-side-history-image {
  position: relative;
  aspect-ratio: 1;
}
.wb-side-history-thumb {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background-size: cover; background-position: center;
  background-color: var(--bg);
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.wb-side-history-thumb:hover { border-color: var(--ink); }
.wb-history-zoom-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(10, 10, 10, 0.22);
  opacity: 0;
  transition: opacity 0.16s ease;
}
.wb-side-history-thumb:hover .wb-history-zoom-hint { opacity: 1; }
.wb-history-download,
.wb-history-zoom {
  position: absolute;
  right: 4px;
  bottom: 3px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.wb-history-zoom {
  bottom: 29px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.wb-side-history-image:hover .wb-history-zoom {
  opacity: 1;
  transform: translateY(0);
}
.wb-history-download:hover,
.wb-history-zoom:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.wb-side-history-failed {
  grid-column: 1 / -1;
  height: 32px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  background: rgba(255, 59, 48, 0.08);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}
.wb-side-history-meta strong { display: block; font-size: 12.5px; }
.wb-side-history-meta span { display: block; color: var(--soft); font-size: 11px; margin-top: 2px; }
.wb-side-history-status.failed {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 59, 48, 0.08);
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
}
.wb-hover-preview {
  position: fixed;
  right: 320px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  width: min(420px, calc(100vw - 360px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
  pointer-events: none;
}
.wb-hover-preview img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  border-radius: var(--r-sm);
  background: var(--bg);
}
.wb-hover-preview div {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}
@media (max-width: 1100px) {
  .wb-hover-preview {
    right: 24px;
    left: 24px;
    top: auto;
    bottom: 24px;
    width: auto;
    transform: none;
  }
}

/* SIDEBAR */
.wb-side { position: sticky; top: 132px; height: fit-content; display: grid; gap: 16px; }
.wb-side-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  overflow: hidden;
}
.wb-side-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
}
.wb-side-head h3 {
  margin: 0; font-family: var(--serif);
  font-size: 16px; font-weight: 500;
}
.wb-side-head small { color: var(--soft); font-size: 12px; }
.wb-side-empty {
  padding: 40px 24px; text-align: center;
  color: var(--soft); font-size: 13px; line-height: 1.6;
}
.wb-side-empty .ph {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: var(--r-md);
  background: var(--bg);
  display: grid; place-items: center;
  color: var(--soft);
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .wb-main { grid-template-columns: 1fr; }
  .wb-side { position: static; }
}

@media (max-width: 640px) {
  .wb-container {
    width: min(100% - 32px, 100%);
  }
  .wb-top-inner {
    height: 56px;
    gap: 10px;
  }
  .wb-brand-name {
    font-size: 17px;
    white-space: nowrap;
  }
  .wb-top-actions {
    gap: 6px;
  }
  .wb-admin-link {
    padding: 0 9px;
    font-size: 12px;
  }
  .wb-credit-pill {
    padding: 0 10px;
  }
  .wb-credit-pill span {
    display: none;
  }
  .wb-account-chip {
    padding: 0 10px;
  }
  #accountName {
    position: relative;
    display: inline-block;
    max-width: 2em;
    overflow: hidden;
    white-space: nowrap;
    color: transparent;
  }
  #accountName::after {
    content: attr(data-mobile-label);
    position: absolute;
    inset: 0;
    color: var(--ink);
  }
  .wb-mode-inner {
    height: auto;
    min-height: 58px;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .wb-mode-inner::-webkit-scrollbar {
    display: none;
  }
  .wb-pills {
    flex: 0 0 auto;
    max-width: none;
    overflow: visible;
  }
  .wb-pill {
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    padding: 0 13px;
  }
  .wb-batch-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .wb-main {
    padding-top: 20px;
  }
  .wb-upload {
    grid-template-columns: 1fr;
    padding: 26px 24px;
  }
  .wb-upload .btn {
    justify-self: start;
  }
  .wb-group-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .wb-group-title h2 {
    font-size: 21px;
    line-height: 1.18;
  }
  .wb-group-title small {
    max-width: none;
    line-height: 1.45;
    text-align: left;
  }
}

/* === 移动端补充 (A7): 字号/触摸区/safe-area === */
@media (max-width: 640px) {
  /* 顶栏品牌名字号收紧，避免折行 */
  .wb-brand-name {
    font-size: 14px;
  }
  /* mode pills 横向滚动加 scroll-snap，单 tab 居中可读 */
  .wb-mode-inner {
    scroll-snap-type: x mandatory;
  }
  .wb-pill {
    scroll-snap-align: start;
  }
  /* 上传缩略图 grid 改 3 列，单格更大，方便点击 */
  .wb-upload-thumbs,
  .wb-uploaded-list,
  [class*="upload"][class*="list"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  /* 缩略图删除按钮：手机始终可见 + 44×44 触摸区扩展 */
  .wb-uploaded-remove {
    opacity: 1;
    width: 28px;
    height: 28px;
    font-size: 18px;
  }
  .wb-uploaded-remove::before {
    content: "";
    position: absolute;
    inset: -8px;
  }
  /* 主 CTA 按钮 min-height 44px（触摸推荐尺寸） */
  .btn-lg {
    min-height: 44px;
  }
  /* 主区底部 safe-area，防 iOS 浏览器底栏遮挡 */
  .wb-main {
    padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
  }
}

/* === MODULES STACK === */
.wb-group-title {
  margin: 32px 0 14px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.wb-group-title h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.005em;
}
.wb-group-title small { color: var(--soft); font-size: 13px; }

.wb-modules {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.wb-mod {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.wb-mod:last-child { border-bottom: 0; }
.wb-mod.is-disabled {
  background: #fafafa;
}
.wb-mod.is-disabled .wb-mod-name,
.wb-mod.is-disabled .wb-mod-desc {
  color: var(--muted);
}
.wb-mod-num {
  width: 30px; height: 30px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 14px; color: var(--ink);
}
.wb-mod-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 4px;
}
.wb-mod-name { font-size: 16px; font-weight: 600; letter-spacing: -0.005em; }
.wb-mod-meta { display: inline-flex; gap: 14px; color: var(--soft); font-size: 12.5px; font-feature-settings: "tnum"; }
.wb-mod-meta b { color: var(--ink); font-weight: 600; }
.wb-optional-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.wb-optional-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--ink);
}
.wb-mod-meta select {
  height: 24px; padding: 0 6px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: #fff; font-size: 12px;
}
.wb-mod-desc { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* TOTALS + CTA */
.wb-totals {
  margin-top: 28px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
}
.wb-totals-info { display: grid; gap: 4px; }
.wb-totals-info strong { font-size: 17px; font-feature-settings: "tnum"; }
.wb-totals-info span { color: var(--soft); font-size: 12.5px; }

/* CTA 提示行 + 输入错误态 */
.wb-totals .btn[disabled],
.wb-mp .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.wb-cta-hint {
  flex-basis: 100%;
  margin-top: 8px;
  color: var(--red, #d33);
  font-size: 12.5px;
  line-height: 1.5;
}
.wb-cta-hint a {
  color: inherit;
  text-decoration: underline;
}
.input-error,
input.input-error,
textarea.input-error {
  border-color: var(--red, #d33) !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.08);
}

/* === SINGLE MODULE === */
.wb-mp { margin-top: 32px; }
.wb-mp-eyebrow {
  color: var(--accent);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 10px;
}
.wb-mp-title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 32px; font-weight: 500;
  letter-spacing: -0.012em; line-height: 1.1;
}
.wb-mp-desc { margin: 0 0 32px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.wb-mp-section {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.wb-mp-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
.wb-mp-section-head strong { font-size: 14px; }
.wb-mp-section-head small { color: var(--soft); font-size: 12px; }

.wb-count-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.wb-count-cell {
  height: 44px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: #fff;
  font-size: 14px; font-weight: 600; color: var(--ink);
  display: grid; place-items: center;
  cursor: pointer;
  font-feature-settings: "tnum";
}
.wb-count-cell.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.wb-count-cell.muted { color: var(--soft); }
.wb-count-cell.disabled { opacity: 0.4; cursor: not-allowed; }

/* === STATE: GENERATING === */
.wb-gen-card {
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #fff;
}
.wb-gen-summary {
  padding: 24px; background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
}
.wb-gen-summary h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.wb-gen-summary p { margin: 0; color: var(--muted); font-size: 13.5px; font-feature-settings: "tnum"; }
.wb-gen-summary .wb-gen-hint {
  margin-top: 8px;
  color: var(--soft);
  font-size: 12.5px;
  line-height: 1.45;
}
.wb-gen-overall-bar { height: 4px; background: var(--bg); border-bottom: 1px solid var(--line); }
.wb-gen-overall-fill { height: 100%; width: 0; background: var(--ink); transition: width 0.3s; }
.wb-gen-modules { padding: 8px 0; }
.wb-gen-mod {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 16px; padding: 16px 24px; align-items: center;
}
.wb-gen-mod + .wb-gen-mod { border-top: 1px solid var(--line); }
.wb-gen-mod-icon {
  width: 30px; height: 30px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 14px;
}
.wb-gen-mod.done .wb-gen-mod-icon { background: var(--ink); border-color: var(--ink); color: #fff; }
.wb-gen-mod.active .wb-gen-mod-icon { box-shadow: 0 0 0 3px rgba(10,10,10,0.06); }
.wb-gen-mod.pending { opacity: 0.5; }
.wb-gen-mod-body strong { display: block; font-size: 14px; margin-bottom: 4px; }
.wb-gen-mod-body small { color: var(--soft); font-size: 12.5px; font-feature-settings: "tnum"; }
.wb-gen-mod-status { font-size: 12px; font-weight: 600; color: var(--soft); }
.wb-gen-mod.done .wb-gen-mod-status { color: var(--green); }
.wb-gen-mod.active .wb-gen-mod-status { color: var(--ink); }
.wb-gen-mod-progress {
  grid-column: 2 / -1; height: 3px; margin-top: 10px;
  background: var(--bg); border-radius: 2px; overflow: hidden;
}
.wb-gen-mod-progress-fill { height: 100%; background: var(--ink); width: 0; transition: width 0.3s; }

/* === STATE: DONE === */
.wb-done-banner {
  padding: 18px 24px;
  border: 1px solid rgba(21, 128, 61, 0.18);
  border-radius: var(--r-md); background: var(--green-soft);
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.wb-done-banner .left { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; }
.wb-done-banner .check {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center;
}
.wb-done-banner strong { font-size: 15px; }
.wb-done-banner small { color: var(--muted); font-size: 13px; font-feature-settings: "tnum"; }

.wb-fail-banner {
  padding: 14px 18px;
  border: 1px solid rgba(185, 28, 28, 0.24);
  border-radius: var(--r-md); background: var(--red-soft);
  margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.wb-fail-banner .ft { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.wb-fail-banner .ft svg { color: var(--red); }

.wb-group {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff; margin-bottom: 16px; overflow: hidden;
}
.wb-group-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}

.wb-thumbs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line);
}
.wb-thumb {
  position: relative; aspect-ratio: 1;
  background: #fff; background-size: cover; background-position: center;
  overflow: hidden;
  cursor: pointer;
}
.wb-thumb-label {
  position: absolute; left: 8px; bottom: 8px;
  padding: 2px 6px; background: rgba(255, 255, 255, 0.92);
  border-radius: 3px; font-size: 10px; font-weight: 600;
}
.wb-thumb-check {
  position: absolute; top: 8px; left: 8px;
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.92);
  display: grid; place-items: center;
  color: transparent;
}
.wb-thumb.selected .wb-thumb-check {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.wb-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.12);
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
}
.wb-thumb:hover::after { opacity: 1; }
.wb-thumb-actions {
  position: absolute; top: 8px; right: 8px;
  display: none; gap: 4px;
  z-index: 3;
}
.wb-thumb:hover .wb-thumb-actions { display: flex; }
.wb-thumb-actions button {
  width: 28px; height: 28px;
  border-radius: var(--r-sm); border: 0;
  background: rgba(10, 10, 10, 0.85); color: #fff;
  display: grid; place-items: center; font-size: 12px;
}
.wb-thumb-actions button:hover { background: #fff; color: var(--ink); }

.wb-download-bar {
  margin-top: 18px; padding: 14px 20px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--ink); color: #fff;
  display: flex; justify-content: space-between; align-items: center;
}
.wb-download-bar .info { font-size: 14px; font-feature-settings: "tnum"; }
.wb-download-bar .info b { font-weight: 700; }
.wb-download-bar .actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.wb-field-hint {
  display: block;
  margin-top: 7px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
}
.wb-prompt-quick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0 4px;
}
.wb-prompt-quick-label {
  font-size: 11px;
  color: var(--soft);
  letter-spacing: 0.04em;
  margin-right: 2px;
}
.wb-prompt-quick-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.wb-prompt-quick-btn:hover {
  background: var(--bg);
  border-color: var(--line-strong);
}
.wb-prompt-quick-wrap {
  position: relative;
  display: inline-flex;
}
.wb-prompt-quick-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--soft);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.wb-prompt-quick-wrap:hover .wb-prompt-quick-del {
  display: inline-flex;
}
.wb-prompt-quick-del:hover {
  color: #fff;
  background: var(--red, #d33);
  border-color: var(--red, #d33);
}
@media (max-width: 640px) {
  /* 手机端常显，方便触摸 */
  .wb-prompt-quick-del {
    display: inline-flex;
    width: 22px;
    height: 22px;
    font-size: 14px;
  }
}
.wb-prompt-save-btn {
  margin-left: auto;
  height: 26px;
  padding: 0 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: transparent;
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.wb-prompt-save-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.wb-prompt-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
}
.wb-prompt-tools select {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  padding: 0 9px;
}
.wb-prompt-tools button,
.wb-segmented button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
}
.wb-prompt-tools button:hover,
.wb-segmented button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.wb-selling-planner {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.wb-mini-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.wb-mini-head strong {
  font-size: 13px;
}
.wb-mini-head span {
  color: var(--soft);
  font-size: 12px;
}
.wb-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.wb-plan-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 2px 8px;
  padding: 9px;
  border-radius: 8px;
  background: var(--bg);
}
.wb-plan-item b {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  grid-row: span 2;
}
.wb-plan-item span {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}
.wb-plan-item small {
  color: var(--soft);
  font-size: 11px;
  line-height: 1.45;
}
.wb-reference-picker {
  margin: 12px 0 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wb-reference-picker > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.wb-reference-picker strong {
  font-size: 12.5px;
  white-space: nowrap;
}
.wb-reference-picker span {
  color: var(--soft);
  font-size: 11.5px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .wb-reference-picker > div:first-child {
    flex-wrap: wrap;
  }
  .wb-reference-picker span {
    flex-basis: 100%;
    white-space: normal;
    overflow: visible;
  }
}
.wb-segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.wb-segmented button {
  border-color: transparent;
}
.wb-segmented button.active {
  background: var(--ink);
  color: #fff;
}
.wb-platform-hint {
  margin-top: 8px;
}
.wb-session-note {
  margin-top: 10px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
}
.wb-reference-flow {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.wb-reference-flow span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}
.wb-reference-flow b {
  color: var(--soft);
}
.wb-reference-flow small {
  flex-basis: 100%;
  color: var(--soft);
  line-height: 1.45;
}

@media (max-width: 640px) {
  .wb-gen-summary,
  .wb-done-banner,
  .wb-fail-banner,
  .wb-download-bar {
    align-items: flex-start;
    flex-direction: column;
  }
  .wb-download-bar .actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .wb-download-bar .actions .btn {
    justify-content: center;
  }
}

.wb-lightbox-modal {
  max-width: min(92vw, 980px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.wb-lightbox-head,
.wb-lightbox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.wb-lightbox-head strong {
  display: block;
  font-size: 15px;
}
.wb-lightbox-head span {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 12px;
}
.wb-lightbox-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.wb-lightbox-close:hover { background: var(--ink); color: #fff; }
.wb-lightbox-body {
  min-height: 0;
  padding: 14px;
  background: var(--bg);
  display: grid;
  place-items: center;
}
.wb-lightbox-image {
  max-width: 100%;
  max-height: calc(92vh - 142px);
  object-fit: contain;
  display: block;
  border-radius: var(--r-sm);
  background: #fff;
  box-shadow: 0 12px 44px rgba(10, 10, 10, 0.10);
}
.wb-lightbox-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
  background: #fff;
}

/* === SKELETON (A13): 首屏 mainContent 占位 + shimmer === */
.wb-skeleton {
  display: grid;
  gap: 14px;
  padding: 8px 0;
}
.wb-skel-block {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, #f2f2ef 0%, #ececec 50%, #f2f2ef 100%);
  background-size: 200% 100%;
  animation: wb-skel-shimmer 1.4s linear infinite;
}
@keyframes wb-skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.wb-skel-fallback {
  margin-top: 8px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
