/* ═══════════════════════════════════════════════════════════════
   AmzStudio — 亚马逊 AI 商品图工作室
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ink:       #0f1419;
  --ink-2:     #39424d;
  --muted:     #5f6a76;
  --muted-2:   #8b95a1;
  --line:      #e4e7ec;
  --line-2:    #eef0f3;
  --bg:        #f4f5f7;
  --card:      #ffffff;
  --accent:    #e8622c;
  --accent-dk: #cb4e1b;
  --accent-bg: #fdf2ec;
  --ok:        #0e9f6e;
  --radius:    12px;
  --shadow-sm: 0 1px 2px rgba(15,20,25,.05);
  --shadow:    0 1px 3px rgba(15,20,25,.05), 0 8px 22px -10px rgba(15,20,25,.12);
  --shadow-lg: 0 16px 44px -16px rgba(15,20,25,.28);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* 超宽屏等比缩放系数，见文件末尾 @media 段 */
  --z: 1;
}

/* ═══════════════════════════════════════════════════════════════
   超宽屏等比放大
   ───────────────────────────────────────────────────────────────
   4.5K / 5K 屏（2540px 逻辑宽）上，14px 的正文在物理上只有蚂蚁大，
   用户根本不是在「看界面」，是在「找字」。
   这里按视口宽度整体放大——布局内部比例完全不变，不会挤压换行。
   .layout 的高度要反向补偿：zoom 会把 vh 一起放大。
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 1560px) { :root { --z: 1.06; } }
@media (min-width: 1800px) { :root { --z: 1.12; } }
@media (min-width: 2050px) { :root { --z: 1.18; } }
@media (min-width: 2350px) { :root { --z: 1.24; } }
@media (min-width: 2800px) { :root { --z: 1.3; } }

body { zoom: var(--z); }

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 关键：hidden 属性优先于组件的 display 声明 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
svg { display: block; flex: none; }

/* ─────────── 顶栏 ─────────── */
.topbar {
  height: 58px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: relative;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(140deg, #f2793e, var(--accent-dk));
  color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center;
  box-shadow: 0 3px 10px -2px rgba(232,98,44,.42);
  letter-spacing: -.5px;
}
.brand-txt h1 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; line-height: 1.25; }
.brand-txt p { font-size: 12.5px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 9px; }

