.mdeditor-loading-container {
  width: 100%;
  height: 100%;
  background-color: #000000c2;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  text-align: center;
  z-index: 100;
}

.mdeditor-container {
  width: 100%;
  height: 100%;
  min-width: 0;
  position: relative;
}


.mdeditor-loading {
  width: 30px;
  height: 30px;
  border: 5px solid #fff;
  border-top-color: transparent;
  border-radius: 100%;
  position: absolute;
  left: 50%;
  /* right: 50%; */
  top: 50%;
  margin-left: -15px;
  margin-top: -15px;

  animation: loading-circle infinite 0.75s linear;
}

@keyframes loading-circle {
  0% {
    transform: rotate(0);
  }

  100% {
    transform: rotate(360deg);
  }
}

.mdeditor-fullscreen {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
}

.mdeditor-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.mdeditor-tools {
  min-height: 30px;
  height: auto;
  overflow: hidden;
  border: 1px solid whitesmoke;
  background-color: white;
  position: sticky;
  top: 0px;
  z-index: 1;
  /* padding-top: 3px; */
  /* line-height: 30px; */
}

.mdeditor-tools .item {
  font-size: 20px;
  margin-right: 2px;
  margin-left: 2px;
  color: #6b6666;
  cursor: pointer;
  padding: 4px;
  background-color: #f7f7f7;
  /* border-right: 1px solid gray; */
}

.mdeditor-tools .item {
  background-color: transparent;
  /* border-right: 1px solid gray; */
}

.mdeditor-tools .icon-left {
  float: left;
}

.mdeditor-tools .icon-right {
  float: right;
}

.mdeditor-tools .item:hover {
  background-color: #d7d6d6;
  color: black;
}
.mdeditor-tools .mdeditor-dark:hover {
  background: #000;
  /* color: black; */
}

