/**
 * 制作台 · 编剧/分镜/透析/母版/参考库壳（P-css-j：从 novel-ws）
 */

/* —— 编剧工作室壳 + AI 侧栏（对齐小说工作室 · 贴边全屏） —— */
.igs-pl-studio {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  border-radius: 0;
  border: none;
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(26, 107, 82, 0.07), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(184, 90, 50, 0.05), transparent 50%),
    linear-gradient(180deg, #f4efe4 0%, var(--igs-ws-paper, #f7f3ea) 40%, #efe9dc 100%);
  position: relative;
}

/* 编剧页：与小说同级铺满（高度链对齐 nv-studio；禁 stage width:100% 以免挤出右侧空带） */
body.igs-on-planning.igs-on-workspace .igs-panel.active,
#panel-planning.active {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body.igs-on-planning .igs-pl-studio,
#panel-planning.active > .igs-pl-studio {
  width: 100%;
  max-width: none;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
}
body.igs-on-planning .igs-pl-studio__body,
#panel-planning.active .igs-pl-studio__body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
body.igs-on-planning .igs-pl-studio__stage,
#panel-planning.active .igs-pl-studio__stage {
  flex: 1 1 auto;
  width: auto; /* 勿 100%：横向 flex 下会与 AI 栏叠算出右侧空洞 */
  max-width: none;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.igs-on-planning .igs-pl-studio.is-ai-open .igs-pl-ai-rail,
body.igs-on-planning .igs-pl-studio.is-ai-open .igs-nv-ai-rail,
#panel-planning.active .igs-pl-studio.is-ai-open .igs-pl-ai-rail,
#panel-planning.active .igs-pl-studio.is-ai-open .igs-nv-ai-rail {
  flex: 0 0 var(--igs-ws-rail, 22.5rem);
  width: var(--igs-ws-rail, 22.5rem);
  max-width: min(var(--igs-chat-max-w, 66.666vw), 100%);
  min-width: 0;
  margin: 0;
  align-self: stretch;
  height: auto;
  min-height: 0;
  box-sizing: border-box;
}
body.igs-on-planning .igs-pl-page,
#panel-planning.active .igs-pl-page,
.igs-pl-studio .igs-pl-page {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0 !important; /* 对齐小说：stage 内容根无外圈 gutter */
  margin: 0;
  gap: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: transparent !important;
}
body.igs-on-planning .igs-pl-arch,
body.igs-on-planning .igs-pl-script,
body.igs-on-planning .igs-pl-shots,
body.igs-on-planning .igs-pl-body,
body.igs-on-planning .igs-pl-page--arch,
body.igs-on-planning .igs-pl-page--shots,
body.igs-on-planning .igs-pl-page--script,
body.igs-on-planning .igs-pl-page--analyze,
#panel-planning.active .igs-pl-arch,
#panel-planning.active .igs-pl-script,
#panel-planning.active .igs-pl-shots,
#panel-planning.active .igs-pl-body {
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}
/* 通读正文默认吃满主栏 */
body.igs-on-planning .igs-pl-page--script .igs-pl-script-body,
#panel-planning.active .igs-pl-page--script .igs-pl-script-body {
  max-width: none !important;
  width: 100%;
  margin: 0;
}
body.igs-on-planning .igs-pl-page--script:not(.is-wide) .igs-pl-script-body {
  max-width: 46rem !important;
  margin: 0 auto !important;
}

