/**
 * 制作台 · 母版工作台 v4（P-css-j：从 ops-mid）
 */

/* —— 母版库 · 工作台 v4（全屏精修：选人→选槽→复制） —— */
body.igs-on-masters #panel-masters {
  height: 100%;
  overflow: hidden;
}

.igs-m-work--v4, .igs-m-work--v5 {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  height: 100%;
  min-height: 0;
}
.igs-m-work--v4 .igs-m-top, .igs-m-work--v5 .igs-m-top {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.28rem 0.45rem;
  background: rgba(255, 252, 245, 0.97);
  border: 1px solid var(--igs-line);
  border-radius: 0.55rem;
  flex: 0 0 auto;
}
.igs-m-work--v4 .igs-m-cats, .igs-m-work--v5 .igs-m-cats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  padding: 0.1rem;
  background: #ebe4d4;
  border-radius: 0.45rem;
}
.igs-m-work--v4 .igs-m-cat, .igs-m-work--v5 .igs-m-cat {
  border: none;
  background: transparent;
  border-radius: 0.35rem;
  padding: 0.28rem 0.5rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  color: var(--igs-ink);
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}
.igs-m-work--v4 .igs-m-cat, .igs-m-work--v5 .igs-m-cat em {
  font-style: normal;
  font-size: 0.62rem;
  color: var(--igs-muted);
}
.igs-m-work--v4 .igs-m-cat.on, .igs-m-work--v5 .igs-m-cat.on {
  background: #fff;
  color: var(--igs-accent);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(20, 32, 28, 0.08);
}
.igs-m-top-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.igs-m-sel {
  border: 1px solid var(--igs-line);
  border-radius: 0.35rem;
  padding: 0.22rem 0.35rem;
  background: #fff;
  font: inherit;
  font-size: 0.74rem;
  color: var(--igs-ink);
  max-width: 7rem;
}
.igs-m-iconbtn {
  border: 1px solid var(--igs-line);
  background: #fff;
  border-radius: 0.35rem;
  width: 1.85rem;
  height: 1.85rem;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.igs-m-more { position: relative; }
.igs-m-more > summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--igs-line);
  border-radius: 0.35rem;
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  background: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}
.igs-m-more > summary::-webkit-details-marker { display: none; }
.igs-m-more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 50;
  min-width: 11rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid var(--igs-line);
  border-radius: 0.55rem;
  box-shadow: 0 12px 28px rgba(20, 32, 28, 0.14);
}
.igs-m-more-lab {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--igs-muted);
  letter-spacing: 0.04em;
}
.igs-m-more-hr {
  border: none;
  border-top: 1px solid var(--igs-line);
  margin: 0.15rem 0;
}
.igs-m-more-stats {
  font-size: 0.64rem;
  color: var(--igs-muted);
}

.igs-m-work--v4 .igs-m-shell, .igs-m-work--v5 .igs-m-shell {
  display: grid;
  grid-template-columns: var(--igs-m-rail-w, 220px) 6px minmax(0, 1fr);
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: hidden;
  align-items: stretch;
}
.igs-m-work--v4 .igs-m-shell.is-flash,
.igs-m-work--v5 .igs-m-shell.is-flash,
.igs-m-work--v4 .igs-m-shell.is-pair,
.igs-m-work--v5 .igs-m-shell.is-pair {
  grid-template-columns: 1fr;
}
@media (max-width: 900px) {
  .igs-m-work--v4 .igs-m-shell, .igs-m-work--v5 .igs-m-shell {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .igs-m-rail-resizer { display: none; }
}
.igs-m-work--v4 .igs-m-rail, .igs-m-work--v5 .igs-m-rail {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 0;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  background: var(--igs-card);
  border: 1px solid var(--igs-line);
  border-radius: 0.6rem 0 0 0.6rem;
  padding: 0.35rem;
  overflow: hidden;
}
.igs-m-work--v4 .igs-m-rail > .igs-m-search,
.igs-m-work--v5 .igs-m-rail > .igs-m-search,
.igs-m-work--v4 .igs-m-rail > .igs-m-cast-scroll,
.igs-m-work--v5 .igs-m-rail > .igs-m-cast-scroll,
.igs-m-rail-sticky,
.igs-m-guest-compose {
  flex: 0 0 auto;
}
.igs-m-rail-resizer {
  position: relative;
  z-index: 3;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}
.igs-m-rail-resizer::after {
  content: '';
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 1px;
  width: 3px;
  border-radius: 3px;
  background: rgba(40, 60, 80, 0.14);
  transition: background 0.15s ease, width 0.15s ease;
}
.igs-m-rail-resizer:hover::after,
.igs-m-rail-resizer:active::after {
  width: 4px;
  background: rgba(61, 126, 166, 0.55);
}
.igs-m-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--igs-line);
  border-radius: 0.4rem;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.78rem;
  background: #fff;
}
.igs-m-cast-scroll {
  display: flex;
  gap: 0.2rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.igs-m-cast-scroll .igs-chip {
  flex: 0 0 auto;
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
}
.igs-m-list {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  /* workspace 高度链修好后：用 min-height:0 吃满侧栏剩余，内部滚动 */
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
}
.igs-m-list.is-char-list {
  gap: 0.35rem;
}
.igs-m-rail-sticky {
  padding-bottom: 0.15rem;
  border-bottom: 1px solid rgba(40, 36, 30, 0.08);
}
.igs-m-guest-compose {
  margin-top: 0.15rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(40, 36, 30, 0.1);
  background: linear-gradient(180deg, rgba(255, 252, 245, 0) 0%, rgba(243, 248, 252, 0.9) 40%);
}
.igs-m-guest-compose > summary {
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  color: #2f5f7a;
  list-style: none;
  padding: 0.28rem 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.45rem;
  align-items: baseline;
  border-radius: 0.4rem;
}
.igs-m-guest-compose > summary:hover { background: rgba(61, 126, 166, 0.08); }
.igs-m-guest-compose > summary::-webkit-details-marker { display: none; }
.igs-m-guest-sum-meta {
  font-weight: 500;
  font-size: 0.66rem;
  color: #7a7368;
}
.igs-m-guest-compose[open] > summary { margin-bottom: 0.3rem; }
.igs-m-guest-compose .igs-m-guest-form {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: min(34vh, 12.5rem);
  overflow: auto;
  padding: 0 0.1rem 0.15rem;
  overscroll-behavior: contain;
}
.igs-m-guest-compose input,
.igs-m-guest-compose textarea,
.igs-m-guest-compose select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--igs-line);
  border-radius: 0.4rem;
  padding: 0.32rem 0.45rem;
  font: inherit;
  font-size: 0.74rem;
  background: #fff;
}
.igs-m-guest-compose textarea { min-height: 2.4rem; resize: vertical; }
.igs-m-guest-compose textarea.is-prompt { min-height: 4.2rem; }
.igs-m-guest-compose .row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.igs-m-guest-compose .hint {
  margin: 0;
  font-size: 0.64rem;
  color: #7a7368;
  line-height: 1.35;
}

