/* 资产媒体样式，负责资产操作、历史记录及分镜媒体状态展示。 */
.asset-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.16s;
}
.asset-card:hover .asset-card-actions,
.asset-card:focus-within .asset-card-actions {
  opacity: 1;
}
.asset-delete,
.asset-add {
  width: 24px;
  height: 24px;
  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;
}
.asset-delete:hover,
.asset-delete:focus-visible {
  color: var(--web-accent-dark);
  background: var(--web-hover);
  border-color: var(--web-line-emphasis);
}
.asset-add:hover,
.asset-add:focus-visible {
  color: var(--web-accent-dark);
  background: var(--web-surface);
  border-color: var(--web-switch-border);
}
.asset-add:disabled {
  color: var(--web-text-subdued);
  border-color: var(--web-line-strong);
  cursor: not-allowed;
}
.current-asset-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 7px;
  height: 7px;
  background: var(--web-success-bright);
  border: 1px solid var(--web-success-border);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--web-current-outline);
}
.current-asset-indicator:after {
  position: absolute;
  inset: -1px;
  content: "";
  border: 1px solid var(--web-success-bright);
  border-radius: 50%;
  animation: asset-current-ripple 1.8s ease-out infinite;
}
@keyframes asset-current-ripple {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(2.6);
  }
}
@media (hover: none) {
  .asset-card-actions {
    opacity: 1;
  }
}
.asset-detail-leave-active {
  display: none;
}
.asset-name-row.single {
  grid-template-columns: 1fr;
}
.asset-image-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--web-accent-dark);
  background: var(--web-media-overlay-soft);
  font-size: 11px;
  line-height: 1.3;
}
.asset-image-loading .el-icon {
  font-size: 28px;
  animation: asset-spin 1s linear infinite;
}
.asset-image-loading b {
  display: block;
  line-height: 1.3;
}
@keyframes asset-spin {
  to {
    transform: rotate(360deg);
  }
}
.asset-thumb {
  position: relative;
}
.asset-thumb-loading {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--web-accent-dark);
  background: var(--web-media-overlay-medium);
  font-size: 21px;
}
.asset-thumb-loading :deep(svg) {
  animation: asset-spin 1s linear infinite;
}
.asset-actions {
  grid-template-columns: minmax(0, 1fr);
}
.asset-actions :deep(.el-button) {
  min-width: 0;
}
.asset-preview.storyboard-media-preview {
  height: 210px !important;
  flex-basis: 210px !important;
}
.storyboard-media-empty {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  color: var(--web-text-tertiary);
  font-size: 11px;
}
.storyboard-media-empty .el-icon {
  color: var(--web-accent-dark);
  font-size: 30px;
}
.storyboard-prompt-field {
  min-height: 200px;
  height: 200px;
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 3px;
  box-sizing: border-box;
}
.storyboard-prompt-field > span,
.storyboard-reference-upload > span:first-child {
  color: var(--web-text-placeholder);
  font-size: 10px;
}
.storyboard-prompt-field :deep(.asset-prompt-editor),
.storyboard-prompt-field :deep(.prompt-content) {
  height: 100%;
}
.storyboard-prompt-field :deep(.asset-prompt-editor) {
  min-width: 0;
  padding: 0;
}
.storyboard-prompt-field :deep(.prompt-content) {
  box-sizing: border-box;
  border: 1px solid var(--web-line-strong);
  border-radius: 7px;
  background: var(--web-surface-soft);
  color: var(--web-text-secondary);
  line-height: 1.65;
  scrollbar-gutter: stable;
  scrollbar-color: var(--web-scrollbar-thumb) var(--web-scrollbar-track);
  scrollbar-width: thin;
}
.storyboard-prompt-field :deep(.prompt-content:hover) {
  border-color: var(--web-line-emphasis);
}
.storyboard-prompt-field :deep(.prompt-content:focus) {
  border-color: var(--web-accent-dark);
  box-shadow: 0 0 0 1px var(--web-accent-dark);
}
.storyboard-reference-upload {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.storyboard-reference-upload .asset-reference-box {
  height: 72px;
  flex-basis: 72px;
}
.storyboard-media-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.storyboard-media-summary strong {
  color: var(--web-text);
  font-size: 13px;
}
.storyboard-media-summary span {
  color: var(--web-text-note);
  font-size: 10px;
}
.storyboard-media-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.asset-history {
  flex: 0 0 auto;
  padding: 0 12px 12px;
  background: var(--web-surface-soft);
}
.asset-history > header {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--web-text);
  font-size: 11px;
}
.asset-history > header small,
.asset-history-limit {
  color: var(--web-accent-dark);
  font-size: 9px;
}
.asset-history-list {
  min-height: 72px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: var(--web-scrollbar-thumb) var(--web-scrollbar-track-panel);
  scrollbar-width: thin;
}
.asset-history-list::-webkit-scrollbar {
  height: 7px;
}
.asset-history-list::-webkit-scrollbar-track {
  background: var(--web-surface);
  border-radius: 7px;
}
.asset-history-list::-webkit-scrollbar-thumb {
  background: var(--web-danger-soft);
  border: 2px solid var(--web-line-strong);
  border-radius: 7px;
}
.asset-history-item {
  position: relative;
  width: 82px;
  height: 72px;
  flex: 0 0 82px;
  overflow: hidden;
  background: var(--web-surface-soft);
  border: 1px solid var(--web-line-strong);
  border-radius: 6px;
}
.asset-history-item > img,
.asset-history-item > video,
.asset-history-item > :deep(.loading-media-element) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-history-item > video,
.asset-history-item > :deep(.loading-media-element) {
  pointer-events: none;
}
.asset-history-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--web-media-overlay-dense);
  opacity: 0;
  transition: opacity 0.15s;
}
.asset-history-item:hover .asset-history-actions,
.asset-history-item:focus-within .asset-history-actions {
  opacity: 1;
}
.asset-history-actions button {
  width: 20px;
  height: 20px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--web-text);
  background: var(--web-hover);
  border: 1px solid var(--web-line-emphasis);
  border-radius: 4px;
  cursor: pointer;
}
.asset-history-actions button:hover {
  color: var(--web-text-strong);
  background: var(--web-primary);
}
.asset-history-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.asset-history-empty {
  display: grid;
  min-width: 100%;
  place-items: center;
  color: var(--web-text-disabled);
  font-size: 10px;
}
.storyboard-video-assets {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.storyboard-video-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.storyboard-video-actions :deep(.duration-trigger) {
  width: 80px;
  flex: 0 0 80px;
}
.storyboard-video-generate {
  width: 100%;
  flex: 1;
}
.storyboard-video-limit {
  margin-top: -5px;
  color: var(--web-accent-dark);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}
.storyboard-video-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.storyboard-video-card {
  position: relative;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--web-text);
  background: var(--web-surface-soft);
  border: 1px solid var(--web-line-strong);
  border-radius: 7px;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
.storyboard-video-card:hover,
.storyboard-video-card:focus-within {
  color: var(--web-text);
  background: var(--web-surface);
  border-color: var(--web-line-emphasis);
}
.storyboard-video-card:focus-within {
  outline: 1px solid var(--web-switch-border);
  outline-offset: 1px;
}
.storyboard-video-card.active {
  border-color: var(--web-switch-border);
  background: var(--web-scrollbar-thumb-hover);
}
.storyboard-video-preview {
  position: relative;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.storyboard-video-card video,
.storyboard-video-card :deep(.loading-media-element),
.storyboard-video-loading {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--web-surface-soft);
  pointer-events: none;
}
.storyboard-video-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--web-text-media-muted);
}
.storyboard-video-loading .el-icon {
  animation: asset-spin 1s linear infinite;
}
.storyboard-video-card strong {
  padding: 7px 8px;
  font-size: 10px;
  font-weight: 500;
}
.storyboard-video-delete,
.storyboard-video-download {
  position: absolute;
  top: 5px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--web-text);
  background: var(--web-surface);
  border: 1px solid var(--web-line-emphasis);
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    background-color 0.15s,
    color 0.15s;
}
.storyboard-video-delete {
  right: 5px;
}
.storyboard-video-download {
  right: 34px;
}
.storyboard-video-card:hover .storyboard-video-delete,
.storyboard-video-card:hover .storyboard-video-download,
.storyboard-video-card:focus-within .storyboard-video-delete,
.storyboard-video-card:focus-within .storyboard-video-download {
  opacity: 1;
  pointer-events: auto;
}
.storyboard-video-delete:hover {
  color: var(--web-text-strong);
  background: var(--web-primary);
}
.storyboard-video-download:hover {
  color: var(--web-text-strong);
  background: var(--web-primary);
}
.storyboard-video-empty {
  grid-column: 1 / -1;
  padding: 28px 8px;
  text-align: center;
  color: var(--web-text-disabled);
  font-size: 11px;
}
.storyboard-video-player-launcher {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.storyboard-media-actions :deep(.el-button) {
  min-width: 0;
  margin-left: 0;
}
@media (max-width: 520px) {
  .storyboard-video-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (hover: none) {
  .asset-preview-actions {
    opacity: 1;
  }
  .storyboard-video-delete {
    opacity: 1;
    pointer-events: auto;
  }
}
