/* 剧集工作台样式，负责分镜编辑表格、配置面板和生成状态的响应式布局。 */
.drama-workbench-shell {
  height: 100dvh;
  min-height: 0 !important;
  padding-bottom: 12px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drama-workbench-shell :deep(.web-header) {
  flex: 0 0 72px;
}
.drama-workbench-shell :deep(.creative-shell__content) {
  height: auto;
  min-height: 0;
  max-width: none;
  margin-top: 14px;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
.drama-workbench-shell :deep(.creative-shell__scroll) {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}
.workbench-context-bar {
  min-height: 38px;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  flex: 0 0 auto;
}
.workbench-context-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.workbench-context-main strong {
  min-width: 0;
  overflow: hidden;
  color: var(--web-text);
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.back-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  color: var(--web-accent-muted);
  background: var(--web-surface);
  border: 1px solid var(--web-line-strong);
  border-radius: 9px;
}
.back-button:hover,
.back-button:focus-visible {
  color: var(--web-text);
  border-color: var(--web-switch-border);
  outline: 2px solid var(--web-focus-ring);
}
.editor-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  flex: 1;
  gap: 12px;
  overflow: hidden;
}
.storyboard-workspace,
.asset-rail {
  min-width: 0;
  min-height: 0;
  background: var(--web-surface);
  border: 1px solid var(--web-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.storyboard-workspace {
  display: flex;
  flex-direction: column;
}
.workspace-toolbar {
  height: 48px;
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 48px;
  border-bottom: 1px solid var(--web-line-strong);
}
.workspace-toolbar > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.workspace-toolbar strong {
  font-size: 14px;
}
.workspace-toolbar span {
  color: var(--web-accent-soft);
  font-size: 10px;
}
.workspace-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--web-text-secondary);
  background: var(--web-surface);
  border: 1px solid var(--web-line-emphasis);
  border-radius: 6px;
  cursor: pointer;
}
.workspace-toolbar button {
  height: 32px;
  padding: 0 10px;
  font-size: 11px;
}
.workspace-toolbar button:hover {
  color: var(--web-text-strong);
  background: var(--web-primary);
  border-color: var(--web-primary);
}
.table-scroll {
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--web-scrollbar-thumb) var(--web-scrollbar-track-panel);
  scrollbar-width: thin;
}
.storyboard-table {
  width: 100%;
  min-width: 1134px;
  border-spacing: 0;
  border-collapse: separate;
  table-layout: fixed;
}
.storyboard-table th {
  position: sticky;
  z-index: 8;
  top: 0;
  height: 42px;
  padding: 0 10px;
  color: var(--web-text-caption);
  background: var(--web-surface-soft);
  border-bottom: 1px solid var(--web-line-strong);
  border-right: 1px solid var(--web-line-strong);
  box-shadow: 0 1px 0 var(--web-line-strong);
  font-size: 10px;
  font-weight: 600;
  text-align: left;
}
.storyboard-table th:last-child {
  border-right: 0;
}
.storyboard-table th:not(.script-column) {
  text-align: center;
}
.storyboard-table th.script-column,
.storyboard-table th.entity-column {
  font-size: 11px;
}
.sequence-column {
  width: 54px;
}
.script-column {
  width: 380px;
}
.entity-column {
  width: 140px;
}
.media-column {
  width: 140px;
}
.storyboard-row > td {
  height: 252px;
  padding: 10px;
  vertical-align: top;
  background: var(--web-surface-soft);
  border-bottom: 1px solid var(--web-line-strong);
  border-right: 1px solid var(--web-line-strong);
  transition: background-color 0.16s;
}
.storyboard-row > td:last-child {
  border-right: 0;
}
.storyboard-row:hover > td {
  background: var(--web-surface-soft);
}
.storyboard-row.active > td {
  background: var(--web-surface);
}
.insert-row td {
  height: 13px;
  padding: 0;
  background: var(--web-surface-soft);
}
.insert-row button {
  width: 100%;
  height: 13px;
  padding: 0;
  display: flex;
  align-items: center;
  color: var(--web-accent-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.insert-row:hover button,
.insert-row button:focus-visible {
  opacity: 1;
}
.insert-row button span {
  height: 1px;
  flex: 1;
  background: var(--web-danger-soft);
}
.insert-row button em {
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--web-surface-soft);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}
.sequence-cell {
  text-align: center;
}
.sequence-cell > b {
  width: 24px;
  height: 24px;
  margin: 2px auto 10px;
  display: grid;
  place-items: center;
  color: var(--web-text-strong);
  background: var(--web-primary);
  border-radius: 5px;
  font-size: 11px;
}
.script-cell {
  height: 252px;
}
.script-cell:focus-within {
  position: relative;
  z-index: 10;
}
.script-cell :deep(.asset-prompt-editor) {
  height: 230px;
  min-height: 230px;
  max-height: 230px;
  overflow: visible;
}
.script-cell :deep(.prompt-content) {
  height: 100%;
  min-height: 0;
  padding: 10px;
  overflow-y: auto;
  background: var(--web-surface-soft);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.65;
}
.script-content-display {
  cursor: text;
}
.script-content-display :deep(.prompt-content) {
  color: var(--web-text-secondary);
}
.script-content-display.empty :deep(.prompt-content) {
  display: grid;
  place-items: center;
  color: var(--web-text-context);
}
.script-content-display.locked :deep(.prompt-content) {
  cursor: default;
}
.entity-cell {
  padding: 10px 6px !important;
}
.entity-chip {
  position: relative;
  margin-bottom: 6px;
  overflow: hidden;
  background: var(--web-surface);
  border: 1px solid var(--web-line-strong);
  border-radius: 6px;
  transition:
    border-color 0.16s,
    background-color 0.16s;
}
.entity-chip:hover,
.entity-chip:focus-within {
  background: var(--web-surface);
  border-color: var(--web-line-emphasis);
}
.entity-chip-main {
  width: 100%;
  padding: 5px 32px 5px 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.entity-chip-main:focus-visible {
  outline: 2px solid var(--web-focus-ring-strong);
  outline-offset: -2px;
}
.entity-chip img,
.entity-chip :deep(.loading-media-element),
.entity-chip-main > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  object-fit: cover;
  color: var(--web-accent-dark);
  background: var(--web-hover);
  border-radius: 4px;
  font-size: 11px;
}
.entity-chip small {
  min-width: 0;
  overflow: hidden;
  color: var(--web-text-secondary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entity-audio-icon {
  flex: 0 0 auto;
  color: var(--web-accent-dark);
}
.entity-remove {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--web-accent-dark);
  background: var(--web-surface);
  border: 1px solid var(--web-line-emphasis);
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%);
  transition:
    opacity 0.16s,
    border-color 0.16s,
    color 0.16s;
}
.entity-chip:hover .entity-remove,
.entity-chip:focus-within .entity-remove {
  opacity: 1;
}
.entity-remove:hover:not(:disabled),
.entity-remove:focus-visible {
  color: var(--web-accent-dark);
  border-color: var(--web-line-critical);
}
.entity-remove:disabled {
  color: var(--web-text-critical-muted);
  border-color: var(--web-line-emphasis);
  cursor: not-allowed;
}
.cell-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--web-text-neutral);
  font-size: 10px;
}
@media (hover: none) {
  .entity-remove {
    opacity: 1;
  }
}
.media-cell {
  padding: 10px 8px !important;
  position: relative;
}
.media-focus-target {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  color: var(--web-accent-muted);
  cursor: pointer;
}
.storyboard-image-error {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  overflow: hidden;
  color: var(--web-danger);
  background: var(--web-danger-soft);
  border: 1px solid var(--web-danger);
  border-radius: 6px;
  font-size: 9px;
  line-height: 1.4;
  cursor: pointer;
}
.storyboard-image-error span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-focus-target > img,
.media-focus-target > video,
.media-focus-target > :deep(.loading-media-element),
.media-focus-target > .media-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  background: var(--web-surface-soft);
  border: 1px solid var(--web-line-strong);
  border-radius: 7px;
}
.media-focus-target > img,
.media-focus-target > video,
.media-focus-target > :deep(.loading-media-element) {
  pointer-events: none;
}
.media-empty {
  flex-direction: column;
  gap: 6px;
  color: var(--web-text-panel-muted);
}
.media-empty small {
  font-size: 9px;
}
.media-focus-target:hover > img,
.media-focus-target:hover > video,
.media-focus-target:hover > :deep(.loading-media-element),
.media-focus-target:hover > .media-empty,
.media-focus-target:focus-visible > img,
.media-focus-target:focus-visible > video,
.media-focus-target:focus-visible > :deep(.loading-media-element),
.media-focus-target:focus-visible > .media-empty {
  border-color: var(--web-switch-border);
}
.media-focus-target:focus-visible {
  outline: 2px solid var(--web-focus-ring-active);
  outline-offset: 2px;
}
.row-actions {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 6px;
}
.row-actions button {
  width: 26px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--web-text-secondary);
  background: var(--web-surface);
  border: 1px solid var(--web-line-strong);
  border-radius: 5px;
  cursor: pointer;
  opacity: 1;
  transition:
    opacity 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.row-actions button:focus-visible,
