/* ══════════════════════════════════════════════════════════════════
   提交反馈条 · 2026-11-05
   老板要求:「交互上要有反馈,不然的话可能会反复提交、重复提交,会浪费钱。
             如果是提交成功的,要显示。如果是因为网络卡住或者等等的,
             你也要提醒说任务正在提交。」

   为什么不能只靠 toast:toast 3.2 秒就消失,而出图是「提交即扣费」。
   用户没看到结果就会再点一次 → 重复扣费。所以这里做一条**常驻**的状态条,
   在生成按钮正上方,只有明确的结论出现才收起来(成功保留 6 秒 / 失败一直留着)。

   六态:
     submitting  提交中(转圈)      → 「正在提交 N 张…」
     slow        超过 8 秒未回        → 「网络较慢,正在等服务器确认,请不要重复点击」
     ok          成功                → 「已提交 N 张 · 已开始出图」
     dedup       被幂等闸门拦下       → 「这一批刚才已经提交过,没有重复扣费」
     err         失败                → 错误原因 + 重试按钮
   ══════════════════════════════════════════════════════════════════ */

.submit-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  /* ⛔ 右侧必须留出 66px(2026-11-05 实测抓到的遮挡):
     右下角有个常驻的圆形悬浮按钮 #drawerFab(58×58, fixed, z-40)「卷」。
     它正好压在本条右侧 —— 实测「查看进度」按钮 x 0.75 / 0.95 两个探测点
     命中的都是 drawerFab,等于**按钮右半边点不动,文字也被盖住**。
     这不是样式偏好问题,是点击被抢走的真 bug。 */
  padding: 11px 66px 11px 13px;
  margin-bottom: 10px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(43,36,23,.05);   /* 和纸底拉开一点层级,别融进去 */
  animation: sb-in .22s ease-out;
}
.submit-bar[hidden] { display: none; }

@keyframes sb-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 转圈 */
.submit-bar .sb-spin {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: .75;
  animation: sb-spin .8s linear infinite;
}
@keyframes sb-spin { to { transform: rotate(360deg); } }

/* 结果图标 */
.submit-bar .sb-icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.submit-bar .sb-body { flex: 1 1 auto; min-width: 0; }
.submit-bar .sb-title { font-weight: 700; letter-spacing: .3px; }
.submit-bar .sb-sub {
  margin-top: 3px;
  font-size: 12.5px;
  opacity: 1;              /* 0.82 实测偏淡:任务号/已等秒数这些用户真要读 */
  word-break: break-all;
}
.submit-bar .sb-sub:empty { display: none; }

