/* components/RichEditor/index.css */
.rich-editor-wrapper {
  position: relative;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.3s;
  background: #fff;
}

.rich-editor-wrapper:hover {
  border-color: #4096ff;
}

.rich-editor-wrapper:focus-within {
  border-color: #4096ff;
  box-shadow: 0 0 0 2px rgba(64, 150, 255, 0.2);
}

.rich-editor-wrapper .tox-tinymce {
  border: none !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rich-editor-wrapper .tox-editor-header {
  border-bottom: 1px solid #e8e8e8 !important;
  background: #fafafa !important;
}

.rich-editor-wrapper .tox-toolbar__primary {
  background: #fafafa !important;
}

.rich-editor-wrapper .tox-statusbar {
  border-top: 1px solid #e8e8e8 !important;
  background: #fafafa !important;
}

/* 自定义按钮样式 */
.rich-editor-wrapper .tox-tbtn--enabled {
  background: transparent !important;
}

.rich-editor-wrapper .tox-tbtn--enabled:hover {
  background: #e6f7ff !important;
  border-color: #91d5ff !important;
}

.rich-editor-wrapper .tox-tbtn--enabled:active {
  background: #bae7ff !important;
}

/* 上传状态覆盖层 */
.upload-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.upload-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1890ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.upload-spinner span {
  color: #666;
  font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .rich-editor-wrapper .tox-toolbar__primary {
    flex-wrap: wrap;
  }

  .rich-editor-wrapper .tox-toolbar__group {
    margin: 2px;
  }
}

/* 图片样式优化 */
.rich-editor-wrapper .tox-edit-area img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 4px 0;
  cursor: pointer;
  transition: transform 0.2s;
}

.rich-editor-wrapper .tox-edit-area img:hover {
  transform: scale(1.02);
}

/* 表格样式优化 */
.rich-editor-wrapper .tox-edit-area table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rich-editor-wrapper .tox-edit-area table td,
.rich-editor-wrapper .tox-edit-area table th {
  border: 1px solid #e8e8e8;
  padding: 8px 12px;
}

.rich-editor-wrapper .tox-edit-area table th {
  background-color: #fafafa;
  font-weight: 600;
}