.api-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fcfcfd;
}
.api-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); transition: background .3s; }
.api-pill.ok i { background: var(--ok); box-shadow: 0 0 0 3px rgba(14,159,110,.14); }
.api-pill.bad i { background: #e02424; box-shadow: 0 0 0 3px rgba(224,36,36,.12); }

.credit-pill {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fcfcfd;
}
.credit-pill b { color: var(--accent-dk); font-weight: 700; }

.btn-ghost {
  display: flex; align-items: center; gap: 6px;
  height: 33px; padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 13.5px; font-weight: 500;
  transition: .15s;
}
.btn-ghost:hover { background: #fafbfc; border-color: #d6dbe2; color: var(--ink); }
.btn-ghost.sm { height: 28px; font-size: 13px; padding: 0 10px; }
a.btn-ghost { text-decoration: none; }

/* ── 账号菜单（右上角） ── */
.user-menu { position: relative; }
.user-drop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 132px; padding: 5px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
.user-drop button {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; border: 0; border-radius: 7px;
  background: none; font-family: var(--font); font-size: 13px;
  color: var(--ink-2); cursor: pointer;
}
.user-drop button:hover { background: #f2f4f6; color: var(--ink); }

/* 余额见底时把数字染红 —— 比弹窗提醒更早被看见 */
.credit-pill.low { border-color: #f0d3d3; background: #fdf6f6; }
.credit-pill.low b { color: var(--danger, #d93a3a); }

.badge {
  min-width: 16px; height: 16px; padding: 0 5px;
  border-radius: 99px;
  background: var(--accent-bg);
  color: var(--accent-dk);
  font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}

/* ─────────── 布局 ─────────── */
.layout {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  /* 行高必须钉死成 1fr：默认是 auto，一旦画布里的结果图变多（min-content 变高），
     这一行会被内容撑大，左面板底部那只「生成」按钮就被顶到视口外——
     表现就是「生成完按钮不见了，刷新一下又有」。 */
  grid-template-rows: minmax(0, 1fr);
  /* zoom 会连 vh 一起放大，这里反向补偿，保证正好铺满一屏且不出纵向滚动 */
  height: calc(100vh / var(--z) - 58px);
}

/* ═══════════ 左面板 ═══════════ */
.panel {
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 左栏滚动容器 */
.panel-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-bottom: 6px;
}
.panel-scroll::-webkit-scrollbar { width: 8px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #dbdfe5; border-radius: 4px; border: 2px solid var(--card); }
.panel-scroll::-webkit-scrollbar-thumb:hover { background: #c5cad2; }

.panel-top { flex: none; }

.block { padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.block:last-child { border-bottom: none; }

.block-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 7px;
  min-height: 20px;
}
.block-head h2 {
  font-size: 13.5px; font-weight: 650;
  letter-spacing: -.05px;
  color: var(--ink);
}
/* 输入区归属标记：两个模式各有自己的一套抓取框与参考图 */
.scope-chip {
  font-size: 11px; font-weight: 600; letter-spacing: 0;
  color: var(--accent-dk);
  background: var(--accent-bg);
  border: 1px solid #f6dccb;
  padding: 0.5px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: 1px;
  white-space: nowrap;
}

.counter {
  font-size: 12px; font-weight: 600;
  color: var(--muted-2);
  background: #f3f5f7;
  padding: 1px 6px;
  border-radius: 5px;
  margin-left: 2px;
}
.picked {
  margin-left: auto;
  font-size: 12.5px; font-weight: 600;
  color: var(--accent-dk);
  background: var(--accent-bg);
  padding: 2px 8px;
  border-radius: 5px;
  max-width: 150px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.link-btn { font-size: 13px; color: var(--muted); margin-left: auto; }
.link-btn:hover { color: var(--accent-dk); text-decoration: underline; text-underline-offset: 2px; }
/* 图位一键全选 / 全不选：跟在已选标签后面，独立小按钮，别抢 .picked 的 auto 边距 */
#btnAllTpl {
  margin-left: 0; flex: none;
  font-size: 12px; font-weight: 650; line-height: 1;
  color: var(--accent-dk);
  padding: 4px 9px; border-radius: 6px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .12);
}
#btnAllTpl:hover { border-color: var(--accent); text-decoration: none; }

/* 参考图 */
/* 缩略图横条：单行横向滚动，图再多也不占额外高度 */
.ref-strip { display: flex; gap: 6px; align-items: flex-start; flex: none; min-height: 60px; }
.ref-row {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  height: 60px;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.ref-row::-webkit-scrollbar { height: 5px; }
.ref-row::-webkit-scrollbar-track { background: transparent; }
.ref-row::-webkit-scrollbar-thumb { background: #dde1e7; border-radius: 94px; }
.ref-row::-webkit-scrollbar-thumb:hover { background: #c6ccd5; }
.ref-row:empty { display: none; }

.ref-item {
  position: relative;
  width: 54px; height: 54px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fafbfc;
  flex: none;
}
.ref-item img { width: 100%; height: 100%; object-fit: cover; }
.ref-item .idx {
  position: absolute; left: 3px; top: 3px;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(15,20,25,.72);
  color: #fff;
  font-size: 12.5px; font-weight: 700;
  display: grid; place-items: center;
  backdrop-filter: blur(3px);
}
.ref-item .del {
  position: absolute; right: 2px; top: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: rgba(15,20,25,.66);
  color: #fff;
  font-size: 11.5px;
  display: grid; place-items: center;
  opacity: 0;
  transition: .14s;
  backdrop-filter: blur(3px);
}
.ref-item:hover .del { opacity: 1; }
.ref-item .del:hover { background: #d33; }

/* 勾选状态：未勾选的参考图变灰，一眼看出哪几张会参与生成 */
.ref-item {
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s;
}
.ref-item:not(.on) img { opacity: .34; filter: grayscale(.85); }
.ref-item:not(.on) { border-style: dashed; border-color: #d9dee5; }
.ref-item.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-bg);
}
.ref-item .tick {
  position: absolute; left: 3px; bottom: 3px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #cdd4dc;
  display: grid; place-items: center;
  transition: .14s;
}
.ref-item .tick svg { width: 9px; height: 9px; opacity: 0; transform: scale(.6); transition: .14s; }
.ref-item.on .tick { background: var(--accent); border-color: var(--accent); }
.ref-item.on .tick svg { opacity: 1; transform: scale(1); }
.ref-item .del { right: 2px; top: 2px; z-index: 2; }
.ref-item.on .idx { background: rgba(232,98,44,.9); }

/* ── 我们的商品（白底图）：AI自动套版专用 ──
   和上面的同行图是两个性质：上面定版式、这里定产品。
   底色淡绿 + 缩略图完整显示（contain），一眼就分得清哪一栏是「我们的货」。 */
.block-prod { background: linear-gradient(180deg, rgba(23,166,115,.05), transparent 64%); }
.block-prod .block-head h2 em.h2-em { color: #128257; }
.block-prod .ref-row { height: 68px; }
.block-prod .ref-item {
  width: 62px; height: 62px;
  cursor: default;
  border-color: #cfe3da;
  background: #fff;
}
/* 白底产品图要看清轮廓：不裁切、不变灰、不压暗 */
.block-prod .ref-item img { object-fit: contain; opacity: 1; filter: none; background: #fff; }
.block-prod .ref-item .idx { background: rgba(23,166,115,.92); }
.block-prod .counter { color: #128257; }
.block-prod .note-line { margin-top: 7px; }

/* 主图生成方式：直出原图 / AI 重画 */
.prod-mode { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.prod-mode .pm-label { font-size: 12px; color: var(--muted); flex: none; }
.pm-seg {
  display: inline-flex; flex: none;
  border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff;
}
.pm-seg button {
  padding: 3px 9px; border: 0; background: #fff;
  font-size: 12px; color: var(--muted-2); cursor: pointer; transition: .12s;
}
.pm-seg button + button { border-left: 1px solid var(--line); }
.pm-seg button.on { background: rgba(23,166,115,.1); color: #128257; font-weight: 600; }

/* 逐页意思行内的「无产品」开关 */
.cif-noprod {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 11.5px; color: var(--muted-2); cursor: pointer; user-select: none;
}
.cif-noprod input { margin: 0; accent-color: #128257; }
.cif-noprod.on { border-color: rgba(23,166,115,.45); background: rgba(23,166,115,.08); color: #128257; }
.cif-noprod.on span { font-weight: 600; }

/* ── 竞品链接抓取 ── */
.block-ref { border-left-color: var(--accent); }
.mini-note { font-size: 11.5px; color: var(--muted-2); }
.asin-row { display: flex; gap: 6px; margin-bottom: 9px; }
.asin-row input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
}
.asin-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.asin-row input::placeholder { color: #a9b2bd; font-size: 13px; }
.btn-fetch {
  flex: none;
  height: 32px;
  padding: 0 13px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: .15s;
  white-space: nowrap;
}
.btn-fetch:hover { background: var(--accent-dk); }
.btn-fetch:disabled { opacity: .6; cursor: default; }

/* 抓取结果信息条 */
.asin-info {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--accent-bg);
  border: 1px solid rgba(232, 98, 44, .16);
  font-size: 13px;
  line-height: 1.5;
}
.asin-title {
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1; min-width: 0;
}
.asin-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.asin-meta { color: var(--muted); font-size: 12px; line-height: 1.5; }
.asin-meta b { color: var(--accent); font-weight: 700; letter-spacing: .2px; }
.asin-bullets {
  margin: 7px 0 0;
  padding: 7px 0 0;
  border-top: 1px dashed rgba(232, 98, 44, .2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.asin-bullets li {
  list-style: none;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.asin-bullets li::before { content: '·'; margin-right: 4px; color: var(--accent); font-weight: 700; }
.asin-actions { display: flex; gap: 6px; margin-top: 8px; }
.asin-actions button {
  flex: 1;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(232, 98, 44, .3);
  background: #fff;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  transition: .14s;
}
.asin-actions button:hover { background: var(--accent); color: #fff; }

/* 图位标签：整套结果里标出每张是哪个图位 */
.plan-tag {
  position: absolute;
  left: 8px; top: 8px;
  z-index: 3;
  max-width: calc(100% - 16px);
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(15, 20, 25, .6);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.plan-tag.on { background: rgba(232, 98, 44, .88); }
.skeleton .plan-tag { background: #e9ecf0; color: #97a1ad; }

/* ── 卖点区折叠 ── */
.head-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.head-toggle .caret {
  width: 11px; height: 11px;
  color: var(--muted-2);
  transform: rotate(-90deg);
  transition: transform .16s;
}
.head-toggle.open .caret { transform: rotate(0deg); }
.head-toggle:hover h2 { color: var(--accent); }
.counter.on {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ── 图内文案：挂在竞品信息卡下面，跟它是同一块 ── */
.copy-inline {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}
.ci-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}
.ci-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  letter-spacing: -.1px;
}
.ci-tag {
  font-size: 11.5px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 99px;
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}
.ci-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted-2);
}
#sellPoints { width: 100%; }

/* 逐张文案：一张一行，编号 + 缩略图 + 可改的文本，哪张的字归哪张 */
.ci-btn {
  margin-left: auto;
  flex: none;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: .15s;
}
.ci-btn:hover { border-color: var(--accent); color: var(--accent); }
.ci-btn[disabled] { opacity: .55; cursor: default; }

.ci-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 246px;
  overflow-y: auto;
  padding-right: 2px;
}
.ci-list[hidden] { display: none; }
.ci-empty-note {
  margin: 0;
  padding: 9px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.ci-list::-webkit-scrollbar { width: 5px; }
.ci-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.cif {
  display: grid;
  grid-template-columns: 38px 34px 1fr;
  gap: 6px;
  align-items: start;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--card);
}
.cif.loading { opacity: .6; }
.cif-n {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  border-radius: 6px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -.3px;
  white-space: nowrap;
}
.cif-thumb {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--line-2);
  display: block;
}
.cif textarea {
  width: 100%;
  min-height: 34px;
  max-height: 120px;
  resize: vertical;
  padding: 5px 7px;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
}
.cif textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
}
.cif-empty textarea::placeholder { color: var(--muted-2); }

/* 风格解读结果：机器读出来的那段文字，能看能核 */
.sbrief {
  margin: 7px 0 6px;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  max-height: 124px;
  overflow-y: auto;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.sbrief b { color: var(--accent); font-weight: 700; }

/* ── 竞品信息 ── */
.asin-details { margin-top: 5px; }
.asin-details summary {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  user-select: none;
}
.asin-details summary::-webkit-details-marker { display: none; }
.asin-details summary::before {
  content: '';
  width: 0; height: 0;
  border-left: 4px solid currentColor;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transition: transform .15s;
}
.asin-details[open] summary::before { transform: rotate(90deg); }
.asin-details summary:hover { text-decoration: underline; }

/* ── 整套出图 ── */
/* ─────────── 模式切换：AGI 整套出图 / 单张精修 ─────────── */
.mode-tabs {
  flex: none;
  /* 四个模式 → 2×2：一条横排会挤到每个只剩 90px，标题全被截断 */
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 9px 12px 8px;
  border-bottom: 1px solid var(--line-2);
  background: var(--card);
}
.mtab {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  transition: .14s;
}
.mtab b { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: -.1px; }
.mtab span {
  font-size: 12.5px; line-height: 1.35; color: var(--muted-2);
  display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mtab:hover { border-color: #d8dee6; }
.mtab.on { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 2px var(--accent-bg); }
.mtab.on b { color: var(--accent); }

/* 这个模式有一批在后台跑：右上角一个呼吸的小点，切走了也知道那边还在动 */
.mtab { position: relative; }
.mtab.live::after {
  content: '';
  position: absolute;
  top: 7px; right: 7px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 98, 44, .16);
  animation: mtabPulse 1.6s ease-in-out infinite;
}
.mtab.live span { color: var(--accent); }
@keyframes mtabPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}

/* 后台跑完了、人不在这个模式：实心点提醒「有新图，点开看」 */
.mtab.done::after {
  content: '';
  position: absolute;
  top: 7px; right: 7px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #17a673;
  box-shadow: 0 0 0 3px rgba(23, 166, 115, .14);
}
.mtab.done span { color: #128257; font-weight: 600; }

/* 整套方案块 */
.block-set .set-sel { width: 100%; }
.set-plan { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.set-hint { font-size: 12px; color: var(--muted-2); line-height: 1.5; margin-top: 5px; }
.plan-empty { font-size: 12px; color: var(--muted-2); }
.plan-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3.5px 8px 3.5px 3.5px;
  border-radius: 6px;
  background: #f5f7f9;
  border: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--muted);
  line-height: 1.3;
}
.plan-pill i {
  font-style: normal;
  width: 14px; height: 14px; border-radius: 4px;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line);
  font-size: 10.5px; font-weight: 700; color: var(--muted-2);
}

.set-row { display: flex; gap: 6px; margin-top: 8px; }
.set-sel {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
}
.btn-set {
  flex: none;
  height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1.5px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: .15s;
  white-space: nowrap;
}
.btn-set:hover { background: var(--accent); color: #fff; }
.btn-set:disabled { opacity: .55; cursor: default; }

.ref-add {
  width: 54px; height: 54px;
  border-radius: 9px;
  border: 1.5px dashed #d3d9e0;
  background: #fafbfc;
  color: var(--muted-2);
  display: grid; place-items: center;
  transition: .16s;
  flex: none;
}
.ref-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.ref-add.hide { display: none; }

.note-line { font-size: 12px; color: var(--muted-2); margin-top: 7px; line-height: 1.45; }

/* 下拉栅格 */
.block-set { padding-top: 9px; padding-bottom: 9px; }
.grid2 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }

.sel-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sel-wrap > span { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
/* 渠道徽标：一眼看出这张图走的是 GPT(lyozc) 还是 Banana(uuapi) */
.chan-badge {
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: 2.5px 5px; border-radius: 4px; letter-spacing: .2px;
  background: rgba(255, 106, 42, .12); color: var(--accent);
  transition: background .14s, color .14s;
}
.chan-badge.gem { background: rgba(16, 163, 127, .13); color: #0f8a6c; }
.model-speed {
  margin-left: auto; font-style: normal; font-size: 11px;
  color: var(--muted-2); white-space: nowrap;
}
.link-tag {
  font-style: normal; font-size: 10.5px; line-height: 1;
  padding: 2px 4px; border-radius: 4px;
  background: rgba(255, 106, 42, .12);
  color: var(--accent);
  cursor: pointer; user-select: none;
  transition: background .12s, color .12s;
}
.link-tag:hover { background: rgba(255, 106, 42, .2); }
.link-tag.manual { background: #eef0f3; color: var(--muted-2); }
.sel-wrap.grow { flex: 1; }
.sel-wrap.narrow { width: 104px; flex: none; }

/* ─────────── 模型选择面板 ─────────── */
.mp { position: relative; }
#modelSel { display: none; }          /* 只做取值载体，界面由 .mp-pop 承担 */
.mp-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; height: 34px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fcfcfd; color: var(--ink-2);
  font-size: 13.5px; font-family: inherit; text-align: left;
  cursor: pointer; transition: border-color .14s, box-shadow .14s, background .14s;
}
.mp-btn:hover { border-color: #d3d8e0; background: #fff; }
.mp-btn.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 98, 44, .1);
  background: #fff;
}
.mp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-caret { flex: none; color: var(--muted-2); transition: transform .16s; }
.mp-btn.open .mp-caret { transform: rotate(180deg); }

.mp-pop {
  position: absolute; left: 0; bottom: calc(100% + 7px); z-index: 60;
  width: 330px; max-width: calc(100vw - 28px);
  /* 8 个模型全展开约 470px，给足高度就不用滚 —— 底栏在最下方，向上空间管够 */
  max-height: min(72vh, 470px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 5px;
  animation: mpIn .14s ease-out;
}
@keyframes mpIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mp-pop::-webkit-scrollbar { width: 8px; }
.mp-pop::-webkit-scrollbar-thumb { background: #d8dde4; border-radius: 4px; border: 2px solid #fff; }

.mp-group {
  padding: 7px 8px 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
  color: var(--muted-2);
}
.mp-group:not(:first-child) { margin-top: 3px; border-top: 1px solid var(--line-2); padding-top: 9px; }

.mp-item {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 7px 8px; border: 0; border-radius: 8px;
  background: transparent; font-family: inherit; text-align: left; cursor: pointer;
  transition: background .1s;
}
.mp-item:hover { background: #f6f7f9; }
.mp-item.on { background: var(--accent-bg); }
.mp-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.mp-dot.gemini { background: var(--ok); }
.mp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mp-txt b {
  font-size: 12.8px; font-weight: 620; color: var(--ink); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-txt em {
  font-style: normal; font-size: 11px; color: var(--muted-2); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-spd { flex: none; font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; text-align: right; }
.mp-spd i {
  display: block; font-style: normal; font-size: 9.5px; font-weight: 650;
  color: #b4741a; background: #fdf3e3; border: 1px solid #f3e0c2;
  border-radius: 4px; padding: 0 4px; margin-top: 3px; letter-spacing: .2px;
}
.mp-tick { flex: none; color: var(--accent); opacity: 0; }
.mp-item.on .mp-tick { opacity: 1; }

select {
  height: 34px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 20px 0 7px;
  background: #fcfcfd;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: .14s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%2378828e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  text-overflow: ellipsis;
}
select:hover { border-color: #d1d7df; }
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,98,44,.09); }

/* 白底净化开关 */
.switch-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px;
  padding: 1px 0;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
/* 在品牌块里它是另一维度的设置，用虚线隔开 */
.block-brand .switch-row {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line-2);
  border-radius: 0;
}
.switch-row input { display: none; }
.sw-track {
  width: 30px; height: 17px;
  border-radius: 99px;
  background: #d3d9e1;
  position: relative;
  flex: none;
  transition: background .18s;
}
.sw-track i {
  position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .18s;
}
.switch-row input:checked + .sw-track { background: var(--accent); }
.switch-row input:checked + .sw-track i { transform: translateX(13px); }
.sw-txt { font-size: 12px; color: var(--ink-2); line-height: 1.45; }

/* 卖点框 */
textarea#sellPoints {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  min-height: 74px;
  background: #fcfcfd;
  transition: .14s;
}
textarea#sellPoints:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(232,98,44,.09); }
textarea#sellPoints::placeholder { color: var(--muted-2); font-size: 13px; }

.tail-line { display: flex; align-items: center; justify-content: space-between; min-height: 14px; margin-top: 5px; }
#copyState { font-size: 12px; color: var(--ok); }

/* 分组模板列表 */
/* 图片类型：常驻区，固定高度 + 内部滚动，任何状态下都可见 */
/* 图位勾选清单：单张模式的主操作区 */
.block-types {
  flex: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid var(--line-2);
  border-top: none;
  background: var(--card);
  padding: 10px 14px 10px;
}
.block-types .block-head { flex: none; }

.groups {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: none;
  padding-bottom: 2px;
}
.groups::-webkit-scrollbar { width: 7px; }
.groups::-webkit-scrollbar-thumb { background: #dee2e8; border-radius: 4px; border: 2px solid var(--card); }
.groups::-webkit-scrollbar-thumb:hover { background: #c6ccd5; }

.group { border-radius: 8px; overflow: hidden; }

.group-head {
  width: 100%;
  display: flex; align-items: center; gap: 7px;
  padding: 8px 8px;
  border-radius: 7px;
  transition: .13s;
  text-align: left;
}
.group-head:hover { background: #f7f8fa; }
.group.collapsed .group-head:hover { background: #f7f8fa; }

.caret {
  width: 9px; height: 9px;
  color: var(--muted-2);
  transition: transform .18s;
  flex: none;
}
.group.collapsed .caret { transform: rotate(-90deg); }

.group-name { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.group-num {
  font-size: 11.5px; font-weight: 650; color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.group-hint { font-size: 12px; color: var(--muted-2); margin-left: auto; }

/* 折叠箭头做成独立按钮，点标题也能折叠，点勾不折叠 */
.gfold {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border-radius: 4px; flex: none;
  color: var(--muted-2);
  padding: 0;
}
.gfold:hover { background: #eceff3; }

/* 组内全选勾 */
.gck, .item .ck {
  flex: none;
  width: 16px; height: 16px;
  border-radius: 4.5px;
  border: 1.5px solid #ccd3dc;
  background: #fff;
  display: grid; place-items: center;
  transition: .13s;
  color: #fff;
  padding: 0;
}
.gck i, .item .ck svg {
  width: 10px; height: 10px;
  opacity: 0; transform: scale(.6);
  transition: .13s;
}
.gck i { width: 8px; height: 8px; border-radius: 2px; background: #fff; }
.gck.on, .item.on .ck { background: var(--accent); border-color: var(--accent); }
.gck.on i, .item.on .ck svg { opacity: 1; transform: none; }
.gck.half { background: #fff; border-color: var(--accent); }
.gck.half i { opacity: 1; transform: none; background: var(--accent); }
.gck:hover { border-color: var(--accent); }

.group-items {
  display: flex; flex-direction: column;
  padding: 2px 0 4px 0;
  gap: 2px;
}
.group.collapsed .group-items { display: none; }

.item {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px 7px 14px;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: .13s;
  text-align: left;
}
.item:hover { background: #f7f8fa; }
.item.on {
  background: var(--accent-bg);
  border-color: #f3c9b3;
}
.item-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #d5dae1;
  flex: none;
  transition: .13s;
}
.item.on .item-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(232,98,44,.15); }

.item-name {
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item.on .item-name { color: var(--accent-dk); font-weight: 650; }

/* 比例标签 */
.ratio-tag {
  margin-left: auto;
  font-size: 11.5px; font-weight: 600;
  color: var(--muted);
  background: #f2f4f7;
  border: 1px solid #e6eaef;
  padding: 0 5px;
  border-radius: 4px;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.item.on .ratio-tag { color: var(--accent-dk); background: #fff; border-color: #f3c9b3; }

.txt-tag {
  margin-left: auto;
  font-size: 12.5px; font-weight: 700;
  color: #8b6d1f;
  background: #fdf6e3;
  border: 1px solid #f0e3bd;
  padding: 0 5px;
  border-radius: 4px;
  flex: none;
  letter-spacing: .2px;
}
.txt-tag + .ratio-tag { margin-left: 4px; }

/* 底部操作条 */
.panel-foot {
  flex: none;
  padding: 9px 14px 11px;
  border-top: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 -6px 18px -14px rgba(15,20,25,.2);
}
.foot-row { display: flex; gap: 8px; margin-bottom: 9px; }

/* 出图规格：分辨率档位 + 交付尺寸 */
.spec-block { margin-bottom: 8px; }
.spec-row { display: flex; align-items: center; gap: 7px; }
.spec-row + .spec-row { margin-top: 5px; }
.spec-label {
  flex: none; width: 41px;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  letter-spacing: .2px;
  white-space: nowrap;
}
.spec-seg {
  display: flex; gap: 1px; flex: none;
  padding: 2px;
  background: #f2f4f7;
  border: 1px solid var(--line-2);
  border-radius: 7px;
}
.spec-seg button {
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11.5px; font-weight: 650; color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: .13s;
  white-space: nowrap;
}
.spec-seg button:hover { color: var(--ink-2); }
.spec-seg button.on {
  background: #fff; color: var(--accent-dk);
  box-shadow: 0 1px 2px rgba(15,20,25,.1);
}
.spec-hint {
  margin-left: auto;
  font-size: 11px; color: var(--muted-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 1K + 1600 交付会放大发虚，用橙色提醒一句 */
.spec-hint.warn { color: var(--accent-dk); font-weight: 600; }

/* 预估积分：数字要能一眼扫到，所以用等宽数字 + 品牌色 */
.credit-val {
  flex: none;
  font-size: 12px; font-weight: 650;
  color: var(--accent-dk);
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
  white-space: nowrap;
}


.btn-generate {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14.5px; font-weight: 650;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: .17s;
}
.btn-generate:hover:not(:disabled) { background: #1d252e; transform: translateY(-1px); box-shadow: 0 9px 22px -10px rgba(15,20,25,.55); }
.btn-generate:active:not(:disabled) { transform: none; }
.btn-generate:disabled { background: #c2c8d0; cursor: not-allowed; }
.btn-generate.busy { background: var(--accent); }
.gen-ico { opacity: .9; }
.gen-label { white-space: nowrap; }
.gen-meta { font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.btn-generate:disabled .gen-meta { color: rgba(255,255,255,.8); }

/* ═══════════ 右画布 ═══════════ */
.canvas {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* 同上：没有 min-height:0，这个 flex 容器会被结果图的最小高度顶开，把整行撑高 */
  min-height: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(15,20,25,.045) 1px, transparent 0);
  background-size: 22px 22px;
}

.canvas-head {
  height: 56px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(10px);
}
.canvas-title h3 { font-size: 14px; font-weight: 650; letter-spacing: -.1px; }
.canvas-title p { font-size: 13px; color: var(--muted); }

.canvas-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-height: 0;
}
.canvas-body::-webkit-scrollbar { width: 9px; }
.canvas-body::-webkit-scrollbar-thumb { background: #d9dde3; border-radius: 4px; border: 2.5px solid var(--bg); }

/* 空状态 */
.empty { max-width: 620px; margin: calc(6vh / var(--z)) auto 0; text-align: center; }

.empty-art { height: 104px; position: relative; margin-bottom: 24px; }
.ea {
  position: absolute;
  width: 78px; height: 78px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  top: 50%; left: 50%;
}
.ea::after {
  content: ''; position: absolute; inset: 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f3f5f7, #e6eaef);
}
.ea.c1 { transform: translate(-50%,-50%) translateX(-72px) rotate(-10deg) scale(.86); opacity: .55; }
.ea.c2 { transform: translate(-50%,-50%) translateX(72px) rotate(10deg) scale(.86); opacity: .55; }
.ea.c3 { transform: translate(-50%,-50%); z-index: 2; }
.ea.c3::after { background: linear-gradient(150deg, #fdf0e8, #f7dccd); }

.empty h4 { font-size: 17px; font-weight: 680; letter-spacing: -.25px; margin-bottom: 7px; }
.empty > p { font-size: 13.5px; color: var(--muted); line-height: 1.7; }

.empty-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  text-align: left;
}
.empty-grid > div { background: var(--card); padding: 11px 13px; }
.empty-grid b { display: block; font-size: 13px; font-weight: 650; color: var(--ink); margin-bottom: 1px; }
.empty-grid span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* 结果网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  align-content: start;
}

.shot {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: .2s;
  animation: pop .32s cubic-bezier(.2,.9,.3,1.1) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(9px) scale(.985); } to { opacity: 1; transform: none; } }
.shot:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: #d8dde4; }

.shot-img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: zoom-in;
  background: #fafbfc;
}
.shot-img.wide { aspect-ratio: 3/2; }
.shot-img.tall { aspect-ratio: 2/3; }

.shot-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border-top: 1px solid var(--line-2);
  gap: 8px;
}
.shot-meta { font-size: 12px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-act { display: flex; gap: 4px; flex: none; }

.act-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--muted);
  background: #f5f7f9;
  transition: .13s;
}
.act-btn:hover { background: var(--ink); color: #fff; }
.act-btn svg { width: 13px; height: 13px; }

/* 骨架 */
.skeleton {
  position: relative;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.sk-img {
  width: 100%; aspect-ratio: 1;
  background: linear-gradient(100deg, #f0f2f5 25%, #e5e9ee 42%, #f0f2f5 60%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
.sk-img.wide { aspect-ratio: 3/2; }
.sk-img.tall { aspect-ratio: 2/3; }
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -30% 0; } }
.sk-bar { height: 41px; display: flex; align-items: center; padding: 0 11px; gap: 6px; }
.sk-line { height: 7px; border-radius: 4px; background: #eef1f4; width: 52%; }
/* 骨架上的状态角标：排队中 / 正在生成…（放右上角，别和图位标签撞） */
.sk-hint {
  position: absolute; right: 9px; top: 9px;
  font-size: 12px; font-weight: 600; color: #7d8794;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 5px; padding: 2px 7px;
}

/* 失败帧：占住自己的位置，给出原因和单张重试 */
.shot.failed { border-color: #f0cfcf; background: #fef7f7; }
.fail-body {
  width: 100%; aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px; text-align: center;
  background: repeating-linear-gradient(135deg, #fdf1f1, #fdf1f1 10px, #fbebeb 10px, #fbebeb 20px);
}
.fail-body.wide { aspect-ratio: 3/2; }
.fail-body.tall { aspect-ratio: 2/3; }
.fail-body b { font-size: 14px; color: #a01c1c; }
.fail-body span {
  font-size: 12px; color: #b0575a; line-height: 1.5;
  max-width: 92%; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.retry-btn {
  font-size: 13px; font-weight: 650;
  color: #fff; background: var(--accent);
  border-radius: 7px; padding: 7px 14px;
}
.retry-btn:hover { background: var(--accent-dk, #d9551f); }
.retry-btn:disabled { opacity: .6; cursor: default; }

.progress-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 0 0 15px;
  font-size: 13px; color: var(--muted);
}
.progress-track { flex: 1; height: 4px; border-radius: 2px; background: #e3e7ec; overflow: hidden; }
.progress-fill {
  height: 100%; width: 2%;
  background: linear-gradient(90deg, #f5904c, var(--accent));
  border-radius: 2px;
  transition: width .6s ease;
}

.err-box {
  border: 1px solid #f3c7c7;
  background: #fef6f6;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #a01c1c;
  line-height: 1.6;
  margin-bottom: 14px;
}
.err-box b { display: block; margin-bottom: 3px; }

/* ─────────── 抽屉 ─────────── */
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(15,20,25,.3);
  backdrop-filter: blur(2px);
  z-index: 60;
  animation: fade .18s;
}
@keyframes fade { from { opacity: 0; } }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 336px; max-width: 88vw;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -14px 0 44px -20px rgba(15,20,25,.34);
  z-index: 61;
  transform: translateX(100%);
  transition: transform .27s cubic-bezier(.3,.9,.3,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }

.drawer-head {
  height: 54px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 14px; font-weight: 650; }
/* 历史是按会员隔离的：标题上标一句，免得「怎么图少了」被当成丢数据 */
.hist-scope {
  margin-left: 8px;
  font-size: 11.5px; font-style: normal; font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0;
}

.icon-btn {
  width: 27px; height: 27px;
  border-radius: 7px;
  color: var(--muted);
  display: grid; place-items: center;
  font-size: 13.5px;
  transition: .13s;
}
.icon-btn:hover { background: #f2f4f6; color: var(--ink); }

.drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-thumb { background: #dbdfe5; border-radius: 4px; border: 2px solid var(--card); }

.hist-item {
  display: flex; gap: 9px;
  padding: 7px;
  border-radius: 9px;
  transition: .13s;
  margin-bottom: 3px;
}
.hist-item:hover { background: #f7f8fa; }
.hist-item img {
  width: 50px; height: 50px;
  border-radius: 7px;
  object-fit: cover;
  background: #fafbfc;
  border: 1px solid var(--line-2);
  flex: none;
  cursor: zoom-in;
}
.hist-txt { min-width: 0; flex: 1; }
.hist-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-sub { font-size: 12px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-date { font-size: 11.5px; color: var(--muted-2); margin-top: 1px; }
.hist-del {
  align-self: flex-start;
  width: 21px; height: 21px;
  border-radius: 6px;
  color: var(--muted-2);
  font-size: 12.5px;
  display: grid; place-items: center;
  flex: none;
  opacity: 0;
  transition: .13s;
}
.hist-item:hover .hist-del { opacity: 1; }
.hist-del:hover { background: #fdeaea; color: #c31c1c; }

.drawer-empty { text-align: center; color: var(--muted-2); font-size: 13px; padding: 56px 20px; line-height: 1.7; }

/* ─────────── Lightbox ─────────── */
.lightbox {
  /* body 上有 zoom: var(--z)（超宽屏等比放大），vh/vw 会跟着一起被放大：
     1920 屏 z=1.12 时 inset:0 的遮罩实际高 1.12 × 视口，底部那截和底栏直接跑到屏幕外。
     所以这里所有视口单位都要先除 z，换算回「视口真实尺寸」。
     另外 max-height 不能用 100%（grid 自动行里百分比高度无法解析 → 当成 none）。 */
  position: fixed; inset: 0;
  width: calc(100vw / var(--z));
  height: calc(100vh / var(--z));
  background: rgba(11,13,16,.9);
  backdrop-filter: blur(6px);
  z-index: 90;
  display: grid; place-items: center;
  padding: 56px 76px 76px;
  animation: fade .16s;
}
.lightbox img {
  max-width: calc(100vw / var(--z) - 152px);
  max-height: calc(100vh / var(--z) - 132px);
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 7px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.72);
  background: #fff;
}
.lb-close {
  position: absolute; top: 16px; right: 20px;
  width: 33px; height: 33px;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: #fff; font-size: 14.5px;
  display: grid; place-items: center;
  transition: .13s;
}
.lb-close:hover { background: rgba(255,255,255,.22); }

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3;
  width: 42px; height: 60px;
  border-radius: 10px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(10px);
  color: #fff; font-size: 27px; line-height: 1;
  display: grid; place-items: center;
  transition: .13s;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,.5);
}
.lb-nav:hover { background: rgba(255,255,255,.32); transform: translateY(-50%) scale(1.04); }
.lb-nav:active { transform: translateY(-50%) scale(.97); }
.lb-nav.prev { left: 18px; }
.lb-nav.next { right: 18px; }

.lb-bar {
  position: absolute; bottom: 18px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  padding: 7px 8px 7px 15px;
  border-radius: 10px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(12px);
  color: rgba(255,255,255,.82);
  font-size: 13px;
  white-space: nowrap;
}
.lb-actions { display: flex; gap: 6px; }
.lb-btn {
  height: 28px; padding: 0 12px;
  border-radius: 6px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 13px; font-weight: 550;
  display: inline-flex; align-items: center;
  text-decoration: none;
  transition: .13s;
}
.lb-btn:hover { background: rgba(255,255,255,.26); }
.lb-btn.primary { background: var(--accent); }
.lb-btn.primary:hover { background: #f0713e; }

/* ─────────── 提示词弹层 ─────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(15,20,25,.5);
  backdrop-filter: blur(3px);
  z-index: 95;
  display: grid; place-items: center;
  padding: 40px;
  animation: fade .16s;
}
.modal-card {
  background: var(--card);
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  width: min(620px, 100%);
  max-height: calc(76vh / var(--z));
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px 13px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 14px; font-weight: 650; }
.modal-card pre {
  flex: 1;
  overflow: auto;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  background: #fbfcfd;
}

/* ─────────── 品牌调性（左栏） ─────────── */
.block-brand { padding-top: 7px; padding-bottom: 7px; }
.block-brand .block-head { margin-bottom: 5px; }

.brand-cfg {
  margin-left: auto;
  display: flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fcfcfd;
  color: var(--ink-2);
  font-size: 12px; font-weight: 600;
  transition: .14s;
}
.brand-cfg:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

.chips-wrap { position: relative; }
/* 右侧渐隐：提示这排调性还能往右滑 */
.chips-wrap::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 3px;
  width: 26px;
  background: linear-gradient(90deg, rgba(255,255,255,0), var(--card) 82%);
  pointer-events: none;
  opacity: 1;
  transition: opacity .18s;
}
.chips-wrap.at-end::after { opacity: 0; }

.tone-chips {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding-bottom: 1px;
}
.tone-chips::-webkit-scrollbar { height: 0; }

.chip {
  flex: none;
  height: 29px; padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fcfcfd;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: .13s;
}
.chip:hover { border-color: #d1d7df; background: #f7f8fa; }
.chip.on {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent-dk);
  font-weight: 650;
}

.brand-sub {
  display: block; width: 100%;
  margin-top: 3px;
  text-align: left;
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .13s;
}
.brand-sub:hover { color: var(--accent); }

/* ─────────── 品牌风格弹窗 ─────────── */
.brand-card { width: min(720px, 100%); max-height: calc(84vh / var(--z)); }

.brand-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.brand-tabs { display: flex; gap: 18px; }
.btab {
  height: 48px;
  font-size: 14px; font-weight: 650;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: .14s;
}
.btab:hover { color: var(--ink-2); }
.btab.on { color: var(--ink); border-bottom-color: var(--accent); }

.brand-card-body { flex: 1; overflow-y: auto; padding: 16px 20px 6px; min-height: 0; }
.brand-card-body::-webkit-scrollbar { width: 8px; }
.brand-card-body::-webkit-scrollbar-thumb { background: #dbdfe5; border-radius: 4px; border: 2px solid var(--card); }

.fld { margin-bottom: 16px; min-width: 0; }
.fld-label {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  margin-bottom: 7px;
}
.fld-label em {
  font-style: normal; font-weight: 400;
  font-size: 12px; color: var(--muted-2);
}
.fld-label em#customCount { margin-left: auto; }

.fld2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; margin-bottom: 16px; }
.fld2 .fld { margin-bottom: 0; }
.fld2 .fld > span {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--muted);
  margin-bottom: 7px;
}

/* 调性卡 */
.tone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.tone-cell {
  text-align: left;
  padding: 8px 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fcfcfd;
  transition: .13s;
  min-width: 0;
}
.tone-cell b { display: block; font-size: 13px; font-weight: 650; color: var(--ink); margin-bottom: 2px; }
.tone-cell span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12px; color: var(--muted-2); line-height: 1.4;
}
.tone-cell:hover { border-color: #d1d7df; background: #f8f9fb; }
.tone-cell.on { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 2px rgba(232,98,44,.08); }
.tone-cell.on b { color: var(--accent-dk); }
.tone-cell.on span { color: #a4705a; }

/* 品牌卡 */
.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.brand-cell {
  position: relative;
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fcfcfd;
  transition: .13s;
  min-width: 0;
}
.brand-cell .bn { display: flex; align-items: baseline; gap: 5px; padding-right: 14px; }
.brand-cell .bn b { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: -.1px; }
.brand-cell .bn i { font-style: normal; font-size: 11.5px; color: var(--muted-2); }
.brand-cell p {
  margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12px; color: var(--muted); line-height: 1.4;
}
.brand-cell:hover { border-color: #d1d7df; background: #f8f9fb; }
.brand-cell.on { border-color: var(--accent); background: var(--accent-bg); }
.brand-cell.on .bn b { color: var(--accent-dk); }
.brand-cell.on::after {
  content: '✓';
  position: absolute; right: 8px; top: 6px;
  font-size: 11.5px; font-weight: 800; color: var(--accent);
}

/* 主色 */
.color-row { display: flex; flex-wrap: wrap; gap: 7px; }
.color-cell {
  display: flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px 0 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fcfcfd;
  font-size: 12.5px; color: var(--ink-2);
  transition: .13s;
}
.color-cell .sw {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,.07);
  flex: none;
}
.color-cell.auto .sw { background: conic-gradient(from 210deg, #2F6BFF, #7C5CFF, #E8622C, #12B981, #F2E4C9, #2F6BFF); }
.color-cell:hover { border-color: #d1d7df; }
.color-cell.on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-dk); font-weight: 650; }

#customScene {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 13.5px; line-height: 1.6;
  resize: vertical;
  min-height: 78px;
  background: #fcfcfd;
  color: var(--ink);
  transition: .14s;
}
#customScene:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(232,98,44,.09); }
#customScene::placeholder { color: var(--muted-2); font-size: 13px; }

.brand-card-foot {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}
.btn-done {
  height: 36px; padding: 0 26px;
  border-radius: 9px;
  background: #1aa251;
  color: #fff;
  font-size: 14px; font-weight: 650;
  transition: .15s;
}
.btn-done:hover { background: #158a45; }

/* 品牌库 */
.lib-tip { font-size: 12.5px; color: var(--muted-2); line-height: 1.65; margin-bottom: 12px; }

/* 品牌层提示：调性只提风格，不换产品 */
.tone-note {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  margin-bottom: 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent, #e8622c);
  background: var(--panel-2, rgba(0, 0, 0, 0.02));
}
.tone-note b { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: 0.2px; }
.tone-note span { font-size: 12.5px; line-height: 1.6; color: var(--muted-2); }
.lib-list { display: flex; flex-direction: column; gap: 7px; }
.lib-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fcfcfd;
}
.lib-main { flex: 1; min-width: 0; }
.lib-name { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.lib-sub {
  font-size: 12px; color: var(--muted-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.lib-acts { display: flex; gap: 5px; flex: none; }
.lib-btn {
  height: 25px; padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-2);
  transition: .13s;
}
.lib-btn:hover { background: #f3f5f7; }
.lib-btn.apply { border-color: var(--accent); color: var(--accent-dk); }
.lib-btn.apply:hover { background: var(--accent-bg); }
.lib-btn.del:hover { background: #fdeaea; color: #c31c1c; border-color: #f5c8c8; }
.lib-empty { text-align: center; color: var(--muted-2); font-size: 13px; padding: 40px 16px; line-height: 1.75; }

/* 缩略图上的「版式参考」标记 */
.ref-item .lay {
  position: absolute; right: 2px; bottom: 2px;
  width: 17px; height: 17px;
  border-radius: 5px;
  background: rgba(255,255,255,.94);
  border: 1px solid #dfe4ea;
  color: var(--muted-2);
  font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center;
  z-index: 2;
  transition: .13s;
}
.ref-item .lay:hover { border-color: var(--accent); color: var(--accent); }
.ref-item .lay.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─────────── Toast ─────────── */
.toast-wrap {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex; flex-direction: column; gap: 7px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 9px 15px;
  border-radius: 9px;
  background: rgba(15,20,25,.95);
  color: #fff;
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,.55);
  animation: toastIn .24s cubic-bezier(.2,.9,.3,1.1) both;
  max-width: 440px;
  line-height: 1.5;
}
.toast.warn { background: #b4321a; }
.toast.good { background: #0b7a53; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* 矮屏：类型区收窄，把空间让给上方配置 */
@media (max-height: 820px) and (min-width: 921px) {
  .block-types { min-height: 150px; }
  .panel-foot { padding: 7px 14px 9px; }
}

/* ─────────── 响应式 ─────────── */
@media (max-width: 920px) {
  body { overflow: auto; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .panel { border-right: none; border-bottom: 1px solid var(--line); }
  .panel-scroll { overflow: visible; }
  .block-types { height: auto; max-height: 420px; }
  .groups { overflow: visible; }
  .panel-foot { position: sticky; bottom: 0; }
  .canvas { min-height: 62vh; }
  .canvas-body { padding: 16px; }
  .empty-grid { grid-template-columns: 1fr; }
  .lightbox { padding: 48px 10px 78px; }
  .lightbox img { max-width: calc(100vw / var(--z) - 20px); max-height: calc(100vh / var(--z) - 126px); }
  .lb-nav.prev { left: 4px; }
  .lb-nav.next { right: 4px; }
}

/* ─────────── 结果区：勾选 + 打包下载 ─────────── */
.shot .pick {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  cursor: pointer;
}
.shot .pick input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.shot .pick span {
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(255,255,255,.94);
  border: 1.5px solid #cfd6de;
  box-shadow: 0 1px 3px rgba(15,20,25,.14);
  display: grid; place-items: center;
  transition: .13s;
}
.shot .pick:hover span { border-color: var(--accent); }
.shot .pick input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}
.shot .pick input:checked + span::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.shot:has(.pick input:checked) { border-color: #f2bda3; box-shadow: 0 2px 10px -4px rgba(232,98,44,.35); }

/* 三个按钮并排：.btn-ghost 自身是 display:flex，容器不给 flex 的话它们会各占一行 */
.canvas-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.canvas-tools .btn-ghost.primary {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.canvas-tools .btn-ghost.primary:hover { background: var(--accent-bg); }
.canvas-tools .btn-ghost:disabled { opacity: .45; cursor: not-allowed; }

/* ─────────── 历史抽屉：单张 / 按批次 ─────────── */
.drawer-tabs {
  display: flex; gap: 4px;
  padding: 8px 14px 0;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.dtab {
  padding: 7px 12px 8px;
  font-size: 12.5px; font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: .13s;
  display: inline-flex; align-items: center;
}
.dtab:hover { color: var(--ink-2); }
.dtab.on { color: var(--ink); border-bottom-color: var(--accent); }
.dtab em { font-style: normal; color: var(--muted-2); margin-left: 4px; font-size: 11px; }

.batch-item {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #fff;
  margin-bottom: 8px;
  transition: .13s;
}
.batch-item:hover { border-color: #d9dee5; box-shadow: var(--shadow-sm); }
.batch-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 68px;
}
.batch-thumbs img {
  width: 33px; height: 33px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg);
  display: block;
}
.batch-none {
  grid-column: 1 / -1;
  width: 68px; height: 68px;
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, #f4f5f7 0 6px, #eef0f3 6px 12px);
  display: grid; place-items: center;
  font-size: 10px; color: var(--muted-2);
}
.batch-txt { min-width: 0; }
.batch-name {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.batch-sub {
  font-size: 11.5px; color: var(--muted-2);
  margin-top: 3px;
  display: flex; align-items: center; gap: 5px;
}
.batch-sub .dot { color: #cfd6de; }
.bs { font-style: normal; color: var(--muted); }
.bs.ok { color: var(--ok); font-weight: 600; }
.bs.bad { color: #c2410c; font-weight: 600; }
.batch-st {
  font-size: 10px; font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border-radius: 4px;
  padding: 1px 5px;
  flex: none;
}
.batch-st.live { color: #1d4ed8; background: #dbeafe; }
.batch-act { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.batch-act .link-btn { font-size: 12px; }

/* ─────────── 自定义改图：提示词块 ─────────── */
.block-edit .h2-em {
  font-style: normal;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  margin-left: 5px;
}
#editPrompt {
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
  min-height: 84px;
  transition: border-color .14s, box-shadow .14s;
}
#editPrompt::placeholder { color: var(--muted-2); }
#editPrompt:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.edit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.echip {
  font-size: 11.5px;
  color: var(--muted);
  background: #f7f8fa;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 9px;
  transition: .13s;
}
.echip:hover {
  color: var(--accent);
  border-color: #f2c6ae;
  background: var(--accent-bg);
}

/* ─────────── 自定义改图：画布任务板 ─────────── */
.egrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
  align-content: start;
}
.ecard {
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: pop .3s cubic-bezier(.2,.9,.3,1.1) both;
  transition: .18s;
}
.ecard:hover { box-shadow: var(--shadow); border-color: #dbe0e7; }
.ecard.live { border-color: #f3cdb8; }

.ecard-media {
  position: relative;
  aspect-ratio: 1;
  background: #f6f7f9;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ecard-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  display: block;
}

.ecard-st {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px;
  text-align: center;
}
.ecard-st.wait {
  background: linear-gradient(100deg, #f4f6f8 25%, #eaeef3 42%, #f4f6f8 60%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
  color: var(--muted);
  font-size: 12.5px;
}
.ecard-st.fail { background: #fdf6f2; }
.ecard-st.fail b { font-size: 13px; color: #b4451b; }
.ecard-st.fail span {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.retry-btn {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: #fff;
  border: 1px solid #f2c6ae;
  border-radius: 7px;
  padding: 4px 10px;
  transition: .13s;
}
.retry-btn:hover { background: var(--accent-bg); }
.retry-btn:disabled { opacity: .6; cursor: default; }

.spin {
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid #dfe3e9;
  border-top-color: var(--accent);
  animation: eSpin .8s linear infinite;
}
@keyframes eSpin { to { transform: rotate(360deg); } }

.ecard-body { padding: 8px 10px 9px; }
.ecard-p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.ecard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
}
.ecard-time { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.ecard-acts { display: flex; gap: 3px; }
.mini-btn {
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 6px;
  transition: .13s;
}
.mini-btn:hover { color: var(--accent); background: var(--accent-bg); border-color: #f6dccb; }
.mini-btn:disabled { opacity: .55; cursor: default; }

/* ═══════════════════════════════════════════════════════════════
   风格参考链接
   ───────────────────────────────────────────────────────────────
   和「商品参考图」是两件事，所以视觉上要能一眼分开：
   那边橙色（我的产品），这边蓝绿（别人的调性）。
   ═══════════════════════════════════════════════════════════════ */
.block-style { position: relative; }
.block-style::before {
  content: '';
  position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 2px; border-radius: 2px;
  background: linear-gradient(#2ea3a0, #3f7fd6);
  opacity: .55;
}
.block-style .block-head h2 { display: flex; align-items: baseline; }
.block-style .h2-em {
  font-style: normal;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  margin-left: 5px;
}
.style-body { margin-top: 2px; }

/* 标题行右侧：清除 + 总开关，一起贴右边，开关永远在最外侧 */
.block-style .head-right {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.block-style .head-right .link-btn { margin-left: 0; }
.sw-head {
  display: inline-flex; align-items: center;
  padding: 2px 1px;
  cursor: pointer;
  user-select: none;
}
.sw-head input { display: none; }
.sw-head .sw-track { width: 28px; height: 16px; }
.sw-head .sw-track i { width: 12px; height: 12px; }
.sw-head input:checked + .sw-track { background: var(--accent); }
.sw-head input:checked + .sw-track i { transform: translateX(12px); }

/* 关闭：整块降调，但输入行保持可用 —— 关的是「套用」，不是「能不能抓」。
   抓取、看参考图这些动作随时能做，只有「进不进提示词」由开关决定。 */
.block-style.off::before { background: var(--line); opacity: .9; }
.block-style.off .note-line,
.block-style.off .style-body { display: none; }
.block-style.off { padding-bottom: 6px; }
.block-style.off .btn-fetch { background: #cfd6de; }
.block-style.off .btn-fetch:hover { background: #c2cad3; }

/* 抓到的风格图：和商品参考图同一套缩略图语言，但勾选色换成蓝绿 */
.style-body .ref-row { height: 56px; }
.style-body .ref-item { width: 50px; height: 50px; }
.style-body .ref-item.on {
  border-color: #2ea3a0;
  box-shadow: 0 0 0 2px #e3f4f3;
}
.style-body .ref-item .tick { left: auto; right: 3px; bottom: 3px; }

/* 识别结果：色卡 + 字体 + 圆角，一行放得下就一行 */
.style-chips {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 5px;
  margin-top: 7px;
}
.sc-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500;
  color: var(--ink-2);
  background: #f7f8fa;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.sc-chip b { font-weight: 650; color: var(--ink); }
.sc-chip .sw {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.16);
  flex: none;
}
.sc-chip.pal { padding-left: 5px; }
.sc-chip.pal i {
  width: 9px; height: 9px; border-radius: 2px;
  border: 1px solid rgba(0,0,0,.14);
  flex: none;
}

/* 风格描述：用户可改，是这套图的文字版美术指导 */
#styleNote {
  width: 100%;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
  min-height: 108px;
  transition: border-color .14s, box-shadow .14s;
}
#styleNote::placeholder { color: var(--muted-2); }
#styleNote:focus {
  outline: none;
  border-color: #2ea3a0;
  box-shadow: 0 0 0 3px #e9f5f4;
}

/* 风格区的勾选记号用青绿：和左侧那条渐变竖线同一套颜色，
   不然青绿边框配橙色勾，看着像两个组件的拼接 */
.style-body .ref-item .tick { background: #2ea3a0; }
.block-style .counter.on { color: #1a7a77; background: #e3f4f3; }
