
/* 编辑器区域布局 */
.editor-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 中间预览大图 */
.main-preview-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.preview-wrapper {
  width: 80%; /* 用户要求80% */
  max-width: 600px;
  height: 400px; /* 固定高度，形成滚动窗口 */
  background-color: #f3f4f6;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
  display: flex;
  /* 移除 align-items: center，允许内容撑开或滚动 */
  justify-content: center; /* 水平居中 */
  overflow: auto; /* 允许滚动 */
  position: relative;
  /* 增加内边距，好看点 */
  padding: 10px;
}

.preview-wrapper img {
  /* 移除 max-height 限制，允许垂直滚动 */
  max-width: 100%; 
  height: auto;
  object-fit: contain;
  display: block;
  /* 默认隐藏，有图时JS显示 */
}

.preview-placeholder {
  position: absolute;
  color: #9ca3af;
  font-size: 14px;
  pointer-events: none;
}

/* 底部面板 */
.bottom-panel {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

/* 可拖拽列表容器 */
.sortable-list-container {
  margin-bottom: 20px;
}

.sortable-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px;
  scroll-behavior: smooth;
  /* 隐藏滚动条但保留功能 */
  scrollbar-width: thin;
}

.sortable-list::-webkit-scrollbar {
  height: 6px;
}
.sortable-list::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 3px;
}

.sort-item {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: grab;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
  touch-action: none; /* 关键：阻止浏览器默认触摸行为 */
}

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

.sort-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  cursor: grabbing;
}

.sort-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* 防止图片拖拽干扰 */
}

.drag-hint {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
}

/* 底部控制栏 */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  flex-wrap: wrap;
  gap: 16px;
}

.action-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-group .label {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.radio-group {
  display: flex;
  gap: 16px;
}

.radio-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #4b5563;
  cursor: pointer;
}

.radio-btn input[type="radio"] {
  accent-color: #2563eb;
  width: 16px;
  height: 16px;
}

.secondary-button {
  background-color: #ffffff;
  color: #1890ff;
  border: 1px solid #1890ff;
  border-radius: 8px;
  height: 48px;
  min-width: 120px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-button:hover {
  background-color: #e6f7ff;
  border-color: #40a9ff;
  color: #40a9ff;
}

.secondary-button:active {
  background-color: #bae7ff;
}

.save-button {
  background-color: #1890ff;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  height: 48px;
  min-width: 120px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.save-button:hover {
  background-color: #096dd9;
}

.save-button:active {
  background-color: #0050b3;
}

.save-button:disabled {
  background-color: #bfbfbf;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .preview-wrapper {
    width: 100%; /* 移动端占满 */
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    justify-content: center;
  }

  .save-button {
    width: 100%;
  }
}
