.rich-editor {
    border: 1px solid #b8c4d0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}

.rich-editor:focus-within {
    border-color: #1769aa;
    box-shadow: 0 0 0 3px rgba(23, 105, 170, .12);
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 9px;
    border-bottom: 1px solid #d8e0e8;
    background: linear-gradient(#fbfcfd, #f2f5f7);
}

.editor-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
    padding-right: 6px;
    border-right: 1px solid #d8e0e8;
}

.editor-group:last-child { border-right: 0; }

.rich-editor-toolbar button,
.rich-editor-toolbar select,
.rich-editor-toolbar label {
    width: auto;
    min-width: 34px;
    height: 34px;
    box-sizing: border-box;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #24313d;
    font: 14px/1 system-ui, sans-serif;
}

.rich-editor-toolbar button:hover,
.rich-editor-toolbar button:focus-visible,
.rich-editor-toolbar select:hover,
.rich-editor-toolbar label:hover {
    border-color: #aebdca;
    background: #fff;
    outline: none;
}

.rich-editor-toolbar button.is-active {
    border-color: #1769aa;
    background: #e8f3fb;
    color: #0b568e;
}

.rich-editor-toolbar select { min-width: 76px; }
.editor-colors label { position: relative; cursor: pointer; text-align: center; }
.editor-colors input[type="color"] {
    position: absolute;
    inset: auto 5px 2px 5px;
    width: 22px;
    height: 5px;
    padding: 0;
    border: 0;
    opacity: .9;
    cursor: pointer;
}

.rich-editor-surface,
.rich-editor-source {
    width: 100%;
    min-height: 340px;
    max-height: 680px;
    box-sizing: border-box;
    overflow: auto;
    padding: 18px 20px;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #18202a;
    font: 16px/1.75 system-ui, sans-serif;
    outline: none;
}

.rich-editor-surface:empty::before {
    content: "请输入作品说明……";
    color: #98a2b3;
    pointer-events: none;
}

.rich-editor-surface h1,
.rich-editor-surface h2,
.rich-editor-surface h3 { line-height: 1.35; }
.rich-editor-surface blockquote {
    margin: 1em 0;
    padding: .6em 1em;
    border-left: 4px solid #1769aa;
    background: #f4f8fb;
    color: #344054;
}
.rich-editor-surface pre {
    padding: 12px;
    overflow: auto;
    border-radius: 6px;
    background: #17202a;
    color: #f5f7fa;
    white-space: pre-wrap;
}
.rich-editor-surface a { color: #1769aa; text-decoration: underline; }
.rich-editor-source {
    display: none;
    resize: vertical;
    background: #111827;
    color: #d1fae5;
    font: 14px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.rich-editor.is-source-mode .rich-editor-surface { display: none; }
.rich-editor.is-source-mode .rich-editor-source { display: block; }

.rich-editor-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border-top: 1px solid #e4e7ec;
    background: #fafbfc;
    color: #667085;
    font-size: 12px;
}

@media (max-width: 720px) {
    .rich-editor-toolbar { align-items: stretch; }
    .editor-group { border-right: 0; padding-right: 0; }
    .rich-editor-toolbar button { flex: 0 0 auto; }
    .rich-editor-surface,
    .rich-editor-source { min-height: 280px; padding: 14px; }
}