/* 添加测试母版 · 大弹窗 */
.igs-guest-sheet {
  width: min(1120px, 97vw);
  max-height: min(94vh, 960px);
}
.igs-guest-body {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 1.15fr);
  gap: 1rem;
  padding: 0.85rem 1rem 0.35rem;
  min-height: 0;
  flex: 1;
  overflow: auto;
}
@media (max-width: 820px) {
  .igs-guest-body { grid-template-columns: 1fr; }
}
.igs-guest-drop {
  position: relative;
  min-height: min(52vh, 420px);
  border-radius: 0.75rem;
  border: 2px dashed color-mix(in srgb, var(--igs-accent, #3d7ea6) 55%, var(--igs-line, #cfc6b4));
  background: linear-gradient(160deg, #f3f7fb 0%, #fffdf8 55%, #f7f1e6 100%);
  display: grid;
  place-items: center;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.igs-guest-drop:hover,
.igs-guest-drop:focus-visible {
  border-color: var(--igs-accent, #3d7ea6);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--igs-accent, #3d7ea6) 22%, transparent);
}
.igs-guest-drop.is-drag {
  border-color: #2a8f5b;
  background: color-mix(in srgb, #d8f0e2 70%, #fff);
}
.igs-guest-drop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.25rem;
  text-align: center;
  pointer-events: none;
}
.igs-guest-drop-empty strong {
  font-size: 1.05rem;
  font-family: var(--igs-serif, "Noto Serif SC", serif);
  color: var(--igs-ink);
}
.igs-guest-drop-empty span {
  font-size: 0.82rem;
  color: var(--igs-muted);
}
.igs-guest-drop-empty em {
  margin-top: 0.35rem;
  font-style: normal;
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--igs-accent, #3d7ea6) 80%, #333);
  max-width: 18rem;
  line-height: 1.4;
}
.igs-guest-drop-preview {
  position: absolute;
  inset: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
}
.igs-guest-drop-preview img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  border-radius: 0.55rem;
  background: #1a1814;
}
.igs-guest-drop-clear { align-self: center; }
.igs-guest-fields {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
.igs-guest-lab {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--igs-muted);
}
.igs-guest-lab b { color: #c0392b; font-weight: 800; }
.igs-guest-lab .muted { font-weight: 500; opacity: 0.85; }
.igs-guest-lab input,
.igs-guest-lab select,
.igs-guest-lab textarea {
  font: inherit;
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--igs-ink);
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--igs-line, #cfc6b4);
  background: #fffef9;
  width: 100%;
  box-sizing: border-box;
}
.igs-guest-lab textarea {
  resize: vertical;
  min-height: 4.2rem;
  line-height: 1.45;
}
.igs-guest-lab textarea.is-prompt {
  min-height: 7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  background: #f7f4ee;
}
.igs-guest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: flex-end;
}
.igs-guest-row .igs-guest-lab { flex: 1 1 8rem; }
.igs-guest-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--igs-ink);
  padding-bottom: 0.35rem;
  cursor: pointer;
}
.igs-guest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 1.6rem;
}
.igs-guest-tags .igs-chip { cursor: pointer; }
.igs-guest-tag-add {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.2rem;
}
.igs-guest-tag-add input {
  flex: 1;
  font: inherit;
  font-size: 0.84rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--igs-line, #cfc6b4);
  background: #fffef9;
}
.igs-m-add-guest {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700 !important;
  white-space: nowrap;
}
.igs-m-rail-add-guest {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--igs-line, #cfc6b4) 70%, transparent);
  background: color-mix(in srgb, var(--igs-paper, #f7f3ea) 82%, #c8dceb);
}
.igs-m-rail-add-guest .igs-btn {
  flex: 1;
  font-weight: 700;
  justify-content: center;
}
.igs-m-empty-main .igs-m-empty-cta {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.igs-m-test-badge {
  display: inline-block;
  margin-left: 0.2rem;
  padding: 0.02rem 0.28rem;
  border-radius: 0.22rem;
  font-size: 0.58rem;
  font-weight: 800;
  font-style: normal;
  letter-spacing: 0.04em;
  color: #7a4a12;
  background: #f6e2b8;
  vertical-align: middle;
}
.igs-m-char-card.is-test {
  border-color: rgba(196, 140, 40, 0.45);
  box-shadow: inset 2px 0 0 #e0a84a;
}
.igs-m-item.is-test,
.igs-master-item.is-test {
  box-shadow: inset 3px 0 0 #e0a84a;
}
.igs-m-eng-btn {
  font-size: 0.7rem !important;
  padding: 0.12rem 0.45rem !important;
  color: #3d5a80 !important;
}
.igs-m-social {
  margin-top: 0.2rem;
  border: 1px solid rgba(40, 36, 30, 0.1);
  border-radius: 0.55rem;
  background: #faf8f3;
  overflow: hidden;
  flex: 0 0 auto;
}
.igs-m-social > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.55rem;
  align-items: center;
  padding: 0.38rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #2f2a24;
  background: #f3efe6;
}
.igs-m-social > summary:hover { background: #ebe6db; }
.igs-m-social > summary::-webkit-details-marker { display: none; }
.igs-m-social-sum-title { flex: 0 0 auto; }
.igs-m-social > summary .muted {
  font-weight: 400;
  color: #7a7368;
  font-size: 0.68rem;
  flex: 1 1 auto;
}
.igs-m-social-sum-cta {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: #3d7ea6;
}
.igs-m-social-body {
  padding: 0.5rem 0.6rem 0.65rem;
  max-height: min(38vh, 20rem);
  overflow: auto;
  overscroll-behavior: contain;
}
.igs-m-social-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}
@media (min-width: 900px) {
  .igs-m-social-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 0.75rem;
  }
}
.igs-m-social-sec .lab {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: baseline;
}
.igs-m-social-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 9.5rem;
  overflow: auto;
  margin-bottom: 0.35rem;
  overscroll-behavior: contain;
}
.igs-m-social-item {
  padding: 0.35rem 0.45rem;
  border-radius: 0.4rem;
  background: #fff;
  border: 1px solid rgba(40, 36, 30, 0.08);
  font-size: 0.74rem;
  line-height: 1.4;
}
.igs-m-social-item header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: baseline;
  margin-bottom: 0.12rem;
  color: #5c6670;
  font-size: 0.66rem;
}
.igs-m-social-item header b { color: #2f2a24; font-size: 0.72rem; }
.igs-m-social-stars { color: #c45c28; letter-spacing: 0.05em; }
.igs-m-star-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.2rem;
  align-items: center;
  margin-bottom: 0.15rem;
}
.igs-m-star-btn {
  border: none;
  background: transparent;
  color: #cfc6b8;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.05rem 0.12rem;
  cursor: pointer;
  transition: color 0.12s ease, transform 0.12s ease;
}
.igs-m-star-btn:hover { color: #e0a84a; transform: scale(1.08); }
.igs-m-star-btn.on { color: #c45c28; }
.igs-m-social-form {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.igs-m-social-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.8rem;
  border: 1px solid var(--igs-line);
  border-radius: 0.4rem;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.74rem;
  resize: vertical;
}
.igs-m-social-form .row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.igs-m-suggest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 0.3rem;
  max-height: 9.5rem;
  overflow: auto;
  margin-bottom: 0.35rem;
  overscroll-behavior: contain;
}
.igs-m-suggest-card {
  border: 1px solid rgba(40, 36, 30, 0.1);
  border-radius: 0.4rem;
  overflow: hidden;
  background: #fff;
}
.igs-m-suggest-card a {
  display: block;
  aspect-ratio: 3 / 4;
  background: #ece7df;
}
.igs-m-suggest-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.igs-m-suggest-card figcaption {
  padding: 0.18rem 0.25rem 0.25rem;
  font-size: 0.6rem;
  color: #6a645a;
  line-height: 1.3;
}
.igs-m-suggest-upload {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.igs-m-suggest-upload input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--igs-line);
  border-radius: 0.35rem;
  padding: 0.3rem 0.4rem;
  font: inherit;
  font-size: 0.74rem;
}
.igs-m-suggest-file {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px dashed rgba(61, 126, 166, 0.35);
  border-radius: 0.4rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.72rem;
  color: #3d5a80;
  cursor: pointer;
  background: #f7fafc;
}
.igs-m-suggest-file input { display: none; }
.igs-m-suggest-preview {
  border-radius: 0.4rem;
  overflow: hidden;
  max-height: 5.5rem;
  background: #ece7df;
}
.igs-m-suggest-preview img {
  display: block;
  width: 100%;
  height: 5.5rem;
  object-fit: contain;
  background: #f3efe6;
}
.igs-m-guest-sec {
  margin-top: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(196, 92, 40, 0.35);
}
.igs-m-guest-sec-h {
  font-size: 0.68rem;
  font-weight: 700;
  color: #7a4a12;
  margin-bottom: 0.25rem;
}
/* 人物筛选在 sticky 内时去掉重复底边 */
.igs-m-rail-sticky .igs-m-char-tools {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.igs-m-item {
  grid-template-columns: 32px 1fr auto !important;
  gap: 0.35rem !important;
  padding: 0.25rem !important;
  border-radius: 0.45rem !important;
  align-items: center;
}
.igs-m-item .thumb {
  width: 32px !important;
  height: 40px !important;
}

/* —— 人物母版侧栏：排列 / 筛选 / 标签 / 简要详情 —— */
.igs-m-char-tools {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.15rem 0.1rem 0.25rem;
  border-bottom: 1px solid rgba(40, 36, 30, 0.08);
  margin-bottom: 0.15rem;
}
.igs-m-char-layouts,
.igs-m-char-filters,
.igs-m-char-tagrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  align-items: center;
}
.igs-m-char-layouts .igs-m-tchip {
  font-size: 0.68rem;
  min-height: 1.55rem;
  padding: 0.12rem 0.4rem;
}
.igs-m-char-filters .igs-chip,
.igs-m-char-tagrow .igs-chip {
  font-size: 0.66rem;
  padding: 0.12rem 0.38rem;
}
.igs-m-char-tagrow .igs-chip em {
  margin-left: 0.2rem;
  opacity: 0.55;
  font-style: normal;
  font-size: 0.9em;
}
.igs-m-char-count {
  font-size: 0.68rem;
  color: #6a645a;
  padding: 0 0.15rem;
}
.igs-m-char-board {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.igs-m-char-board.is-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}
.igs-m-char-board.is-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
}
.igs-m-char-board.is-compact {
  gap: 0.15rem;
}
.igs-m-char-card {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(40, 36, 30, 0.1);
  border-radius: 0.5rem;
  background: #fff;
  overflow: hidden;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.igs-m-char-card:hover {
  border-color: rgba(61, 126, 166, 0.35);
}
.igs-m-char-card.active {
  border-color: #3d7ea6;
  box-shadow: 0 0 0 1px rgba(61, 126, 166, 0.25);
  background: #f3f8fc;
}
.igs-m-char-card.is-lead.active {
  background: #f6faf4;
}
.igs-m-char-card.is-finalized {
  border-color: rgba(61, 122, 69, 0.42);
}
.igs-m-char-card.is-finalized.active {
  background: #f3faf2;
  box-shadow: 0 0 0 1px rgba(61, 122, 69, 0.28);
}
.igs-m-char-card .thumb,
.igs-master-item .thumb,
.igs-ea-picker-avatar,
.igs-epassets-preview,
.igs-m-pwin-imgwrap {
  position: relative;
}
.igs-m-pwin-imgwrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.igs-m-pwin-imgwrap .igs-m-pwin-img {
  max-width: 100%;
  max-height: 100%;
}
.igs-m-final-stamp {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 3;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  padding: 0.12rem 0.32rem;
  border-radius: 0.22rem;
  color: #f5fff2;
  background: linear-gradient(135deg, #3f8a4a 0%, #2a6034 100%);
  box-shadow: 0 1px 3px rgba(20, 40, 24, 0.35);
  pointer-events: none;
  white-space: nowrap;
}
.igs-m-final-stamp.is-sm {
  font-size: 0.5rem;
  padding: 0.06rem 0.22rem;
  top: 2px;
  left: 2px;
}
.igs-m-final-stamp.is-lg {
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
  top: 10px;
  left: 10px;
  letter-spacing: 0.12em;
}
.igs-m-cat.is-final-cat.on {
  border-color: rgba(61, 122, 69, 0.55);
  background: #eef7ee;
  color: #1f4d28;
}
.igs-m-cat.is-final-cat.on em {
  color: #2a6034;
}
.igs-master-item.is-finalized .thumb,
.igs-ea-picker-item.is-finalized .igs-ea-picker-avatar {
  box-shadow: inset 0 0 0 1px rgba(61, 122, 69, 0.35);
}
.igs-pill.ok.tiny {
  font-size: 0.58rem;
  padding: 0.05rem 0.28rem;
  vertical-align: middle;
}
.igs-m-char-hit {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 0.35rem;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0.3rem;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  font: inherit;
  color: inherit;
}
.igs-m-char-board.is-dual .igs-m-char-hit,
.igs-m-char-board.is-grid .igs-m-char-hit {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  padding: 0.35rem 0.3rem 0.4rem;
}
.igs-m-char-board.is-compact .igs-m-char-hit {
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 0.18rem 0.25rem;
  gap: 0.28rem;
}
.igs-m-char-card .thumb {
  width: 36px;
  height: 46px;
  border-radius: 0.35rem;
  overflow: hidden;
  background: #ece7df;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.igs-m-char-board.is-dual .thumb,
.igs-m-char-board.is-grid .thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  max-height: 7.5rem;
}
.igs-m-char-board.is-compact .thumb {
  width: 28px;
  height: 36px;
}
.igs-m-char-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.igs-m-char-card .thumb .igs-m-pending-local {
  font-size: 0.62rem;
  padding: 0.15rem;
}
.igs-m-char-tools .igs-m-pending-banner {
  width: 100%;
  flex: 1 1 100%;
}
.igs-m-char-card .igs-m-item-body {
  min-width: 0;
  width: 100%;
}
.igs-m-char-card .igs-m-item-body b {
  display: block;
  font-size: 0.8rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.igs-m-char-board.is-dual .igs-m-item-body b,
.igs-m-char-board.is-grid .igs-m-item-body b {
  font-size: 0.74rem;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.igs-m-char-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
  align-items: center;
  margin-top: 0.12rem;
}
.igs-m-char-g {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.05rem 0.28rem;
  border-radius: 0.28rem;
  background: #dfeaf3;
  color: #1f4f6e;
}
.igs-m-char-g.f {
  background: #f3e0ea;
  color: #8a3a5c;
}
.igs-m-char-lead {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.05rem 0.28rem;
  border-radius: 0.28rem;
  background: #e5f0e2;
  color: #2f6b3a;
}
.igs-m-char-lead.is-sup {
  background: #eeeae3;
  color: #6a645a;
}
.igs-m-char-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin-top: 0.2rem;
}
.igs-m-char-tags i {
  font-style: normal;
  font-size: 0.6rem;
  padding: 0.05rem 0.28rem;
  border-radius: 0.28rem;
  background: rgba(40, 36, 30, 0.06);
  color: #4a4540;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.igs-m-char-tags i.more {
  opacity: 0.65;
}
.igs-m-char-blurb {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.64rem;
  color: #7a7368;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.igs-m-char-card .igs-m-dot {
  position: absolute;
  top: 0.3rem;
  right: 1.55rem;
}
.igs-m-char-peek-btn {
  flex: 0 0 auto;
  align-self: stretch;
  border: 0;
  border-left: 1px solid rgba(40, 36, 30, 0.08);
  background: rgba(40, 36, 30, 0.03);
  color: #4a5666;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0 0.35rem;
  cursor: pointer;
}
.igs-m-char-board.is-dual .igs-m-char-peek-btn,
.igs-m-char-board.is-grid .igs-m-char-peek-btn {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  border: 0;
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.88);
  padding: 0.1rem 0.3rem;
  align-self: auto;
}
.igs-m-char-peek {
  margin-top: 0.35rem;
  padding: 0.5rem 0.55rem 0.6rem;
  border-radius: 0.55rem;
  background: #f4f7fa;
  border: 1px solid rgba(36, 56, 78, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.igs-m-char-peek-h {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  align-items: center;
}
.igs-m-char-peek-h strong {
  font-size: 0.9rem;
}
.igs-m-char-peek-h span {
  font-size: 0.72rem;
  color: #5c6670;
  flex: 1;
}
.igs-m-char-peek-blurb {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #3a3630;
}
.igs-m-char-peek-sec .lab {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #2f2a24;
}
.igs-m-char-peek-sec .lab .muted,
.igs-m-char-peek .muted {
  font-weight: 400;
  color: #7a7368;
  font-size: 0.68rem;
}
.igs-m-char-peek-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.3rem;
}
.igs-m-char-tag-add {
  display: flex;
  gap: 0.3rem;
}
.igs-m-char-tag-add input {
  flex: 1;
  min-width: 0;
  height: 1.85rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(40, 36, 30, 0.14);
  padding: 0 0.45rem;
  font: inherit;
  font-size: 0.78rem;
}
.igs-m-char-peek-prompt {
  margin: 0;
  max-height: 7.5rem;
  overflow: auto;
  padding: 0.45rem 0.5rem;
  border-radius: 0.4rem;
  background: #fff;
  border: 1px solid rgba(40, 36, 30, 0.1);
  font-size: 0.68rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #2f2a24;
}
.igs-m-char-peek-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}
.igs-m-char-stage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  margin: 0.2rem 0 0.15rem;
}
.igs-m-char-stage-tags i {
  font-style: normal;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.35rem;
  background: rgba(61, 126, 166, 0.1);
  color: #1f4f6e;
}
.igs-m-shell.is-character-cat .igs-m-main {
  border-radius: 0 0.6rem 0.6rem 0;
}
.igs-m-shell.is-animal-cat .igs-m-item.is-animal {
  border-color: color-mix(in srgb, #5a8f6e 35%, var(--igs-line, #d8d2c6));
}
.igs-m-shell.is-animal-cat .igs-m-item.is-animal .thumb {
  aspect-ratio: 1 / 1;
}
.igs-m-shell.is-scene-cat .igs-m-item.is-scene {
  grid-template-columns: 48px 1fr auto !important;
}
.igs-m-shell.is-scene-cat .igs-m-item.is-scene .thumb {
  width: 48px !important;
  height: 27px !important;
  aspect-ratio: 16 / 9;
}
.igs-m-tri-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
}
.igs-m-tri-row.mini {
  margin-top: 0.12rem;
}
.igs-m-tri {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.05rem 0.28rem;
  border-radius: 4px;
  background: #efe8da;
  color: #6a7a72;
}
.igs-m-tri.ok {
  background: #d8f0e4;
  color: #2f6b5a;
}
.igs-m-tri.miss {
  background: #f3eee3;
  color: #9a8b78;
}
.igs-pill.tiny {
  font-size: 0.58rem;
  padding: 0.05rem 0.28rem;
}
.igs-m-item-body {
  min-width: 0;
}
.igs-m-item-body b {
  font-size: 0.78rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.igs-m-item .igs-bar {
  margin-top: 0.12rem;
  height: 2px;
}
.igs-m-dot {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  flex: 0 0 auto;
  vertical-align: middle;
}
.igs-m-dot.ok { background: #3d9b6e; }
.igs-m-dot.warn { background: #c45c28; }
.igs-m-empty,
.igs-m-empty-main {
  color: var(--igs-muted);
  font-size: 0.8rem;
  padding: 1rem 0.4rem;
  text-align: center;
}

.igs-m-work--v4 .igs-m-main, .igs-m-work--v5 .igs-m-main {
  background: var(--igs-card);
  border: 1px solid var(--igs-line);
  border-radius: 0.7rem;
  padding: 0.45rem 0.55rem;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}
.igs-m-stage-head {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 0 0 auto;
}
.igs-m-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--igs-muted);
}
.igs-m-who strong {
  font-family: var(--igs-serif);
  font-size: 1.05rem;
  color: var(--igs-ink);
  font-weight: 700;
}
.igs-m-geom {
  padding: 0.2rem 0.55rem !important;
  font-size: 0.74rem !important;
  white-space: nowrap;
}
.igs-m-scene-desc {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding: 0.35rem 0.55rem 0.5rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--igs-paper, #f7f3ea) 88%, #c8d8c0);
  border: 1px solid color-mix(in srgb, var(--igs-line, #cfc6b4) 70%, transparent);
}
.igs-m-scene-desc > summary {
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  color: #3a4a42;
  list-style: none;
}
.igs-m-scene-desc > summary::-webkit-details-marker { display: none; }
.igs-m-scene-desc-lab {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--igs-muted);
}
.igs-m-scene-desc-lab input,
.igs-m-scene-desc-lab textarea {
  font: inherit;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--igs-ink);
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--igs-line, #cfc6b4);
  background: var(--igs-paper, #fffef8);
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.igs-m-scene-desc #btnSaveSceneDesc,
.igs-m-scene-desc #btnSaveCharDesc {
  align-self: flex-start;
  margin-top: 0.1rem;
}
.igs-m-char-desc {
  background: color-mix(in srgb, var(--igs-paper, #f7f3ea) 86%, #c4d0e0);
}
.igs-m-char-peek-desc {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--igs-muted);
  white-space: pre-wrap;
}
.igs-m-scene-desc-lab textarea.is-prompt {
  min-height: 4.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}
.igs-m-blurb-ro {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
}
.igs-m-slot-rail {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  align-items: center;
  overflow-x: auto;
  padding: 0.15rem 0 0.25rem;
  scrollbar-width: thin;
}
.igs-m-chip-g {
  flex: 0 0 auto;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--igs-muted);
  padding: 0 0.15rem 0 0.35rem;
}
.igs-m-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid var(--igs-line);
  border-radius: 999px;
  background: #fff;
  padding: 0.22rem 0.48rem;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--igs-ink);
  white-space: nowrap;
}
.igs-m-chip i {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: #d5cbb8;
}
.igs-m-chip.has i { background: #3d9b6e; }
.igs-m-chip.on {
  border-color: var(--igs-accent);
  background: #e8f5f0;
  color: var(--igs-accent);
  font-weight: 700;
}

.igs-m-canvas {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.igs-m-hero {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-height: 0;
}
.igs-m-hero-frame {
  position: relative;
  flex: 1;
  min-height: 280px;
  border-radius: 0.55rem;
  overflow: hidden;
  background: #1a1a1a;
  border: 1px solid var(--igs-line);
  display: grid;
  place-items: center;
}
.igs-m-hero-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}
.igs-m-hero-zoom {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  border: none;
  border-radius: 0.4rem;
  padding: 0.3rem 0.55rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.igs-m-hero-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: #c8c0b4;
  padding: 2rem;
  text-align: center;
}
.igs-m-hero-empty b { color: #eee; font-family: var(--igs-serif); }
.igs-m-hero-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  flex: 0 0 auto;
}
.igs-m-hero-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.igs-m-upload-sm {
  margin: 0 !important;
  padding: 0.32rem 0.65rem !important;
  font-size: 0.78rem !important;
}
.igs-m-hero-more { position: relative; }
.igs-m-hero-more > summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--igs-line);
  border-radius: 0.4rem;
  padding: 0.28rem 0.55rem;
  background: #fff;
  font-size: 0.76rem;
}
.igs-m-hero-more > summary::-webkit-details-marker { display: none; }

