* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f0f2f5;
  min-height: 100vh;
  overflow-y: auto; /* 允许页面垂直滚动，让页脚可见 */
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 70px; /* 导航栏高度 */
}

.app-header {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  color: white;
  padding: 20px 30px;
  box-shadow: 0 4px 20px rgba(0, 102, 204, 0.3);
}

/* 避免logo样式冲突 */
.app-header .logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo svg {
  flex-shrink: 0;
}

.logo h1 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 4px;
}

.logo p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.app-main {
  flex: 1;
  display: flex;
  gap: 20px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* 样式库 */
.style-library {
  width: 380px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 700px;
}

.library-header {
  padding: 14px 18px;
  background: #f8f9fa;
  border-bottom: 1px solid #e8e8e8;
  font-weight: 600;
  color: #333;
  font-size: 15px;
  flex-shrink: 0;
}

.library-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  max-height: 650px;
}

.category {
  margin-bottom: 20px;
}

.category-title {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 3px solid #0066cc;
}

.style-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.style-item {
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e8e8e8;
}

.style-item:hover {
  background: #f0f7ff;
  border-color: #0066cc;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.style-item:active {
  transform: translateX(2px) scale(0.98);
}

.style-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.style-item .preview {
  pointer-events: none;
}

/* 编辑区 */
.editor-section {
  flex: 1;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 720px;
}

.editor-header {
  padding: 14px 18px;
  background: #f8f9fa;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-header span {
  font-weight: 600;
  color: #333;
  font-size: 15px;
}

.btn-clear {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-clear:hover {
  background: #fee;
  color: #f44;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

.toolbar-btn {
  padding: 8px 16px;
  border: 1px solid #e8e8e8;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  transition: all 0.2s;
}

.toolbar-btn:hover {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
}

.toolbar-separator {
  width: 1px;
  height: 28px;
  background: #e8e8e8;
  margin: 0 4px;
}

.toolbar-text {
  font-size: 13px;
  color: #666;
  align-self: center;
  margin-right: 8px;
}

.color-pickers-sm {
  display: flex;
  gap: 4px;
}

.color-picker-sm {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.color-picker-sm:hover {
  transform: scale(1.1);
  border-color: #0066cc;
}

.color-tip {
  background: linear-gradient(135deg, #e6f7ff 0%, #f0f7ff 100%);
  border: 1px solid #91cae4;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #333;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.color-panel {
  padding: 14px;
  background: #fafafa;
  border-bottom: 1px solid #e8e8e8;
}

.color-row {
  display: flex;
  gap: 30px;
}

.color-group {
  flex: 1;
}

.color-label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.color-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-picker {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: 3px solid transparent;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-picker:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.color-picker.active {
  border-color: #0066cc;
  transform: scale(1.1);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.3);
}

.current-color {
  margin-top: 10px;
  font-size: 12px;
  color: #888;
}

.current-color span {
  color: #0066cc;
  font-weight: 600;
}

.current-color-inline {
  font-size: 12px;
  color: #888;
  font-weight: normal;
  margin-left: 10px;
}

.current-color-inline span {
  color: #0066cc;
  font-weight: 600;
}

.editor-toolbar-wrapper {
  flex-shrink: 0;
  background: white;
  border-bottom: 1px solid #e8e8e8;
  overflow-y: auto;
}

.editor-toolbar-wrapper::-webkit-scrollbar,
.editor-content::-webkit-scrollbar {
  width: 6px;
}

.editor-toolbar-wrapper::-webkit-scrollbar-track,
.editor-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.editor-toolbar-wrapper::-webkit-scrollbar-thumb,
.editor-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.editor-toolbar-wrapper::-webkit-scrollbar-thumb:hover,
.editor-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.editor-content {
  flex: 1;
  min-height: 200px;
  padding: 24px;
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  outline: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.editor-content:focus {
  background: #fff;
}

.editor-content .placeholder {
  color: #ccc;
  font-style: italic;
}

.editor-content h1 {
  font-size: 28px;
  font-weight: bold;
  margin: 24px 0 16px;
  color: #1a1a1a;
}

.editor-content h2 {
  font-size: 22px;
  font-weight: bold;
  margin: 20px 0 14px;
  color: #1a1a1a;
}

.editor-content p {
  margin-bottom: 1em;
}

.editor-content blockquote {
  margin: 16px 0;
  padding: 14px 18px;
  color: #666;
  font-style: italic;
}

.editor-content div {
  margin: 16px 0;
}

.editor-content img {
  border-radius: 8px;
  object-fit: cover;
}

.editor-content hr {
  border: none;
  margin: 24px 0;
}

.editor-content ul, .editor-content ol {
  padding-left: 24px;
  margin: 12px 0;
}

.editor-content li {
  margin: 8px 0;
}

.editor-footer {
  padding: 20px;
  background: #f8f9fa;
  border-top: 1px solid #e8e8e8;
  display: flex;
  justify-content: center;
}

.btn-copy {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  color: white;
  padding: 16px 48px;
  border-radius: 30px;
  font-weight: 500;
  font-size: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
  transition: all 0.3s;
}

.btn-copy:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.btn-copy:active {
  transform: translateY(-1px);
}

.btn-copy.success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.app-footer {
  background: #1a1a1a;
  color: #888;
  text-align: center;
  padding: 20px;
  font-size: 14px;
}

/* 滚动条 */
.library-content::-webkit-scrollbar,
.editor-content::-webkit-scrollbar {
  width: 6px;
}

.library-content::-webkit-scrollbar-track,
.editor-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.library-content::-webkit-scrollbar-thumb,
.editor-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.library-content::-webkit-scrollbar-thumb:hover,
.editor-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 拖拽提示 */
.editor-content.drag-over {
  background: #f0f7ff;
  outline: 2px dashed #0066cc;
  outline-offset: -8px;
}

/* 响应式 */
@media (max-width: 900px) {
  .app-main {
    flex-direction: column;
  }
  
  .style-library {
    width: 100%;
    max-height: 400px;
  }
  
  .library-content {
    max-height: 340px;
  }
}
