/* 簡單HTML編輯器樣式 */

.editor-container {
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
}

.editor-toolbar {
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
  padding: 10px;
  border-radius: 5px 5px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.editor-toolbar button {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-toolbar button:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.editor-toolbar button:active {
  background: #dee2e6;
}

.editor-toolbar select {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 6px;
  cursor: pointer;
  font-size: 12px;
  height: 32px;
}

.editor-toolbar select:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.editor-toolbar .separator {
  color: #dee2e6;
  margin: 0 5px;
  font-size: 16px;
}

.editor-content {
  padding: 15px;
  min-height: 300px;
  outline: none;
  line-height: 1.6; /* 固定行距 */
  font-family: inherit;
  font-size: 14px;
  color: #000;
  background: #fff;
}

.editor-content:focus {
  box-shadow: inset 0 0 5px rgba(102, 126, 234, 0.3);
}

.editor-content h2 {
  font-size: 1.5em;
  font-weight: bold;
  margin: 20px 0 10px 0;
  color: #000;
}

.editor-content h3 {
  font-size: 1.3em;
  font-weight: bold;
  margin: 15px 0 8px 0;
  color: #000;
}

.editor-content p {
  margin: 10px 0;
  color: #000;
  line-height: 1.6; /* 確保段落行距一致 */
}

.editor-content span {
  line-height: inherit; /* 繼承父元素行距 */
}

.editor-content ul,
.editor-content ol {
  margin: 10px 0;
  padding-left: 30px;
  color: #000;
  line-height: 1.6; /* 確保列表行距一致 */
}

.editor-content li {
  margin: 5px 0;
  color: #000;
}

.editor-content a {
  color: #3498db;
  text-decoration: underline;
}

.editor-content a:hover {
  color: #2980b9;
}

.editor-content strong {
  font-weight: bold;
  color: #000;
}

.editor-content em {
  font-style: italic;
  color: #000;
}

.editor-content u {
  text-decoration: underline;
  color: #000;
}

.editor-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
}

.editor-content th,
.editor-content td {
  border: 1px solid #ddd;
  padding: 8px;
  color: #000;
}

.editor-content th {
  background: #f8f9fa;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .editor-toolbar {
    padding: 8px;
  }

  .editor-toolbar button {
    padding: 4px 6px;
    font-size: 11px;
    min-width: 28px;
    height: 28px;
  }

  .editor-toolbar select {
    padding: 4px;
    font-size: 11px;
    height: 28px;
  }

  .editor-content {
    padding: 12px;
    font-size: 13px;
  }
}

/* 編輯器內容樣式預覽 */
.content-preview {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 20px;
  background: #fff;
  margin-top: 20px;
  color: #000;
}

.content-preview h2 {
  color: #000;
  font-size: 1.8em;
  margin-bottom: 15px;
}

.content-preview h3 {
  color: #000;
  font-size: 1.4em;
  margin: 20px 0 10px 0;
}

.content-preview p {
  line-height: 1.8;
  margin-bottom: 15px;
  color: #000;
}

.content-preview ul,
.content-preview ol {
  margin: 15px 0;
  padding-left: 25px;
  color: #000;
}

.content-preview li {
  margin: 8px 0;
  line-height: 1.6;
  color: #000;
}

.content-preview a {
  color: #3498db;
  text-decoration: none;
}

.content-preview a:hover {
  text-decoration: underline;
}

.content-preview table {
  border-collapse: collapse;
  width: 100%;
  margin: 15px 0;
}

.content-preview th,
.content-preview td {
  border: 1px solid #ddd;
  padding: 10px;
  color: #000;
}

.content-preview th {
  background: #f8f9fa;
}