/* 精修 · 自样式预览窗 */
.igs-m-pwin {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  border: 1px solid #cfc4b0;
  border-radius: 0.75rem;
  overflow: hidden; /* 必须裁切：visible 会撑破主区导致左右都滑不动 */
  background:
    linear-gradient(180deg, #fffaf2 0%, #f7f0e4 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 10px 28px rgba(40, 32, 20, 0.08);
}
.igs-m-pwin.is-finalized {
  border-color: #7a9a6a;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 0 0 1px rgba(90, 130, 70, 0.22),
    0 10px 28px rgba(40, 32, 20, 0.08);
}
.igs-m-pwin.is-finalized .igs-m-pwin-chrome {
  background: linear-gradient(180deg, #f4faf0 0%, #e8f0e2 100%);
}
.igs-m-stage-head .igs-pill.ok {
  letter-spacing: 0.02em;
}
.igs-m-pwin-chrome {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid #e2d8c6;
  border-radius: 0.75rem 0.75rem 0 0;
  background:
    linear-gradient(180deg, #fffdf8 0%, #f3ebe0 100%);
  position: relative;
  z-index: 5;
  max-height: 5.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
}
.igs-m-pwin-title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem 0.4rem;
  min-width: 0;
  font-size: 0.86rem;
}
.igs-m-pwin-title strong {
  font-family: var(--igs-serif);
  font-weight: 700;
  color: #2a241c;
  letter-spacing: 0.01em;
}
.igs-m-pwin-title .sep { color: #b8ad9a; }
.igs-m-pwin-tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: center;
}
.igs-m-pwin-tool {
  border: 1px solid #d2c6b2;
  background: #fff;
  border-radius: 0.4rem;
  padding: 0.28rem 0.55rem;
  font: inherit;
  font-size: 0.72rem;
  color: #3a342c;
  cursor: pointer;
  line-height: 1.2;
}
.igs-m-pwin-tool:hover {
  border-color: var(--igs-accent);
  color: var(--igs-accent);
}
.igs-m-pwin-tool.on,
.igs-m-pwin-tool.primary {
  border-color: #9fc4b4;
  background: #e8f5f0;
  color: var(--igs-accent);
  font-weight: 700;
}
.igs-m-pwin-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0; /* 父级 .igs-m-pwin 已有高度时吃满；兜底见下方 workspace 链 */
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* 顶对齐：避免 center 溢出时裁掉头顶 */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.55rem 0.65rem;
  background-color: #1c1a17;
  background-image:
    linear-gradient(45deg, #26231f 25%, transparent 25%),
    linear-gradient(-45deg, #26231f 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #26231f 75%),
    linear-gradient(-45deg, transparent 75%, #26231f 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
.igs-m-pwin-img {
  display: block;
  position: static;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  /* 相对预览框高度；框未算准时也至少有视口高度兜底 */
  max-height: min(100%, calc(100vh - 16rem));
  object-fit: contain;
  object-position: center top;
  cursor: zoom-in;
  border-radius: 0.2rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 36px rgba(0, 0, 0, 0.45);
  background: #111;
}
.igs-m-pwin.is-native .igs-m-pwin-stage {
  display: block;
  align-items: flex-start;
  justify-content: flex-start;
}
.igs-m-pwin.is-native .igs-m-pwin-img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  margin: 0 auto;
}
.igs-m-pwin-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.45rem 0.65rem 0.55rem;
  border-top: 1px solid #e2d8c6;
  border-radius: 0 0 0.75rem 0.75rem;
  background: rgba(255, 252, 245, 0.96);
}
.igs-m-pwin-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: baseline;
}
.igs-m-pwin-facts .fact {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  font-size: 0.74rem;
  color: #3a342c;
  max-width: 100%;
}
.igs-m-pwin-facts .fact i {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #9a8f7c;
  text-transform: none;
}
.igs-m-pwin-facts .fact b {
  font-weight: 650;
  color: #2a241c;
}
.igs-m-pwin-facts .fact b.mono,
.igs-m-pwin-facts .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  word-break: break-all;
}
.igs-m-pwin-hint {
  margin: 0;
  font-size: 0.66rem;
  color: #9a8f7c;
}
.igs-m-pwin .igs-m-hero-empty {
  position: static;
  flex: 1 1 auto;
  width: 100%;
  min-height: 12rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  color: #c8c0b4;
}
.igs-m-pwin .igs-m-hero-empty b {
  color: #f2ebe0;
  font-family: var(--igs-serif);
  font-size: 1.15rem;
}
@media (max-width: 900px) {
  .igs-m-pwin-stage { min-height: 0; padding: 0.45rem; }
  .igs-m-pwin-title { font-size: 0.8rem; }
}
.igs-m-gallery-cta--compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}
.igs-m-gallery-cta--compact .igs-btn,
.igs-m-gallery-cta--compact .igs-btn-ghost {
  font-size: 0.72rem !important;
  padding: 0.22rem 0.55rem !important;
}
.igs-m-hero-more-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.25rem);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.45rem;
  background: #fff;
  border: 1px solid var(--igs-line);
  border-radius: 0.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  min-width: 7rem;
}
.igs-m-pwin-chrome .igs-m-hero-more-panel {
  left: auto;
  right: 0;
  bottom: auto;
  top: calc(100% + 0.25rem);
}
.igs-m-danger {
  border-color: #b33 !important;
  color: #b33 !important;
}
.igs-m-compare-tools,
.igs-m-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

