/* cover 页面专用样式（封面生成） */
.cover-page .cols-2 { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.cover-form .panel-hd .tabs { padding: 3px; }
.cover-form .panel-hd .tab { height: 28px; }
.cover-sec { border-top: 1px solid var(--line-2); }

.cover-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; min-height: 34px; }
.cover-err-inline { color: var(--red); font-size: 13px; }
.cover-tip a.link { white-space: nowrap; }
.cover-tip { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 12px; font-size: 12.5px; color: var(--sub); line-height: 1.6; }
.cover-tip .ic { width: 15px; height: 15px; margin-top: 2px; color: var(--brand); }
.cover-tip b { color: var(--text); }

/* 照片挑选格子 */
.cover-pick {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px;
  max-height: 340px; overflow-y: auto; padding: 2px 4px 2px 2px;
}
.cover-pick .empty { grid-column: 1 / -1; }
.cover-pick .empty .ic { width: 22px; height: 22px; color: var(--brand); }
.cover-grp { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; margin: 6px 0 0; font-size: 12.5px; font-weight: 600; color: var(--sub); }
.cover-grp:first-child { margin-top: 0; }
.cover-grp i { font-style: normal; font-weight: 400; color: var(--mute); }
.cover-ph {
  position: relative; display: block; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden;
  background: var(--line-2); outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .12s, transform .12s;
}
.cover-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-ph:hover { outline-color: #b9c8f5; }
.cover-ph.on { outline: 3px solid var(--brand); outline-offset: -3px; }
.cover-ph.on::after {
  content: "✓"; position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--brand);
}
.cover-used { display: none; position: absolute; left: 4px; bottom: 4px; font-style: normal; font-size: 11px; line-height: 17px; padding: 0 5px; border-radius: 4px; color: #fff; background: rgba(240, 71, 58, .88); }
.cover-ph.used .cover-used { display: block; }
.cover-ph.bad img { visibility: hidden; }
.cover-ph.bad::before { content: "读不了"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--mute); }
.cover-picked { margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: #fafbfd; border: 1px solid var(--line-2); font-size: 13px; color: var(--sub); overflow-wrap: anywhere; }
.cover-picked b { color: var(--brand); }

/* 填字 */
.cover-form .field > span { display: flex; align-items: baseline; gap: 8px; }
.cover-l3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cover-in { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cover-in em { display: flex; align-items: baseline; gap: 8px; font-style: normal; font-size: 12px; color: var(--mute); }
.cover-cnt { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--mute); font-variant-numeric: tabular-nums; }
.cover-cnt.warn { color: #c26a00; }
.cover-cnt.bad { color: var(--red); font-weight: 600; }
.cover-go { width: 100%; height: 42px; justify-content: center; font-size: 15px; }
.cover-err { margin: -4px 0 0; padding: 8px 12px; border-radius: 8px; background: #ffecea; color: var(--red); font-size: 13px; }

/* 右侧：预览 + 历史 */
.cover-right { display: grid; gap: 16px; min-width: 0; }
.cover-meta { font-size: 12.5px; white-space: nowrap; }
.cover-view { display: flex; justify-content: center; }
.cover-view img {
  display: block; width: 100%; max-width: 420px; aspect-ratio: 3 / 4; object-fit: contain;
  border-radius: 10px; background: #14110c; box-shadow: 0 8px 26px rgba(20, 16, 8, .22);
}
.cover-acts { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.cover-check { display: flex; align-items: flex-start; gap: 6px; margin: 14px 0 0; padding: 8px 12px; border-radius: 8px; background: #fff7ec; color: #95500a; font-size: 12.5px; line-height: 1.6; }
.cover-check .ic { width: 15px; height: 15px; margin-top: 2px; }
.cover-src { margin: 8px 0 0; font-size: 12px; text-align: center; overflow-wrap: anywhere; }

.cover-hist { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.cover-hi { min-width: 0; border-radius: 9px; border: 1px solid var(--line); overflow: hidden; background: #fff; transition: border-color .12s, box-shadow .12s; }
.cover-hi:hover { border-color: #c9d5f5; }
.cover-hi.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.cover-hi-img { display: block; width: 100%; aspect-ratio: 3 / 4; background: #14110c; }
.cover-hi-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-hi-ft { display: flex; align-items: center; gap: 2px; padding: 2px 2px 2px 8px; font-size: 11.5px; }
.cover-hi-ft .mute { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-hi-ft .icon-btn { width: 26px; height: 26px; }
.cover-hi-ft .icon-btn .ic { width: 15px; height: 15px; }
.cover-del:hover { color: var(--red); background: #ffefed; }

@media (max-width: 860px) {
  .cover-page .cols-2 { grid-template-columns: 1fr; }
  .cover-pick { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); max-height: 300px; }
  .cover-view img { max-width: 100%; }
  .cover-hist { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}
@media (max-width: 560px) {
  .cover-l3 { grid-template-columns: 1fr; }
}

/* ================= 新版 · 10 种风格（cover-studio.js，类名都是 cover-s- 开头） ================= */
.cover-page .pg-hd .cover-mode { flex: none; }
.cover-s [hidden] { display: none !important; }   /* 下面有些块自己设了 display，hidden 属性会被盖掉 */
.cover-s.cols-2 { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.cover-s-form .panel-hd .tabs { padding: 3px; }
.cover-s-form .panel-hd .tab { height: 28px; }
.cover-s-form .field > span { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cover-s-fhint { font-style: normal; font-size: 12px; color: var(--mute); }
.cover-s-hdnote { font-size: 12.5px; color: var(--brand); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-s-hint { margin: 10px 0 0; font-size: 12.5px; color: var(--sub); line-height: 1.6; }
.cover-s-warn { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: #fff7ec; color: #c26a00; font-size: 12.5px; line-height: 1.6; }
.cover-s-warn .ic { width: 15px; height: 15px; margin-top: 2px; }
.cover-s-soft { color: #c26a00; }

/* 用谁的照片 / 出图方式：一排可点的小卡片 */
.cover-s-src, .cover-s-engs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.cover-s-engs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.cover-s-srcb {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; text-align: left;
  padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); transition: border-color .12s, box-shadow .12s;
}
.cover-s-srcb b { font-size: 13.5px; }
.cover-s-srcb small { font-size: 12px; color: var(--mute); line-height: 1.5; }
.cover-s-srcb:hover { border-color: #c9d5f5; }
.cover-s-srcb.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.cover-s-srcb.on b { color: var(--brand); }

/* 照片格子（竖图 3:4） */
.cover-s-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; }
.cover-s-ph {
  position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 9px; overflow: hidden; cursor: pointer; min-width: 0;
  background: var(--line-2); outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .12s;
}
.cover-s-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-s-ph:hover { outline-color: #b9c8f5; }
.cover-s-ph:focus-visible { outline: 3px solid #b9c8f5; outline-offset: -3px; }
.cover-s-ph.on { outline: 3px solid var(--brand); outline-offset: -3px; }
.cover-s-tick {
  position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: var(--brand);
}
.cover-s-auto-ph, .cover-s-up {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; text-align: center;
  background: #f6f8fd; border: 1px dashed #c9d3ea; color: var(--sub);
}
.cover-s-auto-ph .ic, .cover-s-up .ic { width: 22px; height: 22px; color: var(--brand); }
.cover-s-auto-ph b, .cover-s-up b { font-size: 13px; color: var(--text); }
.cover-s-auto-ph small, .cover-s-up small { font-size: 11px; line-height: 1.45; color: var(--mute); }
.cover-s-auto-ph.on { background: var(--brand-soft); border-color: transparent; }
.cover-s-upic { transform: rotate(180deg); }
.cover-s-up.busy { cursor: progress; }
.cover-s-del {
  position: absolute; left: 4px; bottom: 4px; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  color: #fff; background: rgba(20, 24, 36, .55); opacity: .9;
}
.cover-s-del .ic { width: 15px; height: 15px; }
.cover-s-del:hover { background: var(--red); opacity: 1; }
.cover-s-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--sub); }
.cover-s-who .tabs { padding: 3px; }
.cover-s-who .tab { height: 26px; padding: 0 12px; }
.cover-s-who small { color: var(--mute); font-size: 12px; }

/* 贴文案挑风格 */
.cover-s-auto { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; }
.cover-s-auto > summary {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px; cursor: pointer; list-style: none;
  font-size: 13.5px; font-weight: 600; color: var(--brand);
}
.cover-s-auto > summary::-webkit-details-marker { display: none; }
.cover-s-auto > summary::after { content: "展开"; margin-left: auto; font-size: 12px; font-weight: 400; color: var(--mute); }
.cover-s-auto[open] > summary::after { content: "收起"; }
.cover-s-auto > summary .ic { width: 16px; height: 16px; }
.cover-s-autobd { padding: 0 12px 12px; display: grid; gap: 10px; }
.cover-s-autobd .textarea { width: 100%; background: var(--panel); }
.cover-s-autoact { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cover-s-scripts { flex: 1 1 180px; min-width: 0; max-width: 100%; height: 30px; font-size: 13px; }
.cover-s-pickres { padding: 10px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-2); font-size: 13px; line-height: 1.6; }
.cover-s-pickres p { margin: 6px 0 0; overflow-wrap: anywhere; }
.cover-s-pickres .cover-s-warn { margin: 0; }
.cover-s-pickline { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cover-s-pickline b { color: var(--brand); }

/* 10 种风格卡片 */
.cover-s-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.cover-s-sty {
  display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 6px 6px 8px; text-align: left; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); transition: border-color .12s, box-shadow .12s;
}
.cover-s-sty:hover { border-color: #c9d5f5; }
.cover-s-sty.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.cover-s-styimg { display: block; aspect-ratio: 3 / 4; border-radius: 7px; overflow: hidden; background: #14110c; margin-bottom: 3px; }
.cover-s-styimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-s-sty b { font-size: 12.5px; line-height: 1.4; }
.cover-s-sty.on b { color: var(--brand); }
.cover-s-sty small { font-size: 11px; line-height: 1.45; color: var(--mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 字 */
.cover-s-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* 右边：进度 / 结果 */
.cover-s-offline { display: flex; align-items: center; gap: 6px; padding: 8px 18px; background: #fff7ec; color: #c26a00; font-size: 12.5px; }
.cover-s-offline .ic { width: 15px; height: 15px; }
.cover-s-wait { padding: 26px 10px; text-align: center; color: var(--sub); font-size: 13px; line-height: 1.6; }
.cover-s-wait > .ic { width: 30px; height: 30px; color: var(--brand); margin-bottom: 6px; }
.cover-s-wait b { display: block; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.cover-s-wait p { margin: 0 0 8px; overflow-wrap: anywhere; }
.cover-s-notes { margin: 8px 0 0; padding: 8px 12px 8px 28px; border-radius: 8px; background: #fafbfd; border: 1px solid var(--line-2); font-size: 12px; line-height: 1.6; color: var(--sub); text-align: left; }
.cover-s-notes li { overflow-wrap: anywhere; }
.cover-s-tags { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.cover-s-pname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cover-s-note { display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--brand-soft); color: #2f55c4; font-size: 12.5px; line-height: 1.6; }
.cover-s-note.bad { background: #ffecea; color: var(--red); }
.cover-s-note .ic { width: 15px; height: 15px; margin-top: 2px; flex: none; }
.cover-check span { min-width: 0; }
.cover-s-foot { margin: 10px 0 0; font-size: 12px; line-height: 1.6; }
.cover-s-active { border-top: 1px solid var(--line-2); padding: 10px 18px 14px; display: grid; gap: 6px; }
.cover-s-acthd { font-size: 12.5px; color: var(--mute); }
.cover-s-actrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cover-s-actrow .link { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-hi-img { position: relative; }
.cover-s-oldtag { position: absolute; left: 4px; top: 4px; font-style: normal; font-size: 10.5px; line-height: 16px; padding: 0 5px; border-radius: 4px; color: #fff; background: rgba(20, 24, 36, .6); }

@media (max-width: 860px) {
  .cover-s.cols-2 { grid-template-columns: 1fr; }
  .cover-page .pg-hd .cover-mode { width: 100%; }
  .cover-page .pg-hd .cover-mode .tab { flex: 1; justify-content: center; }
}
@media (max-width: 560px) {
  .cover-s-src { grid-template-columns: 1fr; }
  .cover-s-srcb { flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .cover-s-engs { grid-template-columns: 1fr; }
  .cover-s-styles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cover-s-sty small { display: none; }
  .cover-s-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* 新版：选「他人」时的人物圆片、新建人物小表单 */
.cover-s-who-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cover-s-who-row .pp-chips { flex: 0 1 auto; }
.cover-s-newp { display: grid; gap: 8px; padding: 12px; border-radius: 10px; border: 1px dashed #c9d3ea; background: #f6f8fd; }
.cover-s-newp > b { font-size: 13.5px; }
.cover-s-newp > small { font-size: 12px; color: var(--sub); line-height: 1.6; }
.cover-s-newrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cover-s-newrow .input { flex: 1 1 160px; min-width: 0; max-width: 260px; background: var(--panel); }
.cover-s-newrow .tabs { padding: 3px; }
.cover-s-newrow .tab { height: 26px; padding: 0 12px; }
.cover-s-newp .pp-chips { margin-top: 6px; }
.cover-s-pwho { margin-top: 12px; }
.cover-s-pwho b { color: var(--text); }
/* 10-03 修：页头标签固定在右上角（两个标签的说明长短不一，以前切标签时按钮会跳） */
.cover-page .pg-hd { align-items: flex-start; flex-wrap: nowrap; }
.cover-page .pg-hd > div:first-child { flex: 1 1 auto; min-width: 0; }
.cover-page .pg-hd .cover-mode { flex: none; }
@media (max-width: 860px) { .cover-page .pg-hd { flex-wrap: wrap; } }
/* 照片上的删除按钮：白底红图标，深色照片上也看得见 */
.cover-s-del {
  width: 30px; height: 30px; border-radius: 50%; left: auto; right: 5px; bottom: 5px;
  color: var(--red); background: #fff; opacity: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.cover-s-del .ic { width: 16px; height: 16px; }
.cover-s-del:hover { color: #fff; background: var(--red); }
/* 不放人物：放什么物件 */
.cover-s-objf { margin: 4px 0 0; }
.cover-s-objs { display: flex; flex-wrap: wrap; gap: 6px; }
.cover-s-obj {
  height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line); background: var(--panel);
  font-size: 13px; color: var(--sub); transition: border-color .12s, color .12s;
}
.cover-s-obj:hover { border-color: #c9d5f5; }
.cover-s-obj.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }
/* 结果上方的体检条：红＝不建议直接用，黄＝提醒 */
.cover-s-check { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: 9px; font-size: 13px; line-height: 1.6; }
.cover-s-check .ic { width: 16px; height: 16px; margin-top: 3px; flex: none; }
.cover-s-check b { display: block; }
.cover-s-check ul { margin: 4px 0 0; padding-left: 18px; }
.cover-s-check p { margin: 4px 0 0; }
.cover-s-check li, .cover-s-check p { overflow-wrap: anywhere; }
.cover-s-check.bad { background: #ffecea; color: var(--red); border: 1px solid #f6c3be; }
.cover-s-check.warn { background: #fff7ec; color: #a35a00; border: 1px solid #f3dcb8; }
/* 「我的形象照」：形象照库里已经建过的人物，收起来 */
.cover-s-more { font-size: 12.5px; color: var(--sub); }
.cover-s-more > summary { cursor: pointer; color: var(--brand); }
.cover-s-more > small { display: block; margin: 6px 0 0; color: var(--mute); }
