/**
 * File: client/css/video-editor.css
 * 视频编辑器样式 - Apple风格
 * 作用: 定义第11步视频合成界面的完整样式，包括四区布局、媒体库、预览区、属性面板、时间轴
 * @date 2025-12-07
 * @modification Apple风格白色主题，使用CSS变量
 * @date 2025-12-09
 */

/* ==========================================
   覆盖父容器样式 - 全宽但保留导航和步骤条
   @modification 适配新的左侧导航布局
   @date 2025-12-09
   ========================================== */
#video-composition-panel {
  position: fixed !important;
  top: 52px !important;
  left: var(--sidebar-width, 220px) !important;
  right: 0 !important;
  bottom: 0 !important;
  width: calc(100vw - var(--sidebar-width, 220px)) !important;
  height: calc(100vh - 52px) !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 100;
  background: var(--bg-secondary);
}

#video-composition-panel .panel-title {
  display: none;
}

/* ==========================================
   视频编辑器 - 主容器 - Apple风格
   @modification 使用CSS变量
   @date 2025-12-09
   ========================================== */
.video-editor-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  overflow: hidden;
  color: var(--text-primary);
  font-family: var(--font-family);
}

/* ==========================================
   顶部工具栏 - Apple风格
   @modification 使用CSS变量
   @date 2025-12-09
   ========================================== */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  height: 52px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-toolbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/**
 * @description 编辑器按钮 - Apple风格
 * @date 2025-12-09
 */
.editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.editor-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

.editor-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.editor-btn-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.editor-btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.editor-btn-success {
  background: var(--success-color);
  border-color: var(--success-color);
  color: #fff;
}

.editor-btn-success:hover {
  filter: brightness(1.1);
}

.editor-btn-icon {
  padding: 8px;
  min-width: 36px;
}

/* ==========================================
   主内容区 - 三栏布局
   ========================================== */
.editor-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  background: #e8e8e8;
  min-height: 0; /* 修复flex溢出问题 */
}

/* ==========================================
   左侧 - 媒体库 - Apple风格
   @modification 使用CSS变量
   @date 2025-12-09
   ========================================== */
.editor-sidebar-left {
  width: 280px;
  min-width: 220px;
  max-width: 400px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  resize: horizontal;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-primary);
}

.sidebar-tab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}

.sidebar-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

.sidebar-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-secondary);
}

/* 媒体库网格 - Apple风格 */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.media-item {
  position: relative;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: grab;
  transition: all 0.15s ease;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.media-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.media-item:active {
  cursor: grabbing;
}

.media-item.dragging {
  opacity: 0.5;
  border-color: var(--primary-color);
}

.media-item-preview {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #f0f0f0;
}

.media-item-preview img,
.media-item-preview video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item-preview .audio-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  color: #16a34a;
}

.media-item-info {
  padding: 8px;
  background: #fff;
}

.media-item-name {
  font-size: 11px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-item-duration {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
  font-family: 'SF Mono', Monaco, monospace;
}

.media-item-type {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
  font-size: 9px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.media-item-type.video {
  background: #dc2626;
}

.media-item-type.audio {
  background: #16a34a;
}

.media-item-type.image {
  background: #2563eb;
}

/* 空状态 */
.media-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #999;
  text-align: center;
}

.media-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.media-empty-text {
  font-size: 13px;
  color: #666;
}

.media-empty-hint {
  font-size: 11px;
  margin-top: 8px;
  color: #999;
  line-height: 1.5;
}

/* ==========================================
   中间 - 预览区
   ========================================== */
.editor-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  min-width: 400px;
  min-height: 0; /* 修复flex子元素溢出问题 */
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0; /* 防止被压缩 */
}

.preview-aspect-ratio {
  display: flex;
  gap: 4px;
  background: #f0f0f0;
  padding: 2px;
  border-radius: 6px;
}

.aspect-btn {
  padding: 4px 12px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #888;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.aspect-btn:hover {
  color: #555;
}