/* 底部出图条 · 压缩高度，避免抢走大脸预览 */
.igs-m-abar {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0.35rem 0.45rem;
  border-radius: 0.6rem;
  border: 1px solid #b5d4c8;
  background: #f0f8f4;
  max-height: 7.25rem;
  overflow: auto;
  overscroll-behavior: contain;
}
.igs-m-abar-refs {
  display: flex;
  gap: 0.3rem;
  align-items: flex-end;
}
.igs-m-aref {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  width: 3.6rem;
  padding: 0.18rem;
  border: 1px solid var(--igs-line);
  border-radius: 0.45rem;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--igs-muted);
}
.igs-m-aref.has {
  cursor: copy;
  border-color: #9bc4b4;
}
.igs-m-aref.has:hover {
  border-color: var(--igs-accent);
  color: var(--igs-accent);
}
.igs-m-aref img {
  width: 3.1rem;
  height: 3.6rem;
  object-fit: cover;
  border-radius: 0.3rem;
  background: #f4efe6;
}
.igs-m-aref .ph {
  width: 3.1rem;
  height: 3.6rem;
  display: grid;
  place-items: center;
  background: #eee8dc;
  border-radius: 0.3rem;
  color: #aaa;
  font-size: 0.8rem;
}
.igs-m-aref:disabled { opacity: 0.55; cursor: not-allowed; }
.igs-m-abar-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.igs-m-abar-cta .igs-btn-copy-hero {
  min-width: 7.5rem;
}
.igs-m-abar-cta .igs-btn-ghost[data-mcp="neg"] {
  min-width: 2rem;
  font-weight: 700;
}

