/* Script Creation 专用样式 */

/* 
 * 滑块样式已从 Slider 组件导入
 * 请使用 Slider 组件或从 Slider.css 导入样式
 */

/* 创作主题分组 */
.topic-category-title {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

.topic-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex: 1;
  align-content: start;
  overflow-y: auto;
}

.topic-groups .option-card {
  min-width: 0;
  padding: 10px 8px;
  font-size: var(--font-base);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.topic-groups .option-card-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
  text-align: left;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-groups .option-card-desc {
  font-size: 11px;
  color: #999;
  line-height: 1.3;
  text-align: left;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 选中态：左侧绿色竖条 + 浅绿背景 */
.topic-groups .option-card.selected {
  border-color: #22c55e;
  background: #f0fdf4;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
}

.topic-groups .option-card.selected::after {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: #22c55e;
  border-radius: 0 3px 3px 0;
}

.topic-groups .option-card.selected .option-card-label {
  color: #15803d;
}

.topic-groups .option-card.selected .option-card-desc {
  color: #4ade80;
}

/* 悬停态 */
.topic-groups .option-card:hover {
  border-color: #22c55e;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.1);
  transform: translateY(-1px);
}

/* 时长滑块容器 */
.duration-slider-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.duration-value {
  margin-left: var(--spacing-sm);
  font-size: var(--font-sm);
  color: var(--primary);
  font-weight: 600;
}

/* 时长刻度 */
.duration-marks {
  display: flex;
  justify-content: space-between;
  padding: 0 var(--spacing-2xs);
}

.duration-mark {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.duration-mark:hover {
  color: var(--primary);
  background: var(--bg-hover);
}

.duration-mark.active {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
  font-weight: 500;
}

/* 脚本编辑器头部 */
.script-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.script-editor-actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* 分镜展开/收起 */
.script-segment {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.script-segment:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
}

.script-segment.expanded {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-light);
}

/* 分镜头部 */
.segment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--bg-input);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.segment-header:hover {
  background: var(--bg-hover);
}

.segment-title-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.segment-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-sm);
}

.segment-duration {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  background: var(--bg-hover);
  padding: var(--spacing-2xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.segment-header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.expand-indicator {
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}

.script-segment.expanded .expand-indicator {
  transform: rotate(180deg);
}

/* 分镜内容区 */
.segment-body {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

/* 分镜字段 */
.segment-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.segment-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.segment-field-label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.segment-field-actions {
  display: flex;
  gap: var(--spacing-xs);
}

.segment-field-value {
  font-size: var(--font-sm);
  color: var(--text-primary);
  line-height: 1.6;
  padding: var(--spacing-sm);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: 60px;
}

.segment-field-value:hover {
  background: var(--bg-hover);
}

.segment-field textarea {
  font-size: var(--font-sm);
  line-height: 1.6;
  resize: vertical;
  min-height: 80px;
}

/* 分镜操作按钮 */
.segment-actions {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  flex-wrap: wrap;
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--border-light);
}

.segment-actions-divider {
  width: 1px;
  height: 16px;
  background: var(--border-color);
  margin: 0 var(--spacing-xs);
}

/* 危险操作按钮 */
.btn-danger {
  color: var(--error) !important;
}

.btn-danger:hover {
  background: rgb(239 68 68 / 10%) !important;
}

/* 超小按钮 */
.btn-xs {
  padding: var(--spacing-2xs) var(--spacing-xs);
  font-size: var(--font-xs);
  min-height: 28px;
}



/* 镜头类型标签 */
.shot-type-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-2xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Script Creation 布局优化 */
.script-creation .step-panel-left {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  height: 100%;
}

.script-creation .step-panel-left > .panel-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  min-height: 0;
}

/* 创作主题分类占满剩余空间 */
.script-creation .step-panel-left > .panel-section > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  min-height: 0;
}

/* 生成按钮和进度条紧跟内容 */
.script-creation .step-panel-left > button,
.script-creation .step-panel-left > .generation-progress {
  flex-shrink: 0;
}

.script-creation .step-panel-right {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* 响应式优化 */
@media (width <= 1024px) {
  .script-creation.step-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .script-creation .step-panel-left {
    max-height: 300px;
  }
}