.aspect-btn.active {
  background: #2563eb;
  color: #fff;
}

.preview-canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /**
   * @description 移除内边距，使预览视频可以填满整个黑色区域高度
   * @date 2025-12-09
   */
  padding: 0;
  background: #0a0a0a;
  min-height: 200px;
  overflow: hidden;
}

.preview-canvas-container {
  position: relative;
  background: #000;
  /**
   * @description 移除阴影和圆角，使视频和黑色区域完全融合
   * @date 2025-12-09
   */
  box-shadow: none;
  border-radius: 0;
  overflow: hidden;
  /* 移除最大尺寸限制，让容器可以填满 */
  max-width: 100%;
  max-height: 100%;
}

/**
 * @description 基于高度计算宽度，保持精确比例，视频高度填满黑色区域
 * @modification 使用100%高度填满父容器
 * @date 2025-12-09
 */
.preview-canvas-container.ratio-16-9 {
  height: 100%;
  width: auto;
  aspect-ratio: 16 / 9;
}

.preview-canvas-container.ratio-9-16 {
  height: 100%;
  width: auto;
  aspect-ratio: 9 / 16;
}

#previewCanvas {
  width: 100%;
  height: 100%;
  background: #000;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

/**
 * @description 修复预览提示层级问题，播放时隐藏提示
 * @date 2025-12-07
 */
.preview-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #555;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.preview-empty.hidden {
  opacity: 0;
  visibility: hidden;
}

.preview-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.preview-empty-text {
  font-size: 13px;
  color: #666;
}

/* 预览控制栏 */
.preview-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0; /* 防止被压缩 */
  min-height: 60px;
}

.preview-time {
  font-size: 12px;
  color: #666;
  font-family: 'SF Mono', Monaco, monospace;
  min-width: 80px;
  text-align: center;
}

.preview-control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 50%;
  color: #555;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preview-control-btn:hover {
  background: #e8e8e8;
  color: #333;
}

.preview-control-btn.play-btn {
  width: 44px;
  height: 44px;
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.preview-control-btn.play-btn:hover {
  background: #1d4ed8;
}

/* ==========================================
   右侧 - 属性面板
   ========================================== */
.editor-sidebar-right {
  width: 260px;
  min-width: 200px;
  max-width: 350px;
  background: #fff;
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  resize: horizontal;
  overflow: hidden;
}

.property-section {
  border-bottom: 1px solid #e0e0e0;
}

.property-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fafafa;
  cursor: pointer;
}

.property-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-section-toggle {
  color: #999;
  font-size: 12px;
}

.property-section-content {
  padding: 12px 16px;
  background: #fff;
}

.property-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.property-row:last-child {
  margin-bottom: 0;
}

.property-label {
  width: 60px;
  font-size: 11px;
  color: #888;
}

.property-value {
  flex: 1;
  font-size: 12px;
  color: #333;
}

.property-input {
  width: 100%;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  color: #333;
  font-size: 12px;
  font-family: 'SF Mono', Monaco, monospace;
}

.property-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.property-slider-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.property-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  outline: none;
}

.property-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.property-slider-value {
  min-width: 40px;
  text-align: right;
  font-size: 11px;
  color: #666;
  font-family: 'SF Mono', Monaco, monospace;
}

/* 无选中状态 */
.property-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #999;
  text-align: center;
  padding: 20px;
}

.property-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.property-empty-text {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
}

/* ==========================================
   底部 - 时间轴
   ========================================== */
.editor-timeline {
  height: 220px;
  min-height: 180px;
  max-height: 400px;
  background: #fff;
  border-top: 1px solid #d0d0d0;
  display: flex;
  flex-direction: column;
  resize: vertical;
  overflow: hidden;
  flex-shrink: 0;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #fafafa;
  border-bottom: 1px solid #e0e0e0;
}

.timeline-tools {
  display: flex;
  gap: 4px;
}

.timeline-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timeline-tool-btn:hover {
  background: #f0f0f0;
  color: #555;
}