/* 换风格派生：写实→三轨 / INK-GAG→三轨 并列 */
.igs-m-style-xfer-wrap {
  width: 100%;
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.igs-m-style-xfer-shared {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
}
.igs-m-style-xfer-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
@media (max-width: 920px) {
  .igs-m-style-xfer-row {
    grid-template-columns: 1fr;
  }
}
.igs-m-style-xfer {
  width: 100%;
  margin-top: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #64748b 28%, transparent);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, #64748b 10%, #fff) 0%,
    color-mix(in srgb, #0d9488 6%, #f8fafc) 55%,
    color-mix(in srgb, #c45c28 6%, #fff) 100%
  );
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.igs-m-style-xfer--from-ink {
  border-color: color-mix(in srgb, #c45c28 35%, transparent);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, #c45c28 12%, #fff) 0%,
    color-mix(in srgb, #ea580c 6%, #fff7ed) 55%,
    color-mix(in srgb, #64748b 6%, #fff) 100%
  );
}
.igs-m-style-xfer-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  font-size: 0.78rem;
}
.igs-m-style-xfer-hd strong {
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: #334155;
}
.igs-m-style-xfer--from-ink .igs-m-style-xfer-hd strong {
  color: #9a3412;
}
.igs-m-style-xfer-hd .hint {
  color: #64748b;
  flex: 1 1 8rem;
}
.igs-m-style-xfer-model {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: #475569;
  font-weight: 600;
  font-size: 0.78rem;
}
.igs-m-style-xfer-model select {
  font: inherit;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
}
.igs-m-style-xfer-ref {
  width: auto !important;
  min-width: 3.2rem;
  height: 2.6rem !important;
  padding: 0 0.35rem 0 0 !important;
}
.igs-m-style-xfer-ref img {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: cover;
  border-radius: 5px;
}
.igs-m-style-xfer-miss {
  color: #b45309;
  font-weight: 600;
  font-size: 0.76rem;
}
.igs-m-style-xfer-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.igs-m-style-xfer-btns .igs-btn {
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
}
.igs-m-style-xfer-all {
  background: #0f172a !important;
  color: #fff !important;
  border-color: #0f172a !important;
}
.igs-m-style-xfer-btns .igs-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.igs-m-compare-lux + .igs-m-style-xfer-wrap,
.igs-master-matrix + .igs-m-style-xfer-wrap,
.igs-m-compare-lux + .igs-m-style-xfer,
.igs-master-matrix + .igs-m-style-xfer {
  margin: 0.55rem 0 0;
}

.igs-m-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