/* —— 三栏改「小说式分割线」：去掉 inset 卡片框 —— */
body.igs-on-planning .igs-pl-arch,
body.igs-on-planning .igs-pl-script,
body.igs-on-planning .igs-pl-shots,
body.igs-on-planning .igs-pl-body {
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
  gap: 0;
  align-items: stretch;
}
body.igs-on-planning .igs-pl-arch {
  min-height: 0; /* 覆盖旧 420px */
}
body.igs-on-planning .igs-pl-arch-tree,
body.igs-on-planning .igs-pl-arch-dock-col,
body.igs-on-planning .igs-pl-arch-main,
body.igs-on-planning .igs-pl-script-rail,
body.igs-on-planning .igs-pl-script-main,
body.igs-on-planning .igs-pl-shots-film,
body.igs-on-planning .igs-pl-shots-prompt,
body.igs-on-planning .igs-pl-col {
  max-height: none !important;
  height: 100%;
  min-height: 0;
  min-width: 0;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  box-sizing: border-box;
}
/* 左轨（树 / 文档 / 胶片 / 故事线） */
body.igs-on-planning .igs-pl-arch-tree,
body.igs-on-planning .igs-pl-script-rail,
body.igs-on-planning .igs-pl-shots-film,
body.igs-on-planning .igs-pl-col--sl {
  border-right: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12)) !important;
  background: linear-gradient(
    180deg,
    var(--igs-elev, #fffcf7),
    color-mix(in srgb, var(--igs-paper, #f5efe4) 90%, var(--igs-mist, #e8e2d6))
  ) !important;
  padding: 0.55rem 0.65rem !important;
  overflow: auto;
}
/* 中画布 / 通读 / 引导词 */
body.igs-on-planning .igs-pl-arch-main,
body.igs-on-planning .igs-pl-script-main,
body.igs-on-planning .igs-pl-shots-prompt,
body.igs-on-planning .igs-pl-col--slate {
  background: linear-gradient(
    180deg,
    var(--igs-elev, #fffcf7) 0%,
    color-mix(in srgb, var(--igs-card, #fff) 55%, var(--igs-paper, #f7f3ea)) 100%
  ) !important;
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.igs-on-planning .igs-pl-arch-main {
  padding: 0.45rem 0.65rem 0.55rem !important;
  overflow: auto;
}
body.igs-on-planning .igs-pl-col--slate {
  padding: 0.55rem 0.75rem !important;
  overflow: auto;
  border-right: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12)) !important;
}
/* 右坞 / 深挖 */
body.igs-on-planning .igs-pl-arch-dock-col,
body.igs-on-planning .igs-pl-col--deep {
  border-left: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12)) !important;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--igs-paper, #f5efe4) 92%, var(--igs-mist, #e8e2d6)),
    var(--igs-elev, #fffcf7)
  ) !important;
  padding: 0.55rem 0.65rem !important;
  overflow: auto;
}
body.igs-on-planning .igs-pl-script-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 1.1rem 2rem !important;
}
body.igs-on-planning .igs-pl-shots-prompt .igs-pl-shot-panel {
  border-radius: 0 !important;
  border: none !important;
  min-height: 100%;
  box-sizing: border-box;
  background: transparent;
  box-shadow: none;
}
/* 页内说明 / 脚注：并入顶栏 meta，不再占主区 */
body.igs-on-planning .igs-pl-explain-line,
body.igs-on-planning .igs-pl-foot,
body.igs-on-planning .igs-pl-dock-hint {
  display: none !important;
}
/* 次级工具条：压成薄顶条（对齐小说 reader-bar） */
body.igs-on-planning .igs-pl-subbar,
body.igs-on-planning .igs-pl-script-meta,
body.igs-on-planning .igs-pl-stats {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.1));
  background: color-mix(in srgb, var(--igs-card, #fffcf7) 88%, var(--igs-paper, #f7f3ea));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
}
body.igs-on-planning .igs-pl-subbar .igs-pl-breadcrumb {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  font-size: 0.78rem;
  gap: 0.25rem;
}
body.igs-on-planning .igs-pl-page--shots,
body.igs-on-planning .igs-pl-page--arch,
body.igs-on-planning .igs-pl-page--script,
body.igs-on-planning .igs-pl-page--analyze {
  gap: 0 !important;
}
body.igs-on-planning .igs-pl-script-toolbar {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

/* 编剧左右拖拽条 */
.igs-pl-resize {
  position: relative;
  z-index: 4;
  width: 0.4rem;
  min-width: 0.4rem;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
  align-self: stretch;
}
.igs-pl-resize::after {
  content: "";
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  width: 0.2rem;
  border-radius: 999px;
  background: rgba(26, 107, 82, 0.28);
  opacity: 0;
  transition: opacity 0.15s;
}
.igs-pl-resize:hover::after,
body.igs-resizing-pl .igs-pl-resize::after {
  opacity: 1;
}
body.igs-resizing-pl {
  cursor: col-resize;
  user-select: none;
}
body.igs-resizing-pl iframe {
  pointer-events: none;
}
.igs-pl-chrome {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  padding: 0.55rem 0.85rem;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(247, 243, 234, 0.92));
  border-bottom: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
  backdrop-filter: blur(8px);
  z-index: 2;
}
/* W1：L0 书境条（书型 + 横竖轨）叠在模式栏之上 */
.igs-pl-chrome-stack {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  z-index: 2;
}
.igs-pl-l0 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  padding: 0.4rem 0.85rem;
  background: rgba(19, 36, 30, 0.04);
  border-bottom: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.1));
  font-size: 0.78rem;
}
.igs-pl-l0__book {
  font-family: var(--igs-serif, "Noto Serif SC", serif);
  font-size: 0.88rem;
  color: var(--igs-ws-ink, #13241e);
  max-width: min(16rem, 40vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.igs-pl-l0__pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  border: 1px solid transparent;
}
.igs-pl-l0__pill--unit {
  color: #145a45;
  background: rgba(26, 107, 82, 0.12);
  border-color: rgba(26, 107, 82, 0.22);
}
.igs-pl-l0__pill--cont {
  color: #3d4a6b;
  background: rgba(61, 74, 107, 0.1);
  border-color: rgba(61, 74, 107, 0.2);
}
.igs-pl-l0__pill--unk {
  color: #7a5a20;
  background: rgba(201, 162, 39, 0.14);
  border-color: rgba(201, 162, 39, 0.28);
}
.igs-pl-l0__track {
  display: inline-flex;
  border: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.14));
  border-radius: 0.45rem;
  overflow: hidden;
  background: #fff;
}
.igs-pl-l0__trk {
  border: 0;
  background: transparent;
  padding: 0.22rem 0.55rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--igs-muted, #5a5348);
  cursor: pointer;
}
.igs-pl-l0__trk + .igs-pl-l0__trk {
  border-left: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
}
.igs-pl-l0__trk.on {
  background: rgba(26, 107, 82, 0.14);
  color: #145a45;
}
.igs-pl-l0__role {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--igs-muted, #5a5348);
  font-weight: 600;
}
.igs-pl-l0__hint {
  padding: 0.1rem 0.4rem !important;
  font-size: 0.7rem !important;
  min-width: 1.5rem;
}
.igs-pl-mode-tabs--pipe button.igs-pl-mode-extra {
  font-size: 0.72rem;
  opacity: 0.85;
  padding: 0.28rem 0.5rem;
}
.igs-pl-mode-tabs--pipe button.igs-pl-mode-extra em {
  display: none;
}
.igs-pl-arch-views--seg {
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0;
  border-bottom: 1px dashed var(--igs-ws-line, rgba(26, 50, 40, 0.12));
  margin-bottom: 0.65rem;
}
.igs-pl-arch-views__lab {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--igs-muted, #5a5348);
  margin-right: 0.25rem;
  letter-spacing: 0.04em;
}
.igs-pl-arch-views--seg button {
  padding: 0.22rem 0.5rem;
  font-size: 0.75rem;
}
.igs-pl-chrome__left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: 0.25rem;
}
.igs-pl-chrome__left strong {
  font-family: var(--igs-serif, "Noto Serif SC", serif);
  font-size: 1.05rem;
  color: var(--igs-ws-ink, #13241e);
  line-height: 1.2;
}
.igs-pl-chrome__season {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--igs-muted);
}
.igs-pl-chrome__season select {
  font: inherit;
  font-size: 0.8rem;
  border: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
  border-radius: 0.45rem;
  padding: 0.28rem 0.45rem;
  background: #fff;
  max-width: 11rem;
}
.igs-pl-chrome__acts {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.igs-pl-chrome__dx,
.igs-nv-chrome__dx {
  font-weight: 650;
  color: #145a45;
  border-color: rgba(26, 107, 82, 0.28);
  background: rgba(26, 107, 82, 0.08);
}
.igs-pl-chrome__dx:hover,
.igs-nv-chrome__dx:hover {
  background: rgba(26, 107, 82, 0.14);
}
.igs-nv-chrome__dx {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
}
.igs-dx-work-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 700;
  color: #145a45;
  background: rgba(26, 107, 82, 0.12);
  border-radius: 999px;
  vertical-align: middle;
}
.igs-dx-novel-card.is-work {
  border-color: rgba(26, 107, 82, 0.45);
  box-shadow: 0 0 0 1px rgba(26, 107, 82, 0.12);
}
.igs-dx-next-cta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0;
}
.igs-dx-stats.is-keep-flash .k-keep {
  animation: igs-dx-keep-pulse 1.2s ease 2;
}
@keyframes igs-dx-keep-pulse {
  0%, 100% { background: transparent; }
  40% { background: color-mix(in srgb, var(--igs-accent) 14%, transparent); border-radius: 0.35rem; }
}
.igs-dx-nav {
  font-weight: 600;
}
.igs-pl-dx-mini {
  margin-left: 0.35rem;
  font-size: 0.72rem !important;
  padding: 0.12rem 0.45rem !important;
  vertical-align: middle;
}
.igs-pl-deep h4 .igs-pl-dx-mini,
.igs-pl-arch-dock h4 .igs-pl-dx-mini {
  font-weight: 650;
}
.igs-pl-chrome__meta {
  font-size: 0.72rem;
  color: var(--igs-muted, #5a5348);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(28rem, 55vw);
}
.igs-pl-chrome__layer-hint {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--igs-muted, #5a5348);
  white-space: normal;
  max-width: min(36rem, 70vw);
  font-weight: 500;
}
.igs-pl-chrome .igs-pl-mode-tabs {
  flex: 0 0 auto;
}
.igs-pl-chrome .igs-pl-ai-toggle {
  border: 1px solid transparent;
  font-weight: 700;
}
.igs-pl-chrome .igs-pl-ai-toggle.is-on {
  background: rgba(26, 107, 82, 0.14);
  color: #145a45;
  border-color: rgba(26, 107, 82, 0.28);
}
.igs-pl-chrome__score {
  font-size: 0.72rem;
  font-weight: 700;
  color: #145a45;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(26, 107, 82, 0.1);
}
.igs-pl-chrome__more {
  position: relative;
}
.igs-pl-chrome__more > summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
  background: rgba(255, 252, 247, 0.9);
  border-radius: 0.45rem;
  padding: 0.28rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--igs-muted, #5a5348);
}
.igs-pl-chrome__more > summary::-webkit-details-marker { display: none; }
.igs-pl-chrome__more[open] > summary {
  color: #145a45;
  border-color: rgba(26, 107, 82, 0.28);
}
.igs-pl-chrome-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 40;
  min-width: 11.5rem;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: #fffcf7;
  border: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
  border-radius: 0.55rem;
  box-shadow: 0 10px 28px rgba(20, 36, 30, 0.12);
}
.igs-pl-chrome-menu .igs-btn-ghost,
.igs-pl-chrome-menu a.igs-btn-ghost {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  font-size: 0.8rem;
}
.igs-pl-chrome-menu .igs-pl-chrome-menu__lab {
  font-size: 0.68rem;
  color: var(--igs-muted);
  padding: 0.2rem 0.35rem 0.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.igs-pl-studio__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.igs-pl-studio__stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.igs-pl-studio.is-ai-open .igs-pl-studio__stage {
  border-right: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
}
.igs-pl-studio.is-ai-closed .igs-pl-ai-rail {
  display: none;
}
.igs-pl-studio .igs-pl-page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-sizing: border-box;
}
.igs-pl-studio .igs-pl-page > .igs-pl-top {
  /* 壳外已有 chrome；页内顶栏改成次级工具条 */
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  padding: 0.35rem 0;
  margin: 0 0 0.35rem;
  background: transparent;
  border: 0;
}
.igs-pl-studio .igs-pl-page > .igs-pl-top .igs-pl-brand {
  display: none;
}
.igs-pl-subbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0 0 0.45rem;
}
.igs-pl-studio .igs-pl-arch,
.igs-pl-studio .igs-pl-body,
.igs-pl-studio .igs-pl-script {
  flex: 1 1 auto;
  min-height: 0;
}
.igs-pl-explain-line {
  margin: 0 0 0.55rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--igs-muted, #5a5348);
  background: rgba(255, 252, 247, 0.72);
  border: 1px solid rgba(26, 50, 40, 0.08);
  border-radius: 0.45rem;
}
.igs-pl-explain-line b {
  color: var(--igs-ws-ink, #13241e);
  font-weight: 700;
}
.igs-pl-explain-line code {
  font-size: 0.78em;
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  background: rgba(26, 107, 82, 0.1);
}
.igs-pl-explain-line .igs-pl-ai-hint {
  color: #145a45;
  font-weight: 650;
}
.igs-pl-dock-hint {
  margin: 0 0 0.45rem;
  font-size: 0.74rem;
  color: var(--igs-muted);
}
.igs-pl-ai-rail {
  flex: 0 0 var(--igs-ws-rail, 22.5rem);
  width: var(--igs-ws-rail, 22.5rem);
  max-width: var(--igs-chat-max-w, 66.666vw);
  min-width: 0; /* 对齐小说轨：避免 min-width 把侧栏撑出视口右侧空白 */
  align-self: stretch;
  border-radius: 0;
  border: none;
  border-left: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
}
.igs-pl-studio .igs-pl-ai-drafts {
  padding: 0.5rem 0.65rem 1rem;
  overflow: auto;
  max-height: 100%;
}

/* 编剧 AI · 四域应用卡（对齐小说页，v1.0.152） */
.igs-ws-bar.is-page-planning.is-opening-lean .igs-ws-ai-coach {
  max-width: 23rem;
}
.igs-ws-canon-draft.is-slate-peak {
  border-color: rgba(26, 107, 82, 0.28);
  background: linear-gradient(165deg, #f7fcf9, #fffefb);
}
.igs-pl-ai-domain {

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.35rem 0 0.75rem;
}
.igs-pl-ai-domain__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  text-align: left;
  font: inherit;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(26, 107, 82, 0.18);
  background: linear-gradient(165deg, #fffefb, #f4faf7);
  cursor: pointer;
  color: #1e3328;
}
.igs-pl-ai-domain__card:hover {
  border-color: rgba(26, 107, 82, 0.4);
  background: #fff;
}
.igs-pl-ai-domain__card b {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.84rem;
  font-weight: 700;
}
.igs-pl-ai-domain__card span {
  font-size: 0.68rem;
  line-height: 1.35;
  color: #6a7c74;
}
.igs-pl-ai-arts .igs-ws-artlib {
  margin-top: 0.5rem;
}
.igs-ws-smart-strip .igs-ws-smart-chip[data-pl-ui-jump],
.igs-ws-smart-strip .igs-ws-smart-chip[data-ws-canon-browse],
.igs-ws-smart-strip .igs-ws-smart-chip[data-ws-ai-intent="pl_unit_bridge"] {
  border-color: rgba(26, 107, 82, 0.22);
}
.igs-pl-ai-lights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
}
.igs-pl-ai-lights .igs-pl-ai-light {
  border: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
  background: #fffcf7;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
}
.igs-pl-ai-lights .igs-pl-ai-light.is-ok { color: var(--igs-accent); }
.igs-pl-ai-lights .igs-pl-ai-light.is-warn { color: #a67c12; }
.igs-pl-ai-lights .igs-pl-ai-light.is-bad { color: #c45c28; }
@media (max-width: 1100px) {
  /* AI 开时默认让出详情坞；窄屏点「详情」分段（mseg-dock）仍可见 */
  .igs-pl-studio.is-ai-open .igs-pl-arch:not(.igs-pl-arch-mseg-dock) .igs-pl-arch-dock-col {
    display: none;
  }
  .igs-pl-studio.is-ai-open .igs-pl-dock-hint {
    display: block;
  }
}
.igs-pl-dock-hint { display: none; }
@media (max-width: 960px) {
  .igs-pl-studio .igs-pl-ai-rail {
    position: fixed;
    top: 3.1rem;
    right: 0;
    bottom: 0;
    z-index: 48;
    width: min(var(--igs-ws-rail, 22.5rem), 100vw);
    max-width: 100vw;
    min-width: 0;
    flex: none;
    box-shadow: -10px 0 32px rgba(20, 36, 30, 0.18);
  }
  .igs-pl-studio.is-ai-open .igs-pl-studio__stage {
    border-right: none;
  }
}

/* —— 编剧·分镜（内容源）+ 分集源徽章 —— */
.igs-pl-page--shots {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
  flex: 1;
}
.igs-pl-shots {
  display: grid;
  grid-template-columns: var(--igs-pl-left, 15.5rem) 0.4rem minmax(18rem, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1;
  align-items: stretch;
}
@media (max-width: 900px) {
  .igs-pl-shots {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(10rem, 32vh) minmax(0, 1fr);
  }
  .igs-pl-shots > .igs-pl-resize {
    display: none;
  }
}
.igs-pl-shots-film {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
  border-radius: 10px;
  background: #f7faf7;
  padding: 0.45rem 0.5rem 0.75rem;
}
.igs-pl-shots-film h3 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: #1a4234;
}
.igs-pl-shots-prompt {
  min-width: 18rem;
  min-height: 0;
  overflow: auto;
  padding: 0.55rem 0.85rem 0.9rem !important;
  box-sizing: border-box;
}
.igs-pl-shot-panel {
  border: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.14));
  border-radius: 12px;
  background: #fffcf7;
  padding: 0.7rem 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 100%;
  box-sizing: border-box;
}
.igs-pl-shot-panel__hd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}
.igs-pl-shot-panel__hd strong {
  font-size: 0.95rem;
  color: #143528;
}
.igs-pl-shot-ready {
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(196, 92, 40, 0.12);
  color: #a04518;
}
.igs-pl-shot-ready.is-ready {
  background: color-mix(in srgb, var(--igs-accent) 14%, transparent);
  color: #145a45;
}
.igs-pl-shot-pic {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--igs-muted, #5a6b62);
}
.igs-pl-shot-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.igs-pl-shot-checks li {
  font-size: 0.7rem;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(26, 50, 40, 0.1);
  background: #fff;
}
.igs-pl-shot-checks li.ok {
  border-color: color-mix(in srgb, var(--igs-accent) 35%, transparent);
  color: #145a45;
}
.igs-pl-shot-checks li.miss {
  border-color: rgba(196, 92, 40, 0.35);
  color: #a04518;
}
.igs-pl-shot-lab {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1a4234;
}
.igs-pl-shot-lab--screen {
  flex: 1 1 auto;
  min-height: 16rem;
}
.igs-pl-shot-lab__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.igs-pl-shot-lab__acts {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.igs-pl-shot-tool {
  font-size: 0.72rem !important;
  padding: 0.14rem 0.5rem !important;
  font-weight: 650;
  color: #145a45;
  border-color: rgba(26, 107, 82, 0.28);
  background: rgba(26, 107, 82, 0.07);
}
.igs-pl-shot-tool:hover {
  background: rgba(26, 107, 82, 0.14);
}
.igs-pl-shot-ta-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 18rem;
  display: flex;
}
.igs-pl-shot-ta {
  width: 100%;
  min-height: 12rem;
  resize: vertical;
  font: inherit;
  font-weight: 400;
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(26, 50, 40, 0.18);
  background: #fff;
  box-sizing: border-box;
}
.igs-pl-shot-ta--lg {
  min-height: 22rem;
  height: min(52vh, 34rem);
  flex: 1 1 auto;
  font-size: 0.9rem;
  line-height: 1.58;
  padding: 0.7rem 2.4rem 0.75rem 0.8rem;
  letter-spacing: 0.01em;
}
.igs-pl-shot-expand-fab {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  border: 1px solid rgba(26, 50, 40, 0.16);
  background: rgba(255, 252, 247, 0.92);
  color: #1a4234;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(20, 40, 30, 0.08);
}
.igs-pl-shot-expand-fab:hover {
  background: #fff;
  border-color: rgba(26, 107, 82, 0.4);
  color: #145a45;
}
.igs-pl-shot-ta.sm {
  min-height: 4.5rem;
}
.igs-pl-shot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
body.igs-on-planning .igs-pl-shots-prompt .igs-pl-shot-lab--screen {
  min-height: clamp(18rem, 48vh, 36rem);
}
@media (min-height: 820px) {
  .igs-pl-shot-ta--lg {
    height: min(58vh, 40rem);
  }
}
.igs-ep-source-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--igs-accent) 28%, transparent);
  background: linear-gradient(105deg, color-mix(in srgb, var(--igs-accent) 8%, transparent), rgba(255, 252, 247, 0.95));
}
.igs-ep-source-banner b {
  display: block;
  font-size: 0.82rem;
  color: #145a45;
}
.igs-ep-source-banner span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.74rem;
  color: var(--igs-muted, #5a6b62);
  line-height: 1.4;
}
.igs-ep-source-banner--producer {
  border-color: color-mix(in srgb, #c45c28 32%, transparent);
  background: linear-gradient(105deg, color-mix(in srgb, #c45c28 10%, transparent), rgba(255, 252, 247, 0.96));
}
.igs-ep-source-banner--producer b {
  color: #8a3a12;
}
.igs-pl-role-banner {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px dashed color-mix(in srgb, #c45c28 40%, transparent);
  background: color-mix(in srgb, #c45c28 7%, transparent);
  font-size: 0.76rem;
  line-height: 1.45;
  color: #5a3a28;
}
.igs-pl-role-banner b {
  color: #8a3a12;
}
.igs-prompt-block--edit {
  border: 1px solid color-mix(in srgb, #c45c28 35%, transparent);
  border-radius: 10px;
  padding: 0.55rem 0.65rem 0.65rem;
  background: color-mix(in srgb, #c45c28 5%, transparent);
}
.igs-prompt--edit {
  min-height: 12rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .igs-pl-shots {
    grid-template-columns: 1fr;
  }
  .igs-pl-shots-film {
    max-height: 14rem;
  }
}

/* —— 编剧模式页签（对齐小说 chrome__views 胶囊） —— */
.igs-pl-chrome .igs-pl-mode-tabs,
.igs-pl-mode-tabs--pipe {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(26, 50, 40, 0.06);
  border: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
}
.igs-pl-mode-tabs--pipe button {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--igs-muted, #5a5348);
  cursor: pointer;
}
.igs-pl-mode-tabs--pipe button:hover {
  color: var(--igs-ws-ink, #13241e);
  background: rgba(255, 255, 255, 0.7);
}
.igs-pl-mode-tabs--pipe button.on {
  background: var(--igs-ws-moss, #1a6b52);
  color: #f5fbf8;
  box-shadow: 0 2px 8px rgba(26, 107, 82, 0.28);
  font-weight: 700;
}
.igs-pl-mode-tabs--pipe button em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(26, 50, 40, 0.1);
  color: inherit;
  opacity: 0.85;
}
.igs-pl-mode-tabs--pipe button.on em {
  background: rgba(255, 255, 255, 0.22);
  color: #f5fbf8;
  opacity: 1;
}
.igs-pl-mode-pipe {
  display: none; /* 胶囊页签不再需要连接线 */
}

/* —— 顶栏分镜就绪 HUD —— */
.igs-pl-chrome__shots-hud {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.4rem 0.15rem 0.15rem;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.9);
  border: 1px solid color-mix(in srgb, var(--igs-accent) 22%, transparent);
}
.igs-pl-chrome__shots-ring {
  --p: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--igs-accent) calc(var(--p) * 1%), rgba(26, 50, 40, 0.12) 0);
  position: relative;
}
.igs-pl-chrome__shots-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fffcf7;
}
.igs-pl-chrome__shots-ring b {
  position: relative;
  z-index: 1;
  font-size: 0.58rem;
  font-weight: 800;
  color: #145a45;
}
.igs-pl-chrome__shots-meta {
  font-size: 0.68rem;
  line-height: 1.25;
  color: #1a4234;
  font-weight: 650;
}
.igs-pl-chrome__shots-meta em {
  font-style: normal;
  font-weight: 500;
  color: var(--igs-muted, #5a5348);
  font-size: 0.62rem;
}

/* —— 分镜进度 + 筛选（并入 subbar，贴边） —— */
.igs-pl-shots-hero {
  display: none; /* 已并入 .igs-pl-subbar--shots */
}
body.igs-on-planning .igs-pl-subbar--shots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
}
body.igs-on-planning .igs-pl-subbar--shots .igs-pl-shots-hero__progress {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 10rem;
  min-width: 8rem;
  margin: 0;
}
body.igs-on-planning .igs-pl-subbar--shots .igs-pl-shots-hero__bar {
  flex: 1 1 auto;
  min-width: 4rem;
  max-width: 10rem;
  margin: 0;
}
body.igs-on-planning .igs-pl-subbar--shots .igs-pl-shots-hero__progress strong {
  font-size: 0.92rem;
  font-family: var(--igs-serif, "Noto Serif SC", serif);
  color: #145a45;
}
body.igs-on-planning .igs-pl-subbar--shots .igs-pl-shots-hero__progress span {
  font-size: 0.72rem;
  color: var(--igs-muted);
}
.igs-pl-shots-hero__progress {
  flex: 1 1 14rem;
  min-width: 12rem;
}
.igs-pl-shots-hero__bar {
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(26, 50, 40, 0.1);
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.igs-pl-shots-hero__bar i {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: linear-gradient(90deg, #2a8f74, var(--igs-accent));
  border-radius: inherit;
  transition: width 0.25s ease;
}
.igs-pl-shots-hero__nums {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}
.igs-pl-shots-hero__nums strong {
  font-size: 1.15rem;
  font-family: var(--igs-serif, "Noto Serif SC", serif);
  color: #145a45;
}
.igs-pl-shots-hero__nums span {
  font-size: 0.72rem;
  color: var(--igs-muted, #5a5348);
}
.igs-pl-shots-hero__filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.85);
  border: 1px solid rgba(26, 50, 40, 0.1);
}
.igs-pl-shots-hero__filters button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--igs-muted, #5a5348);
  font-weight: 600;
}
.igs-pl-shots-hero__filters button.on {
  background: var(--igs-accent);
  color: #fff;
}

/* —— 胶片 · 分镜紧凑 + 词角标 —— */
.igs-pl-film--shots .igs-pl-film-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7faf7;
  padding-bottom: 0.25rem;
}
.igs-pl-film--shots .igs-pl-film-card {
  flex-basis: 5.6rem;
  padding: 0.28rem;
}
.igs-pl-film--shots .igs-pl-film-card b {
  font-size: 0.68rem;
}
.igs-pl-film-card.is-filtered {
  display: none;
}
.igs-pl-pr-badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 2;
  font-style: normal;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.14rem 0.28rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.igs-pl-pr-badge.tier-ready {
  color: #145a45;
  background: #d8f0e6;
}
.igs-pl-pr-badge.tier-gap {
  color: #a04518;
  background: #fde8d8;
}
.igs-pl-pr-badge.tier-empty {
  color: #6a645c;
  background: #efece4;
}
.igs-pl-pr-leg {
  font-size: 0.62rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
}
.igs-pl-pr-leg.tier-ready {
  background: #d8f0e6;
  color: #145a45;
}
.igs-pl-pr-leg.tier-gap {
  background: #fde8d8;
  color: #a04518;
}

/* —— 分镜审词面板增强 —— */
.igs-pl-shot-context {
  display: grid;
  grid-template-columns: 4.8rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}
.igs-pl-shot-thumb {
  width: 4.8rem;
  height: 6.4rem;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(26, 50, 40, 0.12);
  background: #efece4;
}
.igs-pl-shot-thumb.is-ph {
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  color: var(--igs-muted, #5a5348);
}
.igs-pl-shot-meter {
  margin-top: 0.35rem;
}
.igs-pl-shot-meter__track {
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(26, 50, 40, 0.1);
  overflow: hidden;
}
.igs-pl-shot-meter__track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #c45c28, var(--igs-accent));
  border-radius: inherit;
  transition: width 0.2s ease;
}
.igs-pl-shot-meter span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--igs-muted, #5a5348);
}
.igs-pl-shot-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  font-size: 0.72rem;
  color: var(--igs-muted, #5a5348);
  margin: -0.15rem 0 0.1rem;
}
.igs-pl-shot-dirty {
  color: #a04518;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgba(196, 92, 40, 0.12);
}
.igs-pl-shot-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.igs-pl-shot-nav em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a4234;
}
.igs-pl-shot-id {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.igs-pl-shot-id span {
  font-size: 0.74rem;
  color: var(--igs-muted, #5a5348);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(28rem, 70vw);
}
@media (max-width: 640px) {
  .igs-pl-shot-context {
    grid-template-columns: 1fr;
  }
  .igs-pl-shot-thumb {
    width: 100%;
    height: 8rem;
  }
  .igs-pl-chrome__shots-hud {
    order: 5;
    width: 100%;
    justify-content: flex-start;
  }
}
}
.igs-pl-shot-id span {
  font-size: 0.74rem;
  color: var(--igs-muted, #5a5348);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(28rem, 70vw);
}
@media (max-width: 640px) {
  .igs-pl-shot-context {
    grid-template-columns: 1fr;
  }
  .igs-pl-shot-thumb {
    width: 100%;
    height: 8rem;
  }
  .igs-pl-chrome__shots-hud {
    order: 5;
    width: 100%;
    justify-content: flex-start;
  }
}

/* —— 分集 / 透析工作室壳 + AI 侧栏（对齐标准/编剧） —— */
.igs-ep-studio,
.igs-dx-studio {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(26, 107, 82, 0.06), transparent 55%),
    linear-gradient(180deg, #f4efe4 0%, var(--igs-ws-paper, #f7f3ea) 45%, #efe9dc 100%);
}
.igs-ep-studio__stage,
.igs-dx-studio__stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.igs-ep-studio.is-ai-open .igs-ep-studio__stage,
.igs-dx-studio.is-ai-open .igs-dx-studio__stage {
  border-right: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
}
.igs-ep-studio.is-ai-closed .igs-nv-ai-rail,
.igs-ep-studio.is-ai-closed .igs-pl-ai-rail,
.igs-dx-studio.is-ai-closed .igs-nv-ai-rail,
.igs-dx-studio.is-ai-closed .igs-pl-ai-rail {
  display: none;
}
.igs-ep-studio.is-ai-open .igs-nv-ai-rail,
.igs-ep-studio.is-ai-open .igs-pl-ai-rail,
.igs-dx-studio.is-ai-open .igs-nv-ai-rail,
.igs-dx-studio.is-ai-open .igs-pl-ai-rail {
  /* 与小说/编剧同源：拖条改 --igs-ws-rail，最宽约屏宽 2/3 */
  flex: 0 0 var(--igs-ws-rail, 22.5rem);
  width: var(--igs-ws-rail, 22.5rem);
  max-width: var(--igs-chat-max-w, 66.666vw);
  min-width: 16rem;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.igs-dx-studio .igs-dx-page {
  flex: 1 1 auto;
  min-height: 0;
  padding: clamp(0.45rem, 1.1vh, 0.85rem) clamp(0.55rem, 1.4vw, 1rem);
  box-sizing: border-box;
}
body.igs-on-episode #panel-episode.active,
body.igs-on-dialysis #panel-dialysis.active,
#panel-episode.active,
#panel-dialysis.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
}
/* 透析底部旧 inject：有右侧轨时藏掉，避免双会话条 */
#panel-dialysis:has(.igs-dx-studio.is-ai-open) > .igs-ws-dx-inject {
  display: none;
}
@media (max-width: 980px) {
  .igs-ep-studio.is-ai-open,
  .igs-dx-studio.is-ai-open {
    position: relative;
  }
  .igs-ep-studio.is-ai-open .igs-nv-ai-rail,
  .igs-ep-studio.is-ai-open .igs-pl-ai-rail,
  .igs-dx-studio.is-ai-open .igs-nv-ai-rail,
  .igs-dx-studio.is-ai-open .igs-pl-ai-rail {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 40;
    width: min(92vw, var(--igs-ws-rail, 24rem));
    max-width: 92vw;
    flex: none;
    box-shadow: -8px 0 28px rgba(20, 36, 30, 0.12);
  }
}

/* —— 母版工作室壳 + AI 侧栏 —— */
.igs-m-studio {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.igs-m-studio__body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.igs-m-studio__stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.igs-m-studio.is-ai-open .igs-m-studio__stage {
  border-right: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.12));
}
.igs-m-studio.is-ai-closed .igs-nv-ai-rail,
.igs-m-studio.is-ai-closed .igs-pl-ai-rail {
  display: none;
}
.igs-m-studio.is-ai-open .igs-nv-ai-rail,
.igs-m-studio.is-ai-open .igs-pl-ai-rail {
  flex: 0 0 var(--igs-ws-rail, 22.5rem);
  width: var(--igs-ws-rail, 22.5rem);
  max-width: var(--igs-chat-max-w, 66.666vw);
  min-width: 16rem;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.igs-m-studio .igs-m-work {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
body.igs-on-masters #panel-masters.active,
#panel-masters.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
}
@media (max-width: 980px) {
  .igs-m-studio.is-ai-open {
    position: relative;
  }
  .igs-m-studio.is-ai-open .igs-nv-ai-rail,
  .igs-m-studio.is-ai-open .igs-pl-ai-rail {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 40;
    width: min(92vw, 24rem);
    max-width: 92vw;
    box-shadow: -8px 0 28px rgba(20, 36, 30, 0.12);
  }
}



/* —— 参考库 AI 侧栏壳 —— */
.igs-refs-studio {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.igs-refs-studio__body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.igs-refs-studio__stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
.igs-refs-studio.is-ai-open .igs-refs-studio__stage {
  border-right: 1px solid var(--igs-ws-line, rgba(26, 50, 40, 0.1));
}
.igs-refs-studio.is-ai-closed .igs-nv-ai-rail,
.igs-refs-studio.is-ai-closed .igs-pl-ai-rail {
  display: none;
}
.igs-refs-studio.is-ai-open .igs-nv-ai-rail,
.igs-refs-studio.is-ai-open .igs-pl-ai-rail {
  /* 与小说/母版/编剧同源：拖条改 --igs-ws-rail，最宽约屏宽 2/3（禁锁死 28rem） */
  flex: 0 0 var(--igs-ws-rail, 22.5rem);
  width: var(--igs-ws-rail, 22.5rem);
  max-width: var(--igs-chat-max-w, 66.666vw);
  min-width: 16rem;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
}
@media (max-width: 960px) {
  .igs-refs-studio.is-ai-open {
    position: relative;
  }
  .igs-refs-studio.is-ai-open .igs-nv-ai-rail,
  .igs-refs-studio.is-ai-open .igs-pl-ai-rail {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 40;
    width: min(92vw, var(--igs-ws-rail, 24rem));
    max-width: min(92vw, var(--igs-chat-max-w, 66.666vw));
    max-width: 92vw;
    box-shadow: -8px 0 28px rgba(20, 36, 30, 0.12);
  }
}

.igs-ws-chip.is-soft-att {
  border-style: dashed;
  color: #5a6e64;
}


/* 编剧 · 章编剧台账（chapter_peak / N68） */
.igs-pl-ch-matrix {
  margin: 0.5rem 0.75rem 1rem;
  padding: 0.75rem 1rem;
  max-height: min(72vh, 900px);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}
.igs-pl-ch-matrix__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.igs-pl-ch-matrix__head h3 { margin: 0 0 0.2rem; }
.igs-pl-ch-matrix__stats { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.igs-pl-ch-matrix__table-wrap { overflow: auto; flex: 1 1 auto; min-height: 12rem; border: 1px solid rgba(0,0,0,0.06); border-radius: 8px; }
.igs-pl-ch-matrix__table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.igs-pl-ch-matrix__table th,
.igs-pl-ch-matrix__table td { padding: 0.35rem 0.5rem; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.05); }
.igs-pl-ch-matrix__table th { position: sticky; top: 0; background: #f3f6f4; z-index: 1; }
.igs-pl-ch-matrix__table .ok { color: #1a6b52; font-weight: 700; }
.igs-pl-ch-matrix__table .miss { color: #999; }
.igs-pl-ch-matrix__table tr.st-empty { background: rgba(180, 80, 60, 0.04); }

/* 编剧 · 按章通读工作区（单元→章 · 中栏改编 · 右栏参考） */
.igs-pl-page--chapter-writer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.igs-pl-ch-ws {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0 0.75rem 0.75rem;
  min-height: 0;
  flex: 1 1 auto;
}
.igs-pl-ch-ws__locus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem;
  background: #eef4f1;
  border-radius: 8px;
  font-size: 0.88rem;
}
.igs-pl-ch-ws__locus em {
  font-style: normal;
  font-size: 0.72rem;
  color: #5a7a6c;
  margin-right: 0.25rem;
}
.igs-pl-ch-ws__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
}
.igs-pl-ch-ws__body {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr) minmax(11rem, 15rem);
  gap: 0.5rem;
  min-height: min(62vh, 720px);
  flex: 1 1 auto;
}
.igs-pl-ch-nav {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  background: #f7f9f8;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.igs-pl-ch-nav h3 {
  margin: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.igs-pl-ch-nav__scroll {
  overflow: auto;
  flex: 1 1 auto;
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.igs-pl-ch-nav__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.25rem;
  align-items: baseline;
  text-align: left;
  padding: 0.35rem 0.4rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}
.igs-pl-ch-nav__item:hover { background: rgba(26, 107, 82, 0.08); }
.igs-pl-ch-nav__item.on { background: #1a6b52; color: #fff; }
.igs-pl-ch-nav__item.on em,
.igs-pl-ch-nav__item.on i { color: rgba(255, 255, 255, 0.85); }
.igs-pl-ch-nav__item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #556;
  font-style: normal;
  font-size: 0.72rem;
}
.igs-pl-ch-nav__item i {
  font-style: normal;
  font-size: 0.68rem;
  color: #889;
}
.igs-pl-ch-main {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.igs-pl-ch-main__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: #fafcfb;
}
.igs-pl-ch-main__body {
  overflow: auto;
  flex: 1 1 auto;
  padding: 0.75rem 1rem 1.25rem;
  line-height: 1.65;
}
.igs-pl-ch-main__body .igs-pack-peak {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}
.igs-pl-ch-main__body .igs-pack-peak h4 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: #1a6b52;
}
.igs-pl-ch-ref {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  background: #f7f9f8;
  padding: 0.5rem 0.65rem;
  overflow: auto;
  min-height: 0;
  font-size: 0.82rem;
}
.igs-pl-ch-ref h3 { margin: 0 0 0.2rem; font-size: 0.88rem; }
.igs-pl-ch-ref h4 { margin: 0.65rem 0 0.25rem; font-size: 0.78rem; color: #5a7a6c; }
.igs-pl-ch-ref__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.35rem 0;
}
.igs-pl-ch-ref__meta span {
  background: #e8f0ec;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
}
.igs-pl-ch-ref__list {
  margin: 0;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.igs-pl-ch-ref__list .mute { color: #99a; list-style: none; margin-left: -1rem; }
.igs-pl-ch-ref__acts {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
@media (max-width: 960px) {
  .igs-pl-ch-ws__body {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .igs-pl-ch-nav__scroll { max-height: 10rem; }
  .igs-pl-ch-main { min-height: 40vh; }
}

/* 红妆 · 架构/分析职责壳 */
.igs-pl-hz-duty {
  margin: 0.75rem 1rem 1.25rem;
  padding: 1rem 1.15rem;
  max-width: 52rem;
}
.igs-pl-hz-duty h3 { margin: 0 0 0.5rem; }
.igs-pl-hz-duty ul {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.55;
}
.igs-pl-hz-duty__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.igs-pl-ch-ws__src {
  font-size: 0.75rem;
  color: #5a7a6c;
  padding: 0.15rem 0.4rem;
  background: rgba(26, 107, 82, 0.08);
  border-radius: 4px;
}
.igs-pl-ch-matrix__table tr.st-partial { background: rgba(180, 140, 40, 0.06); }
