/* Scoped styles: this module does not change the surrounding admin drawer. */
.portal-editor,
.portal-editor * { box-sizing: border-box; }
.portal-editor {
  --pe-accent: #973000;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 390px;
  min-width: 0;
  border: 1px solid #deddd5;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  color: #333;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.portal-editor [hidden] { display: none !important; }
.portal-editor .pe-toolbar {
  display: flex;
  flex: 0 0 188px;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid #deddd5;
  background: #f4f5f7;
  user-select: none;
}
.portal-editor .pe-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  min-height: 0;
}
.portal-editor button,
.portal-editor select,
.portal-editor input,
.portal-editor textarea { font-family: inherit; font-size: inherit; }
.portal-editor button.pe-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  min-width: 0;
  height: 32px;
  padding: 0;
  margin: 0;
  border: 1px solid #d8d9dc;
  border-radius: 4px;
  background: #fff;
  color: #333;
  box-shadow: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.portal-editor .pe-format-row .pe-button {
  flex: 1 1 36px;
  max-width: 36px;
}
.portal-editor button.pe-button:hover:not(:disabled) { border-color: #b99b8d; background: #fbeee7; }
.portal-editor button.pe-button.is-active,
.portal-editor button.pe-button.is-active:hover:not(:disabled) {
  border-color: var(--pe-accent);
  background: var(--pe-accent);
  color: #fff;
}
.portal-editor .pe-source-button { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.portal-editor .pe-align-row { height: 32px; }
.portal-editor .pe-colors { height: 23px; gap: 5px; }
.portal-editor .pe-highlights { display: flex; align-items: center; flex-shrink: 1; min-width: 0; gap: 4px; }
.portal-editor .pe-bg-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 1px solid #d8d9dc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.portal-editor .pe-bg-picker::before {
  content: 'A';
  padding-bottom: 1px;
  border-bottom: 4px solid #ffff00;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.portal-editor .pe-bg-picker:hover { border-color: #b99b8d; }
.portal-editor .pe-bg-picker input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.portal-editor button.pe-swatch.pe-highlight-none {
  position: relative;
  background: repeating-conic-gradient(#e9e9e9 0% 25%, #fff 0% 50%) 50% / 10px 10px;
  color: #d33;
}
.portal-editor button.pe-swatch.pe-highlight-none::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 1px;
  right: 1px;
  border-top: 2px solid #d33;
  transform: rotate(-35deg);
}
.portal-editor button.pe-clear-bg-button { flex: 0 0 32px; width: 32px; }
.portal-editor .pe-clear-bg {
  position: relative;
  display: inline-block;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.portal-editor .pe-clear-bg::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -2px;
  right: -2px;
  border-top: 2px solid #d33;
  transform: rotate(-35deg);
}
.portal-editor button.pe-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 23px;
  width: 23px;
  min-width: 0;
  height: 23px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 2px;
  background: var(--pe-swatch);
  color: #333;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}
.portal-editor button.pe-swatch.is-active { outline: 2px solid var(--pe-accent); outline-offset: 1px; }
.portal-editor button.pe-swatch:not(.pe-highlight).is-active::after {
  content: '';
  width: 7px;
  height: 10px;
  margin-top: -3px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  filter: drop-shadow(0 0 1px #333);
}
.portal-editor .pe-style-row { height: 32px; gap: 6px; }
.portal-editor select.pe-font-size {
  width: 52px;
  min-width: 44px;
  height: 32px;
  flex: 0 0 52px;
  margin: 0;
  padding: 0 5px;
  border: 1px solid #d8d9dc;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
}
.portal-editor .pe-history-row { height: 32px; }
.portal-editor button:disabled,
.portal-editor select:disabled,
.portal-editor input:disabled { opacity: .42; cursor: not-allowed; }
.portal-editor button:focus-visible,
.portal-editor select:focus-visible,
.portal-editor input:focus-visible,
.portal-editor textarea:focus-visible { outline: 2px solid var(--pe-accent); outline-offset: 2px; }
.portal-editor .pe-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #fff;
  overscroll-behavior: contain;
}
.portal-editor .pe-surface { height: 100%; min-height: 100%; }
.portal-editor .pe-document {
  min-height: 100%;
  padding: 14px 16px 24px;
  outline: none;
  color: #333;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  caret-color: var(--pe-accent);
}
.portal-editor .pe-document > :first-child { margin-top: 0; }
.portal-editor .pe-document > :last-child { margin-bottom: 0; }
.portal-editor .pe-document p { margin: 0 0 .7em; }
.portal-editor .pe-document h1 { margin: .6em 0 .4em; font-size: 2em; font-weight: 700; line-height: 1.3; }
.portal-editor .pe-document h2 { margin: .6em 0 .4em; font-size: 1.6em; font-weight: 700; line-height: 1.3; }
.portal-editor .pe-document h3 { margin: .6em 0 .4em; font-size: 1.3em; font-weight: 700; line-height: 1.3; }
.portal-editor .pe-document ul,
.portal-editor .pe-document ol { margin: .5em 0; padding-left: 1.7em; }
.portal-editor .pe-document ul { list-style: disc; }
.portal-editor .pe-document ol { list-style: decimal; }
.portal-editor .pe-document li > p { margin-bottom: .25em; }
.portal-editor .pe-document blockquote { margin: .6em 0; padding: 2px 12px; border-left: 3px solid #bba08f; background: #faf7f4; color: #66554b; }
.portal-editor .pe-document pre { margin: .6em 0; padding: 12px; border-radius: 6px; background: #f4f5f7; white-space: pre-wrap; }
.portal-editor .pe-document code { padding: 1px 3px; border-radius: 3px; background: #f4f5f7; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.portal-editor .pe-document pre code { padding: 0; }
.portal-editor .pe-document a { color: #973000; text-decoration: underline; cursor: text; }
.portal-editor .pe-document mark { padding: 0; color: inherit; }
.portal-editor .pe-document img { display: block; max-width: 100%; height: auto; margin: .6em 0; border-radius: 4px; }
.portal-editor .pe-document img.ProseMirror-selectednode { outline: 2px solid var(--pe-accent); outline-offset: 2px; }
.portal-editor .pe-document hr { margin: 1em 0; border: 0; border-top: 1px solid #deddd5; }
.portal-editor .pe-document > p:only-child:has(> br.ProseMirror-trailingBreak:only-child)::before {
  content: attr(data-placeholder);
  content: '请输入内容…';
  float: left;
  height: 0;
  color: #aaa;
  pointer-events: none;
}
.portal-editor textarea.pe-source {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 12px 14px 26px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #333;
  outline: none;
  resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.portal-editor .pe-popover {
  position: absolute;
  top: 43px;
  left: 10px;
  right: 10px;
  z-index: 10;
  max-height: calc(100% - 82px);
  padding: 12px;
  overflow: auto;
  border: 1px solid #deddd5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(44, 28, 15, .16);
}
.portal-editor .pe-field-label,
.portal-editor .pe-upload-label { display: block; margin: 0 0 10px; color: #555; font-size: 12px; font-weight: 400; }
.portal-editor .pe-field-label input {
  display: block;
  width: 100%;
  height: 34px;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid #deddd5;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 13px;
}
.portal-editor .pe-popover-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.portal-editor .pe-popover-actions button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #deddd5;
  border-radius: 4px;
  background: #fff;
  color: #555;
  font-size: 12px;
  cursor: pointer;
}
.portal-editor .pe-popover-actions button.pe-primary { border-color: var(--pe-accent); background: var(--pe-accent); color: #fff; }
.portal-editor .pe-upload-label { margin-top: 10px; margin-bottom: 0; }
.portal-editor input.pe-file { display: block; width: 100%; margin-top: 6px; font-size: 12px; }
.portal-editor .pe-status {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 11;
  max-height: 76px;
  padding: 6px 10px;
  overflow: auto;
  border-top: 1px solid #e4e1da;
  background: #f7f7f3;
  color: #536346;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.portal-editor .pe-status.is-error { background: #fff0eb; color: #973000; }
@media (max-width: 504px) {
  .portal-editor .pe-toolbar { padding-right: 8px; padding-left: 8px; }
  .portal-editor .pe-format-row { gap: 3px; }
  .portal-editor .pe-style-row { gap: 4px; }
  .portal-editor .pe-colors { gap: 4px; }
  .portal-editor .pe-highlights { gap: 3px; }
  .portal-editor .pe-style-row .pe-button { flex: 0 1 32px; width: 32px; }
  .portal-editor .pe-style-row .pe-highlights { flex: 1 1 auto; max-width: 205px; }
  .portal-editor select.pe-font-size { flex-basis: 48px; width: 48px; }
  .portal-editor .pe-bg-picker,
  .portal-editor button.pe-clear-bg-button { flex: 0 0 28px; width: 28px; height: 28px; }
  .portal-editor .pe-swatch.pe-highlight-none { flex-basis: 20px; width: 20px; }
  .portal-editor .pe-style-row .pe-highlights { max-width: 176px; }
  .portal-editor .pe-document { padding-right: 12px; padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-editor * { scroll-behavior: auto; }
}