.mdeditor-main {
  /* height: calc(100% - 32px); */
  flex: 1;
  height: auto;
  display: flex;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.mdeditor-editor-container {
  width: 100%;
  height: 100%;
  display: flex;
}

.mdeditor-toc {
  height: 100%;
  overflow: auto;
  border: 1px solid #e5e5e5;
  /* background-color: black;
  color: white; */
}

.mdeditor-toc ul {
  /* list-style: circle; */
  padding-inline-start: 20px;
}

.mdeditor-toc a {
  text-decoration: none;
  color: #5f5d5d;
  font-size: 12px;
}

.mdeditor-toc a:hover {
  text-decoration: underline;
  color: #10b981;
  font-size: 12px;
}

.mdeditor-editor {
  height: 100%;
  width: 50%;
}

.mdeditor-preview {
  height: 100%;
  width: 50%;
  background-color: white;
  padding: 0px 26px;
  overflow: auto;
  scroll-behavior: smooth;

  /* background-color: black; */
}

.mdeditor-dialog {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

/* base */
.mdeditor-preview iframe {
  width: 100%;
  height: 350px;
  border: none;
}

:root {
  --space: 0.25rem;
}

.mdeditor-preview img {
  background-image: linear-gradient(
      45deg,
      #eee 25%,
      transparent 25%,
      transparent 75%,
      #eee 75%,
      #eee 100%
    ),
    linear-gradient(45deg, #eee 25%, white 25%, white 75%, #eee 75%, #eee 100%);
  background-position:
    0 0,
    calc(2 * var(--space)) calc(2 * var(--space));
  background-size: calc(4 * var(--space)) calc(4 * var(--space));
  max-width: 100%;
}

.mdeditor-preview .mermaid {
  /* background: white; */
}

.mdeditor-scrolltop {
  position: absolute;
  z-index: 1000;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-align: center;
  cursor: pointer;
  line-height: 40px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  /* margin-left: calc(100% - 24px); */
}

.mdeditor-scrolltop:hover {
  background: rgba(0, 0, 0, 0.85);
}

.mdeditor-scrolltop .iconfont {
  font-size: 20px;
}

.editor-scrolltop {
  margin-left: 0px;
}

.viewer-open {
  overflow: auto !important;
}

.mdeditor-float-container {
  background-color: white;
  /* min-height: 100px;
  min-width: 60px; */
  border: 1px solid #e9e9e9;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1000;
  display: none;
  max-height: 560px;
  overflow: auto;
}

.mdeditor-theme-select {
  height: 25px;
}

.mdeditor-theme-select-item {
  /* height: 20px; */
  font-size: 14px;
  border-bottom: 1px solid #e9e9e9;
  padding: 2px 8px;
  cursor: pointer;
}

.mdeditor-theme-select-item:hover {
  background-color: #d7d6d6;
  /* color: white; */
}

.mdeditor-theme-select-item.active {
  background-color: #1e1e1e;
  color: #fff;
}

.markmap-render {
  width: 100%;
  height: 100%;
}

.mdeditor-dark {
  background-color: #000;
  color: #fff;
}

.mdeditor-dark .mdeditor-preview {
  background-color: #0d1117;
  color: #c9d1d9;
}

.mdeditor-dark .mdeditor-tools {
  background-color: #000;
  border: 1px solid #30363d;
}

.mdeditor-dark .mdeditor-toc {
  border: 1px solid #30363d;
}

.mdeditor-dark .mdeditor-toc a {
  color: #8b949e;
}

.mdeditor-dark .mdeditor-toc a:hover {
  color: #58a6ff;
}

.mdeditor-dark .mdeditor-scrolltop {
  background-color: #fff;
  color: #000;
}

.mdeditor-dark .mdeditor-float-container {
  background-color: #000;
  border: 1px solid #30363d;
  color: #9b9999 !important;
  color-scheme: dark;
}

.mdeditor-panel-dark {
  border: 1px solid #000;
}

.mdeditor-dark .mdeditor-theme-select-item {
  border-bottom: 1px solid #000;
}

.mdeditor-dark .mdeditor-theme-select-item:hover {
  background-color: #000;
}

.file-dnd-container {
  width: 500px;
  height: 400px;
  text-align: center;
  border: 1px dashed #e9e9e9;
}

/* copy from https://github.com/vuejs/vitepress/blob/v1.0.0-beta.6/src/client/theme-default/styles/vars.css */
:root {
  --vp-c-white: #ffffff;
  --vp-c-black: #000000;

  --vp-c-gray: #8e8e93;

  --vp-c-text-light-1: rgba(60, 60, 67);
  --vp-c-text-light-2: rgba(60, 60, 67, 0.75);
  --vp-c-text-light-3: rgba(60, 60, 67, 0.33);

  --vp-c-text-dark-1: rgba(255, 255, 245, 0.86);
  --vp-c-text-dark-2: rgba(235, 235, 245, 0.6);
  --vp-c-text-dark-3: rgba(235, 235, 245, 0.38);

  --vp-c-green: #10b981;
  --vp-c-green-light: #34d399;
  --vp-c-green-lighter: #6ee7b7;
  --vp-c-green-dark: #059669;
  --vp-c-green-darker: #047857;
  --vp-c-green-dimm-1: rgba(16, 185, 129, 0.05);
  --vp-c-green-dimm-2: rgba(16, 185, 129, 0.2);
  --vp-c-green-dimm-3: rgba(16, 185, 129, 0.5);

  --vp-c-yellow: #d97706;
  --vp-c-yellow-light: #f59e0b;
  --vp-c-yellow-lighter: #fbbf24;
  --vp-c-yellow-dark: #b45309;
  --vp-c-yellow-darker: #92400e;
  --vp-c-yellow-dimm-1: rgba(234, 179, 8, 0.05);
  --vp-c-yellow-dimm-2: rgba(234, 179, 8, 0.2);
  --vp-c-yellow-dimm-3: rgba(234, 179, 8, 0.5);

  --vp-c-red: #f43f5e;
  --vp-c-red-light: #fb7185;
  --vp-c-red-lighter: #fda4af;
  --vp-c-red-dark: #e11d48;
  --vp-c-red-darker: #be123c;
  --vp-c-red-dimm-1: rgba(244, 63, 94, 0.05);
  --vp-c-red-dimm-2: rgba(244, 63, 94, 0.2);
  --vp-c-red-dimm-3: rgba(244, 63, 94, 0.5);

  --vp-c-sponsor: #db2777;
}

/* copy from https://github.com/vuejs/vitepress/blob/v1.0.0-beta.6/src/client/theme-default/styles/vars.css */
/**
 * Colors Theme
 * -------------------------------------------------------------------------- */

:root {
  --vp-c-bg: #ffffff;

  --vp-c-bg-elv: #ffffff;
  --vp-c-bg-elv-up: #ffffff;
  --vp-c-bg-elv-down: #f6f6f7;
  --vp-c-bg-elv-mute: #f6f6f7;

  --vp-c-bg-soft: #f6f6f7;
  --vp-c-bg-soft-up: #f9f9fa;
  --vp-c-bg-soft-down: #e3e3e5;
  --vp-c-bg-soft-mute: #e3e3e5;

  --vp-c-bg-alt: #f6f6f7;

  --vp-c-border: rgba(60, 60, 67, 0.29);
  --vp-c-divider: rgba(60, 60, 67, 0.12);
  --vp-c-gutter: rgba(60, 60, 67, 0.12);

  --vp-c-neutral: var(--vp-c-black);
  --vp-c-neutral-inverse: var(--vp-c-white);

  --vp-c-text-1: var(--vp-c-text-light-1);
  --vp-c-text-2: var(--vp-c-text-light-2);
  --vp-c-text-3: var(--vp-c-text-light-3);

  --vp-c-text-inverse-1: var(--vp-c-text-dark-1);
  --vp-c-text-inverse-2: var(--vp-c-text-dark-2);
  --vp-c-text-inverse-3: var(--vp-c-text-dark-3);

  --vp-c-text-code: var(--vp-c-text-1);
}

.dark {
  --vp-c-bg: #1e1e20;

  --vp-c-bg-elv: #252529;
  --vp-c-bg-elv-up: #313136;
  --vp-c-bg-elv-down: #1e1e20;
  --vp-c-bg-elv-mute: #313136;

  --vp-c-bg-soft: #252529;
  --vp-c-bg-soft-up: #313136;
  --vp-c-bg-soft-down: #1e1e20;
  --vp-c-bg-soft-mute: #313136;

  --vp-c-bg-alt: #161618;

  --vp-c-border: rgba(82, 82, 89, 0.32);
  --vp-c-divider: rgba(82, 82, 89, 0.32);
  --vp-c-gutter: #000000;

  --vp-c-neutral: var(--vp-c-white);
  --vp-c-neutral-inverse: var(--vp-c-black);

  --vp-c-text-1: var(--vp-c-text-dark-1);
  --vp-c-text-2: var(--vp-c-text-dark-2);
  --vp-c-text-3: var(--vp-c-text-dark-3);

  --vp-c-text-inverse-1: var(--vp-c-text-light-1);
  --vp-c-text-inverse-2: var(--vp-c-text-light-2);
  --vp-c-text-inverse-3: var(--vp-c-text-light-3);

  --vp-c-text-code: var(--vp-c-text-dark-1);
}

/* Mobile view toggle */
.mdeditor-toggle-btn {
  display: none;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 50%;
  position: absolute;
  bottom: 80px;
  right: 20px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mdeditor-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}
