/**
 * 制作台 · 统一页壳 / 开制启动台 / 时间轴（P-css-i：从 shot-layout 切出）
 */

/* —— 统一页壳 —— */
.igs-page {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
  height: 100%;
}
.igs-page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: space-between;
  flex: 0 0 auto;
}
.igs-page-head.compact {
  align-items: center;
  margin-bottom: 0.35rem;
}
.igs-page-head h2 {
  margin: 0;
  font-family: var(--igs-serif);
  font-size: 1.15rem;
}
.igs-page-head p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--igs-muted);
}
.igs-page-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--igs-muted);
}
.igs-page-empty h2, .igs-page-empty h3 {
  margin: 0 0 0.35rem;
  font-family: var(--igs-serif);
  color: var(--igs-ink);
}

body.igs-on-workspace .igs-novel-page,
body.igs-on-workspace .igs-nv-reader-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.igs-on-workspace .igs-nv-reader-bar,
body.igs-on-workspace .igs-nv-reader-syn {
  flex: 0 0 auto;
}
body.igs-on-workspace .igs-novel-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
body.igs-on-workspace .igs-novel-layout,
body.igs-on-workspace .igs-std-layout,
body.igs-on-workspace .igs-clib-layout,
body.igs-on-workspace .igs-wf-layout,
body.igs-on-workspace .igs-lora-layout,
body.igs-on-workspace .igs-rel-page,
body.igs-on-workspace .igs-acad-layout,
body.igs-on-workspace .igs-master-layout,
body.igs-on-workspace .igs-vid-layout,
body.igs-on-workspace .igs-graph-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  align-items: stretch;
}
body.igs-on-workspace .igs-novel-nav,
body.igs-on-workspace .igs-nv-ch-panel,
body.igs-on-workspace .igs-std-nav,
body.igs-on-workspace .igs-clib-grid,
body.igs-on-workspace .igs-wf-list,
body.igs-on-workspace .igs-lora-side,
body.igs-on-workspace .igs-rel-nav,
body.igs-on-workspace .igs-acad-nav,
body.igs-on-workspace .igs-master-list {
  max-height: none;
  overflow: auto;
  min-height: 0;
  align-self: stretch;
}
body.igs-on-workspace .igs-novel-reader:has(.igs-nv-twin),
body.igs-on-workspace .igs-novel-reader:has(.igs-nv-twin-solo) {
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  max-height: none;
  min-height: 0;
  height: 100% !important;
}
body.igs-on-workspace .igs-novel-reader,
body.igs-on-workspace .igs-std-reader,
body.igs-on-workspace .igs-clib-detail,
body.igs-on-workspace .igs-wf-detail,
body.igs-on-workspace .igs-lora-main,
body.igs-on-workspace .igs-acad-main,
body.igs-on-workspace .igs-master-detail,
body.igs-on-workspace .igs-rel-shell,
body.igs-on-workspace .igs-vid-grid {
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  max-height: none;
  height: auto;
  align-self: stretch;
}
body.igs-on-workspace .igs-nv-studio .igs-novel-reader {
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow: hidden;
}
body.igs-on-workspace .igs-acad-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.igs-on-workspace .igs-acad-reader {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
body.igs-on-workspace .igs-acad-inv {
  flex: 0 1 auto;
  max-height: min(32vh, 18rem);
  overflow: auto;
}
body.igs-on-workspace .igs-hub {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}
body.igs-on-workspace .igs-matrix-wrap {
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}
body.igs-on-workspace .igs-rel-page {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
}
body.igs-on-workspace .igs-rel-page > .igs-novel-ctx {
  grid-column: 1 / -1;
}
body.igs-on-workspace .igs-rel-nav {
  max-height: none;
  min-height: 0;
  overflow: auto;
  align-self: stretch;
}
body.igs-on-workspace .igs-rel-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  grid-template-rows: minmax(0, 1fr);
  gap: 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  align-items: stretch;
  overflow: hidden;
}
body.igs-on-workspace .igs-rel-shell > div:first-child {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
body.igs-on-workspace .igs-rel-shell > .igs-card {
  min-height: 0;
  overflow: auto;
}
body.igs-on-workspace .igs-rel-canvas {
  flex: 1 1 auto;
  min-height: min(52vh, 28rem);
  height: auto;
  max-height: none;
  overflow: auto;
}
@media (max-width: 980px) {
  body.igs-on-workspace .igs-rel-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(18rem, 1fr) auto;
    overflow: auto;
  }
}
.igs-novel-ch-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.35rem;
}
.igs-novel-reader-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.igs-novel-reader-head h2 {
  margin: 0;
  font-family: var(--igs-serif);
  font-size: 1.15rem;
}
.igs-vid-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}
@media (max-width: 900px) {
  .igs-vid-layout { grid-template-columns: 1fr; }
}
.igs-sync-log {
  white-space: pre-wrap;
  font-size: 0.8rem;
  background: #fff;
  padding: 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid var(--igs-line);
  margin-top: 0.65rem;
  max-height: 50vh;
  overflow: auto;
}
.igs-graph-casts { margin-bottom: 0.35rem; }
.igs-std-page .igs-std-styles { margin: 0; }
.igs-std-page .igs-std-flow { margin: 0.15rem 0 0.35rem; }
.igs-wf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.igs-wf-toolbar label {
  font-size: 0.72rem;
  color: var(--igs-muted);
  font-weight: 600;
}
.igs-wf-toolbar select {
  border: 1px solid var(--igs-line);
  border-radius: 0.35rem;
  padding: 0.22rem 0.35rem;
  font: inherit;
  font-size: 0.78rem;
  background: #fff;
}

