/* 资产面板核心样式，负责面板主体、资产卡片和编辑器基础布局。 */
.asset-panel {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--web-surface-soft);
  border: 1px solid var(--web-line-strong);
  border-radius: 11px;
  overflow: hidden;
  scrollbar-color: var(--web-scrollbar-thumb) var(--web-scrollbar-track-panel);
  scrollbar-width: thin;
}
.asset-panel > header {
  height: 40px;
  padding: 0 12px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 40px;
  border-bottom: 1px solid var(--web-line-strong);
}
.asset-panel header div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.asset-panel header span {
  color: var(--web-accent-dark);
  font:
    11px Arial,
    sans-serif;
}
.asset-panel header button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--web-text-secondary);
  background: var(--web-surface);
  border: 1px solid var(--web-line-strong);
  border-radius: 6px;
  cursor: pointer;
}
.asset-panel header button:disabled {
  color: var(--web-text-subdued);
  border-color: var(--web-line-strong);
  cursor: not-allowed;
}
.asset-detail-header {
  justify-content: flex-start !important;
  gap: 9px;
}
.asset-detail-header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--web-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-tabs {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  border-bottom: 1px solid var(--web-line-strong);
}
.asset-tabs.has-media {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.asset-tabs button {
  min-width: 0;
  height: 32px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--web-text-note);
  background: var(--web-surface);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 10px;
  cursor: pointer;
}
.asset-tabs button > .el-icon {
  font-size: 15px;
}
.asset-tabs button.active {
  color: var(--web-accent-dark);
  background: var(--web-surface);
  border-color: var(--web-line-emphasis);
}
.asset-tabs small {
  font:
    9px Arial,
    sans-serif;
}
.asset-list {
  min-height: 86px;
  padding: 10px;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  scrollbar-color: var(--web-scrollbar-thumb) var(--web-scrollbar-track-panel);
  scrollbar-width: thin;
}
.asset-section {
  min-width: 0;
}
.asset-section-header {
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--web-text-caption);
}
.asset-section-header strong {
  font-size: 10px;
  font-weight: 600;
}
.asset-section-header span {
  font:
    9px Arial,
    sans-serif;
}
.asset-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}
.episode-assets .asset-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.asset-section-empty {
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--web-text-neutral);
  background: var(--web-surface-soft);
  border: 1px dashed var(--web-line-strong);
  border-radius: 6px;
  font-size: 9px;
}
.asset-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--web-surface);
  border: 1px solid var(--web-line-strong);
  border-radius: 7px;
  transition:
    border-color 0.16s,
    background-color 0.16s;
}
.asset-card:hover,
.asset-card:focus-within {
  background: var(--web-surface);
  border-color: var(--web-line-emphasis);
}
.asset-card-main {
  width: 100%;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--web-text-secondary);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.episode-assets .asset-card-main {
  padding: 4px;
  gap: 4px;
}
.asset-card-main:focus-visible {
  outline: 2px solid var(--web-focus-ring-strong);
  outline-offset: -2px;
}
.asset-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--web-hover);
  border-radius: 5px;
}
.asset-thumb img,
.asset-thumb video,
.asset-thumb :deep(.loading-media-element) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-thumb i {
  color: var(--web-accent-dark);
  font-size: 25px;
  font-style: normal;
}
.episode-assets .asset-thumb i {
  font-size: 18px;
}
.asset-copy {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
}
.asset-copy b {
  min-width: 0;
  overflow: hidden;
  flex: 1;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.episode-assets .asset-copy b {
  font-size: 9px;
}
.asset-audio-badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 2;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  grid-auto-flow: column;
  place-items: center;
  gap: 3px;
  color: var(--web-accent-dark);
  background: var(--web-media-overlay);
  border: 1px solid var(--web-line-emphasis);
  border-radius: 10px;
}
.asset-audio-badge small,
.asset-preview-audio-badge small {
  font-size: 9px;
  white-space: nowrap;
}
.asset-empty {
  min-height: 68px;
  display: grid;
  place-items: center;
  color: var(--web-text-tertiary);
  font-size: 11px;
}
.asset-editor {
  min-height: 0;
  padding: 12px;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  background: var(--web-surface-soft);
  scrollbar-color: var(--web-scrollbar-thumb) var(--web-scrollbar-track-panel);
  scrollbar-width: thin;
}
.asset-preview {
  position: relative;
  width: 100%;
  height: 150px;
  display: grid;
  place-items: center;
  flex: 0 0 150px;
  overflow: hidden;
  color: var(--web-accent-dark);
  background: var(--web-surface-soft);
  border: 1px solid var(--web-line-strong);
  border-radius: 8px;
}
.asset-preview > img,
.asset-preview > video,
.asset-preview > :deep(.loading-media-element) {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.asset-preview > i {
  font-size: 32px;
  font-style: normal;
}
.asset-preview-audio-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  display: grid;
  grid-auto-flow: column;
  place-items: center;
  gap: 4px;
  color: var(--web-accent-dark);
  background: var(--web-media-overlay);
  border: 1px solid var(--web-line-emphasis);
  border-radius: 12px;
}
.asset-preview-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--web-preview-overlay);
  opacity: 0;
  transition: opacity 0.18s;
}
.asset-preview:hover .asset-preview-actions,
.asset-preview:focus-within .asset-preview-actions {
  opacity: 1;
}
.asset-preview-actions label,
.asset-preview-actions button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--web-text);
  background: var(--web-surface);
  border: 1px solid var(--web-line-strong);
  border-radius: 50%;
  cursor: pointer;
}
.asset-preview-actions label:hover,
.asset-preview-actions button:hover {
  color: var(--web-accent-dark);
  border-color: var(--web-line-accent);
}
.asset-preview-actions label.disabled,
.asset-preview-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.asset-preview-actions input,
.audio-upload input {
  display: none;
}
.asset-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}
.asset-editor:not(.storyboard-media-editor) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: start;
}
.asset-editor:not(.storyboard-media-editor) > .prompt-field,
.asset-editor:not(.storyboard-media-editor) > .asset-actions,
.asset-editor:not(.storyboard-media-editor) > .asset-preview {
  grid-column: 1 / -1;
}
.asset-reference-upload {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--web-text-subtle);
  font-size: 10px;
}
.asset-reference-box {
  position: relative;
  width: 100%;
  height: 92px;
  flex: 0 0 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  color: var(--web-accent-dark);
  background: var(--web-surface-soft);
  border: 1px dashed var(--web-line-strong);
  border-radius: 7px;
  cursor: pointer;
}
.asset-reference-box img,
.asset-reference-box :deep(.loading-media-element) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-reference-box input {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  cursor: pointer;
}
.asset-reference-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--web-accent-dark);
  background: var(--web-error-overlay);
  border: 1px solid var(--web-line-critical);
  border-radius: 50%;
  cursor: pointer;
}
.asset-editor:not(.storyboard-media-editor) > .asset-name-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.asset-name-row > label,
.asset-editor > label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.asset-name-row label > span:first-child,
.asset-editor > label > span {
  color: var(--web-text-subtle);
  font-size: 10px;
}
.audio-upload {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--web-text-secondary);
  background: var(--web-surface-soft);
  border: 1px solid var(--web-line-strong);
  border-radius: 6px;
  font-size: 10px;
  cursor: pointer;
}
.audio-upload:hover {
  color: var(--web-accent-dark);
  border-color: var(--web-line-emphasis);
}
.asset-editor .prompt-field {
  height: 260px;
  min-height: 260px;
  flex: 0 0 260px;
}
.prompt-field :deep(.el-textarea),
.prompt-field :deep(.el-textarea__inner) {
  height: 100%;
  scrollbar-color: var(--web-scrollbar-thumb) var(--web-scrollbar-track);
  scrollbar-width: thin;
}
.asset-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
}
.asset-detail-enter-active,
.asset-detail-leave-active {
  transition:
    opacity 0.18s,
    transform 0.18s;
}
.asset-detail-enter-from,
.asset-detail-leave-to {
  opacity: 0;
  transform: translateX(16px);
}
@media (max-width: 820px) {
  .asset-editor:not(.storyboard-media-editor) {
    display: flex;
  }
  .asset-name-row {
    grid-template-columns: 1fr;
  }
}
