/* ===== 历史补丁区（后置覆盖，必须最后加载） ===== */
/* 弹窗头部（标题 + 关闭按钮同行） */
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-head h3 { margin: 0; font-size: 16px; }

.primary-button.danger {
  background: #dc2626 !important; border-color: #dc2626 !important; color: #fff !important;
}
.primary-button.danger:hover { background: #b91c1c !important; }
.link-button.danger { color: #b91c1c !important; }

/* API 对接 · 密钥分页与模型分段 */
.api-key-pager {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 10px 0 2px; flex-wrap: wrap;
}
.api-key-pager .secondary-button { padding: 4px 12px; font-size: 12px; }
.api-key-count {
  margin: 8px 0 0; font-size: 11.5px; color: var(--muted, #94a3b8); text-align: right;
}
.docs-model-sub {
  font-size: 12.5px; font-weight: 700; color: #475569;
  margin: 18px 0 8px; padding-left: 8px; border-left: 3px solid #6366f1;
}
.docs-model-sub:first-child { margin-top: 4px; }
.docs-model-sub code {
  font-size: 11px; background: rgba(99,102,241,.1); color: #4f46e5;
  padding: 1px 6px; border-radius: 5px; margin-left: 6px;
}

/* 图片渠道 · 健康状态圆点 */
.image-model-rate { display: inline-flex; align-items: center; gap: 6px; }
.img-health-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: #cbd5e1;
}
.image-model-rate.is-ok .img-health-dot { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.18); }
.image-model-rate.is-warn .img-health-dot { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.18); }
.image-model-rate.is-bad .img-health-dot { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.18); }
.image-model-rate.is-ok { color: #15803d; }
.image-model-rate.is-warn { color: #b45309; }
.image-model-rate.is-bad { color: #b91c1c; }

/* 作品 · 失败统一封面 */
.work-failed {
  position: relative; overflow: hidden; padding: 0 !important;
  background: #0f172a;
}
.work-failed img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: .92;
}
.work-failed small {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 10px; font-size: 11.5px; color: #fed7d7;
  background: linear-gradient(transparent, rgba(15,23,42,.9));
  text-align: center;
}

/* 图片页 · @ 素材浮层（复用 mention-pop 样式，仅补定位） */
#image-mention-pop {
  position: fixed; z-index: 80; max-height: 232px; overflow: auto;
}

/* 图片页 · 描述画面里的参考图缩略提示 */
.image-prompt-refs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 10px; border-radius: 10px;
  background: rgba(99,102,241,.05); border: 1px dashed rgba(99,102,241,.25);
}
.image-prompt-refs.empty {
  font-size: 11.5px; color: var(--muted, #94a3b8);
  display: flex; align-items: center; gap: 6px; margin: 10px 0 0;
  padding: 8px 10px; border-style: dashed; background: rgba(148,163,184,.06);
}
.ipr-label {
  font-size: 11px; color: #6366f1; font-weight: 600; flex: 0 0 auto;
}
.ipr-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 4px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(99,102,241,.28); background: #fff;
  transition: all .14s ease;
}
.ipr-chip:hover { border-color: #6366f1; background: rgba(99,102,241,.08); }
.ipr-chip img {
  width: 20px; height: 20px; border-radius: 50%; object-fit: cover; display: block;
}
.ipr-chip b {
  font-size: 11px; font-weight: 600; color: #4f46e5; font-variant-numeric: tabular-nums;
}
.ipr-hint { font-size: 10.5px; color: var(--muted, #94a3b8); margin-left: auto; }

/* Toast · 警告档（部分成功、需要注意但不致命） */
.toast.warn {
  border-color: rgba(245, 158, 11, .45);
  background: #fffbeb;
  color: #92400e;
}
.toast.warn svg { color: #d97706; }

/* 资产阶段图：同一对象的不同时期 */

/* 图片模型卡：窄栏里统一按单行省略，不再让「积分/张」「最多 4 张」折成两行 */
#image-model-list .model-rail-heading > strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: keep-all;
}
#image-model-list button {
  min-width: 0;
  overflow: hidden;
}
.image-model-line {
  flex-wrap: nowrap;
  min-width: 0;
}
.image-model-line b {
  white-space: nowrap;
  flex: none;
}
.image-model-line small {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.image-model-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
}
.image-model-rate {
  white-space: nowrap;
}
.image-model-rate span,
.image-model-rate {
  flex-wrap: nowrap;
}

/* 费用条：窄栏里别把「0.04 积分/张」拆成一堆单字 */
.billing-breakdown {
  flex-wrap: wrap;
  row-gap: 4px;
}
.billing-breakdown > span:first-child {
  flex: none;
  white-space: nowrap;
}
.billing-price {
  flex: none;
  white-space: nowrap;
}
.billing-price strong {
  white-space: nowrap;
  word-break: keep-all;
}
.billing-breakdown > small {
  flex: 1 1 100%;
  margin-left: 0;
  white-space: normal;
  line-height: 1.5;
}

/* 费用条单位：跟在金额后面，不单独换行 */
.billing-price { white-space: nowrap; }
.price-unit {
  font-style: normal; font-size: 11px; color: #64748b;
  margin-left: 1px; white-space: nowrap;
}

/* 文档提示块：flex 子项被压到一字一行 → 强制可伸缩 + 允许按词换行 */
.docs-warning > div,
.docs-success > div,
.docs-warn > div,
.docs-note > div {
  flex: 1 1 auto;
  min-width: 0;
}
.docs-warning strong,
.docs-success strong,
.docs-warn strong,
.docs-note strong {
  display: block;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.docs-warning p,
.docs-success p,
.docs-warn p,
.docs-note p {
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: normal;
}
/* 文档正文里所有 flex 提示卡都按这个规则来 */
.api-doc-body [class*="docs-"] {
  min-width: 0;
}
.api-doc-body [class*="docs-"] > div {
  flex: 1 1 auto;
  min-width: 0;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* 提示块补充规则 */
.docs-warning > *,
.docs-success > *,
.docs-warn > *,
.docs-note > * {
  min-width: 0;
}
.docs-warning > .icon,
.docs-success > .icon,
.docs-warn > .icon,
.docs-note > .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.docs-warning code,
.docs-success code,
.docs-warn code,
.docs-note code {
  white-space: nowrap;
}

/* 提示块图标：绝对定位到左上角，不参与文本流 */
.docs-warning > .icon,
.docs-warn > .icon {
  position: absolute;
  left: 13px;
  top: 13px;
  width: 18px;
  height: 18px;
}
.docs-success > .icon {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 18px;
  height: 18px;
}
.docs-note > .icon {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 16px;
  height: 16px;
}
.docs-note {
  display: block;
  position: relative;
  padding-left: 36px;
}
/* 正文里的内联 code 别撑破容器 */
.docs-warning code,
.docs-success code,
.docs-warn code,
.docs-note code {
  white-space: nowrap;
  max-width: 100%;
  display: inline-block;
  vertical-align: baseline;
}

/* 用户管理：今日数据稍微突出一点 */
.admin-cell-today strong { color: #1d4ed8; }
.admin-cell-today { white-space: nowrap; }

/* 用户管理：管理员账号标记为测试数据 */
.admin-test-badge {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  font-size: 10.5px; font-weight: 600;
  color: #92400e; background: #fef3c7; border: 1px solid #fcd34d;
}

/* 压缩播放提示：明显但不刺眼 */
.play-quality-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 12.5px;
  line-height: 1.6;
}
.play-quality-note > .icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: #2563eb;
}
.play-quality-note strong { color: #1d4ed8; }

/* 作品列表「加载更多」 */
.works-more { display: flex; justify-content: center; padding: 18px 0 6px; }
.works-more button { min-width: 180px; }

/* 作品与任务：缩略图列 */
.admin-cell-thumb { width: 76px; padding: 4px 6px !important; }
.admin-thumb {
  position: relative; display: block; width: 64px; height: 44px;
  padding: 0; border: 1px solid #e2e8f0; border-radius: 6px;
  overflow: hidden; background: #0f172a; cursor: zoom-in;
}
.admin-thumb img, .admin-thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.admin-thumb-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none;
}
.admin-thumb-ph {
  display: grid; place-items: center; width: 64px; height: 44px;
  border-radius: 6px; background: #f1f5f9; color: #cbd5e1;
}

/* 任务详情里的参考图 */
.record-refs { margin-top: 14px; }
.record-refs h4 { margin: 0 0 8px; font-size: 12.5px; color: #334155; }
.record-refs-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.record-ref {
  position: relative; width: 72px; height: 72px; padding: 0;
  border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden;
  cursor: zoom-in; background: #f8fafc;
}
.record-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.record-ref span {
  position: absolute; right: 3px; bottom: 3px;
  min-width: 15px; height: 15px; padding: 0 3px;
  display: grid; place-items: center; border-radius: 4px;
  background: rgba(15, 23, 42, .72); color: #fff; font-size: 10px; font-weight: 700;
}
.record-refs-empty { margin-top: 12px; font-size: 12px; }

/* 人物资产：一张三视图设定板，不再四宫格 */

/* 参考图查看遮罩 */
.ref-lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: rgba(15, 23, 42, .82);
  backdrop-filter: blur(2px);
}
.ref-lightbox-figure { margin: 0; max-width: min(90vw, 1000px); max-height: 88vh; text-align: center; }
.ref-lightbox-figure img {
  max-width: 100%; max-height: 80vh; object-fit: contain;
  border-radius: 10px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.ref-lightbox-figure figcaption { margin-top: 10px; color: #e2e8f0; font-size: 12.5px; }
.ref-lightbox-close {
  position: absolute; top: 18px; right: 20px;
  width: 34px; height: 34px; border-radius: 8px; border: 0;
  background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.ref-lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.16); color: #fff; font-size: 24px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.ref-lightbox-nav.prev { left: 22px; }
.ref-lightbox-nav.next { right: 22px; }
