.rich-editor-heading,
.article-pdf-actions,
.article-pdf-viewer-controls,
.editor-asset-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rich-editor-heading {
  justify-content: space-between;
  color: var(--ink, #17324d);
  font-weight: 750;
}

.rich-editor-shell:not(.is-ready):not(.is-loading) .article-block-editor,
.rich-editor-shell.is-ready .rich-editor-fallback,
.rich-editor-shell.is-loading .rich-editor-fallback {
  display: none;
}

.article-block-editor {
  min-height: 360px;
  margin-top: 8px;
  padding: 16px 18px;
  border: 1px solid #c8dbe7;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.article-block-editor:focus-within {
  border-color: #1775ad;
  box-shadow: 0 0 0 3px rgba(23, 117, 173, .12);
}

.article-block-editor .ce-block__content,
.article-block-editor .ce-toolbar__content {
  max-width: 760px;
}

.article-block-editor .ce-paragraph,
.article-block-editor .cdx-quote__text,
.article-block-editor .cdx-list__item-content {
  line-height: 1.8;
}

.boxin-asset-tool {
  padding: 16px;
  border: 1px solid #c9dce8;
  border-radius: 14px;
  background: #f7fbfd;
}

.boxin-asset-tool-preview {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 14px;
}

.boxin-asset-tool-preview img {
  width: 112px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
}

.boxin-asset-tool-badge,
.article-attachment-type {
  display: grid;
  min-width: 70px;
  min-height: 54px;
  place-items: center;
  border-radius: 10px;
  background: #dfeff8;
  color: #075d8f;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .06em;
}

.boxin-asset-tool-actions,
.boxin-asset-tool-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.boxin-asset-tool-fields label {
  min-width: 180px;
  flex: 1;
  color: #4c6478;
  font-size: 12px;
}

.boxin-asset-tool-fields input,
.boxin-asset-tool-fields select {
  width: 100%;
  margin-top: 5px;
}

.boxin-asset-upload {
  position: relative;
  overflow: hidden;
}

.boxin-asset-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.boxin-asset-upload:focus-within {
  outline: 3px solid rgba(11, 111, 194, .24);
  outline-offset: 2px;
}

.boxin-asset-tool-error {
  color: #a12626;
}

.editor-asset-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: 88vh;
  padding: 22px;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 28px 90px rgba(7, 39, 63, .34);
}

.editor-asset-dialog::backdrop {
  background: rgba(4, 26, 43, .64);
}

.editor-asset-tools {
  align-items: end;
  flex-wrap: wrap;
  margin: 18px 0 10px;
}

.editor-asset-tools > label:not(.media-file-picker) {
  min-width: 190px;
  flex: 1;
  color: #52697c;
  font-size: 12px;
  font-weight: 700;
}

.editor-asset-tools input,
.editor-asset-tools select {
  width: 100%;
  margin-top: 5px;
}

.editor-asset-grid {
  display: grid;
  max-height: 52vh;
  padding: 4px;
  overflow: auto;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
}

.editor-asset-choice {
  display: flex;
  min-width: 0;
  padding: 9px;
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #cee0ea;
  border-radius: 13px;
  background: #fff;
  color: #19364d;
  text-align: left;
  cursor: pointer;
}

.editor-asset-choice:hover,
.editor-asset-choice:focus-visible {
  border-color: #1475ad;
  box-shadow: 0 8px 24px rgba(15, 91, 136, .14);
}

.editor-asset-choice img,
.editor-asset-choice .media-file-icon {
  width: 100%;
  height: 96px;
  border-radius: 9px;
  object-fit: cover;
}

.editor-asset-choice b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-asset-more {
  display: block;
  margin: 14px auto 0;
}

.article-content a {
  color: #096da5;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-quote {
  margin: 30px 0;
  padding: 22px 24px;
  border-left: 4px solid #1688a8;
  border-radius: 0 14px 14px 0;
  background: #edf7fa;
}

.article-quote-center {
  border-left: 0;
  text-align: center;
}

.article-quote p {
  margin: 0;
  font-size: 1.08em;
}

.article-quote cite {
  display: block;
  margin-top: 10px;
  color: #647b8e;
  font-size: 13px;
  font-style: normal;
}

.article-list-lower-roman { list-style-type: lower-roman; }
.article-list-upper-roman { list-style-type: upper-roman; }
.article-list-lower-alpha { list-style-type: lower-alpha; }
.article-list-upper-alpha { list-style-type: upper-alpha; }

.article-checklist {
  padding-left: 0;
  list-style: none;
}

.article-check {
  display: inline-grid;
  width: 1.25em;
  height: 1.25em;
  margin-right: 9px;
  place-items: center;
  border: 1px solid #7ca9be;
  border-radius: 4px;
  color: #08709c;
  font-size: .8em;
  font-weight: 850;
}

.article-asset,
.article-attachment {
  margin: 34px 0;
}

.article-asset-wide {
  width: min(920px, calc(100vw - 32px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.article-asset-full {
  width: min(1180px, calc(100vw - 20px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.article-asset-image img,
.article-asset-video video,
.article-asset-audio audio {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #e7f0f5;
}

.article-image-open {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  cursor: zoom-in;
}

.article-image-open::after {
  content: '查看大图  ↗';
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(4, 24, 39, .78);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.article-image-open:hover::after,
.article-image-open:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.article-image-open:focus-visible {
  outline: 3px solid #0e8fa6;
  outline-offset: 4px;
}

.article-asset figcaption {
  margin-top: 10px;
  color: #647a8d;
  font-size: 13px;
  line-height: 1.6;
}

.article-attachment,
.article-pdf {
  display: flex;
  padding: 18px;
  align-items: center;
  gap: 16px;
  border: 1px solid #cbdde7;
  border-radius: 16px;
  background: #f7fbfd;
}

.article-attachment > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.article-attachment small {
  overflow: hidden;
  color: #677d8f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-attachment-missing {
  color: #8a3030;
  border-color: #e2b7b7;
  background: #fff7f7;
}

.article-pdf {
  align-items: stretch;
  flex-direction: column;
}

.article-pdf figcaption {
  display: flex;
  margin: 0;
  flex-direction: column;
}

.article-pdf-actions {
  flex-wrap: wrap;
}

.article-pdf-viewer-controls {
  margin-left: auto;
}

.article-pdf-pages {
  display: grid;
  overflow: auto;
  place-items: center;
}

.article-pdf-canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
  border: 1px solid #d4e0e7;
  background: #fff;
  box-shadow: 0 8px 24px rgba(10, 42, 62, .12);
}

.article-pdf-status {
  min-height: 1.4em;
  margin: 0;
  color: #61788a;
  font-size: 13px;
}

.article-text-preview {
  padding: 18px;
  border: 1px solid #cbdde7;
  border-radius: 16px;
  background: #f7fbfd;
}

.article-text-preview summary {
  color: #143d58;
  font-weight: 760;
  cursor: pointer;
}

.article-text-preview pre {
  max-height: 440px;
  margin: 16px 0;
  padding: 16px;
  overflow: auto;
  border-radius: 10px;
  background: #102534;
  color: #e7f3f8;
  font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.article-preview-truncated {
  color: #647a8d;
  font-size: 13px;
}

@media (max-width: 680px) {
  .rich-editor-heading,
  .article-attachment,
  .article-pdf-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .article-pdf-viewer-controls {
    margin-left: 0;
  }

  .editor-asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
