/**
 * 优雅草 HTML 编辑器 (yeditor) - 样式
 * 成都市一颗优雅草科技有限公司 · 卓伊凡
 * https://gitee.com/youyacao/yeditor
 */

.yeditor-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.yeditor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
  border-bottom: 1px solid #e0e4e8;
}

.yeditor-toolbar .yeditor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #495057;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.yeditor-toolbar .yeditor-btn:hover {
  background: #e9ecef;
  color: #212529;
}

.yeditor-toolbar .yeditor-btn.active {
  background: #dee2e6;
  color: #212529;
}

.yeditor-toolbar .yeditor-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.yeditor-toolbar .yeditor-divider {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: #dee2e6;
}

.yeditor-select-wrap {
  display: inline-flex;
  align-items: center;
}

.yeditor-toolbar .yeditor-select {
  height: 28px;
  padding: 0 6px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
  color: #495057;
  font-size: 13px;
  cursor: pointer;
  min-width: 56px;
}

.yeditor-color-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.yeditor-color-input {
  position: absolute;
  width: 32px;
  height: 32px;
  opacity: 0;
  cursor: pointer;
  left: 0;
  top: 0;
}

.yeditor-color-btn {
  font-weight: bold;
  font-size: 14px;
}

.ye-icon-align-left { display: block; text-align: left; }
.ye-icon-align-center { display: block; text-align: center; }
.ye-icon-align-right { display: block; text-align: right; }
.ye-icon-align-justify { display: block; text-align: justify; }

.yeditor-image-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.yeditor-btn-image .yeditor-icon-image,
.yeditor-btn-image .yeditor-icon-images {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.yeditor-btn-image .yeditor-icon-image svg,
.yeditor-btn-image .yeditor-icon-images svg {
  display: block;
  width: 18px;
  height: 18px;
  color: currentColor;
}

.yeditor-image-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 120px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 100;
  padding: 4px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.yeditor-image-dropdown.ye-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.yeditor-image-opt {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  font-size: 13px;
  color: #495057;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}

.yeditor-image-opt:hover {
  background: #f1f3f5;
  color: #212529;
}

.yeditor-editor {
  min-height: 200px;
  max-height: 500px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.6;
  color: #212529;
  outline: none;
}

.yeditor-editor:empty::before {
  content: attr(data-placeholder);
  color: #adb5bd;
}

.yeditor-editor:focus {
  outline: none;
}

.yeditor-editor h1 { font-size: 1.75em; margin: 0.5em 0; }
.yeditor-editor h2 { font-size: 1.5em; margin: 0.5em 0; }
.yeditor-editor h3 { font-size: 1.25em; margin: 0.5em 0; }
.yeditor-editor p { margin: 0.5em 0; }

.yeditor-editor font[size="1"] { font-size: 12px; }
.yeditor-editor font[size="2"] { font-size: 14px; }
.yeditor-editor font[size="3"] { font-size: 16px; }
.yeditor-editor font[size="4"] { font-size: 18px; }
.yeditor-editor font[size="5"] { font-size: 20px; }
.yeditor-editor font[size="6"] { font-size: 24px; }
.yeditor-editor font[size="7"] { font-size: 32px; }
.yeditor-editor ul, .yeditor-editor ol { margin: 0.5em 0; padding-left: 1.5em; }
.yeditor-editor blockquote {
  margin: 0.5em 0;
  padding-left: 1em;
  border-left: 4px solid #dee2e6;
  color: #6c757d;
}

.yeditor-editor pre,
.yeditor-editor code {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9em;
}

.yeditor-editor pre {
  margin: 0.5em 0;
  padding: 12px;
  background: #f1f3f5;
  border-radius: 6px;
  overflow-x: auto;
}

.yeditor-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.yeditor-editor a {
  color: #0d6efd;
  text-decoration: none;
}

.yeditor-editor a:hover {
  text-decoration: underline;
}

/* 源码模式 */
.yeditor-editor.yeditor-source-mode {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
}

.yeditor-status {
  padding: 4px 12px;
  font-size: 12px;
  color: #6c757d;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}
