:root {
  --bg: #fafaf8;
  --card: #ffffff;
  --line: #e5e3dd;
  --line-soft: #f2f0ea;
  --ink: #1a1a1a;
  --mut: #6b6b6b;
  --hint: #9a9a9a;
  --accent: #0f6e56;
  --accent-soft: #eef6f3;
  --warn: #8a5a00;
  --warn-soft: #fffaf0;
  --danger: #a32d2d;
  --danger-soft: #fcebeb;
  --radius: 12px;
  /* 下拉框的自绘箭头：原生箭头永远贴着右边缘（padding-right 推不动它），
     导致「文字离左边 11px、箭头离右边 3px」的左右不对称。 */
  --chev: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 4.6 6 8l3.4-3.4' fill='none' stroke='%236f6f76' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

/* 只要元素上写了 display: flex / grid / inline-flex，就会盖掉浏览器默认的
   [hidden] { display: none }。本项目大量用 hidden 控制显隐（任务步骤、退出按钮、
   图片存储行、面板切换），逐个补 [xxx][hidden] 既容易漏又会反复踩，统一兜一层。 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 120px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 28px;
}
.topbar h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.topbar .sub { color: var(--mut); font-size: 13px; margin: 2px 0 0; }
.topbar nav { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.topbar-acts { display: flex; align-items: center; gap: 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
.card > h2 {
  font-size: 14px; font-weight: 600; margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.card > .desc { color: var(--mut); font-size: 12.5px; margin: 0 0 16px; }
.step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 600; flex: none;
}

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block; font-size: 12.5px; color: var(--mut); margin-bottom: 7px;
}
/* 所有文字类输入框共用一套尺寸。密码框曾经漏在外面，宽度退回浏览器默认（很窄），
   登录页上「账号」满宽、「密码」却是小半截 —— 加新类型时别只写 type="text"。 */
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink);
  font-family: inherit; font-size: 13.5px;
  outline: none; transition: border-color .12s;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
input[type="number"]:focus, input[type="search"]:focus,
select:focus, textarea:focus { border-color: var(--accent); }

/* 下拉框：去掉原生箭头（它固定贴右边缘、做不出对称留白），换成自绘 chevron。
   右边留 32px 给箭头、箭头距边 11px，和左边 11px 的文字缩进对上。 */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 32px;
  background-image: var(--chev);
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px 12px;
  cursor: pointer;
}
/* 显式行高：normal 行高下 textarea 的 rows 与实际行数对不上，
   rows=6 只能显示 5 行半，占位提示最后一行会被裁掉一条。 */