.timeline-tool-btn.active {
  background: #2563eb;
  color: #fff;
}

.timeline-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-zoom-slider {
  width: 100px;
  -webkit-appearance: none;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  outline: none;
}

.timeline-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
}

.timeline-zoom-label {
  font-size: 11px;
  color: #888;
  min-width: 35px;
}

.timeline-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 轨道标签区 */
.timeline-track-labels {
  width: 140px;
  min-width: 120px;
  background: #fafafa;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  /**
   * @description 添加顶部内边距，与时间刻度高度(24px+1px边框)对齐
   * @date 2025-12-08
   */
  padding-top: 25px;
}

.track-label {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid #eee;
  font-size: 11px;
  color: #555;
  gap: 8px;
}

.track-label-icon {
  font-size: 12px;
  opacity: 0.7;
}

.track-label-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-label-actions {
  display: flex;
  gap: 2px;
}

.track-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  color: #999;
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
}

.track-action-btn:hover {
  background: #e8e8e8;
  color: #555;
}

.track-action-btn.muted {
  color: #dc2626;
}

/* 轨道内容区 */
.timeline-tracks-wrapper {
  flex: 1;
  overflow: auto;
  position: relative;
  background: #f5f5f5;
}

/* 时间刻度尺 */
.timeline-ruler {
  height: 24px;
  background: #fafafa;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.timeline-ruler-inner {
  height: 100%;
  position: relative;
}

.ruler-mark {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid #ddd;
}

.ruler-mark.major {
  border-left-color: #ccc;
}

.ruler-mark-label {
  position: absolute;
  top: 6px;
  left: 4px;
  font-size: 9px;
  color: #888;
  white-space: nowrap;
  font-family: 'SF Mono', Monaco, monospace;
}

/* 播放指针 */
.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dc2626;
  z-index: 20;
  cursor: ew-resize;
}

