/* Trix 编辑器适配项目设计令牌 */
trix-editor {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.75rem;
  min-height: 20rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  line-height: 1.625;
}

trix-editor:focus {
  outline: none;
  box-shadow: 0 0 0 1px hsl(var(--ring));
}

trix-toolbar {
  border: 1px solid hsl(var(--border));
  border-bottom: none;
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
  background: hsl(var(--muted));
  padding: 0.25rem;
}

trix-toolbar .trix-button {
  border: none;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: hsl(var(--muted-foreground));
  padding: 0.25rem 0.5rem;
}

trix-toolbar .trix-button:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

trix-toolbar .trix-button.trix-active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

trix-toolbar .trix-button-group {
  border: none;
  margin-right: 0.5rem;
}

/* 编辑器有 toolbar 时移除顶部圆角 */
trix-toolbar + trix-editor {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* 编辑器内容样式 */
trix-editor h1 { font-size: 1.5rem; font-weight: 700; margin: 1rem 0 0.5rem; }
trix-editor a { color: hsl(var(--primary)); text-decoration: underline; }
trix-editor blockquote {
  border-left: 3px solid hsl(var(--border));
  padding-left: 0.75rem;
  color: hsl(var(--muted-foreground));
}
trix-editor pre {
  background: hsl(var(--muted));
  padding: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  overflow-x: auto;
}