.storyboard-row.locked .row-actions .lock-action {
  opacity: 1;
}
.row-actions button:hover:not(:disabled) {
  color: var(--web-accent-muted);
  border-color: var(--web-switch-border);
}
.row-actions button.lock-action.active {
  color: var(--web-accent-dark);
  border-color: var(--web-switch-border);
}
.row-actions button.danger {
  color: var(--web-accent-dark);
}
.row-actions button.danger:hover:not(:disabled) {
  color: var(--web-accent-dark);
  border-color: var(--web-line-emphasis);
}
.row-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}
.empty-storyboards {
  min-height: 360px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--web-accent-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.empty-storyboards strong {
  color: var(--web-text-secondary);
}
.empty-storyboards span {
  color: var(--web-text-tertiary);
  font-size: 11px;
}
.parse-loading {
  cursor: default;
}
.parse-loading > svg {
  color: var(--web-accent-dark);
}
.parse-failed {
  cursor: default;
}
.parse-failed > svg {
  color: var(--web-accent-dark);
}
.parse-failed span {
  max-width: min(560px, 80%);
  color: var(--web-accent-dark);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
.asset-rail {
  display: flex;
}
.asset-rail :deep(.asset-panel) {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}
.parse-action.is-cancel {
  color: var(--web-accent-dark);
  background: var(--web-surface);
  border-color: var(--web-line-emphasis);
}
.parse-action {
  margin-left: var(--space-sm) !important;
}
.parse-action.is-cancel:hover,
.parse-action.is-cancel:focus-visible {
  color: var(--web-text);
  background: var(--web-hover);
  border-color: var(--web-line-critical);
}
.source-dialog-content {
  min-height: 430px;
}
.source-meta {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.source-meta span {
  color: var(--web-accent-dark);
  font-size: 11px;
}
.source-meta small {
  color: var(--web-text-tertiary);
  font-size: 10px;
}
.source-dialog :deep(.el-textarea__inner) {
  line-height: 1.7;
  scrollbar-color: var(--web-scrollbar-thumb) var(--web-scrollbar-track);
  scrollbar-width: thin;
}
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 1100px) {
  .editor-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}
@media (max-width: 960px) {
  .workbench-context-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .workbench-context-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .parse-action {
    margin-left: 0 !important;
  }
}
@media (max-width: 820px) {
  .drama-workbench-shell :deep(.creative-shell__content) {
    margin-top: 10px;
  }
  .editor-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(340px, 1.25fr) minmax(250px, 0.75fr);
  }
}
@media (max-width: 600px) {
  .drama-workbench-shell :deep(.web-header) {
    flex-basis: 68px;
  }
}
@media (max-width: 520px) {
  .workbench-context-actions :deep(.el-button) {
    width: calc(50% - var(--space-xs));
    flex: 1 1 calc(50% - var(--space-xs));
  }
  .workspace-toolbar {
    align-items: flex-start;
    height: auto;
    padding: 10px;
    flex-direction: column;
    gap: 8px;
  }
  .workspace-toolbar button {
    width: 100%;
  }
  .storyboard-table {
    min-width: 1180px;
  }
}
