/* ============================================
   编辑器样式
   ============================================ */

.editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
  margin: 8px 8px 0 8px;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  box-shadow: var(--shadow-sm);
}

/* 编辑器工具栏 */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-surface-hover);
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
  flex-shrink: 0;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-btn {
  padding: 4px 10px;
  border-radius: var(--border-radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.toolbar-btn:hover {
  background: var(--bg-body);
  color: var(--text-primary);
}
.toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.toolbar-btn.warning {
  color: var(--danger);
}
.toolbar-btn.warning:hover {
  background: var(--danger-bg);
}
.toolbar-btn.review-btn {
  color: var(--accent-dark);
}
.toolbar-btn.review-btn:hover {
  background: rgba(0,206,201,0.1);
}

.toolbar-separator {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 4px;
}

.chapter-indicator {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  padding: 2px 8px;
  background: var(--primary-bg);
  border-radius: 4px;
}

.selection-count {
  font-size: 11px;
  color: var(--text-muted);
}

.ai-score-indicator {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-body);
}

/* 编辑器主体 */
.editor-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.editor-content {
  min-height: 100%;
  padding: 30px 50px;
  font-family: var(--editor-font-family);
  font-size: var(--editor-font-size);
  line-height: var(--editor-line-height);
  color: var(--editor-font-color);
  background: var(--editor-bg);
  white-space: pre-wrap;
  word-wrap: break-word;
  outline: none;
  transition: font-size var(--transition-fast), font-family var(--transition-fast);
}
.editor-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  font-style: italic;
}

/* AI输出区域（在正文编辑器内部） */
.ai-output-area {
  margin: 20px 50px;
  border: 2px dashed var(--primary-light);
  border-radius: var(--border-radius);
  background: linear-gradient(to bottom, rgba(108,92,231,0.03), rgba(0,206,201,0.03));
  animation: ai-output-appear 0.3s ease;
}

.ai-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary-bg), rgba(0,206,201,0.08));
  border-bottom: 1px solid var(--primary-light);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-output-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.ai-output-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-output-score {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-body);
  color: var(--text-secondary);
}

.ai-action-btn {
  padding: 4px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.ai-action-btn.accept {
  background: var(--success);
  color: white;
}
.ai-action-btn.accept:hover {
  background: #00a382;
}
.ai-action-btn.reject {
  background: var(--bg-surface-hover);
  color: var(--danger);
  border: 1px solid var(--danger-light);
}
.ai-action-btn.reject:hover {
  background: var(--danger-bg);
}
.ai-action-btn.review {
  background: var(--bg-surface-hover);
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}
.ai-action-btn.review:hover {
  background: rgba(0,206,201,0.1);
}

.ai-output-content {
  padding: 20px;
  font-family: var(--editor-font-family);
  font-size: var(--editor-font-size);
  line-height: var(--editor-line-height);
  color: var(--editor-font-color);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 生成进度条 */
.generation-progress {
  padding: 12px 20px;
  background: var(--bg-surface-hover);
  border-top: 1px solid var(--border-light);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 4px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}
.progress-step.active {
  color: var(--primary);
  font-weight: 600;
}
.progress-step.done {
  color: var(--success);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.progress-step.active .step-dot {
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary-light);
  animation: pulse 1.5s infinite;
}
.progress-step.done .step-dot {
  background: var(--success);
}

.step-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar-container {
  height: 4px;
  background: var(--bg-body);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}
