:root {
  --left-toolbar: 5%;
  --editor: 75%;
  --preview: 20%;
  --toolbar-height: 50px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f5f5f5;
}
.container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
/* 左侧工具栏 */
.left-toolbar {
  width: var(--left-toolbar);
  background: #ffffff;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
  overflow-y: auto;
}
.toolbar-btn {
  padding: 10px;
  border: 1px solid #d0d0d0;
  background: #fff;
  cursor: pointer;
  transition: all .2s;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  text-align: center;
}
.toolbar-btn:hover {
  background: #f0f0f0;
  border-color: #999;
}
/* 编辑器区域 */
.editor-section {
  width: var(--editor);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e0e0e0;
}
.editor-container {
  height: 100%;
  overflow: hidden;
}
#vditor {
  height: 100%;
  border: none;
}
/* 预览区域 */
.preview-section {
  width: var(--preview);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.color-toolbar {
  height: var(--toolbar-height);
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  overflow-x: auto;
}
.color-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
}
.color-option:hover {
  transform: scale(1.1);
}
.color-option.active {
  border-color: #000;
  transform: scale(1.2);
}
.custom-color {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
  position: relative;
}
.custom-color::after {
  content: '+';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}
.preview-container {
  display: block; 
  height: auto;
  max-height: none;
  overflow-y: auto;
  padding: 10px;
}
.preview-image {
  width: 100%;
  margin-bottom: 10px;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  transition: all .3s;
}
.preview-image:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.preview-image img {
  width: 100%;
  height: auto;
  display: block;
}
.color-picker {
  display: none;
  position: absolute;
  z-index: 1000;
}
/* 响应式设计 */
@media (max-width: 1024px) {
  :root {
    --left-toolbar: 15%;
    --editor: 55%;
    --preview: 30%;
  }
  .toolbar-btn {
    font-size: 12px;
    padding: 8px 5px;
  }
}
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  .left-toolbar {
    width: 100%;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 5px;
    gap: 5px;
  }
  .toolbar-btn {
    flex-shrink: 0;
    padding: 6px 10px;
  }
  .editor-section {
    width: 100%;
    height: 50vh;
  }
  .preview-section {
    width: 100%;
    height: 40vh;
  }
}
@media (max-width: 480px) {
  .toolbar-btn {
    font-size: 11px;
    padding: 3px 6px;
  }
  .color-option {
    width: 18px;
    height: 18px;
  }
}