/* 右侧操作按钮(查看任务 / 重试) */
.submit-bar .sb-act {
  flex: none;
  align-self: center;
  min-height: 44px;          /* 触达标准:可见按钮 ≥44px(手机拇指友好) */
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.submit-bar .sb-act:hover { background: rgba(255,255,255,.35); }

/* ── 提交中:中性金,不刺眼,但可见 ── */
/* ── 提交中:暖金底 + 深褐字 ──
   ⛔ 第一版用 --ink-soft(#5A5044) + 10% 底,实测「像蒙了层灰、读不清」。
   提交状态是用户最需要看清的一刻(要不要再点?能不能关?),对比度不能省。 */
.submit-bar.sb-submitting {
  color: #4E3F24;
  background: rgba(169,139,61,.16);
  border-color: rgba(169,139,61,.50);
}

/* ── 网络较慢:琥珀色告警,明确叫用户别点 ── */
.submit-bar.sb-slow {
  color: #8A5A12;
  background: rgba(217,152,29,.11);
  border-color: rgba(217,152,29,.38);
}
.submit-bar.sb-slow .sb-title::after {
  content: ' ⚠';
}

/* ── 提交成功·任务仍在跑:古金暖调 + 转圈 ──
   ⛔ 这里刻意**不用对勾**:对勾=「已完成」的通用语义,而此刻图还在画。
   用户看到勾会以为图已到,回头发现任务还在跑=(又一次)不信任。
   也刻意不用绿色/冷蓝:全站是米白+暗红+古金,冷色横在这儿像系统弹窗。
   语义靠「转圈 + 正在出图」承担,颜色只负责让它在暖色页面上看得见。 */
.submit-bar.sb-ok {
  color: #5E4415;
  background: rgba(169,139,61,.15);
  border-color: rgba(169,139,61,.48);
}
/* 「查看进度」是提交后唯一有用的动作(要去看图画到哪了),做成实色:
   第一版是浅描边幽灵按钮,实测「像标签、不像能点」,和提示条背景融在一起。 */
.submit-bar.sb-ok .sb-act,
.submit-bar.sb-dedup .sb-act {
  background: #8A6E2A;
  border-color: #8A6E2A;
  color: #FFF8E8;
  font-weight: 700;
}
.submit-bar.sb-ok .sb-act:hover,
.submit-bar.sb-dedup .sb-act:hover { background: #6E5720; border-color: #6E5720; }

/* ── 重复被拦:暖灰褐,表达「这条没花钱」,不抢眼 ── */
.submit-bar.sb-dedup {
  color: #6B6154;
  background: rgba(107,97,84,.09);
  border-color: rgba(107,97,84,.28);
}
.submit-bar.sb-dedup .sb-icon { background: #6B6154; }

/* ── 失败:朱砂红 ── */
.submit-bar.sb-err {
  color: var(--cinnabar, #A03028);
  background: rgba(160,48,40,.08);
  border-color: rgba(160,48,40,.30);
}
.submit-bar.sb-err .sb-icon { background: var(--cinnabar, #A03028); }

/* 提交中按钮:除了 disabled,再断掉指针事件(双击/连点在 DOM 层就无效) */
/* 提交中按钮:文字改成「提交中…」+ 转圈 + 断指针 + 降饱和。
   ⛔ 只改 opacity 不够 —— 视觉上仍像「可点但淡」,用户会以为没点上又去点。
   现在是三件事一起:文字变了、有转圈动效、pointer-events 直接没了。 */
/* 按钮锁定态(提交中 / 刚提交完 4 秒):
   ⛔ 不用大块深褐:主操作按钮突然变深色大块,视觉权重比正常态还高,像"要我按"。
   这里走「低权重禁用块」——浅底、暖灰字、虚线边,一眼是「状态」不是「动作」。 */
.wb-gen-big[data-submitting="1"] {
  pointer-events: none;
  opacity: 1;
  transform: none;
  box-shadow: none;
  background: rgba(43,36,23,.055);
  color: #6B6154;
  border: 1px dashed rgba(43,36,23,.18);
  cursor: not-allowed;
}
.wb-gen-big[data-submitting="1"]::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid rgba(107,97,84,.30);
  border-top-color: #6B6154;
  border-radius: 50%;
  animation: sb-spin .8s linear infinite;
  vertical-align: -2px;
}

/* 手机端:状态条贴着底栏,别太高 */
@media (max-width: 700px) {
  .submit-bar {
    padding: 9px 62px 9px 11px;   /* 右边同样避开悬浮按钮 */
    font-size: 12.5px;
    margin-bottom: 8px;
  }
  .submit-bar .sb-sub { font-size: 11.5px; }
  .submit-bar .sb-act { min-height: 44px; padding: 0 12px; font-size: 12.5px; }
}

/* ═══════════════════════════════════════════════════════════════════
   ＋ 上传新产品(2026-11-05)
   闭环「先粘链接复刻 → 选图 → 再上产品」这条路径:产品库头部直接传新品。
   配色跟提交反馈条同一套暖古金(--gold-deep / --cinnabar),不用冷色。
   触达:所有按钮 min-height 44px(手机上手点得中)。
   ═══════════════════════════════════════════════════════════════════ */

/* 头部按钮:这是主操作,给实色古金底(和「查看进度」同级),不只描边 */
.lib-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  margin-right: 8px;
  border-radius: 10px;
  border: 1px solid var(--gold-deep, #A8843F);
  background: var(--gold-deep, #A8843F);
  color: #FFFBF2;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .15s ease, transform .08s ease;
}
.lib-new-btn:hover { background: #8F6F33; border-color: #8F6F33; }
.lib-new-btn:active { transform: translateY(1px); }
.lib-new-btn:disabled {
  cursor: default;
  background: rgba(168, 132, 63, .55);
  border-color: transparent;
  transform: none;
}
.lib-new-btn:focus-visible { outline: 2px solid var(--cinnabar, #A03028); outline-offset: 2px; }

/* 表单浮层:盖在产品库(z-index 100000)之上,和它同一层不冲突 */
.lib-new-mask {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(43, 36, 23, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.lib-new-card {
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: #FBF8F1;
  border: 1px solid rgba(168, 132, 63, .28);
  box-shadow: 0 18px 48px -16px rgba(43, 36, 23, .38);
}

/* 头部:主图缩略 + 两行说明 */
.lib-new-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.lib-new-thumb {
  width: 56px; height: 56px; flex: 0 0 56px;
  object-fit: cover; border-radius: 10px;
  background: #EFE8D8;
  border: 1px solid rgba(168, 132, 63, .22);
}
.lib-new-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lib-new-meta b { font-size: 1rem; color: var(--ink, #2B2417); letter-spacing: .01em; }
.lib-new-meta span { font-size: .78rem; color: #7A6A52; }

/* 字段 */
.lib-new-label {
  display: block;
  margin: 0 0 6px;
  font-size: .8rem;
  font-weight: 600;
  color: #5A4B36;
}
.lib-new-label:not(:first-of-type) { margin-top: 14px; }
.lib-new-req {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(160, 48, 40, .10);
  color: var(--cinnabar, #A03028);
  font-size: .68rem;
  font-weight: 700;
  vertical-align: 1px;
}
.lib-new-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(43, 36, 23, .16);
  background: #FFFFFF;
  color: var(--ink, #2B2417);
  font-size: .95rem;
}
.lib-new-input:focus {
  outline: none;
  border-color: var(--gold-deep, #A8843F);
  box-shadow: 0 0 0 3px rgba(168, 132, 63, .14);
}

/* 品类:大格子,一眼能点中(手机 3 列) */
.lib-new-cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.lib-new-cat {
  min-height: 44px;
  padding: 0 4px;
  border-radius: 10px;
  border: 1px solid rgba(43, 36, 23, .16);
  background: #FFFFFF;
  color: #4A3E2B;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .13s ease;
}
.lib-new-cat:hover { border-color: var(--gold, #C9A84F); }
.lib-new-cat.is-on {
  border-color: var(--gold-deep, #A8843F);
  background: rgba(201, 168, 79, .16);
  color: #5E4415;
  font-weight: 700;
}

/* 错误:贴近按钮,不用 toast(用户正在这个框里操作,别让提示飘走) */
.lib-new-err {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(160, 48, 40, .08);
  border-left: 3px solid var(--cinnabar, #A03028);
  color: #8A2A23;
  font-size: .8rem;
  line-height: 1.45;
}

/* 按钮组 */
.lib-new-acts {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.lib-new-cancel,
.lib-new-go {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
}
.lib-new-cancel {
  flex: 0 0 32%;
  border: 1px solid rgba(43, 36, 23, .18);
  background: transparent;
  color: #5A4B36;
}
.lib-new-cancel:hover { background: rgba(43, 36, 23, .05); }
.lib-new-go {
  border: 1px solid var(--gold-deep, #A8843F);
  background: var(--gold-deep, #A8843F);
  color: #FFFBF2;
}
.lib-new-go:hover { background: #8F6F33; border-color: #8F6F33; }
.lib-new-go:disabled { background: rgba(168, 132, 63, .55); border-color: transparent; cursor: default; }
.lib-new-cancel:focus-visible,
.lib-new-go:focus-visible,
.lib-new-cat:focus-visible { outline: 2px solid var(--cinnabar, #A03028); outline-offset: 2px; }

/* 手机:按钮和输入框都再放大一点,免得手指点偏 */
@media (max-width: 480px) {
  .lib-new-card { max-width: none; padding: 16px 14px 14px; }
  .lib-new-btn { padding: 0 12px; font-size: .84rem; }
  .lib-new-input, .lib-new-cancel, .lib-new-go { min-height: 48px; }
}
