/* 确保编辑表单（popper-menu）及其所有内容在 backdrop 之上，且可以接收交互 */

.editor .bke-popper-menu {
  position: absolute !important;
  z-index: 1000 !important;
  pointer-events: auto !important;
}

.editor .bke-popper-menu *,
  .editor .bke-popper-menu * *,
  .editor .bke-popper-menu .popper-box,
  .editor .bke-popper-menu .popper-box * {
  pointer-events: auto !important;
}

/* 编辑表单内容区域，阻止点击事件冒泡到 backdrop */

.editor .bke-popper-menu .popper-box {
  cursor: default !important;
  position: relative !important;
  z-index: 1001 !important;
}

.editor .bke-popper-menu {
  position: absolute;
  z-index: 1000;
  left: -99999px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  pointer-events: auto;
}

.editor .bke-popper-menu--show {
  opacity: 1;
}

.editor .bke-popper-menu-button {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.editor .bke-popper-menu-button:hover {
  background: #f3f4f6;
  color: #111827;
}

.editor .bke-popper-menu-button:active {
  background: #e5e7eb;
}

.editor .bke-popper-menu-button.bke-active {
  background: hsl(var(--theme-color-primary));
  color: white;
}

.editor .bke-popper-menu-button.bke-active:hover {
  background: hsl(var(--theme-color-primary-hsl-h) var(--theme-color-primary-hsl-s) calc(var(--theme-color-primary-hsl-l) - 15%));
}

.editor .bke-popper-menu-button svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.editor .bke-popper-menu-divider {
  width: 1px;
  height: 24px;
  background-color: #e2e8f0;
  margin: 0 4px;
  flex-shrink: 0;
}

/* 链接类型标识 */

.editor .bke-link-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.editor .bke-link-type-badge--internal {
  background-color: #dbeafe;
  color: #1e40af;
}

.editor .bke-link-type-badge--external {
  background-color: #fef3c7;
  color: #92400e;
}

.editor .bke-link-type-badge--dam {
  background-color: #dbeafe;
  color: #92400e;
}

.editor .bke-dropdown {
  display: inline-flex;
}

.editor .bke-dropdown__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-size: 0.85rem;
  border-radius: 0.375rem;
  cursor: pointer;
  color: #374151;
}

.editor .bke-dropdown__button:hover {
  background-color: #e2e8f0;
}

.editor .bke-dropdown__popper-root {
  position: absolute;
  visibility: hidden;
  z-index: 1000;
  /* 防止遮挡 */
  left: -9999px;
  top: -9999px;
}

.editor .bke-dropdown__popper-root.show {
  visibility: visible;
}