.timeline-playhead::before {
  content: '';
  position: absolute;
  top: 0;
  left: -5px;
  width: 12px;
  height: 12px;
  background: #dc2626;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

/* 轨道容器 */
.timeline-tracks {
  position: relative;
}

.timeline-track {
  height: 40px;
  border-bottom: 1px solid #eee;
  position: relative;
  background: #f8f8f8;
}

.timeline-track:nth-child(even) {
  background: #f0f0f0;
}

.timeline-track.drag-over {
  background: rgba(37, 99, 235, 0.1);
  border: 1px dashed #2563eb;
}

/**
 * @description 字幕轨道特殊样式
 * @date 2025-12-08
 */
.timeline-track-subtitle {
  background: #fef3c7 !important;
}

.track-label-subtitle {
  background: #fef9c3;
}

.track-label-subtitle .track-label-icon {
  opacity: 1;
}

.btn-auto-subtitle {
  background: #f59e0b !important;
  color: white !important;
  border-radius: 3px;
}

.btn-auto-subtitle:hover {
  background: #d97706 !important;
}

/* 轨道上的片段 */
.track-clip {
  position: absolute;
  top: 4px;
  height: 32px;
  background: #888;
  border-radius: 4px;
  cursor: move;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
  border: 1px solid rgba(0,0,0,0.1);
}

.track-clip:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.track-clip.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.track-clip.video {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.track-clip.audio {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.track-clip.text {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

/**
 * @description 字幕片段特殊样式
 * @date 2025-12-08
 */
.subtitle-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  overflow: hidden;
}

.clip-subtitle-text {
  font-size: 10px;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.clip-content {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 8px;
  gap: 6px;
}

.clip-name {
  flex: 1;
  font-size: 10px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.clip-duration {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'SF Mono', Monaco, monospace;
}

/* 片段调整手柄 */
.clip-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  background: rgba(255, 255, 255, 0.3);
  cursor: ew-resize;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.track-clip:hover .clip-handle {
  opacity: 1;
}

.clip-handle-left {
  left: 0;
  border-radius: 4px 0 0 4px;
}

.clip-handle-right {
  right: 0;
  border-radius: 0 4px 4px 0;
}

/* 音频波形 */
.clip-waveform {
  position: absolute;
  bottom: 2px;
  left: 8px;
  right: 8px;
  height: 10px;
  display: flex;
  align-items: flex-end;
  gap: 1px;
}

.waveform-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 1px;
}

/* ==========================================
   拖拽提示
   ========================================== */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  padding: 8px 12px;
  background: #2563eb;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   加载状态
   ========================================== */
.editor-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.editor-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0e0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: editor-spin 0.8s linear infinite;
}

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

.editor-loading-text {
  margin-top: 16px;
  font-size: 13px;
  color: #888;
}

/* ==========================================
   滚动条样式
   ========================================== */
.video-editor-container ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.video-editor-container ::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.video-editor-container ::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.video-editor-container ::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* ==========================================
   底部操作按钮区域（隐藏，工具栏已有）
   ========================================== */
.editor-footer {
  display: none;
}

/* ==========================================
   隐藏外部容器的限制
   ========================================== */
#video-composition-panel .step-header,
#video-composition-panel .step-footer {
  display: none !important;
}

/* ==========================================
   媒体片段属性面板
   @date 2025-12-08
   ========================================== */
.clip-properties {
  padding: 12px;
  background: #fff;
  overflow-y: auto;
}

/* ==========================================
   字幕属性面板
   @date 2025-12-08
   ========================================== */
.subtitle-properties {
  padding: 12px;
  background: #fff;
  height: 100%;
  overflow-y: auto;
}

.subtitle-properties .property-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.subtitle-properties .property-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.subtitle-properties .property-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subtitle-properties .property-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.subtitle-properties .property-row:last-child {
  margin-bottom: 0;
}

.subtitle-properties .property-label {
  width: 50px;
  font-size: 11px;
  color: #666;
  flex-shrink: 0;
}

.subtitle-properties .property-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.subtitle-properties .property-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.subtitle-properties .property-select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
}

.subtitle-properties .property-select:focus {
  outline: none;
  border-color: #2563eb;
}

.subtitle-properties .property-range {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  outline: none;
}

.subtitle-properties .property-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.subtitle-properties .property-value {
  min-width: 45px;
  text-align: right;
  font-size: 11px;
  color: #666;
  font-family: 'SF Mono', Monaco, monospace;
}

.subtitle-properties .property-color {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  -webkit-appearance: none;
}

.subtitle-properties .property-color::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.subtitle-properties .property-color::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.subtitle-properties .property-checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.subtitle-properties .property-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.subtitle-properties .property-checkbox-label {
  font-size: 12px;
  color: #333;
  cursor: pointer;
}

.subtitle-properties .property-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', Monaco, monospace;
}

.subtitle-properties .property-input:focus {
  outline: none;
  border-color: #2563eb;
}

.subtitle-properties .property-input[readonly] {
  background: #f5f5f5;
  color: #888;
}

.subtitle-properties .property-btn-group {
  display: flex;
  gap: 4px;
}

.subtitle-properties .property-btn {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subtitle-properties .property-btn:hover {
  background: #f5f5f5;
}

.subtitle-properties .property-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* 字幕预设样式按钮 */
.subtitle-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.subtitle-preset-btn {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.subtitle-preset-btn:hover {
  border-color: #2563eb;
  background: #f0f7ff;
}

.subtitle-preset-btn.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

/* ==========================================
   ASR字幕识别等待遮罩
   @date 2025-12-08
   ========================================== */
.asr-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.asr-loading-modal {
  background: rgba(30, 30, 30, 0.95);
  border-radius: 16px;
  padding: 40px 60px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.asr-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: asr-spin 1s linear infinite;
  margin: 0 auto 24px;
}

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

.asr-loading-title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.asr-loading-text {
  font-size: 14px;
  color: #f59e0b;
  margin-bottom: 8px;
}

.asr-loading-hint {
  font-size: 12px;
  color: #888;
}