/* —— 开制启动台（宽高双轴自适应） —— */
.igs-hub {
  --igs-hub-gap: clamp(0.4rem, 0.9vh, 0.75rem);
  --igs-hub-pad: clamp(0.35rem, 0.8vw, 0.75rem);
  --igs-hub-ep-min: clamp(10.5rem, 16vw, 15.5rem);
  display: flex;
  flex-direction: column;
  gap: var(--igs-hub-gap);
  min-width: 0;
}
body.igs-on-workspace .igs-hub--fill {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  gap: var(--igs-hub-gap);
  container-type: size;
  container-name: igs-hub;
}
.igs-hub-chrome {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--igs-hub-gap);
  min-width: 0;
  max-height: min(54%, 26rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 0.1rem;
  scrollbar-width: thin;
}
.igs-hub[data-density='roomy'] .igs-hub-chrome {
  max-height: min(58vh, 32rem);
  overflow: auto;
}
.igs-hub[data-density='compact'] .igs-hub-chrome {
  max-height: min(48%, 22rem);
}
.igs-hub[data-density='dense'] .igs-hub-chrome {
  max-height: min(42%, 16rem);
}
.igs-hub-kicker {
  margin: 0 0 0.1rem;
  font-size: clamp(0.65rem, 1.4vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--igs-accent);
  text-transform: uppercase;
}
.igs-hub-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  flex: 0 0 auto;
}
.igs-hub-head-text {
  min-width: min(100%, 16rem);
  flex: 1 1 14rem;
}
.igs-hub-head h2 {
  margin: 0;
  font-family: var(--igs-serif);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.2;
}
.igs-hub-sub {
  margin: 0.2rem 0 0;
  color: var(--igs-muted);
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  line-height: 1.4;
}
.igs-hub-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
}
.igs-hub-topgrid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(14rem, 22rem);
  gap: var(--igs-hub-gap);
  align-items: stretch;
  flex: 0 0 auto;
  min-width: 0;
}
.igs-hub-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  min-width: 0;
}
.igs-hub-stats .igs-stat {
  background: var(--igs-card);
  border: 1px solid var(--igs-line);
  border-radius: 0.65rem;
  padding: clamp(0.4rem, 1vw, 0.65rem) clamp(0.4rem, 1vw, 0.75rem);
  text-align: center;
  min-width: 0;
}
.igs-hub-stats .igs-stat b {
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  overflow-wrap: anywhere;
}
.igs-hub-stats .igs-stat span {
  display: block;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.igs-hub-next {
  border: 1px solid color-mix(in srgb, var(--igs-accent) 35%, transparent);
  border-radius: 0.85rem;
  padding: clamp(0.55rem, 1.2vw, 0.8rem);
  background: linear-gradient(155deg, #e8f5f0 0%, #fffcf6 55%, #fff 100%);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}
.igs-hub-next-lab {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--igs-accent);
  text-transform: uppercase;
}
.igs-hub-next strong {
  font-family: var(--igs-serif);
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.igs-hub-next p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--igs-muted);
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.igs-hub-next-actions { margin: 0.15rem 0 0; }
.igs-hub-bar {
  flex: 0 0 auto;
  margin: 0;
  height: 0.42rem;
}
.igs-hub-launch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 0 0 auto;
}
.igs-hub-launch-lab {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--igs-muted);
  text-transform: uppercase;
}
.igs-hub-launch-toggle {
  font-size: 0.72rem !important;
  padding: 0.2rem 0.5rem !important;
}
.igs-hub-launch-wrap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  flex: 0 0 auto;
  min-width: 0;
}
.igs-hub.is-launch-collapsed .igs-hub-launch-wrap {
  display: none;
}
.igs-hub-launch-g {
  background: rgba(255, 252, 245, 0.72);
  border: 1px solid var(--igs-line);
  border-radius: 0.75rem;
  padding: 0.4rem 0.45rem 0.5rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.igs-hub-launch-g h3 {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--igs-muted);
  text-transform: uppercase;
}
.igs-hub-launch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
}
.igs-hub-tile {
  text-align: left;
  border: 1px solid var(--igs-line);
  border-radius: 0.55rem;
  padding: 0.5rem 0.6rem;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  transition: transform 0.12s ease, border-color 0.12s, box-shadow 0.12s;
  font: inherit;
  color: var(--igs-ink);
  width: 100%;
  min-width: 0;
}
.igs-hub-tile:hover {
  transform: translateY(-1px);
  border-color: var(--igs-accent);
  box-shadow: 0 6px 14px rgba(20, 32, 28, 0.07);
}
.igs-hub-tile strong {
  font-family: var(--igs-serif);
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  line-height: 1.25;
}
.igs-hub-tile-short { display: none; }
.igs-hub-tile-desc {
  font-size: 0.68rem;
  color: var(--igs-muted);
  line-height: 1.35;
}
.igs-hub-tile.tone-a { background: linear-gradient(160deg, #e8f5f0, #fff); }
.igs-hub-tile.tone-b { background: linear-gradient(160deg, #f3efe4, #fff); }
.igs-hub-tile.tone-c { background: linear-gradient(160deg, #f7ebe3, #fff); }
.igs-hub-tile.tone-d { background: linear-gradient(160deg, #eef2f6, #fff); }
.igs-hub-tile.tone-sys { background: linear-gradient(160deg, #efe8f2, #fff); }
.igs-hub-eps {
  background: var(--igs-card);
  border: 1px solid var(--igs-line);
  border-radius: 0.85rem;
  padding: clamp(0.45rem, 1vw, 0.75rem);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.igs-hub-eps-head { flex: 0 0 auto; min-width: 0; }
.igs-hub-eps-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.65rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
}
.igs-hub-eps-head h3 {
  margin: 0;
  font-family: var(--igs-serif);
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
}
.igs-hub-tl {
  padding-bottom: 0.35rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.igs-hub-tl .igs-tl-ep {
  width: clamp(5.4rem, 12vw, 7.2rem);
  padding: 0.4rem 0.35rem;
}
.igs-tl-ep.is-next {
  outline: 2px solid color-mix(in srgb, var(--igs-accent) 45%, transparent);
  outline-offset: 1px;
  border-radius: 0.45rem;
}
.igs-hub-ep-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fill, minmax(var(--igs-hub-ep-min), 1fr));
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
  align-content: start;
  scrollbar-width: thin;
}
.igs-hub-ep {
  border: 1px solid var(--igs-line);
  border-radius: 0.65rem;
  padding: 0.55rem 0.6rem;
  background: var(--igs-elev);
  color: var(--igs-ink);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.igs-hub-ep.is-next {
  border-color: color-mix(in srgb, var(--igs-accent) 45%, var(--igs-line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--igs-accent) 14%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--igs-accent) 10%, var(--igs-elev)),
    var(--igs-elev)
  );
}
.igs-hub-ep.is-done { opacity: 0.88; }
.igs-hub-ep-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--igs-muted);
  margin-bottom: 0.15rem;
  gap: 0.35rem;
}
.igs-hub-ep-top span {
  text-align: right;
  overflow-wrap: anywhere;
}
.igs-hub-ep strong {
  display: block;
  font-family: var(--igs-serif);
  font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  margin-bottom: 0.15rem;
  overflow-wrap: anywhere;
}
.igs-hub-ep-blurb {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  color: var(--igs-muted);
  line-height: 1.35;
  min-height: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 auto;
}
.igs-hub-ep-actions { margin: 0.25rem 0 0; }
.igs-hub-empty {
  text-align: center;
  padding: 2rem 1.25rem;
  margin: auto;
}
.igs-hub-empty h2 { font-family: var(--igs-serif); margin: 0 0 0.5rem; }

/* 密度：紧凑 */
.igs-hub[data-density='compact'] {
  --igs-hub-gap: 0.45rem;
  --igs-hub-ep-min: clamp(10rem, 14vw, 13.5rem);
}
.igs-hub[data-density='compact'] .igs-hub-sub { display: none; }
.igs-hub[data-density='compact'] .igs-hub-tile-desc { display: none; }
.igs-hub[data-density='compact'] .igs-hub-tile { padding: 0.4rem 0.5rem; }
.igs-hub[data-density='compact'] .igs-hub-next p { -webkit-line-clamp: 1; }
.igs-hub[data-density='compact'] .igs-hub-cta-continue { display: none; }

/* 密度：密集（矮屏优先分集） */
.igs-hub[data-density='dense'] {
  --igs-hub-gap: 0.35rem;
  --igs-hub-ep-min: clamp(9.5rem, 20vw, 12.5rem);
}
.igs-hub[data-density='dense'] .igs-hub-sub,
.igs-hub[data-density='dense'] .igs-hub-kicker { display: none; }
.igs-hub[data-density='dense'] .igs-hub-head h2 { font-size: 1.1rem; }
.igs-hub[data-density='dense'] .igs-hub-tile-desc { display: none; }
.igs-hub[data-density='dense'] .igs-hub-tile-full { display: none; }
.igs-hub[data-density='dense'] .igs-hub-tile-short { display: inline; }
.igs-hub[data-density='dense'] .igs-hub-launch-wrap {
  grid-template-columns: 1fr;
  gap: 0.35rem;
}
.igs-hub[data-density='dense'] .igs-hub-launch-g {
  flex-direction: row;
  align-items: center;
  padding: 0.3rem 0.4rem;
  overflow-x: auto;
  gap: 0.4rem;
}
.igs-hub[data-density='dense'] .igs-hub-launch-g h3 {
  flex: 0 0 auto;
  width: 2.4rem;
}
.igs-hub[data-density='dense'] .igs-hub-launch {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
}
.igs-hub[data-density='dense'] .igs-hub-tile {
  width: auto;
  flex: 0 0 auto;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
}
.igs-hub[data-density='dense'] .igs-hub-next p { display: none; }
.igs-hub[data-density='dense'] .igs-hub-cta-continue { display: none; }
.igs-hub[data-density='dense'] .igs-hub-ep-blurb { display: none; }

/* 宽度带 */
.igs-hub[data-w='lg'] .igs-hub-launch-wrap,
.igs-hub[data-w='md'] .igs-hub-launch-wrap {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.igs-hub[data-w='sm'] .igs-hub-topgrid,
.igs-hub[data-w='xs'] .igs-hub-topgrid {
  grid-template-columns: 1fr;
}
.igs-hub[data-w='sm'] .igs-hub-launch-wrap,
.igs-hub[data-w='xs'] .igs-hub-launch-wrap {
  grid-template-columns: 1fr;
}
.igs-hub[data-w='sm'] .igs-hub-stats,
.igs-hub[data-w='xs'] .igs-hub-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.igs-hub[data-w='xs'] .igs-hub-head-actions {
  width: 100%;
  justify-content: stretch;
}
.igs-hub[data-w='xs'] .igs-hub-head-actions > * {
  flex: 1 1 auto;
  justify-content: center;
}
.igs-hub[data-w='xs'] .igs-hub-launch-g {
  flex-direction: row;
  align-items: center;
  overflow-x: auto;
  gap: 0.35rem;
}
.igs-hub[data-w='xs'] .igs-hub-launch {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.3rem;
}
.igs-hub[data-w='xs'] .igs-hub-tile {
  width: auto;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
}
.igs-hub[data-w='xs'] .igs-hub-tile-desc { display: none; }
.igs-hub[data-w='xs'] .igs-hub-tile-full { display: none; }
.igs-hub[data-w='xs'] .igs-hub-tile-short { display: inline; }
.igs-hub[data-w='xs'] {
  --igs-hub-ep-min: min(100%, 17rem);
}
.igs-hub[data-w='sm'] {
  --igs-hub-ep-min: clamp(11rem, 42vw, 16rem);
}

/* 视口兜底（无 ResizeObserver / 初次绘制） */
@media (max-width: 1100px) {
  .igs-hub-launch-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .igs-hub-topgrid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .igs-hub-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .igs-hub-launch-wrap { grid-template-columns: 1fr; }
  .igs-hub-sub { display: none; }
}
@media (max-width: 520px) {
  .igs-hub-cta-continue { flex: 1 1 100%; }
  body.igs-on-workspace .igs-main {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }
}
@media (max-height: 780px) {
  .igs-hub-sub { display: none; }
  .igs-hub-tile-desc { display: none; }
}
@media (max-height: 640px) {
  body:not(.igs-on-overview) .igs-hub-chrome { max-height: min(42%, 15rem); overflow: auto; }
  body.igs-on-overview .igs-hub-chrome { max-height: none !important; }
  .igs-hub-ep-blurb { display: none; }
}

/* 容器查询：按面板实际尺寸（比视口更准） */
@supports (container-type: size) {
  @container igs-hub (max-width: 980px) {
    .igs-hub-launch-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @container igs-hub (max-width: 720px) {
    .igs-hub-topgrid { grid-template-columns: 1fr; }
    .igs-hub-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @container igs-hub (max-height: 700px) {
    .igs-hub-sub,
    .igs-hub-tile-desc { display: none; }
  }
  @container igs-hub (max-height: 560px) {
    .igs-hub-ep-blurb { display: none; }
  }
}
@keyframes igs-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.igs-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.igs-card {
  background: var(--igs-card); border: 1px solid var(--igs-line);
  border-radius: 0.8rem; padding: 0.95rem;
  box-shadow: 0 10px 28px rgba(40, 30, 10, 0.045);
}
.igs-card h3 { margin: 0 0 0.4rem; font-family: var(--igs-serif); font-size: 1.05rem; }
.igs-card p { margin: 0.25rem 0; color: var(--igs-muted); font-size: 0.86rem; line-height: 1.5; }
.igs-bar {
  height: 0.5rem; background: var(--igs-mist); border-radius: 99px; overflow: hidden; margin: 0.5rem 0;
}
.igs-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--igs-accent), #3d9b7a); border-radius: 99px; transition: width 0.4s ease; }
.igs-pill {
  display: inline-block; font-size: 0.7rem; padding: 0.12rem 0.42rem;
  border-radius: 99px; background: var(--igs-mist); margin: 0 0.2rem 0.15rem 0; font-weight: 600;
}
.igs-pill.ok { background: #d4f0dc; color: var(--igs-ok); }
.igs-pill.warn { background: #ffe6d0; color: var(--igs-warn); }
.igs-pill.info { background: #dceaf5; color: #2a5a7a; }
.igs-pill.hot { background: #fde0d4; color: var(--igs-accent-2); }

/* —— 总览时间轴 —— */
.igs-timeline {
  display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.35rem 0 0.75rem;
  scroll-snap-type: x proximity;
}
.igs-tl-ep {
  flex: 0 0 auto; width: 7.2rem; scroll-snap-align: start;
  border: 1px solid var(--igs-line); border-radius: 0.65rem; padding: 0.55rem;
  background: #fff; cursor: pointer; text-align: center; transition: border-color 0.15s, transform 0.15s;
}
.igs-tl-ep:hover, .igs-tl-ep.active { border-color: var(--igs-accent); transform: translateY(-2px); }
.igs-tl-ep b { display: block; font-family: var(--igs-serif); font-size: 0.95rem; }
.igs-tl-ep small { color: var(--igs-muted); font-size: 0.72rem; display: block; margin-top: 0.2rem; line-height: 1.3; }
.igs-tl-dot {
  width: 0.55rem; height: 0.55rem; border-radius: 50%; margin: 0.35rem auto 0;
  background: var(--igs-mist);
}
.igs-tl-dot.on { background: var(--igs-ok); }
.igs-tl-dot.mid { background: #d4a017; }

/* —— 全局关联矩阵 —— */
.igs-matrix-wrap { overflow: auto; max-height: 52vh; border: 1px solid var(--igs-line); border-radius: 0.75rem; background: #fff; }
.igs-matrix { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 0.78rem; }
.igs-matrix th, .igs-matrix td {
  padding: 0.35rem 0.4rem; text-align: center; border-bottom: 1px solid #eee8dc; border-right: 1px solid #f2ebe0;
  white-space: nowrap;
}
.igs-matrix th { position: sticky; top: 0; background: #f7f2e8; z-index: 2; font-weight: 700; }
.igs-matrix th.corner { left: 0; z-index: 3; text-align: left; min-width: 5.5rem; }
.igs-matrix td.cast { position: sticky; left: 0; background: #fffcf5; text-align: left; font-weight: 600; z-index: 1; }
.igs-matrix .cell {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 1.7rem; border-radius: 0.35rem; cursor: pointer;
  font-weight: 700; color: #fff;
}
.igs-matrix .cell.z0 { background: #ebe4d6; color: var(--igs-muted); font-weight: 500; }
.igs-matrix .cell.z1 { background: #7ab8a4; }
.igs-matrix .cell.z2 { background: #3d9b7a; }
.igs-matrix .cell.z3 { background: var(--igs-accent); }
.igs-matrix .cell.z4 { background: #0f4a3c; box-shadow: inset 0 0 0 2px #c45c28; }

.igs-assoc-flow {
  display: grid; gap: 0.75rem;
  grid-template-columns: 1.2fr 1fr;
}
@media (max-width: 960px) {
  .igs-assoc-flow { grid-template-columns: 1fr; }
}
.igs-flow-svg { width: 100%; height: 280px; background: #fff; border-radius: 0.75rem; border: 1px solid var(--igs-line); }
.igs-kf-chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; max-height: 220px; overflow: auto; }
.igs-kf-chip {
  border: 1px solid var(--igs-line); border-radius: 0.45rem; padding: 0.3rem 0.5rem;
  background: #fff; cursor: pointer; font-size: 0.75rem; max-width: 11rem;
}
.igs-kf-chip:hover, .igs-kf-chip.active { border-color: var(--igs-accent); background: #eef7f3; }
.igs-kf-chip .st { float: right; }

/* —— 工作台 —— */
.igs-workbench {
  display: grid; gap: 0;
  grid-template-columns: 250px minmax(0, 1fr) 360px;
  align-items: stretch;
}
#panel-episode {
  --igs-ep-left: 250px;
  --igs-ep-right: 380px;
  --igs-ep-font: 1;
  font-size: calc(0.95rem * var(--igs-ep-font, 1));
}
#panel-episode .igs-workbench:not(.compare-mode) {
  grid-template-columns: var(--igs-ep-left) 6px minmax(0, 1fr) 6px var(--igs-ep-right);
  gap: 0 0.15rem;
}
#panel-episode .igs-workbench--slim:not(.compare-mode) {
  grid-template-columns: minmax(0, 1fr) 6px var(--igs-ep-right);
}
/* hint 必须在 .igs-workbench 外；若误入网格则通栏，避免挤乱左/中/右 */
#panel-episode .igs-workbench > .igs-ep-locus-hint {
  grid-column: 1 / -1;
  margin: 0 0 0.35rem;
}
#panel-episode .igs-ep-locus-hint {
  margin: 0 0 0.55rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  background: rgba(47, 107, 90, 0.06);
  border: 1px solid rgba(47, 107, 90, 0.12);
}
#panel-episode .igs-ep-locus-hint > summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--igs-accent, #2f6b5a);
  list-style: none;
}
#panel-episode .igs-ep-locus-hint > summary::-webkit-details-marker { display: none; }
#panel-episode .igs-ep-locus-hint[open] > summary { margin-bottom: 0.25rem; }
#panel-episode .igs-ep-locus-hint > p { margin: 0; line-height: 1.45; }

/* 工作台主舞台：保证中/右有高度，空态可见 */
#panel-episode .igs-workbench {
  min-height: min(62vh, 720px);
}
#panel-episode .igs-ep-center {
  min-height: min(58vh, 680px);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: auto;
  background: var(--igs-surface, #f7f8f6);
  border-radius: 10px;
  padding: 0.35rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
#panel-episode #kfDetail {
  min-height: min(58vh, 680px);
  overflow: auto;
}
#panel-episode .igs-ep-empty-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 1.1rem 1rem;
  margin: 0.35rem;
  border-radius: 12px;
  background: rgba(47, 107, 90, 0.05);
  border: 1px dashed rgba(47, 107, 90, 0.28);
}
#panel-episode .igs-ep-empty-cta strong {
  font-size: 0.95rem;
}
#panel-episode .igs-ep-empty-cta p {
  margin: 0;
  color: var(--igs-muted, #667);
  font-size: 0.84rem;
  line-height: 1.45;
  max-width: 28rem;
}
#panel-episode .igs-ep-empty-cta .igs-btn,
#panel-episode .igs-ep-empty-cta .igs-btn-ghost {
  margin-top: 0.15rem;
}
/* 主工具条略压高度，把像素留给工作台 */
#panel-episode .igs-ep-toolbar--primary {
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  padding: 0.35rem 0.25rem;
}
#panel-episode .igs-ep-toolbar--secondary {
  opacity: 0.96;
}
.igs-ep-resizer {
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 3;
  align-self: stretch;
  min-height: 4rem;
}
.igs-ep-resizer::after {
  content: '';
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 1px;
  right: 1px;
  border-radius: 3px;
  background: rgba(47, 107, 90, 0.18);
}
.igs-ep-resizer:hover::after,
.igs-ep-resizer:active::after {
  background: var(--igs-accent, #2f6b5a);
}
.igs-ep-pack-empty {
  border-color: rgba(196, 92, 40, 0.35);
  background: rgba(196, 92, 40, 0.07);
}
.igs-ep-pack-empty h3 { margin: 0 0 0.35rem; }
.igs-chip.pack-planned {
  opacity: 0.78;
  border-style: dashed;
}
.igs-cast-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.igs-cast-looks-btn {
  font-size: 0.65rem !important;
  padding: 0.1rem 0.35rem !important;
}
.igs-cast-looks-sheet {
  width: min(920px, 96vw);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
}
.igs-cast-looks-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.35rem 0.85rem 0.75rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.igs-cast-look-sec-h {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
}
.igs-cast-look-sec-h em {
  font-style: normal;
  color: var(--igs-muted, #888);
  font-size: 0.75rem;
}
.igs-cast-look-sec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
}
.igs-cast-look-sec-grid.is-wear {
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
}
.igs-cast-look-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 1px solid rgba(47, 107, 90, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}
.igs-cast-look-card.is-wear {
  border-color: rgba(47, 107, 90, 0.35);
  box-shadow: 0 4px 14px rgba(47, 107, 90, 0.08);
}
.igs-cast-look-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #ebe6dc;
  cursor: zoom-in;
  aspect-ratio: 3 / 4;
}
.igs-cast-look-card.is-wear .igs-cast-look-thumb {
  aspect-ratio: 2 / 3;
  background: #f7f4ee;
}
.igs-cast-look-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}
.igs-cast-look-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.2rem 0.35rem 0.35rem;
  font-size: 0.72rem;
}
.igs-cast-look-cap > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--igs-muted, #666);
}
@media (max-width: 1100px) {
  .igs-workbench { grid-template-columns: 1fr; }
  #panel-episode .igs-workbench:not(.compare-mode),
  #panel-episode .igs-workbench--slim:not(.compare-mode) {
    grid-template-columns: 1fr;
  }
  .igs-ep-resizer { display: none; }
  .igs-ep-mobile-tabs { display: flex; }
  .igs-workbench.igs-ep-mobile-center > #kfDetail,
  .igs-workbench.igs-ep-mobile-center > .igs-ep-resizer[data-ep-resize="right"] {
    display: none !important;
  }
  .igs-workbench.igs-ep-mobile-detail > .igs-ep-center,
  .igs-workbench.igs-ep-mobile-detail > .igs-ep-brief,
  .igs-workbench.igs-ep-mobile-detail > .igs-ep-resizer[data-ep-resize="left"] {
    display: none !important;
  }
}

/* 参考页 · 上下文条 / 筛选抽屉 */
.igs-refs-ctx-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--igs-accent) 20%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--igs-accent) 10%, transparent), rgba(255, 253, 248, 0.9));
  flex: 0 0 auto;
}
.igs-refs-ctx-main {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.78rem;
}
.igs-refs-ctx-main b {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--refs-leaf, var(--igs-accent));
}
.igs-refs-ctx-main em {
  font-style: normal;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #fffdf8;
  border: 1px solid rgba(196, 185, 166, 0.55);
  color: var(--igs-ink, #143028);
  font-weight: 600;
  font-size: 0.72rem;
}
.igs-refs-ctx-acts {
  display: inline-flex;
  gap: 0.3rem;
}
.igs-refs-filter-drawer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  padding: 0.35rem 0.45rem 0.5rem;
  border-bottom: 1px solid rgba(196, 185, 166, 0.4);
  background: rgba(255, 253, 248, 0.55);
  flex: 0 0 auto;
}
.igs-refs-filter-drawer.is-collapsed,
.igs-refs-filter-drawer[hidden] {
  display: none;
}

