.rich-editor-shell {
  min-width: 0;
  width: 100%;
}

.article-editor-row > div {
  min-width: 0;
}

.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 38px;
  box-sizing: border-box;
  padding: 5px 7px;
  border: 1px solid #cfd6e2;
  border-bottom: 0;
  background: #f7f9fc;
}

.rich-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 30px;
  height: 28px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0 7px;
  color: #26334a;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.rich-toolbar button:hover,
.rich-toolbar button:focus-visible,
.rich-toolbar button[aria-pressed="true"] {
  border-color: #c6d2ea;
  color: #315bd8;
  background: #eaf0ff;
  outline: 0;
}

.rich-toolbar button svg {
  width: 15px;
  height: 15px;
}

.rich-toolbar-spacer {
  flex: 1;
  min-width: 10px;
}

.rich-editor,
.rich-source-editor {
  display: block;
  width: 100%;
  min-height: 360px;
  max-height: min(520px, 58vh);
  box-sizing: border-box;
  margin: 0;
  border: 1px solid #cfd6e2;
  border-radius: 0;
  padding: 14px 16px;
  color: #202938;
  background: #fff;
  font: 14px/1.85 "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  overflow: auto;
  resize: vertical;
}

.rich-editor:focus,
.rich-source-editor:focus {
  border-color: #7084ec;
  outline: 1px solid #7084ec;
}

.rich-source-editor {
  color: #d9e2f2;
  background: #111827;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.6;
  tab-size: 2;
}

.rich-editor[hidden],
.rich-source-editor[hidden] {
  display: none;
}

.rich-image-input {
  position: fixed;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rich-editor-status {
  min-height: 22px;
  box-sizing: border-box;
  padding: 4px 8px 0;
  color: #60708a;
  font-size: 12px;
}

.rich-editor-status.is-error {
  color: #d83b52;
}

.rich-editor p {
  margin: 0 0 12px;
}

.rich-editor h1,
.rich-editor h2,
.rich-editor h3,
.rich-editor h4 {
  margin: 20px 0 10px;
  line-height: 1.35;
}

.rich-editor table {
  width: 100%;
  margin: 18px 0;
  border: 1px solid #cfd7e5;
  border-collapse: collapse;
  table-layout: auto;
  background: #fff;
}

.rich-editor caption {
  padding: 8px;
  color: #59657a;
  font-weight: 700;
}

.rich-editor th,
.rich-editor td {
  min-width: 74px;
  border: 1px solid #cfd7e5;
  padding: 9px 10px;
  vertical-align: top;
  text-align: left;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.rich-editor th {
  color: #26334a;
  background: #eef2fb;
  font-weight: 700;
}

.rich-editor figure {
  margin: 22px auto;
  text-align: center;
}

.rich-editor figure img,
.rich-editor > img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px auto;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 5px 18px rgba(34, 49, 82, .1);
}

.rich-editor figcaption {
  margin-top: 7px;
  color: #8a94a6;
  font-size: 12px;
}

.order-create-form .rich-content-field {
  align-items: start;
}

.order-create-form .rich-editor,
.order-create-form .rich-source-editor {
  min-height: 280px;
  max-height: 420px;
}

@media (max-width: 760px) {
  .user-article-modal .article-form-body {
    gap: 12px;
    padding: 14px;
  }

  .user-article-modal .article-form-body > label {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .user-article-modal .article-form-body > label > span {
    padding: 0;
    text-align: left;
  }

  .user-article-modal .reference-radio-row {
    flex-wrap: wrap;
    margin-left: 0;
  }

  .user-article-modal .article-cover-preview {
    width: 100%;
    height: auto;
    max-height: 140px;
    margin-left: 0;
  }

  .user-article-modal form > footer {
    flex-wrap: wrap;
    justify-content: center;
    min-height: 58px;
    height: auto;
    padding: 8px;
  }

  .rich-toolbar {
    flex-wrap: wrap;
  }

  .rich-toolbar-spacer {
    display: none;
  }

  .rich-editor,
  .rich-source-editor {
    min-height: 300px;
  }
}