.editor .bke-dropdown__popper-box {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.375rem 0;
  font-family: 'Inter', sans-serif;
  color: #111;
  opacity: 0;
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
  transition-property: transform, visibility, opacity;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 暗色模式 */

.editor .bke-dropdown :is(.dark .bke-dropdown__popper-root > .bke-dropdown__popper-box) {
  border-color: #475569;
  background: #1e293b;
  color: #a3adc2;
}

.editor .bke-dropdown__popper-root.show .editor .bke-dropdown__popper-box {
  opacity: 1;
  transform: translate(0) !important;
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.editor .bke-dropdown__menu {
  max-height: 15rem;
  overflow-y: auto;
}

.editor .bke-dropdown__item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.editor .bke-dropdown__item:hover {
  background-color: #f1f5f9;
}

.editor .bke-dropdown__item--selected {
  color: hsl(var(--theme-color-primary));
}

.editor .bke-dropdown__item--selected .bke-dropdown__item-content,
        .editor .bke-dropdown__item--selected .bke-dropdown__check-icon {
  color: inherit;
}

.editor .bke-dropdown__item-content {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.editor .bke-dropdown__check-icon {
  visibility: hidden;
  flex-shrink: 0;
}

.editor .bke-dropdown__check-icon--visible {
  visibility: visible;
}

.editor {
  display: flex;
  min-height: 0px;
  flex: 1 1 0%;
  flex-direction: column;
  caret-color: hsl(var(--theme-color-primary-700-hsl-h, var(--theme-color-primary-hsl-h)) var(--theme-color-primary-700-hsl-s, var(--theme-color-primary-hsl-s)) var(--theme-color-primary-700-hsl-l, 44%) / 1);
}

/* 临时使用 */

.editor__margin {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.editor.editing {
  border-radius: 0.25rem;
  border-width: 1px;
  border-color: #cbd5e1;
}

.editor.editing:is(.bke-dark *) {
  border-color: #697A9B;
}

.editor.editing {
  position: relative;
}

.editor__toolbar {
  z-index: 40;
  display: flex;
  grid-auto-columns: max-content;
  align-items: center;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  border-bottom-width: 1px;
  border-color: #cbd5e1;
  background-color: #fff;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.editor__toolbar:is(.bke-dark *) {
  border-color: #384766;
  background-color: #202B40;
}

.editor__toolbar {
  flex-wrap: wrap;
}

.editor__toolbar__icon {
  height: 1rem;
  width: 1rem;
}

.editor__toolbar__item > * {
  transition: background-color 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor__toolbar__item {
  display: flex;
  cursor: pointer;
  align-items: center;
  border-radius: 0.375rem;
  padding: 0.5rem;
  font-weight: 500;
  color: #111827;
}

.editor__toolbar__item:hover {
  background-color: #e2e8f0;
}

.editor__toolbar__item:is(.bke-dark *) {
  color: #C2C9D6;
}

.editor__toolbar__item:hover:is(.bke-dark *) {
  background-color: #313E59;
}

.editor__toolbar__item--disable {
  cursor: not-allowed;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  opacity: 0.25;
}

.editor__toolbar__item--active {
  background-color: #f1f5f9;
  color: hsl(var(--theme-color-primary) / 1);
}

.editor__toolbar__item--active:is(.bke-dark *) {
  background-color: #313E59;
}

.editor__divider {
  margin-right: 0.25rem;
  height: 1.5rem;
  width: 0.125rem;
  background-color: #E9EEF5;
  padding: 0px;
}

.editor__divider:is(.bke-dark *) {
  background-color: #313E59;
}

.editor__floating_menu {
  display: flex;
  align-items: center;
}

.editor__floating_menu > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
  margin-right: calc(0.5rem * var(--tw-space-x-reverse));
  margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}

.editor__dropdown_menu > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
}

.editor__dropdown_menu {
  border-width: 1px;
  border-color: #3b82f6;
}

.editor__content_with_toc {
  display: grid;
  min-height: 0px;
  flex: 1 1 0%;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.editor__content_with_toc [data-toc-target="container"] {
  display: none;
}

/* 全屏编辑才显示 TOC */

.editor--fullscreen .editor__content_with_toc {
  grid-template-columns: 1fr 320px;
}

.editor--fullscreen .editor__content_with_toc [data-toc-target="container"] {
  display: flex;
  min-height: 0px;
  flex-direction: column;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 4rem;
}

.editor__content {
  /* 这里的 pt 必须大于 16，否则第一行的菜单就看不到了 */
  margin-left: auto;
  margin-right: auto;
  display: flex;
  min-height: 10rem;
  width: 100%;
  flex: 1 1 0%;
  flex-direction: column;
  padding: 1rem;
}

.editor__content:has([bke-role="doc-title"]){
  padding-top: 20px;
}

.editor--readonly .editor__content {
  margin-left: 0px;
  margin-right: 0px;
  border-radius: 0.5rem;
  background-color: #fff;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.editor--fullscreen {
  background-color: #fff;
}

.editor--fullscreen .editor__toolbar {
  position: fixed;
  top: 0px;
  left: 0px;
  right: 0px;
}

.editor--fullscreen .editor__content {
  margin-top: 4rem;
  margin-bottom: 2rem;
  overflow: auto;
}

.editor::-webkit-scrollbar {
  width: 2px;
  /* 设置滚动条宽度 */
}

.editor::-webkit-scrollbar-track {
  background-color: #f1f1f1;
  /* 设置滚动条轨道背景色 */
}

.editor::-webkit-scrollbar-thumb {
  background-color: #4f46e5;
  /* 设置滚动条滑块背景色 */
  border-radius: 5px;
  /* 设置滚动条滑块圆角 */
}

.editor::-webkit-scrollbar-thumb:hover {
  background-color: #555;
  /* 设置滚动条滑块鼠标悬停时的背景色 */
}

.bke-emoji-picker {
  position: absolute;
  left: 50%;
  opacity: 0;
  transition-property: opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
  height: 280px;
  --background: #fff;
  --border-color: #e2e8f0;
  --border-radius: 0.375rem;
  --border-size: 1px;
  --button-active-background: #edf2f7;
  --button-hover-background: #d4d4d4;
  --outline-color: #d4d4d4;
  --emoji-padding: 0.25rem;
  --emoji-size: 1.35rem;
  --num-columns: 7;
  --input-padding: 0.25rem 0.5rem;
  --input-border-radius: 0.375rem;
  --input-border-color: #e2e8f0;
  --input-font-color: #2d3748;
}

.bke-emoji-picker--show {
  opacity: 1;
  z-index: 9999;
}

.ProseMirror {
  position: relative;
  min-width: 0px;
  font-size: 1rem;
  line-height: 1.5rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.ProseMirror > * {
  max-width: 100%;
}

/* > * {
    @apply my-2 w-full first:mt-0 last:mb-0;
  } */

.ProseMirror .resize-cursor {
  cursor: ew-resize;
  cursor: col-resize;
}

.ProseMirror > *[bke-role] {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.ProseMirror[contenteditable="true"]:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.ProseMirror[contenteditable="true"] [data-placeholder].is-empty::before {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #94a3b8;
}

.ProseMirror[contenteditable="true"] [data-placeholder].is-empty:is(.bke-dark *)::before {
  color: #475569;
}

.ProseMirror[contenteditable="true"] [data-placeholder].is-empty::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}

.ProseMirror[contenteditable="true"] [bke-align="center"][data-placeholder].is-empty::before {
  float: unset;
}

.ProseMirror[contenteditable="true"] [bke-align="right"][data-placeholder].is-empty::before {
  float: right;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection {
  caret-color: transparent;
}

.ProseMirror[contenteditable="false"] {
  outline: none !important;
  border: none !important;
}

.ProseMirror[contenteditable="true"] .ProseMirror-selectednode {
  /* @apply !border-blue-500 !border-2 !border-dashed; */
  outline-style: dotted;
  outline-width: 2px;
  outline-offset: 4px;
  outline-color: hsl(var(--theme-color-primary) / 1);
}

.ProseMirror:not(.dragging) .ProseMirror-selectednode {
  /* outline: none !important; */
  /* border-radius: 0.2rem; */
  /* background-color: #f1f3f5; */
  /* transition: background-color 0.2s; */
  box-shadow: none;
}

.ProseMirror-trailingBreak {
  width: 1rem;
  background-color: #334155;
}

.ProseMirror-trailingBreak:is(.bke-dark *) {
  background-color: #202B40;
}

.ProseMirror * + p,
  .ProseMirror * + div[bke-role="paragraph"] {
  margin-top: 1rem;
}

.ProseMirror p + *,
  .ProseMirror div[bke-role="paragraph"] + * {
  margin-top: 1rem;
}

.ProseMirror p,
  .ProseMirror div[bke-role="paragraph"] {
  line-height: 1.5;
  min-height: 1.5rem;
}

.ProseMirror div[bke-role="paragraph"][bke-align="left"] {
  text-align: left;
}

.ProseMirror div[bke-role="paragraph"][bke-align="center"] {
  text-align: center;
}

.ProseMirror div[bke-role="paragraph"][bke-align="right"] {
  text-align: right;
}

.ProseMirror li > p + ol,
  .ProseMirror li > p + ul,
  .ProseMirror li > div[bke-role="paragraph"] + ol,
  .ProseMirror li > div[bke-role="paragraph"] + ul
  {
  margin-top: 0;
}

.ProseMirror * ~ blockquote {
  margin-top: 1.5rem;
}

.ProseMirror blockquote {
  border-left: 3px solid rgb(230, 230, 230);
  padding-left: 1rem;
  color: #646a73;
}

.ProseMirror [bke-role="callout"] {
  display: flex;
  align-items: flex-start;
}

.ProseMirror [bke-role="callout"] > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
  margin-right: calc(0.75rem * var(--tw-space-x-reverse));
  margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse)));
}

.ProseMirror [bke-role="callout"] {
  border-radius: 0.375rem;
  border-width: 1px;
  border-color: transparent;
  padding: 1rem;
}

.ProseMirror [bke-role="callout"] > [bke-role="emoji"] {
  /* mt-1 与 callout-content 的 pt-1 对齐，避免图钉相对首行正文偏上 */
  margin-top: 0.25rem;
  display: flex;
  height: 2rem;
  width: 2rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  padding: 0.375rem;
  font-size: 1.5rem;
  line-height: 2rem;
}

.ProseMirror [bke-role="callout"] [bke-role="callout-content"] {
  flex: 1 1 0%;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-right: 0.5rem;
}

.ProseMirror[contenteditable="true"] [bke-role="callout"] > [bke-role="emoji"] {
  cursor: pointer;
}

.ProseMirror[contenteditable="true"] [bke-role="callout"] > [bke-role="emoji"]:hover {
  background-color: rgb(0 0 0 / 0.1);
}

/* 这是编辑器在使用 */

pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em
}

code.hljs {
  padding: 3px 5px
}

/*
 * Visual Studio 2015 dark style
 * Author: Nicolas LLOBERA <nllobera@gmail.com>
 */

.hljs {
  background: #1E1E1E;
  color: #DCDCDC
}

.hljs-keyword,
.hljs-literal,
.hljs-symbol,
.hljs-name {
  color: #569CD6
}

.hljs-link {
  color: #569CD6;
  text-decoration: underline
}

.hljs-built_in,
.hljs-type {
  color: #4EC9B0
}

.hljs-number,
.hljs-class {
  color: #B8D7A3
}

.hljs-string,
.hljs-meta .hljs-string {
  color: #D69D85
}

.hljs-regexp,
.hljs-template-tag {
  color: #9A5334
}

.hljs-subst,
.hljs-function,
.hljs-title,
.hljs-params,
.hljs-formula {
  color: #DCDCDC
}

.hljs-comment,
.hljs-quote {
  color: #57A64A;
  font-style: italic
}

.hljs-doctag {
  color: #608B4E
}

.hljs-meta,
.hljs-meta .hljs-keyword,
.hljs-tag {
  color: #9B9B9B
}

.hljs-variable,
.hljs-template-variable {
  color: #BD63C5
}

.hljs-attr,
.hljs-attribute {
  color: #9CDCFE
}

.hljs-section {
  color: gold
}

.hljs-emphasis {
  font-style: italic
}

.hljs-strong {
  font-weight: bold
}

/*.hljs-code {
  font-family:'Monospace';
}*/

.hljs-bullet,
.hljs-selector-tag,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: #D7BA7D
}

