/* ============================================================================
 * 影造AI · 两栏工作台（2026-10-27 新建）
 * 权威依据：docs/effect-mockup-final.html（电脑端 1440×900 效果图）
 *
 * 形态：左 = 模板墙（可滚动）  |  右 = 固定编辑面板（position: sticky）
 *
 * 铁律（与 scripts/check-responsive.js 一致）：
 *   1. 本文件是外链 CSS，不在页面内联 style 里写死手机列宽。
 *   2. 面板宽度走 --wb-panel-w 令牌，桌面 ≥1100px 生效，手机端一律单列。
 *   3. 主题色只用 design-system.css 令牌（--gold / --gold-hi / --purple / --bg-0..4）。
 * ========================================================================== */

.wb-shell {
  display: block;
}

/* ---------- 桌面端：左墙 + 右固定面板 ---------- */
@media (min-width: 1100px) {
  .wb-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--wb-panel-w, 380px);
    column-gap: var(--sp-6);
    align-items: start;
  }
  /* 左墙：第 1 列第 1 行 */
  .wb-wall { grid-column: 1; grid-row: 1; }
  /* 右面板：第 2 列，跨全部行；align-self:start 保证不被拉高（否则 sticky 失效） */
  .wb-panel {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
    position: sticky;
    top: calc(var(--topbar-h, 56px) + var(--sp-4, 16px));
    max-height: calc(100vh - var(--topbar-h, 56px) - var(--sp-8, 32px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* 步骤卡等其余直接子元素一律回左列续排 */
  .wb-shell > *:not(.wb-wall):not(.wb-panel) { grid-column: 1; }
}

/* ---------- 左：模板墙 ---------- */
.wb-wall {
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-1);
}
.wb-wall-head { margin-bottom: var(--sp-4); }
.wb-wall-title {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.35;
  margin-bottom: 4px;
}
.wb-wall-sub {
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.6;
}

/* 列数自适应（老板定稿）：minmax(150px,1fr)，容器多宽排多少列 */
.wb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-3);
}
/* 手机端：容器窄，自适应会把封面挤成 1 列；按效果图口径固定 3 列 */
@media (max-width: 640px) {
  .wb-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-2);
  }
}

/* 画风卡：18 个 · 3 排 6 列（固定，不自适应） */
.wb-style-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-2);
}
@media (max-width: 900px) { .wb-style-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .wb-style-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 模板卡（9:16 封面墙） ---------- */
.wb-tpl {
  display: block;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--line-2);
  background: var(--bg-2);
  border-radius: var(--r-md);
  padding: 6px;
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.wb-tpl:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.wb-tpl.is-on {
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(199, 243, 106, .20);
}
.wb-tpl:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

/* 封面：9:16，缺图时渐变占位（绝不裂图） */
.wb-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: linear-gradient(150deg, var(--bg-4) 0%, var(--bg-1) 55%, var(--bg-0) 100%);
  margin-bottom: 6px;
}
.wb-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wb-cover .wb-cover-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
}
.wb-cover .wb-hook {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 7px;
  font-size: 11px;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
}
.wb-tpl-name {
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--text-1);
  line-height: 1.35;
  margin-bottom: 2px;
}
.wb-tpl-meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
  line-height: 1.5;
}

/* ---------- 右：固定编辑面板 ---------- */
.wb-panel {
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
}
.wb-panel-title {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.35;
}
.wb-panel-sub {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.6;
}

/* 三钮：换内容 / 增强内容 / 一键填分镜 */
.wb-btns {
  display: flex;
  gap: var(--sp-2);
  margin: var(--sp-4) 0;
}
.wb-btn {
  flex: 1;
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text-2);
  border-radius: var(--r-sm);
  padding: 9px 4px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-2) var(--ease);
}
.wb-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-hi); }
.wb-btn.is-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  font-weight: 700;
}
.wb-btn.is-primary:hover:not(:disabled) { background: var(--gold-hi); color: #fff; }
.wb-btn:disabled { opacity: .5; cursor: not-allowed; }
.wb-btn.is-busy { opacity: .65; cursor: progress; }

/* 内容预览框 */
.wb-pre {
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--text-1);
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-sm);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 分镜表 */
.wb-shots { display: flex; flex-direction: column; gap: 6px; }
.wb-shot {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--text-2);
  border-bottom: 1px dashed var(--line-1);
  padding-bottom: 6px;
}
.wb-shot:last-child { border-bottom: 0; }
.wb-shot-no {
  flex: 0 0 auto;
  min-width: 46px;
  font-weight: 800;
  color: var(--gold-hi);
}
.wb-shot-txt {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 底部：价格 + 主行动按钮 */
.wb-panel-foot { margin-top: auto; padding-top: var(--sp-4); }
.wb-price {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-bottom: var(--sp-2);
  line-height: 1.6;
}
.wb-price b { color: var(--gold-hi); }
.wb-go {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--r-full);
  padding: 13px 0;
  font-size: var(--fs-md);
  font-weight: 700;
  color: #fff;
  background: var(--gold);
  box-shadow: var(--shadow-gold);
  cursor: pointer;
}
.wb-go:hover { background: var(--gold-hi); }
.wb-go:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }

/* 空态：还没挑模板时右侧面板的提示 */
.wb-empty {
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.7;
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
  text-align: center;
}
.wb-empty b { color: var(--text-2); }

/* 面板内的说明小字 */
.wb-hint {
  font-size: var(--fs-xs);
  color: var(--text-3);
  line-height: 1.6;
}

/* 换一批 */
.wb-more {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-3);
}
.wb-more button {
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text-2);
  border-radius: var(--r-full);
  padding: 7px 16px;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.wb-more button:hover { border-color: var(--gold); color: var(--gold-hi); }
/* ============================================================================
 * 影造AI · 两栏工作台 · 补充件（2026-10-27 T6-b/T6-c）
 * ==========================================================================*/

/* ---------- 商品图 / 品类图：1:1 方封面（商品图不能裁成 9:16） ---------- */
.wb-cover--sq {
  aspect-ratio: 1 / 1;
}

/* ---------- 面板里的分段参数组 ---------- */
.wb-seg-group {
  margin: var(--sp-4) 0 var(--sp-2);
}
.wb-seg-label {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-bottom: 6px;
  font-weight: 700;
}

/* ---------- 门店品类墙（18 个 · PC 9列2排 · 手机5列，对齐效果图页面3） ---------- */
.wb-cat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--sp-2);
}
@media (min-width: 960px) {
  .wb-cat-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
.wb-cat {
  display: block;
  width: 100%;
  border: 1.5px solid var(--line-2);
  background: var(--bg-3);
  border-radius: var(--r-sm);
  padding: 4px;
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.wb-cat:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.wb-cat.is-on {
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(199, 243, 106, .20);
}
.wb-cat.is-on span { color: var(--gold-hi); font-weight: 800; }
.wb-cat:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.wb-cat img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  margin-bottom: 3px;
  background: var(--bg-4);
}
.wb-cat span {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 做片页：桌面端（≥1100px）底部吸底条让位给右侧固定面板 ---------- */
@media (min-width: 1100px) {
  .gv-foot { display: none; }
  .sv-foot { display: none; }
}
/* ---------- 手机端：面板不重复价格与生成（底部吸底条已有） ---------- */
@media (max-width: 1099px) {
  .gv-panel-foot-m { display: none; }
  .sv-panel-foot-m { display: none; }
}
