/* 剧集项目页样式，负责项目上下文栏、剧集卡片、导入区与创建选项的响应式布局。 */
.project-context-bar {
  min-height: var(--control-height-lg);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

.project-context-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.project-context-main strong {
  overflow: hidden;
  color: var(--web-text);
  font-size: 20px;
  font-weight: 650;
  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 {
  color: var(--web-text);
  border-color: var(--web-line-emphasis);
}

.model-warning {
  color: var(--creative-accent);
  border-color: var(--web-line-emphasis);
}

.setup-notice {
  margin-bottom: 16px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--web-surface);
  border: 1px solid var(--web-line-strong);
  border-radius: 10px;
}

.setup-notice div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setup-notice span {
  color: var(--web-text-caption);
  font-size: 12px;
}

.episode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-md);
}

.episode-card {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--web-surface);
  border: 1px solid var(--web-line-strong);
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.episode-card:hover,
.episode-card:focus-visible {
  border-color: var(--web-switch-border);
  outline: none;
}

.episode-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--web-surface-raised);
  border-bottom: 1px solid var(--web-line-strong);
}

.episode-cover video,
.episode-cover :deep(.loading-media-element) {
  height: 100%;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.episode-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--web-episode-placeholder);
}

.episode-status {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  color: var(--web-episode-status-text);
  background: var(--web-surface);
  border: 1px solid var(--web-line-strong);
  border-radius: 5px;
  font-size: 11px;
}

.episode-status.active {
  color: var(--web-project-tooltip-accent);
}

.episode-copy {
  min-width: 0;
  padding: 10px 12px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.episode-title-row {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
}

.episode-title-row h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.episode-title-row input {
  width: min(240px, 100%);
  height: 28px;
  padding: 0 8px;
  color: var(--web-text);
  background: var(--web-surface);
  border: 1px solid var(--web-line-emphasis);
  border-radius: 6px;
  outline: none;
}

.episode-title-row button {
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  color: var(--web-text-caption);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.episode-title-row button:hover,
.episode-title-row button:focus-visible {
  color: var(--web-accent-dark);
  background: var(--web-surface);
  outline: 1px solid var(--web-line-emphasis);
}

.episode-delete {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  color: var(--web-episode-copy);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.episode-delete:hover {
  background: var(--web-episode-copy-hover);
}

.episode-meta {
  padding: 0 12px 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--web-project-tooltip-label);
  font-size: 11px;
}

.episode-meta span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-empty {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  color: var(--web-text-tertiary);
  background: var(--web-surface);
  border: 1px dashed var(--web-line-emphasis);
  border-radius: var(--radius-lg);
}

.episode-empty strong {
  color: var(--web-text-secondary);
  font-size: 15px;
}

.creation-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.creation-options button {
  min-width: 0;
  padding: 18px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--web-text-secondary);
  text-align: left;
  background: var(--web-surface-soft);
  border: 1px solid var(--web-line-strong);
  border-radius: 10px;
  cursor: pointer;
}

.creation-options button:hover,
.creation-options button:focus-visible {
  color: var(--web-accent-muted);
  border-color: var(--web-line-emphasis);
  outline: none;
}

.creation-options button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.creation-options button > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.creation-options strong {
  font-size: 14px;
}

.creation-options small {
  color: var(--web-text-hint);
  font-size: 12px;
  line-height: 1.6;
}

.creation-option-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  color: var(--web-accent-dark);
  background: var(--web-surface);
  border: 1px solid var(--web-line-emphasis);
  border-radius: 8px;
}

.import-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.import-tabs :deep(.el-tabs__header) {
  margin: 0 0 18px;
}

.import-tabs :deep(.el-tabs__nav-wrap::after) {
  height: 1px;
  background: var(--web-hover);
}

.import-tabs :deep(.el-tabs__item) {
  height: 44px;
  color: var(--web-text-note);
  font-size: 13px;
}

.import-tabs :deep(.el-tabs__item:hover),
.import-tabs :deep(.el-tabs__item.is-active) {
  color: var(--web-accent-dark);
}

.import-tabs :deep(.el-tabs__active-bar) {
  height: 2px;
  background: var(--web-primary);
}

.import-tab-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.import-dialog-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--web-text);
  font-size: 18px;
  line-height: 24px;
}

.import-help {
  color: var(--web-text-caption);
  cursor: help;
}

.import-help:focus-visible {
  color: var(--web-accent-dark);
  outline: 1px solid var(--web-primary);
  outline-offset: 2px;
  border-radius: 50%;
}

.import-upload :deep(.el-upload),
.import-upload :deep(.el-upload-dragger) {
  width: 100%;
}

.import-upload :deep(.el-upload-dragger) {
  min-height: 250px;
  padding: 54px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--web-text-secondary);
  background: var(--web-surface-soft);
  border-color: var(--web-line-strong);
}

.import-upload :deep(.el-upload-dragger:hover) {
  border-color: var(--web-switch-border);
}

.import-upload :deep(.el-upload-dragger .el-icon--upload) {
  margin: 0 0 14px;
  color: var(--web-control-muted);
}

.import-upload :deep(.el-upload-dragger small) {
  margin-top: 8px;
  color: var(--web-text-disabled);
  font-size: 11px;
}

:deep(.import-dialog .el-upload-dragger.is-dragover),
:deep(.import-dialog.page-drag-active .el-upload-dragger) {
  color: var(--web-accent-muted) !important;
  background: var(--web-surface) !important;
  border-color: var(--web-primary) !important;
  box-shadow: inset 0 0 0 1px var(--web-focus-inset);
}

:deep(.import-dialog .el-upload-dragger.is-dragover .el-icon--upload),
:deep(.import-dialog.page-drag-active .el-upload-dragger .el-icon--upload) {
  color: var(--web-accent-dark);
}

.import-preview > strong {
  color: var(--web-text);
}

.import-preview > p {
  color: var(--web-text-input-placeholder);
}

.chapter-list {
  max-height: 240px;
  margin-bottom: 16px;
  overflow: auto;
  border: 1px solid var(--web-line-strong);
  border-radius: 8px;
}

.chapter-list span {
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  color: var(--web-text-secondary);
  border-bottom: 1px solid var(--web-line-strong);
  font-size: 12px;
}

.chapter-list span:last-child {
  border-bottom: 0;
}

.chapter-list small {
  color: var(--web-text-tertiary);
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767px) {
  .creation-options {
    grid-template-columns: 1fr;
  }

  .episode-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .setup-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-context-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-context-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .import-upload :deep(.el-upload-dragger) {
    min-height: 210px;
    padding: 40px 16px;
  }
}