textarea { resize: vertical; min-height: 62px; line-height: 1.6; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* display:grid 会盖掉浏览器默认的 [hidden]{display:none}，隐藏整行时必须显式写一条 */
.row[hidden] { display: none; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* 上传区 */
.drop {
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  padding: 26px 18px;
  text-align: center;
  color: var(--mut);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: 13px;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop b { color: var(--ink); font-weight: 500; display: block; margin-bottom: 4px; }
/* 缩略图网格：auto-fit + 1fr 让「有 5 张就正好排满 5 个、只有 4 张就自动摊宽」，
   不会出现「第 5 张掉到第二行」或「4 张右边空一大块」。
   minmax 的 88px 是按左栏 540 宽算的：5×88 + 4×10 = 480 < 500，留 20px 余量防亚像素。 */
.thumbs {
  /* 固定 92px 一格，不随张数拉伸 —— auto-fit + 1fr 会让 4 张各自胀到 127px、
     5 张又缩回 92px，同一批图在不同张数下大小不一致，视觉上很跳。
     反正点开能看大图，缩略图只负责「认出是哪一张」，稳定比填满更重要。
     auto-fill（不是 auto-fit）才会保留空轨道，末尾不会把最后一张拉宽。 */
  display: grid; grid-template-columns: repeat(auto-fill, 92px);
  gap: 10px; margin-top: 12px;
}
.thumb {
  position: relative; aspect-ratio: 1 / 1; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fbfbfa;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb .x {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer; padding: 0;
}

/* 模板选择 */
.presets { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.preset {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 20px;
  background: #fff; font-size: 12.5px; color: var(--ink); cursor: pointer;
  font-family: inherit; transition: all .12s;
}
.preset:hover { border-color: var(--accent); color: var(--accent); }
.preset.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
.tpl {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  cursor: pointer; background: #fff; transition: all .12s; user-select: none;
}
.tpl:hover { border-color: #b9b6ac; }
.tpl.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.tpl .n { font-size: 12.5px; font-weight: 500; display: block; margin-bottom: 2px; }
.tpl .m { font-size: 11px; color: var(--hint); font-variant-numeric: tabular-nums; }

/* 底部报价条 */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 13px 24px;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  z-index: 20;
}
.bar .sum { display: flex; align-items: baseline; gap: 12px; }
.bar .sum b { font-size: 19px; font-variant-numeric: tabular-nums; }
.bar .sum span { color: var(--mut); font-size: 12.5px; }

button.primary, a.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border: none; border-radius: 10px;
  background: var(--accent); color: #fff;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: opacity .12s; text-decoration: none;
}
button.primary:hover, a.primary:hover { opacity: .88; text-decoration: none; }
button.primary:disabled { opacity: .4; cursor: not-allowed; }
/* 次按钮：<button> 和 <a> 共用一套 —— 顶部导航里两种都有，
   以前链接是灰色下划线小字、按钮是描边块，同一排里两种长相。 */
button.ghost, a.ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-family: inherit; font-size: 13px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
button.ghost:hover, a.ghost:hover {
  border-color: var(--accent); color: var(--accent); text-decoration: none;
}

/* ---------- 登录页 ---------- */
body.login {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.login-card { width: 100%; max-width: 360px; margin: 0; }
/* 登录卡只有标题 + 两个字段，标题下面直接接输入框，靠标题的下边距留白 */
.login-title { font-size: 20px; font-weight: 600; margin: 0 0 18px; letter-spacing: -0.01em; }
.login-btn { width: 100%; margin-top: 2px; }
/* 顶部那一排次要操作（新建任务 / 历史 / 退出）：比正文小一档但仍是实体按钮，
   原来 6px 13px / 12.5px 像一行灰字，找不到；边框也压深一点，
   白底 + 发丝边在 #fafaf8 背景上几乎看不出来。 */
.ghost.sm {
  padding: 8px 16px; font-size: 13px; font-weight: 500; border-color: #d8d4cb;
}
.ghost.sm:hover { border-color: var(--accent); }

/* 提示条 */
.note {
  border-radius: 10px; padding: 10px 13px; font-size: 12.5px; line-height: 1.55;
  margin: 0 0 12px;
}
.note.info { background: var(--accent-soft); color: var(--accent); }
.note.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0e0c0; }
.note.err { background: var(--danger-soft); color: var(--danger); }
.note ul { margin: 4px 0 0; padding-left: 18px; }

/* 结果页 */
.kpis { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 16px; min-width: 104px;
}
.kpi span { display: block; font-size: 11.5px; color: var(--mut); margin-bottom: 1px; }
.kpi b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.gallery figure {
  margin: 0; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: #fff;
}
.gallery img { width: 100%; display: block; background: #fbfbfa; }
.gallery figcaption {
  display: flex; justify-content: space-between; gap: 6px;
  padding: 7px 10px; font-size: 11.5px; color: var(--mut);
  border-top: 1px solid var(--line-soft);
}
.gallery figcaption b { font-weight: 500; color: var(--ink); }

table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line-soft); }
th { color: var(--mut); font-weight: 500; background: #faf9f6; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

details { margin-top: 12px; }
summary { cursor: pointer; font-size: 12.5px; color: var(--accent); outline: none; }

.prompt-box {
  background: #faf9f6; border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 10px 12px; font-size: 12px; line-height: 1.62;
  color: #444; white-space: pre-wrap; word-break: break-word;
  max-height: 210px; overflow: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.mut { color: var(--mut); }
.hint { color: var(--hint); font-size: 12px; }
.spin {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }

/* ---------- 模式切换（自己挑模板 / 用成熟配方） ---------- */
.modes { display: flex; gap: 8px; margin: 12px 0 14px; }
.mode {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 14px; font-size: 13px; color: var(--mut);
  font-family: inherit; cursor: pointer;
}
.mode:hover { border-color: #cfcbc0; }
.mode.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }

/* ---------- 缩略图上的角色选择 ---------- */
.thumb { position: relative; }
.thumb .role {
  position: absolute; left: 6px; right: 6px; bottom: 6px;
  /* 🔴 必须写 width:auto：全局 select 是 width:100%，绝对定位下 100% 会按格子算，
     left/right 两个约束直接失效，下拉框向右溢出 5px 被卡片裁掉 —— 看起来就是
     「左边贴着、右边被吃掉」的左右不对称。 */
  width: auto;
  /* 92px 的格子里空间紧张：左边留 7px 和文字基线对齐，右边给箭头 19px，
     箭头缩到 9px 并距边 6px —— 否则箭头会压到「风格参考」最后一个字。 */
  font-size: 11px; padding: 3px 19px 3px 7px; border-radius: 6px;
  border: 1px solid rgba(0,0,0,.12);
  background-color: rgba(255,255,255,.94);
  background-image: var(--chev);
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 9px 9px;
  font-family: inherit; color: var(--ink); cursor: pointer;
}

/* ---------- 变体 chips ---------- */
.vrow {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin: 7px 0 0; padding-top: 7px; border-top: 1px dashed var(--line-soft);
}
.vchip {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; font-size: 11px; color: var(--mut);
  font-family: inherit; cursor: pointer; line-height: 1.7;
}
.vchip:hover { border-color: #cfcbc0; color: var(--ink); }
.vchip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
/* 「默认」= 不指定变体，是个兜底项而不是一个变体：
   放最前、虚线框、字号更小，避免它看起来比真变体还重 */
.vchip.ghost {
  font-style: normal; font-size: 11px; padding: 1px 7px;
  border-style: dashed; color: var(--hint); background: transparent;
}
.vchip.ghost.on { background: transparent; border-color: var(--line); color: var(--hint); font-weight: 400; }

/* ---------- 配方卡片 ---------- */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.rcard {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  cursor: pointer; background: #fff; display: flex; flex-direction: column; gap: 3px;
}
.rcard:hover { border-color: #cfcbc0; }
.rcard.on { border-color: var(--accent); background: var(--accent-soft); }
.rcard b { font-size: 13px; font-weight: 500; }
.rcard .rmeta { font-size: 11px; color: var(--hint); }
.rcard .rdir { font-size: 11.5px; color: var(--mut); line-height: 1.45; }
.rcard .rbadges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.rcard .rbadges i {
  font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 999px;
  background: #f2f0ea; color: var(--mut);
}
.rcard .rbadges i.pix { background: #fcebeb; color: var(--danger); }

/* ---------- 高级选项 ---------- */
.opts { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--mut); cursor: pointer; }
.chk input { margin: 0; width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 auto; }

/* ---------- 结果页：单张操作 ---------- */
.gallery figure .acts { display: flex; gap: 6px; padding: 0 10px 9px; }
.gallery figure .acts button {
  flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 4px 0; font-size: 11.5px; color: var(--mut);
  font-family: inherit; cursor: pointer;
}
.gallery figure .acts button:hover { border-color: var(--accent); color: var(--accent); }
.badge {
  display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 999px;
  background: #f2f0ea; color: var(--mut); vertical-align: middle;
}
.badge.ok { background: #eef6f3; color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.fail { background: var(--danger-soft); color: var(--danger); }
.badge.ver { background: #eef1f8; color: #3b5b9a; }
.stitch-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; max-width: 420px; }
/* 详情长图动辄 8000+ px 高：整张铺开会把下面的成本明细推到几屏之外，
   但只按高度压缩又会把它挤成一条几十像素宽的细带。
   做法：固定宽度 + 限高滚动容器，宽度看得清、高度受控，点图看原尺寸。 */
.stitch-scroll { max-height: 560px; overflow-y: auto; border-radius: 6px; }
.stitch-scroll img {
  display: block; border-radius: 6px; border: 1px solid var(--line-soft);
  width: 360px; max-width: 100%; height: auto;
}

/* ---------- 配方库：类目快捷筛选 ---------- */
.rquick { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 10px; }
.fbtn {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; color: var(--mut);
  font-family: inherit; cursor: pointer; line-height: 1.4;
}
.fbtn:hover { border-color: #cfcbc0; color: var(--ink); }
.fbtn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.fbtn b {
  font-weight: 400; font-size: 11px; color: var(--hint);
  background: #f4f2ec; border-radius: 999px; padding: 0 6px;
}
.fbtn.on b { background: #fff; color: var(--accent); }
.rcount { font-size: 12px; color: var(--hint); margin: 0 0 9px; }
.rcount b { color: var(--ink); font-weight: 500; }
/* 配方卡片的风格描述限制两行，避免长文本把卡片撑得高低不齐 */
.rcard .rdir {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 配方卡片：配色预览条（1173 套无封面图，用自带 palette 代替） ---------- */
.rcard .rswatch {
  display: flex; height: 10px; border-radius: 4px; overflow: hidden;
  margin-bottom: 3px; border: 1px solid rgba(0,0,0,.06);
}
.rcard .rswatch i { flex: 1; display: block; }

/* ---------- 加载更多 ---------- */
.rmore { text-align: center; margin: 14px 0 4px; }
.rmore button {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 22px; font-size: 13px; color: var(--mut);
  font-family: inherit; cursor: pointer;
}
.rmore button:hover { border-color: var(--accent); color: var(--accent); }
.rmore button:disabled { opacity: .55; cursor: default; }
.rcard .rcover {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block;
  border-radius: 6px; margin-bottom: 4px; border: 1px solid var(--line-soft);
  background: #f4f2ec;
}
/* 命中的角色标签高亮，让"为什么这套被匹配"一眼可见 */
.rcard .rbadges i.hit { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* ---------- 历史记录：卡片（保留用户填过的商品图/类目/风格） ---------- */
.hlist { display: flex; flex-direction: column; gap: 10px; }
.hcard {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.hthumb { display: flex; gap: 6px; flex: 0 0 auto; }
.hthumb img {
  width: 86px; height: 86px; object-fit: contain; display: block;
  background: #f7f5ef; border: 1px solid var(--line-soft); border-radius: 8px;
}
.hph {
  display: flex; align-items: center; justify-content: center;
  width: 86px; height: 86px; padding: 6px; text-align: center;
  background: #f7f5ef; border: 1px dashed var(--line); border-radius: 8px;
  color: var(--hint); font-size: 11px; line-height: 1.4;
}
.hmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hh b { font-size: 14px; font-weight: 500; }
.hcost { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.hmeta { font-size: 12px; color: var(--hint); }
.hline { font-size: 12px; color: var(--mut); line-height: 1.5; }
.hline > span:first-child {
  display: inline-block; min-width: 52px; margin-right: 6px;
  color: var(--hint); font-size: 11px;
}
.hline.empty { color: var(--hint); }
.hline.err { color: var(--danger); }
.hline.plan .tag {
  display: inline-block; font-size: 11px; padding: 1px 6px; margin-right: 6px;
  border-radius: 4px; background: #eef1f8; color: #3b5b9a;
}
.hfoot { font-size: 11px; color: var(--hint); margin-top: 2px; }
.hacts { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.hacts .btn {
  display: block; text-align: center; white-space: nowrap;
  font-size: 13px; padding: 7px 14px; border-radius: 10px;
  border: 1px solid var(--accent); color: var(--accent); text-decoration: none;
}
.hacts .btn:hover { background: var(--accent-soft); text-decoration: none; }
.hacts .btn.ghost { border-color: var(--line); color: var(--mut); }
.hacts .btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .hcard { flex-wrap: wrap; }
  .hacts { flex-direction: row; width: 100%; }
  .hacts .btn { flex: 1; }
}

/* ---------- 结果页：输入的商品原图 ---------- */
.inputs { display: flex; flex-wrap: wrap; gap: 10px; }
.inputs figure {
  margin: 0; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: #fbfbfa; width: 148px;
}
.inputs figure img { width: 100%; height: 148px; object-fit: contain; display: block; }
.inputs figure .hph {
  width: 100%; height: 148px; border: 0; border-radius: 0;
}
.inputs figure figcaption {
  padding: 5px 8px; font-size: 11px; color: var(--hint);
  border-top: 1px solid var(--line-soft); background: #fff;
}

/* ---------- 两栏布局：左侧表单 / 右侧任务与历史 ---------- */
.wrap.wide { max-width: 1420px; }
.layout {
  display: grid;
  /* 左栏是主操作区，给够宽度：表单里的两列输入框在 420 以下会挤成窄条；
     右栏是任务与结果，1fr 自适应，宽屏下自然变宽。 */
  grid-template-columns: minmax(440px, 580px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.col-left > .card:last-child { margin-bottom: 0; }
.col-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-right .card { margin-bottom: 0; }

/* 左栏变窄后，模板/配方网格改用更小的最小宽度，避免被压成一列 */
.col-left .tgrid { grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); }
.col-left .rgrid { grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); }

/* 任务顶部的「① 方案 / ② 出图」：这两个是整块面板的切换按钮，不是标签。
   原来 12px + 灰底 3px 内边距，看着像状态标签、点不动；
   现在做成实体按钮：白底描边 → 选中填色，点上去有明确的按下感。 */
.task-steps { display: flex; gap: 8px; margin: 2px 0 16px; flex-wrap: wrap; }
.ts-item {
  font-size: 13.5px; font-weight: 500; color: var(--mut); letter-spacing: .01em;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 20px;
  cursor: pointer; user-select: none;
  transition: color .12s, background .12s, border-color .12s, box-shadow .12s;
}
.ts-item:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.ts-item:active { transform: translateY(1px); }
.ts-item.on {
  color: #fff; border-color: var(--accent); background: var(--accent);
  box-shadow: 0 2px 8px rgba(15, 110, 86, .22); cursor: default;
}
.ts-item.on:hover { color: #fff; background: var(--accent); }
.ts-item.done { color: #2e7d32; border-color: #c8e6c9; background: #f1f8f2; }
.ts-item.done:hover { color: #2e7d32; border-color: #b6d9ba; background: #ecf6ee; }

.task-empty { text-align: center; padding: 36px 18px; color: var(--mut); font-size: 13px; line-height: 1.7; }
.task-empty b { display: block; color: #2b2b30; font-size: 14px; margin-bottom: 6px; }
.task-frame { width: 100%; border: 0; display: block; min-height: 520px; background: transparent; }

.hmini {
  display: flex; gap: 10px; padding: 9px 2px; cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.hmini:last-child { border-bottom: 0; }
.hmini:hover .hmini-name { color: var(--accent); }
.hmini-thumb {
  width: 42px; height: 42px; flex: none; border-radius: 8px;
  border: 1px solid var(--line-soft); object-fit: cover; background: #fafafa;
}
.hmini-main { min-width: 0; flex: 1; }
.hmini-name {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hmini-meta { font-size: 11.5px; color: var(--mut); margin-top: 3px; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .col-left .tgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .task-frame { min-height: 420px; }
}

/* ---------- 结果页 embed 模式（嵌在新建页右栏里） ---------- */
body.embed .topbar { display: none; }
/* 嵌在右栏时不留整页边距，但左右各留 13px：
   父页的任务条（¥0.66 / 确认出图）内边距就是 13px，这样标题、说明、
   镜头表都和它对齐；不留的话标题会顶到卡片边框上，看着像漏了边距。 */
body.embed .wrap { max-width: none; padding: 0 13px 10px; }
/* 内嵌时隐藏内页的底部操作条：父页任务面板顶部已经有 sticky 的「确认出图」，
   两处都显示会出现两个价格两个按钮，而且内页那个要滚到底才看得到。 */
body.embed .bar { display: none; }

/* 右栏示例成品：每张图下面标出它是哪一类（主图/场景/细节特写…），
   光看图分不清主图和场景图，也就不知道自己该照着出哪几张。 */
.samples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sample { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sample figcaption {
  font-size: 11px; color: var(--mut); text-align: center; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.samples img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in;
  border-radius: 8px; border: 1px solid var(--line-soft); background: #fafafa;
}
.samples img:hover { border-color: var(--accent); }

/* 智能推荐结果 */
.reco { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.reco-item {
  border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 8px 10px; background: #fbfbfc;
}
.reco-item b { font-size: 13px; font-weight: 500; }
.reco-slot {
  font-size: 11px; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 1px 7px; margin-left: 6px;
}
.reco-why { font-size: 11.5px; color: var(--mut); margin-top: 3px; line-height: 1.5; }

/* ---------- 方案预览：导演规划 + 镜头卡 ---------- */
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 2px 0 16px; }
.plan-title { font-size: 19px; font-weight: 600; letter-spacing: -0.2px; }
.plan-sub { font-size: 12.5px; color: var(--mut); margin-top: 5px; }
.status-pill {
  flex: none; font-size: 12px; color: #8a5a00; background: #fff5e0;
  border: 1px solid #ffe0a3; border-radius: 999px; padding: 3px 11px;
}

.dir { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; margin-bottom: 4px; }
.dir h3 { font-size: 13px; font-weight: 600; margin: 0 0 10px; letter-spacing: .02em; }
.dir-row { display: flex; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--line-soft); font-size: 13px; line-height: 1.7; }
.dir-k { flex: none; width: 62px; color: var(--mut); font-size: 12.5px; }
.dir-v { flex: 1; min-width: 0; }
.dir-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }
.chip {
  font-size: 11.5px; color: #4a4a52; background: #f5f5f7;
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 2px 9px;
}
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.swatches { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }
.sw { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--mut); }
.sw i { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(0,0,0,.08); display: inline-block; }

.sec-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 24px 0 10px; }
.sec-title b { font-size: 14px; font-weight: 600; }
.sec-title span { font-size: 12px; color: var(--mut); }

.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(296px, 1fr)); gap: 10px; }
.shot-card {
  border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px;
  background: #fff; display: flex; flex-direction: column; gap: 8px;
}
.shot-top { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.shot-no {
  font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border-radius: 6px; padding: 1px 7px; flex: none;
}
.shot-name { font-size: 13.5px; font-weight: 500; }
.shot-desc { font-size: 12.5px; line-height: 1.7; color: #2b2b30; margin: 0; }
.shot-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.shot-card details summary { font-size: 11.5px; color: var(--mut); cursor: pointer; }

@media (max-width: 720px) {
  .shot-grid { grid-template-columns: 1fr; }
  .plan-head { flex-direction: column; gap: 8px; }
}

/* 历史列表选中态 */
.hmini.on { background: #faf7f0; border-radius: 8px; }
.hmini.on .hmini-name { color: var(--accent); }

/* ---------- 方案/结果页的三个标签：① 规划 ② 提示词 ③ 出图 ---------- */
/* 一级 tab：结果页（① 方案 / ② 出图）和右栏（任务 / 历史 / 示例）共用同一套尺寸。
   以前一处 13px/9px、一处 14px/10px，同一产品里两套 tab 看着像两个网站。 */
.tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.tab {
  appearance: none; background: none; border: none; border-bottom: 3px solid transparent;
  padding: 10px 18px 11px; font-size: 14px; font-weight: 500; color: var(--mut);
  cursor: pointer; font-family: inherit; letter-spacing: .01em;
}
.tab:hover { color: #2b2b30; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
/* 嵌在新建页右栏时隐藏内部条：上方「任务」卡片里那三个就是 tab */
.tabs-in-embed { display: none; }
.pane[hidden] { display: none; }

/* 新建页右栏的两个 tab（① 方案 ② 出图）—— 样式统一在上面的 .task-steps 里定义 */

/* 重出面板里的质检提示 */
.qa-fix {
  border: 1px solid #ffe0a3; background: #fff9ec; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px; font-size: 11.5px; color: #7a5200; line-height: 1.6;
}
.qa-fix b { display: block; font-size: 12px; margin-bottom: 4px; color: #8a5a00; }
.qa-fix ul { margin: 0 0 7px; padding-left: 16px; }
.qa-fix button { font-size: 11.5px; padding: 3px 9px; }

/* 多版本切换（重出过的那张图） */
.vers { display: flex; align-items: center; gap: 5px; padding: 0 10px 8px; flex-wrap: wrap; }
.vbtn {
  appearance: none; font-family: inherit; font-size: 11px; line-height: 1;
  padding: 3px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--mut);
}
.vbtn:hover { border-color: var(--accent); color: var(--accent); }
.vbtn.on {
  background: var(--accent-soft); border-color: transparent;
  color: var(--accent); font-weight: 600;
}

/* 重出面板里的状态提示（未写修正 / 已写入） */
.fixstate { margin-top: 7px; font-size: 11.5px; line-height: 1.55; }
.fixstate.warn { color: #8a5a00; }
.fixstate.ok { color: #1f6b3a; }

/* ---------- 右栏一级 tab：任务 / 历史 / 示例（尺寸与结果页统一，见上面的 .tab） ---------- */
.panel[hidden] { display: none; }
.panel-card > .tabs { margin: -4px 0 14px; }

/* ---------- 表单里的小按钮（一键解析等） ---------- */
.lbl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lbl-row .mut { font-style: normal; font-size: 11.5px; }
button.mini {
  appearance: none; font-family: inherit; font-size: 11.5px; line-height: 1.5;
  padding: 3px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent);
  white-space: nowrap;
}
button.mini:hover { background: #e3f1ec; }
button.mini:disabled { opacity: .55; cursor: default; }
button.mini i { font-style: normal; color: var(--mut); font-size: 11px; }

/* ---------- 提示词编辑 ---------- */
.prompt-edit { border-top: 1px dashed var(--line-soft); padding-top: 9px; display: flex; flex-direction: column; gap: 7px; }
.pe-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--mut); }
.prompt-edit textarea {
  width: 100%; font-size: 11.5px; line-height: 1.72; resize: vertical;
  min-height: 168px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; background: #fdfdfc;
}
.prompt-edit textarea:focus { border-color: var(--accent); background: #fff; }
.prompt-edit details { margin-top: 2px; }
.prompt-edit details summary { font-size: 11.5px; }
.pe-state { font-size: 11.5px; line-height: 1.55; }
.pe-state.ok { color: #1f6b3a; }
.pe-state.err { color: var(--danger); }

.lang-switch {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12px; color: var(--mut); margin: 0 0 12px;
  background: #fbfbfa; border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 11px;
}
.lang-switch .mut { font-size: 11.5px; }
.langbtn {
  appearance: none; font-family: inherit; font-size: 12px; cursor: pointer;
  padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--mut);
}
.langbtn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* ---------- 详情长图：手动选图拼接 ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pick {
  display: flex; flex-direction: column; gap: 4px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff;
}
.pick:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #fafafa; display: block; }
.pick span { font-size: 11px; color: var(--mut); line-height: 1.35; }
.stitch-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 六个规划模块的标题变长（模块连续性规则），窄 62px 会被挤成两行 */
.dir-k { width: 92px; flex: none; }

/* ---------- 表单列里的报价条（替代原来的整页固定条） ----------
   原来的 .bar 是 position:fixed 跨整页，报价和按钮离表单很远，
   改完参数要抬眼找价格。现在它属于左栏：跟着表单滚，贴列底常驻。 */
.bar.in-form {
  /* 就是表单末尾的一块，不吸底 —— 吸底会浮在输入框上面，边填边被挡。 */
  position: static;
  flex-direction: row; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-top: 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
  z-index: 20;
}
/* 单行紧凑版：条高约 56px，贴列底常驻也不会挡住太多表单 */
.bar.in-form .sum { flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.bar.in-form .sum b { font-size: 19px; line-height: 1.25; }
.bar.in-form .sum span { font-size: 11px; line-height: 1.35; color: var(--mut); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar.in-form .primary { flex: none; padding: 10px 20px; font-size: 13.5px; }

/* ---------- 任务面板顶部：价格 + 确认出图（sticky） ---------- */
.task-action {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 12px; padding: 10px 13px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
}
.task-action.info { box-shadow: none; background: var(--accent-soft); border-color: transparent; }
.task-action .ta-sum { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.task-action .ta-sum b { font-size: 19px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.task-action .ta-sum span { font-size: 11.5px; color: var(--mut); line-height: 1.4; }
.task-action .primary { flex: none; padding: 10px 22px; }

/* 简报字段的说明文字：跟在 label 后面，小一号灰一点 */
.field label .mut { font-style: normal; font-size: 11.5px; color: var(--hint); }

/* ---------- 下载按钮（成图 / 长图 / 打包） ---------- */
.dlbtn {
  appearance: none; font-family: inherit; font-size: 11.5px; line-height: 1.5;
  padding: 4px 11px; border-radius: 8px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); background: #fff; color: #2b2b30;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.dlbtn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.dlbtn::before { content: "↓"; font-size: 11px; opacity: .7; }

/* ---------- 拼接顺序序号 ---------- */
.pick { position: relative; }
.pick .ord {
  position: absolute; top: 5px; left: 5px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; font-style: normal;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.stitch-meta { font-size: 11.5px; color: var(--mut); margin: 8px 0 4px; }
.ord-line { font-size: 11.5px; color: var(--mut); line-height: 2; }

/* 图卡里同时放「下载」和「重出」两个按钮，卡片只有 200px 宽：
   允许换行、按钮内文字不折行，否则会出现「重出这一张 / ¥0.22」被挤成两行 */
.gallery figure .acts { flex-wrap: wrap; gap: 5px; }
.gallery figure .acts button, .gallery figure .acts .dlbtn { white-space: nowrap; }

/* ---------- 重出面板：换模型 ---------- */
.regen-model {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 8px; padding: 7px 9px;
  background: #fbfbfa; border: 1px solid var(--line-soft); border-radius: 8px;
}
.regen-model label { font-size: 11.5px; color: var(--mut); white-space: nowrap; }
.regen-model select {
  flex: 1; min-width: 130px; font-size: 11.5px; padding: 4px 24px 4px 8px;
  border: 1px solid var(--line); border-radius: 6px; background-color: #fff;
  background-image: var(--chev); background-repeat: no-repeat;
  background-position: right 7px center; background-size: 10px 10px;
  font-family: inherit; cursor: pointer;
}
.rmprice { font-size: 11.5px; color: var(--mut); white-space: nowrap; }
.rmprice.sw { color: #a35b00; font-weight: 600; }

/* 图卡上的模型短名 */
.gallery figure .mslot {
  display: block; font-style: normal; font-size: 11px; color: var(--mut);
  padding: 0 10px 6px; line-height: 1.4;
}

.qa-fix-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.qa-fix-acts button { font-size: 11px; padding: 3px 8px; }

/* 展开中的重出卡片横跨整行：提示词很长，200px 宽的格子改不了 */
.gallery figure.editing { grid-column: 1 / -1; }
.gallery figure.editing img { max-height: 320px; width: auto; max-width: 100%; }
/* 只给「提示词」这个框限高；补充说明那个小框不该被撑成半屏 */
.gallery figure.editing textarea[id^="rp-"] { min-height: 200px; }

/* ---------- 钱花在哪（按类汇总，一行四个） ---------- */
.cost-split {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 9px 12px;
  background: #fbfbfa; border: 1px solid var(--line-soft); border-radius: 10px;
}
.cost-split .cs-title { font-size: 11.5px; color: var(--mut); }
.cs-item {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; position: relative; overflow: hidden;
}
.cs-item b { font-weight: 500; color: var(--mut); }
.cs-item i {
  position: absolute; left: 0; bottom: 0; height: 2px;
  background: var(--accent); opacity: .55;
}

/* ---------- 重出面板：用户补充 + AI 优化 ---------- */
.regen-notes { margin: 0 0 8px; }
.regen-notes label { display: block; font-size: 11.5px; color: var(--mut); margin-bottom: 4px; }
.regen-notes label .mut { font-style: normal; font-size: 11px; opacity: .8; }
.regen-notes textarea {
  width: 100%; font-size: 11.5px; line-height: 1.6; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-family: inherit;
}
.rn-acts { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 6px; }
.rn-acts button { font-size: 11.5px; padding: 4px 10px; white-space: nowrap; }
.rn-acts button i { font-style: normal; color: var(--hint); font-size: 11px; }
.rn-acts .fixstate { margin-top: 0; }

/* 成本明细折叠后别留一大块内边距 */
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: 10px; }

/* ---------- 花费卡：四列网格对齐（名称 / 金额 / 占比条 / 百分比） ----------
   原来是三个 KPI 方块 + 一排长短不一的胶囊，金额和条形对不上，看着散。 */
.cost-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.cc-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding-bottom: 11px; margin-bottom: 11px; border-bottom: 1px dashed var(--line-soft);
}
.cc-total span { font-size: 12px; color: var(--mut); margin-right: 8px; }
.cc-total b {
  font-size: 25px; font-weight: 600; letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}
.cc-sub { font-size: 12px; color: var(--mut); font-variant-numeric: tabular-nums; }
.cc-rows { display: grid; gap: 8px; }
.cc-row {
  display: grid; grid-template-columns: 84px 66px minmax(60px, 1fr) 40px;
  align-items: center; gap: 10px; font-size: 12px;
}
.cc-name { color: var(--ink); white-space: nowrap; }
.cc-amt { text-align: right; font-variant-numeric: tabular-nums; }
.cc-bar { height: 6px; background: #f0efec; border-radius: 999px; overflow: hidden; }
.cc-bar i { display: block; height: 100%; background: var(--accent); opacity: .7; border-radius: 999px; }
.cc-pct { text-align: right; color: var(--mut); font-size: 11px; font-variant-numeric: tabular-nums; }

/* ---------- 智能推荐：先给结论（哪几张），理由收进折叠 ---------- */
.reco-sum {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: 11px; padding: 9px 11px;
  background: #fbfbfa; border: 1px solid var(--line-soft); border-radius: 10px;
}
.reco-sum .mut { font-size: 12px; }
.reco-sum .chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.reco-sum .chip b { font-weight: 600; color: var(--accent); }
.reco-more { margin-top: 8px; }
.reco-more > summary {
  cursor: pointer; font-size: 12px; color: var(--mut); padding: 3px 0;
}
.reco-why-row { padding: 7px 0 7px 2px; border-top: 1px dashed var(--line-soft); }
.reco-why-row b { font-size: 12.5px; font-weight: 500; }

/* ---------- 出图结构：一行胶囊，勾选即出图 ----------
   替代原来的「出几张」下拉：张数由勾选决定，能拍几类就列几类。 */
.structs { display: flex; flex-wrap: wrap; gap: 6px; }
.structs .st {
  font: inherit; font-size: 12.5px; line-height: 1.2;
  padding: 7px 12px; cursor: pointer;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  transition: background .12s, border-color .12s, color .12s;
}
.structs .st:hover { border-color: var(--accent); }
.structs .st.on {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent); font-weight: 500;
}

/* ---------- 小问号：说明收进悬停，不占版面 ---------- */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin-left: 4px; vertical-align: 1px;
  font-style: normal; font-size: 9.5px; line-height: 1;
  color: var(--hint); border: 1px solid var(--line); border-radius: 50%;
  cursor: help;
}
.tip:hover { border-color: var(--accent); color: var(--accent); }

/* 不适配当前类目的结构：仍可点，只是标淡（14 类全列，不做过滤） */
.structs .st.weak { color: var(--hint); border-style: dashed; }
.structs .st.weak.on { color: var(--accent); border-style: solid; }

#promoBox label { display: block; font-size: 12.5px; color: var(--mut); margin-bottom: 5px; }

/* .field label 是 block，会把 .lbl-row 的 flex 覆盖掉 —— 按钮就贴不到右边。
   这里提一级特异性，确保「核心卖点」这类带按钮的 label 行是真 flex。 */
.field label.lbl-row { display: flex; align-items: center; justify-content: space-between; }

/* ---------- 气泡提示 ----------
   原生的 title 要悬停一秒才出、样式不可控、手机上不显示，
   所以自己画一个。任意元素加 data-tip="文案" 即可（&#10; 换行）。 */
#tipb {
  position: fixed; z-index: 9999; left: 0; top: 0;
  max-width: 268px; padding: 7px 10px;
  background: #2c2c2c; color: #fff;
  font-size: 12px; line-height: 1.55;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  white-space: pre-line;          /* 让文案里的换行生效 */
  pointer-events: none;
  opacity: 0; transform: translateY(2px);
  transition: opacity .12s ease, transform .12s ease;
}
#tipb.on { opacity: 1; transform: translateY(0); }
#tipb::after {
  content: ''; position: absolute; left: var(--arrow, 50%); margin-left: -4px;
  top: 100%; border: 4px solid transparent; border-top-color: #2c2c2c;
}
#tipb.below::after {
  top: auto; bottom: 100%;
  border-top-color: transparent; border-bottom-color: #2c2c2c;
}

/* 问号图标：现在统一挂气泡，不再用原生 title */
.tip { cursor: help; }

/* 缺条件时的按钮：仍可点（点了会说明缺什么），只是看起来"还没就绪" */
button.primary.locked { opacity: .62; }
button.primary.locked:hover { opacity: .78; }
@keyframes btn-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
button.primary.shake { animation: btn-shake .6s ease; }

/* ---------- 必填标记与校验高亮 ---------- */
.req {
  display: inline-block; line-height: 1; vertical-align: 1px;
  font-style: normal; color: #c0392b; margin: 0 2px 0 3px;
  font-size: 12px;
}
/* 缺这一项时把对应区域圈红，2 秒后自动褪掉，不长期留疤 */
.invalid,
.drop.invalid {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .12) !important;
  animation: invalid-pulse .5s ease;
}
@keyframes invalid-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(192, 57, 43, .12); }
  50% { box-shadow: 0 0 0 5px rgba(192, 57, 43, .2); }
}

/* ---------- 大图预览（lightbox） ----------
   参考图和成片都能点开看大图，不跳页、不开新标签 ——
   用户核对细节时最忌讳「点一下页面就没了」。 */
#lb {
  position: fixed; inset: 0; z-index: 9998; display: none;
  align-items: center; justify-content: center;
  padding: 3vh 3vw; background: rgba(14, 14, 16, .88);
  backdrop-filter: blur(3px);
}
#lb.on { display: flex; }
#lb img {
  max-width: 94vw; max-height: 90vh; object-fit: contain;
  border-radius: 8px; background: #fff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .55);
}
#lb .lb-tools {
  position: fixed; top: 16px; right: 18px; display: flex; gap: 8px; align-items: center;
}
#lb .lb-tools a,
#lb .lb-tools button {
  appearance: none; font-family: inherit; font-size: 12.5px; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .28); color: #fff;
  background: rgba(255, 255, 255, .1);
}
#lb .lb-tools a:hover,
#lb .lb-tools button:hover { background: rgba(255, 255, 255, .2); }
#lb .lb-cap {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .72); font-size: 12.5px; max-width: 80vw;
  text-align: center; pointer-events: none;
}


/* ---------- 忙时锁表单 ----------
   生成方案 / 出图这几分钟里，表单改了也不会进这一单 —— 允许编辑只会让人以为
   「我刚把卖点改了，应该生效了吧」。所以整块盖住并真 disable，结束再放行。 */
.col-left.busy { position: relative; }
.col-left.busy::before {
  content: ''; position: absolute; inset: -6px; z-index: 40; border-radius: 16px;
  background: rgba(255, 255, 255, .58); backdrop-filter: blur(1.5px);
}
/* 提示做成贴视口底部的浮条，而不是钉在表单顶部：
   表单能滚很长，钉在顶部的话用户滚到底部按钮那儿就看不见「正在生成」了。 */
.col-left.busy::after {
  content: attr(data-busy); position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%); z-index: 41;
  padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  background: rgba(20, 20, 22, .9); color: #fff; font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
/* 内嵌的结果页在出图期间同样不许点：提示词改了也不会用在正在跑的这一批 */
.task-frame.busy { pointer-events: none; opacity: .42; }
/* 单独打开结果页时出图的等待期 */
body.busy .pane { pointer-events: none; opacity: .55; }
body.busy .pane { transition: opacity .15s; }
