/* 文章编辑器：类似 GitHub Release Write 的工具栏 + 编辑区 */

.article-editor {
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background-color: var(--color-bg-input);
  overflow: hidden;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.article-editor:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb33;
}

.article-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg-secondary);
  min-height: 2.5rem;
}

/* 非管理员仅可查看：隐藏工具栏，编辑功能仅登录管理员可用 */
.article-editor-toolbar--readonly {
  display: none;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.toolbar-btn:hover {
  background-color: var(--color-border);
  color: var(--color-text-primary);
}

.toolbar-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.toolbar-btn .toolbar-icon {
  flex-shrink: 0;
}

.toolbar-sep {
  width: 1px;
  height: 1.25rem;
  margin: 0 0.2rem;
  background-color: var(--color-border);
}

.article-editor-textarea {
  display: block;
  width: 100%;
  min-height: 280px;
  border: none;
  border-radius: 0;
  padding: 0.75rem 1rem;
  resize: vertical;
}

.article-editor-textarea:focus {
  outline: none;
  box-shadow: none;
}