.hljs-addition {
  background-color: #144212;
  display: inline-block;
  width: 100%
}

.hljs-deletion {
  background-color: #600;
  display: inline-block;
  width: 100%
}

.ProseMirror pre {
  border-radius: 0.375rem;
  background-color: #0f172a;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #fff;
}

.ProseMirror pre code {
  background-color: transparent;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: inherit;
}

.ProseMirror pre[data-placeholder].is-empty:before{
  color: #ffffff4f !important;
}

.ProseMirror pre ~ pre {
  margin-top: 1rem;
}

.ProseMirror {
  /* 去掉 .prose 给code前后加个单引号的问题 */
  /* code::before {
    content: "";
  }
  code::after {
    content: "";
  } */
}

.ProseMirror code {
  border-radius: 0.125rem;
  background-color: #e2e8f0;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
  padding: 0.25rem;
  color: #b91c1c;
  text-wrap: wrap;
}

.ProseMirror [bke-role="column"] {
  min-width: 0px;
  flex: none;
  border-radius: 0.25rem;
  background-color: #f9fafb;
  padding: 1rem;
}

.ProseMirror [bke-role="column"]:is(.bke-dark *) {
  background-color: #1e293b;
}

.ProseMirror [bke-role="columns"] {
  display: grid;
  gap: 0.25rem;
  border-radius: 0.125rem;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

@media screen and (max-width: 600px) {
  .ProseMirror [bke-role="columns"] {
    display: block;
    gap: 0px;
  }
}

.ProseMirror [bke-role="columns"][bke-columns="2"][bke-columns-layout="1:2"] {
  grid-template-columns: 1fr 2fr;
}

.ProseMirror [bke-role="columns"][bke-columns="2"][bke-columns-layout="2:1"] {
  grid-template-columns: 2fr 1fr;
}

.ProseMirror [bke-role="columns"][bke-columns="3"][bke-columns-layout="1:2:1"] {
  grid-template-columns: 1fr 2fr 1fr;
}

.ProseMirror[contenteditable="true"] [bke-role="column"] {
  border-width: 1px;
  border-style: dashed;
}

.ProseMirror[contenteditable="true"] [bke-role="column"]:hover {
  background-color: #f3f4f6;
}

.ProseMirror[contenteditable="true"] [bke-role="column"]:is(.bke-dark *) {
  background-color: #1e293b;
}

.ProseMirror[contenteditable="true"] {
}

.ProseMirror [data-dam-deleted] {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background-color: #f3f4f6;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: #d1d5db;
}

.ProseMirror [data-dam-deleted]:is(.bke-dark *) {
  background-color: #202B40;
}

.ProseMirror [bke-role="doc-title"] {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  border-bottom-width: 1px;
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}

.ProseMirror [bke-role="doc-title"] [bke-role="emoji"] {
  margin-right: 0.125rem;
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.ProseMirror [bke-role="doc-title"] [bke-role="emoji"][bke-emoji=""],
    .ProseMirror [bke-role="doc-title"] [bke-role="emoji"]:not([bke-emoji]) {
  display: none;
}

.ProseMirror [bke-role="title"] {
  margin: 0px;
  flex: 1 1 0%;
}

.ProseMirror[contenteditable="true"] [bke-role="doc-title"] [bke-role="emoji"]:hover {
  background-color: #f3f4f6;
}

.ProseMirror .drag-handle {
  position: fixed;
  opacity: 1;
  transition: opacity ease-in 0.2s;
  border-radius: 0.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' style='fill: rgba(0, 0, 0, 0.5)'%3E%3Cpath d='M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z'%3E%3C/path%3E%3C/svg%3E");
  background-size: calc(0.5em + 0.375rem) calc(0.5em + 0.375rem);
  background-repeat: no-repeat;
  background-position: center;
  width: 1.2rem;
  height: 1.5rem;
  z-index: 50;
  cursor: grab;
}

.ProseMirror .drag-handle:hover {
  background-color: rgb(245 245 244);
  transition: background-color 0.2s;
}

.ProseMirror .drag-handle:active {
  background-color: rgb(231 229 228);
  transition: background-color 0.2s;
}

.ProseMirror .drag-handle.hide {
  opacity: 0;
  pointer-events: none;
}

@media screen and (max-width: 600px) {
  .ProseMirror .drag-handle {
    display: none;
    pointer-events: none
  }
}

/* 文件样式主文件 - 导入所有子模块 */

/* 文件卡片基础样式 */

.ProseMirror [bke-role="file"] {
  display: block;
  width: 100%;
  max-width: var(--bke-file-max-width, var(--bke-max-width, 680px));
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  transition: all 0.2s ease;
  overflow: visible;
  position: relative;
}

.ProseMirror [bke-role="file"]:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.ProseMirror [bke-role="file"][bke-align="center"] {
  margin-left: auto;
  margin-right: auto;
}

.ProseMirror [bke-role="file"][bke-align="right"] {
  margin-left: auto;
}

.ProseMirror [bke-role="file"][bke-align="left"] {
  margin-right: auto;
}

.ProseMirror [bke-role="file"][bke-width] {
  max-width: 100%;
}

.ProseMirror [bke-role="file"] audio {
  width: 100%;
}

.ProseMirror [bke-role="file"] video {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.ProseMirror [bke-role="file"] [bke-file-layout] {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
}

.ProseMirror [bke-role="file"] [bke-file-layout] [bke-file-icon-container] {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0.375rem;
  background-color: #f3f4f6;
  padding: 0.5rem;
}

.ProseMirror [bke-role="file"] [bke-file-layout] [bke-file-icon-container] [bke-file-icon] {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
}

.ProseMirror [bke-role="file"] [bke-file-layout] [bke-file-icon-container] [bke-file-icon] > svg {
  height: 100%;
  width: 100%;
}

.ProseMirror [bke-role="file"] [bke-file-content]{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
}

/* 视频和音频的标题容器 */

.ProseMirror [bke-role="file"] [bke-file-title] {
  margin: 0;
  margin-top: 8px;
  text-align: left;
}

.ProseMirror [bke-role="file"] [bke-file-title] [bke-file-name] {
  margin-bottom: 4px;
}

.ProseMirror [bke-role="file"] [bke-file-name] {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
  margin: 0;
  display: block;
  min-width: 0;
}

/* 在 flex 布局中允许收缩，便于子元素截断 */

.ProseMirror [bke-role="file"] [bke-file-name] > button {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ProseMirror [bke-role="file"] [bke-file-name] > a {
  text-decoration: none;
  color: unset;
}

.ProseMirror [bke-role="file"] [bke-file-name] > a:hover {
  background-color: unset;
  text-decoration: underline;
}

.ProseMirror [bke-role="file"] [bke-file-info] {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.ProseMirror [bke-role="file"] [bke-file-size] {
  font-size: 12px;
  color: #94a3b8;
}

.ProseMirror [bke-role="file"] [bke-file-time] {
  font-size: 12px;
  color: #94a3b8;
}

.ProseMirror [bke-role="file"] [bke-file-actions] {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  flex-shrink: 0;
}

/* Fragment 样式主文件 - 导入所有子模块 */

/* Fragment 卡片基础样式 */

.ProseMirror[contenteditable="true"] [bke-role="fragment"] {
  display: block;
  position: relative;
  padding: 2px;
  border-radius: 3px;
  outline: 1px solid #e2e8f0;
  outline-offset: 3px;
  transition: all 0.2s ease;
  overflow: visible;
}

.ProseMirror[contenteditable="true"] [bke-role="fragment"]:hover {
  outline-color: #cbd5e1;
}

.ProseMirror[contenteditable="true"] [bke-role="fragment"]:hover [bke-fragment-title] {
  display: block;
}

/* Fragment 标题容器（左上角） */

.ProseMirror [bke-role="fragment"] [bke-fragment-title] {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  background-color: #ffffff;
  padding: 4px 8px;
  border-top-left-radius: 8px;
  border-bottom-right-radius: 6px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  border-top: none;
  border-left: none;
  max-width: 80%;
  display: none;
}

/* Fragment 标题按钮 */

.ProseMirror [bke-role="fragment"] [bke-fragment-title] button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.ProseMirror [bke-role="fragment"] [bke-fragment-title] button:hover {
  text-decoration: underline;
}

/* Fragment 标题文本 */

.ProseMirror [bke-role="fragment"] [bke-fragment-title] button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fragment 图标样式 */

.ProseMirror [bke-role="fragment"] [bke-fragment-title] button [data-controller="file-icon"] {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ProseMirror [bke-role="fragment"] [bke-fragment-title] button [data-controller="file-icon"] svg {
  width: 14px;
  height: 14px;
}

/* Fragment 内容容器 */

.ProseMirror [bke-role="fragment"] .fragment-content {
  border-radius: 8px;
  overflow: clip;
}

.ProseMirror h1, .ProseMirror h2, .ProseMirror h3, .ProseMirror h4, .ProseMirror h5, .ProseMirror h6 {
  margin-top: 1rem;
  font-weight: 700;
}

.ProseMirror h1 {
  margin-top: 2rem;
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.ProseMirror h2 {
  margin-top: 1.5rem;
  font-size: 1.5rem;
  line-height: 2rem;
}

.ProseMirror h3 {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.ProseMirror h4 {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.ProseMirror h5 {
  font-size: 1rem;
  line-height: 1.5rem;
}

.ProseMirror h6 {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.ProseMirror[contenteditable="true"] h1[data-placeholder].is-empty::before {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.ProseMirror[contenteditable="true"] h2[data-placeholder].is-empty::before {
  font-size: 1.5rem;
  line-height: 2rem;
}

.ProseMirror[contenteditable="true"] h3[data-placeholder].is-empty::before {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.ProseMirror[contenteditable="true"] h4[data-placeholder].is-empty::before {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.ProseMirror[contenteditable="true"] h5[data-placeholder].is-empty::before {
  font-size: 1rem;
  line-height: 1.5rem;
}

.ProseMirror[contenteditable="true"] h6[data-placeholder].is-empty::before {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.ProseMirror hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 1.5rem 0;
}

.ProseMirror div[bke-role="iframe"] {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  /* 16:9 Aspect Ratio (9 / 16 = 0.5625) */
  height: 0;
  overflow: hidden;
  border-radius: 0.5rem;
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important;
  --tw-ring-color: #d1d5db !important;
}

.ProseMirror div[bke-role="iframe"] .bke-iframe__toolbar {
  display: none;
}

.ProseMirror div[bke-role="iframe"] .bke-iframe-toolbar__url-bar {
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.ProseMirror div[bke-role="iframe"] .bke-iframe-toolbar__url-bar a {
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: nowrap;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  color: #6b7280;
}

.ProseMirror div[bke-role="iframe"] .bke-iframe-toolbar__url-bar a:hover {
  background-color: inherit;
  color: hsl(var(--theme-color-primary) / 1);
}

.ProseMirror div[bke-role="iframe"] > iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ProseMirror div[bke-role="iframe-empty"] {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border-width: 1px;
  border-style: dashed;
  border-color: #d1d5db;
  padding: 6rem;
}

.ProseMirror[contenteditable="true"] div[bke-role="iframe"] .bke-iframe__toolbar {
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  display: block;
  height: 2rem;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  background-color: #f3f4f6;
}

.ProseMirror[contenteditable="true"] div[bke-role="iframe"] > iframe {
  top: 2rem;
}

.ProseMirror .editor_image {
  position: relative;
  margin-left: auto;
  margin-right: auto;
  display: inline-block;
  padding: 0.5rem;
}

.ProseMirror [bke-role="image"] {
  display: inline-block;
  max-width: 100%;
}

.ProseMirror[contenteditable="true"] [bke-role="image"]:not([bke-dam-id]) {
  border-left-width: 4px;
  border-right-width: 4px;
  border-style: dashed;
  border-color: #9ca3af;
}

@keyframes bke-pulse {
  50% {
    opacity: .5;
  }
}

.ProseMirror[contenteditable="true"] [bke-role="image"][bke-dam-uploading] {
  animation: bke-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  border-color: #22c55e;
}

.ProseMirror[contenteditable="true"] [bke-role="image"][bke-dam-upload-failed] {
  border-color: #ef4444;
}

/* 链接样式主文件 - 导入所有子模块 */

/* 内部链接 parsing 动画 */

@keyframes internal-link-parsing {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* 刷新按钮旋转动画 */

@keyframes bke-link-reload-rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* 解析状态波浪动画 */

@keyframes bke-link-parsing-wave {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* 加载旋转动画 */

@keyframes bke-link-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 默认链接样式（标题视图） */

.ProseMirror a {
  color: var(--bke-link-color, #1c7ed6);
  -webkit-text-decoration: var(--bke-link-text-decoration, underline);
          text-decoration: var(--bke-link-text-decoration, underline);
}

.ProseMirror a:hover {
  background-color: var(--bke-link-hover-background-color, #e0f0ff);
}

/* 链接编辑时的高亮样式 */

.ProseMirror a[bke-link-editing] {
  background-color: var(--bke-link-editing-background-color, #fff3cd);
  transition: background-color 0.2s ease;
}

/* 链接视图：显示为链接样式（蓝色、下划线） */

.ProseMirror a[bke-link-display="url"] {
  -webkit-text-decoration: var(--bke-link-text-decoration--link-mode, none);
          text-decoration: var(--bke-link-text-decoration--link-mode, none);
}

/* 内部链接 parsing 状态（横向向右循环的白色半透明渐变） */

.ProseMirror a[bke-link-parse="parsing"] {
  background: linear-gradient(
      90deg,
      var(--bke-link-parsing-background-color, #72caf3) 0%,
      rgba(255, 255, 255, 0.5) 50%,
      var(--bke-link-parsing-background-color, #72caf3) 100%
    );
  background-size: 200% 100%;
  animation: internal-link-parsing 1.5s linear infinite;
  transition: background-color 0.2s ease;
}

/* 链接卡片基础样式 */

.ProseMirror [bke-role="link_node"] {
  display: block;
  max-width: 680px;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  transition: all 0.2s ease;
  overflow: visible;
  position: relative;
}

.ProseMirror [bke-role="link_node"]:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.ProseMirror [bke-role="link_node"][bke-align="center"] {
  margin-left: auto;
  margin-right: auto;
}

.ProseMirror [bke-role="link_node"][bke-align="right"] {
  margin-left: auto;
}

.ProseMirror [bke-role="link_node"][bke-align="left"] {
  margin-right: auto;
}

.ProseMirror [bke-role="link_node"][bke-width] {
  max-width: 100%;
}

/* 卡片内容区域（flex 布局：图标在左，内容在右） */

.ProseMirror [bke-role="link_node"] [bke-link-layout] {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* 图标区域 */

.ProseMirror [bke-role="link_node"] [bke-link-layout] [bke-link-icon-container] {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
  border-radius: 6px;
  overflow: hidden;
  padding: 6px;
}

.ProseMirror [bke-role="link_node"] [bke-link-layout] [bke-link-icon-container]:has(img) {
  padding: 0px;
}

.ProseMirror [bke-role="link_node"] [bke-link-layout] [bke-link-icon-container]:empty {
  background-color: blue;
}

.ProseMirror [bke-role="link_node"] [bke-link-layout] [bke-link-icon-container] img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
}

.ProseMirror [bke-role="link_node"] [bke-link-layout] [bke-link-icon-container] [bke-link-icon] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
}

/* 内容区域（在图标右边） */

.ProseMirror [bke-role="link_node"] [bke-link-content]{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-right: 20px;
}

/* 标题 - 在图标右边，单行，超出省略 */

.ProseMirror [bke-role="link_node"] [bke-link-content] [bke-link-title] {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* URL 容器 - 在标题下面，小间距 */

.ProseMirror [bke-role="link_node"] [bke-link-content] [bke-link-url-container] {
  line-height: 1.0;
  overflow: hidden;
  min-width: 0;
  margin-right: -20px;
}

/* URL 链接 - 在标题下面，小字，灰色，单行显示，超出省略 */

.ProseMirror [bke-role="link_node"] [bke-link-content] [bke-link-url-container] [bke-link-url] {
  font-size: 12px;
  color: #94a3b8;
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ProseMirror [bke-role="link_node"] [bke-link-content] [bke-link-url-container] [bke-link-url]:hover {
  color: #64748b;
  text-decoration: underline;
}

/* 描述 - 在 URL 下面，图标右侧，最多两行显示 */

.ProseMirror [bke-role="link_node"] [bke-link-content] [bke-link-description] {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* 描述为空时隐藏（避免留白） */

.ProseMirror [bke-role="link_node"] [bke-link-content] [bke-link-description]:empty {
  display: none;
  margin-top: 0;
}

/* DAM 链接卡片样式 */

.ProseMirror [bke-role="link_node"][bke-link-type="dam"],
  .ProseMirror [bke-role="link_node"][bke-link-type="internal"] {
  /* border-color: #fb923c; */
}

/* 图标骨架屏占位符 */

.ProseMirror [bke-role="link_node"] [bke-link-skeleton="icon"] {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background-color: #e2e8f0;
  animation: bke-link-parsing-wave 1.5s ease-in-out infinite;
}

/* 标题骨架屏占位符 - 在图标右边，单行 */

.ProseMirror [bke-role="link_node"] [bke-link-skeleton="title"] {
  height: 21px;
  /* 15px font-size * 1.4 line-height ≈ 21px */
  width: 200px;
  border-radius: 4px;
  background-color: #e2e8f0;
  animation: bke-link-parsing-wave 1.5s ease-in-out infinite;
  margin-bottom: 6px;
  /* 标题和 URL 之间的间距 */
}

/* URL 骨架屏占位符 - 在标题下面 */

.ProseMirror [bke-role="link_node"] [bke-link-url-container] [bke-link-skeleton="url"] {
  height: 14.4px;
  /* 12px font-size * 1.2 line-height ≈ 14.4px */
  width: 120px;
  border-radius: 4px;
  background-color: #e2e8f0;
  animation: bke-link-parsing-wave 1.5s ease-in-out infinite;
  display: block;
  /* 确保占位符显示为块级元素 */
}

/* 描述骨架屏占位符 - 在 URL 下面 */

.ProseMirror [bke-role="link_node"][bke-link-parse="parsing"] [bke-link-skeleton="description"] {
  height: 18.2px;
  /* 13px font-size * 1.4 line-height ≈ 18.2px */
  width: 100%;
  border-radius: 4px;
  background-color: #e2e8f0;
  animation: bke-link-parsing-wave 1.5s ease-in-out infinite;
  margin-top: 8px;
  /* 描述和 URL 之间的间距，与 card-content.css 保持一致 */
}

/* 内部链接 reload 按钮（右上角） */

.ProseMirror [bke-role="link_node"][bke-link-type="internal"] [bke-link-reload] {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.2s ease;
  z-index: 10;
  opacity: 0.6;
}

.ProseMirror [bke-role="link_node"][bke-link-type="internal"] [bke-link-reload]:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.95);
  color: #64748b;
}

.ProseMirror [bke-role="link_node"][bke-link-type="internal"] [bke-link-reload]:active {
  transform: scale(0.95);
}

.ProseMirror [bke-role="link_node"][bke-link-type="internal"] [bke-link-reload] svg {
  width: 16px;
  height: 16px;
}

/* 当链接处于 parsing 状态时，刷新按钮旋转 */

.ProseMirror [bke-role="link_node"][bke-link-parse="parsing"] [bke-link-reload] svg {
  animation: bke-link-reload-rotate 1s linear infinite;
}

/* 解析状态遮罩（统一用于 URL 解析、DAM 同步等所有解析场景） */

.ProseMirror [bke-role="link_node"][bke-link-parse="parsing"] {
  position: relative;
}

.ProseMirror [bke-role="link_node"][bke-link-parse="parsing"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: rgba(200, 200, 200, 0.5);
  border-radius: 8px;
  animation: bke-link-parsing-wave 1.5s ease-in-out infinite;
}

.ProseMirror [bke-role="link_node"][bke-link-parse="parsing"] > [bke-link-spinner] {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
}

.ProseMirror [bke-role="link_node"][bke-link-parse="parsing"] [bke-link-spinner] {
  height: 28px;
  width: 28px;
  animation: bke-link-spin 1s linear infinite;
  border-radius: 50%;
  border: 3px solid #3b82f6;
  border-right-color: transparent;
}

/* 内部链接样式 */

.ProseMirror a[bke-link-type="internal"]:not([bke-link-display="card"]) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--bke-link-color, #1c7ed6);
  text-decoration: none;
  background-color: #f0f9ff;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.ProseMirror a[bke-link-type="internal"]:not([bke-link-display="card"]):not([bke-link-parse="parsing"])::before {
  content: "🔗";
  width: 16px;
  height: 16px;
  text-align: center;
  line-height: 16px;
  font-size: 16px;
  color: #1c7ed6;
}

.ProseMirror a[bke-link-type="internal"]:not([bke-link-display="card"]):hover {
  background-color: #e0f2fe;
}

.ProseMirror a[bke-link-type="internal"] + a[bke-link-type="internal"] {
  margin-left: 8px;
}

.ProseMirror {
  /* li > p.is-empty[data-placeholder]:before {
    padding-left: 1.5rem;
  } */
}

.ProseMirror ol,
  .ProseMirror ul {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0 1rem;
}

.ProseMirror ol:first-child, .ProseMirror ul:first-child {
  margin-top: 0;
}

.ProseMirror ol:last-child, .ProseMirror ul:last-child {
  margin-bottom: 0;
}

.ProseMirror ol li, .ProseMirror ul li {
  margin: 0;
  line-height: 1.5;
}

.ProseMirror ol li::marker, .ProseMirror ul li::marker {
  /* color: hsl(var(--theme-color-primary)); */
  font-weight: 500;
}

.ProseMirror ol li > p + p, .ProseMirror ul li > p + p {
  margin: 0;
}

.ProseMirror ol {
  list-style-type: decimal;
}

.ProseMirror ul {
  list-style-type: disc;
}

.ProseMirror ul[data-type="taskList"] {
  list-style-type: none;
  padding-left: 0;
}

.ProseMirror ul[data-type="taskList"] > li {
  display: flex;
  align-items: start;
}

.ProseMirror ul[data-type="taskList"] > li > :first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.35rem;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.ProseMirror ul[data-type="taskList"] > li > :first-child input[type="checkbox"] {
  -webkit-appearance: none;
  top: 3px;
  display: grid;
  place-content: center;
  width: 1rem;
  height: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  outline: none;
  cursor: pointer;
  -moz-appearance: none;
       appearance: none;
  position: relative;
}

.ProseMirror ul[data-type="taskList"] > li > :first-child input[type="checkbox"]::before {
  content: " ";
  display: inline-block;
  line-height: normal;
  font-size: 1rem;
  background-position: 50%;
  white-space: normal;
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  position: absolute;
  top: -1px;
  left: -1px;
}

.ProseMirror ul[data-type="taskList"] > li > :first-child input[type="checkbox"]:checked {
  border: 1px solid hsl(var(--theme-color-primary));
}

.ProseMirror ul[data-type="taskList"] > li > :first-child input[type="checkbox"]:checked::before {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");
  background-color: hsl(var(--theme-color-primary));
}

/* 嵌套列表，不需要上下间距 */

.ProseMirror li ul,
  .ProseMirror li ol {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.ProseMirror ul ul{
  list-style-type: square;
  /* 实心方块 */
}

.ProseMirror ul ul ul{
  list-style-type: circle;
  /* 空心圆点 */
}

.ProseMirror ul ul ul ul{
  list-style-type: disc;
  /* 实心圆点 */
}

.ProseMirror ul ul ul ul ul{
  list-style-type: square;
  /* 实心方块 */
}

.ProseMirror ul ul ul ul ul ul{
  list-style-type: circle;
  /* 空心圆点 */
}

.ProseMirror ul ul ul ul ul ul ul{
  list-style-type: disc;
  /* 实心圆点 */
}

.ProseMirror ol ol{
  list-style-type: lower-alpha;
  /* 小写字母 */
}

.ProseMirror ol ol ol{
  list-style-type: lower-roman;
  /* 小写罗马数字 */
}

.ProseMirror ol ol ol ol{
  list-style-type: number;
  /* 数字 */
}

.ProseMirror ol ol ol ol ol{
  list-style-type: lower-alpha;
  /* 大写字母 */
}

.ProseMirror ol ol ol ol ol ol{
  list-style-type: lower-roman;
  /* 大写罗马数字 */
}

.ProseMirror ol ol ol ol ol ol ol{
  list-style-type: number;
  /* 数字 */
}

.ProseMirror pre[bke-role="markdown-block"] {
  background-color: inherit;
  padding: 0px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, PingFang SC, Hiragino Sans GB, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
  color: inherit;
}

.ProseMirror pre[bke-role="markdown-block"] .bke-markdown-block__toolbar {
  display: none;
}

.ProseMirror pre[bke-role="markdown-block"] > code {
  display: none;
}

.ProseMirror pre[bke-role="markdown-block"] .bke-markdown-block__preview {
  display: block;
  padding: 0px;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] {
  border-radius: 0.5rem;
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
  --tw-ring-color: hsl(var(--theme-color-primary) / 1);
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] > code {
  display: block;
  padding: 1rem;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .bke-markdown-block__toolbar {
  display: flex;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  align-items: flex-start;
  justify-content: space-between;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .bke-markdown-block__label {
  max-width: -moz-fit-content;
  max-width: fit-content;
  border-top-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  background-color: hsl(var(--theme-color-primary) / 1);
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  line-height: 1rem;
  color: #fff;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .bke-markdown-block__actions {
  display: flex;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0.25rem;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .bke-markdown-block__btn-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.25rem;
  background-color: #f9fafb;
  padding: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .bke-markdown-block__btn-preview > span {
  border-radius: 0.25rem;
  padding-left: 0.375rem;
  padding-right: 0.375rem;
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .bke-markdown-block__btn-preview > span:first-child {
  background-color: #e5e7eb;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .bke-markdown-block__preview {
  display: none;
  padding: 1rem;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"].bke-markdown--previewing .bke-markdown-block__btn-preview > span:first-child {
  background-color: inherit;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"].bke-markdown--previewing .bke-markdown-block__btn-preview > span:last-child {
  background-color: #e5e7eb;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"].bke-markdown--previewing > code {
  display: none;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"].bke-markdown--previewing .bke-markdown-block__preview {
  display: block;
}

/* 拷贝 https://github.com/highlightjs/highlight.js/blob/main/src/styles/github.css */

/*!
  Theme: GitHub
  Description: Light theme as seen on github.com
  Author: github.com
  Maintainer: @Hirse
  Updated: 2021-05-15

  Outdated base version: https://github.com/primer/github-syntax-light
  Current colors taken from GitHub's CSS
*/

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs {
  color: #24292e;
  background: #ffffff;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-doctag,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-keyword,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-meta .hljs-keyword,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-template-tag,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-template-variable,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-type,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-variable.language_ {
  /* prettylights-syntax-keyword */
  color: #d73a49;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-title,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-title.class_,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-title.class_.inherited__,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-title.function_ {
  /* prettylights-syntax-entity */
  color: #6f42c1;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-attr,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-attribute,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-literal,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-meta,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-number,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-operator,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-variable,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-selector-attr,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-selector-class,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-selector-id {
  /* prettylights-syntax-constant */
  color: #005cc5;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-regexp,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-string,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-meta .hljs-string {
  /* prettylights-syntax-string */
  color: #032f62;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-built_in,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-symbol {
  /* prettylights-syntax-variable */
  color: #e36209;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-comment,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-code,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-formula {
  /* prettylights-syntax-comment */
  color: #6a737d;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-name,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-quote,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-selector-tag,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-selector-pseudo {
  /* prettylights-syntax-entity-tag */
  color: #22863a;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-subst {
  /* prettylights-syntax-storage-modifier-import */
  color: #24292e;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-section {
  /* prettylights-syntax-markup-heading */
  color: #005cc5;
  font-weight: bold;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-bullet {
  /* prettylights-syntax-markup-list */
  color: #735c0f;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-emphasis {
  /* prettylights-syntax-markup-italic */
  color: #24292e;
  font-style: italic;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-strong {
  /* prettylights-syntax-markup-bold */
  color: #24292e;
  font-weight: bold;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-addition {
  /* prettylights-syntax-markup-inserted */
  color: #22863a;
  background-color: #f0fff4;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-deletion {
  /* prettylights-syntax-markup-deleted */
  color: #b31d28;
  background-color: #ffeef0;
}

.ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-char.escape_,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-link,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-params,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-property,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-punctuation,
    .ProseMirror[contenteditable="true"] pre[bke-role="markdown-block"] .hljs-tag {
  /* purposely ignored */
}

.ProseMirror {
  --table-th-bg-color: var(--bke-table-th-bg-color, #f8f9fa);
  --table-selected-bg-color: var(--bke-table-selected-bg-color, rgba(0, 0, 0, 0.05));
  --table-border-color: var(--bke-table-border-color, #dee2e6);
  --table-resize-handle-bg-color: var(--bke-table-resize-handle-bg-color, hsl(var(--theme-color-primary, 200deg 80% 50%)));
  --table-resizing-bg-color: var(--bke-table-resizing-bg-color, hsl(var(--theme-color-primary-hsl-h) 100% 96%));
  --table-tr-hover-bg-color: var(--bke-table-tr-hover-bg-color, hsl(var(--theme-color-primary-hsl-h) 100% 99%));
}

.ProseMirror.resize-cursor {
  cursor: ew-resize;
  cursor: col-resize;
}

.ProseMirror .tableWrapper,
  .ProseMirror .bke-table-container {
  margin: 1.5rem 0;
  /* max-width: 100%; */
  max-width: -moz-fit-content;
  max-width: fit-content;
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid var(--table-border-color);
}

.ProseMirror .tableWrapper > table, .ProseMirror .bke-table-container > table {
  overflow: hidden;
}

.ProseMirror .tableWrapper > table tr:first-child > td,
      .ProseMirror .tableWrapper > table tr:first-child > th,
      .ProseMirror .bke-table-container > table tr:first-child > td,
      .ProseMirror .bke-table-container > table tr:first-child > th {
  border-top: none;
}

.ProseMirror .tableWrapper > table tr:last-child > td,
      .ProseMirror .tableWrapper > table tr:last-child > th,
      .ProseMirror .bke-table-container > table tr:last-child > td,
      .ProseMirror .bke-table-container > table tr:last-child > th {
  border-bottom: none;
}

.ProseMirror .tableWrapper > table tr > td:first-child,
      .ProseMirror .tableWrapper > table tr > th:first-child,
      .ProseMirror .bke-table-container > table tr > td:first-child,
      .ProseMirror .bke-table-container > table tr > th:first-child {
  border-left: none;
}

.ProseMirror .tableWrapper > table tr > td:last-child:not([colwidth]),
      .ProseMirror .tableWrapper > table tr > th:last-child:not([colwidth]),
      .ProseMirror .bke-table-container > table tr > td:last-child:not([colwidth]),
      .ProseMirror .bke-table-container > table tr > th:last-child:not([colwidth]) {
  border-right: none;
}

/* table {
      table-layout: fixed;
    } */

.ProseMirror[contenteditable="true"] td[colwidth],
    .ProseMirror[contenteditable="true"] th[colwidth] {
  border-right: 1px solid hsl(0 0 0);
}

.ProseMirror table {
  border-collapse: collapse;
  margin: 0;
  table-layout: fixed;
  width: 100%;
}

.ProseMirror table[data-table-layout="fixed"] {
  table-layout: fixed;
}

.ProseMirror table[data-table-layout="auto"] {
  table-layout: auto;
}

.ProseMirror table td,
    .ProseMirror table th {
  border: 1px solid var(--table-border-color);
  box-sizing: border-box;
  padding: 6px 8px;
  position: relative;
  vertical-align: top;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: break-word;
}

.ProseMirror table td > *, .ProseMirror table th > * {
  margin-bottom: 0;
}

.ProseMirror table td > :first-child, .ProseMirror table th > :first-child {
  min-width: 2em;
  min-height: 1.5em;
}

.ProseMirror table tr {
  transition: background 0.2s;
}

.ProseMirror table tr:hover{
  background: var(--table-tr-hover-bg-color);
}

.ProseMirror table th {
  background-color: var(--table-th-bg-color);
  font-weight: bold;
  text-align: left;
}

.ProseMirror table .selectedCell:after {
  background-color: var(--table-selected-bg-color);
  content: "";
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.ProseMirror table .selectedCell [data-placeholder].is-empty::before {
  display: none;
}

.ProseMirror table .column-resize-handle {
  background-color: var(--table-resize-handle-bg-color);
  bottom: -1px;
  pointer-events: none;
  position: absolute;
  right: -3px;
  top: -1px;
  width: 5px;
  margin: 0;
  z-index: 3;
}

.ProseMirror table td.column-resize-dragging {
  background-color: var(--table-resizing-bg-color);
}

.ProseMirror table p {
  margin: 0;
}

.ProseMirror .video:not([data-dam-deleted]) {
  display: inline-block;
  aspect-ratio: 16 / 9;
  border-radius: 0.375rem;
  border-width: 1px;
  border-color: #e2e8f0;
  padding: 0.5rem;
}

.ProseMirror .video:not([data-dam-deleted]):hover {
  border-color: hsl(var(--theme-color-primary) / 1);
}

/* ___ app/javascript/controllers/popper_controller.js ___ */

/* --样式，__组件 */

.popper__root {
  position: absolute;
  visibility: hidden;
  z-index: 1000;
  /* 防止遮挡 */
  left: -9999px;
  top: -9999px;
}

.popper__root.popper--show {
  visibility: visible
}

.popper__root > .popper--box {
  /* color: #64748b; */
  color: #111;
  opacity: 0;
  transition-duration: .2s;
  transition-timing-function: cubic-bezier(0,0,.2,1);
  transition-property: transform,visibility,opacity;
}

:is(.dark .popper__root > .popper--box) {
  color: #a3adc2
}

.popper__root.popper--show > .popper--box {
  opacity: 1;
  transform: translate(0)!important;
  transition-timing-function: cubic-bezier(.4,0,1,1)
}

/* ___app/components/ui/dropdown_component.html.erb___ */

.popper-root {
  position: absolute;
  visibility: hidden;
  z-index: 1000;
  /* 防止遮挡 */
  left: -9999px;
  top: -9999px;
}

.popper-root.show {
  visibility: visible
}

.popper-root > .popper-box {
  /* color: #64748b; */
  color: #111;
  opacity: 0;
  transition-duration: .2s;
  transition-timing-function: cubic-bezier(0,0,.2,1);
  transition-property: transform,visibility,opacity;
}

:is(.dark .popper-root>.popper-box) {
  color: #a3adc2
}

.popper-root.show>.popper-box {
  opacity: 1;
  transform: translate(0)!important;
  transition-timing-function: cubic-bezier(.4,0,1,1)
}

.popper-root[data-popper-placement^=right]>.popper-box {
  --tw-translate-x: 0.75rem

}

.popper-root[data-popper-placement^=bottom]>.popper-box,.popper-root[data-popper-placement^=right]>.popper-box {
  transform: translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
}

.popper-root[data-popper-placement^=bottom]>.popper-box {
  --tw-translate-y: 0.75rem

}

.popper-root[data-popper-placement^=top]>.popper-box {
  --tw-translate-y: -0.75rem

}

.popper-root[data-popper-placement^=left]>.popper-box,.popper-root[data-popper-placement^=top]>.popper-box {
  transform: translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
}

.popper-root[data-popper-placement^=left]>.popper-box {
  --tw-translate-x: -0.75rem

}

.popper-root[data-popper-placement^=top] [data-popper-arrow] {
  bottom: .25rem
}

.popper-root[data-popper-placement^=top] [data-popper-arrow]>svg {
  --tw-rotate: 180deg;
  top: .875rem;
  transform: translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
}

.popper-root[data-popper-placement^=bottom] [data-popper-arrow] {
  top: .25rem
}

.popper-root[data-popper-placement^=bottom] [data-popper-arrow]>svg {
  bottom: .875rem
}

.popper-root[data-popper-placement^=left] [data-popper-arrow] {
  right: .125rem
}

.popper-root[data-popper-placement^=left] [data-popper-arrow] svg {
  left: 13px;
  top: calc(50% - 5px);
  transform: rotate(90deg)
}

.popper-root[data-popper-placement^=right] [data-popper-arrow] {
  left: .125rem
}

.popper-root[data-popper-placement^=right] [data-popper-arrow] svg {
  right: 13px;
  top: calc(50% - 5px);
  transform: rotate(-90deg)
}

.bke-relative {
  position: relative;
}

.bke-my-2 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.bke-hidden {
  display: none;
}

.bke-w-full {
  width: 100%;
}
