.rich-content::after,
.rich-editor-content::after { display: block; clear: both; content: ""; }

.rich-content img,
.rich-editor-content img { max-width: 100%; height: auto; }

.rich-content img[data-align="left"],
.rich-editor-content img[data-align="left"] { float: left; margin: 4px 18px 12px 0; }

.rich-content img[data-align="right"],
.rich-editor-content img[data-align="right"] { float: right; margin: 4px 0 12px 18px; }

.rich-content img[data-align="center"],
.rich-editor-content img[data-align="center"] { display: block; margin: 14px auto; }

.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-editor-content h2,
.rich-editor-content h3,
.rich-editor-content h4 { clear: both; }

.rich-content table,
.rich-editor-content table { display: block; width: max-content; max-width: 100%; margin: 24px 0; border-collapse: collapse; overflow-x: auto; }
.rich-content caption,
.rich-editor-content caption { padding: 0 0 10px; font-weight: 600; text-align: left; }
.rich-content th,
.rich-content td,
.rich-editor-content th,
.rich-editor-content td { padding: 8px 10px; vertical-align: top; border: 1px solid #d8dee8; }
.rich-content th,
.rich-editor-content th { background: #edf1f6; text-align: left; white-space: nowrap; }
.rich-content tbody tr:nth-child(even),
.rich-editor-content tbody tr:nth-child(even) { background: #f8f9fb; }

.rich-editor-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: #edf1f6; border: 1px solid #cdd4df; border-bottom: 0; border-radius: 8px 8px 0 0; }
.rich-editor-toolbar button { min-height: 34px; padding: 5px 9px; font: inherit; background: #fff; border: 1px solid #c6ceda; border-radius: 5px; cursor: pointer; }
.rich-editor-content { min-height: 220px; padding: 18px; line-height: 1.6; background: #fff; border: 1px solid #cdd4df; border-radius: 0 0 8px 8px; overflow: auto; }
.rich-editor-source { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.rich-image-library { margin-top: 22px; padding: 16px; background: #f7f8fc; border-radius: 8px; }
.rich-image-library-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; max-height: 480px; margin-top: 12px; overflow: auto; }
.rich-image-card { padding: 9px; background: #fff; border: 1px solid #d8dee8; border-radius: 7px; }
.rich-image-card img { display: block; width: 100%; height: 110px; object-fit: contain; background: #f5f6f8; }
.rich-image-card div { display: flex; gap: 5px; margin-top: 7px; }
.rich-image-card button { flex: 1; padding: 5px; font: inherit; font-size: 12px; }
