.md-editor {
  --editor-scrollbar-thumb: #d9dde2;
  --editor-scrollbar-thumb-hover: #c9cfd6;
  --editor-line-height: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  max-width: 1100px;
  margin: 20px auto;
}

.md-editor.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 999;
  margin: 0;
  max-width: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding-bottom: 0;
}

.md-editor.is-fullscreen .title-input {
  display: none;
}

.md-editor.is-fullscreen .topic-select {
  display: none;
}

.title-input {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.title-input input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 20px;
  color: #333;
}

.tab-select {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.window_header {
  min-height: 40px;
}

.tab-left {
  display: flex;
  align-items: center;
}

.tab-option {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
  border-bottom: 3px solid transparent;
}

.tab-option.active {
  border-bottom-color: #111;
  color: #111;
  font-weight: 600;
}

.markdown-tip {
  margin-left: auto;
  margin-right: 10px;
  font-size: 12px;
  color: #6b7280;
}

.markdown-tip a {
  color: inherit;
  text-decoration: none;
}

.editor-top-button {
  width: 24px;
  height: 24px;
  border-radius: 2px;
  color: #666;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background-color: transparent;
}

.editor-top-button:hover,
.editor-top-button.active {
  background-color: rgba(0, 0, 0, 0.1);
}

.mde-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 10px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.mde-toolbar.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.md-editor.mode-preview-active .mde-toolbar {
  display: none;
}

.mde-toolbar .sep {
  width: 1px;
  height: 14px;
  background: #d1d5db;
  margin: 0 3px;
}

.toolbar-item {
  border: none;
  background: transparent;
  border-radius: 2px;
  padding: 4px 3px;
  cursor: pointer;
  font-size: 13px;
  color: #777;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-item:hover {
  background: transparent;
}

.toolbar-item svg {
  width: 16px;
  height: 16px;
}

.content-area {
  min-height: 320px;
  height: auto;
  overflow: visible;
}

.content-area #cm-editor-wrapper {
  height: 100%;
}

.md-editor.is-fullscreen .content-area {
  flex: 1;
  min-height: 0;
  height: auto;
  padding-bottom: 0;
}

.md-editor.is-fullscreen .split-view-container {
  height: 100%;
}

.md-editor.is-fullscreen .split-view-container #cm-editor-wrapper {
  height: 100%;
  min-height: 0;
}

.split-view-container {
  display: block;
  height: 100%;
}

.split-view-container.mode-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.md-editor.is-fullscreen .split-view-container.mode-split {
  height: 100%;
}

.md-editor.is-fullscreen .split-view-container.mode-preview {
  height: 100%;
}

.md-editor.is-fullscreen .split-view-container.mode-split #cm-editor-wrapper,
.md-editor.is-fullscreen .split-view-container.mode-split .markHtml-wrapper {
  min-height: 0;
  height: 100%;
}

.md-editor.is-fullscreen .split-view-container.mode-split #cm-editor-wrapper {
  overflow: hidden;
}

.md-editor.is-fullscreen .split-view-container.mode-split .markHtml-wrapper {
  overflow: auto;
}

.md-editor.is-fullscreen .split-view-container.mode-preview .markHtml-wrapper {
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.split-view-container.mode-preview #cm-editor-wrapper {
  display: none;
}

.editor-area {
  padding: 12px 2px 12px 16px;
  position: relative;
  box-sizing: border-box;
  height: auto;
  min-height: 344px;
}

.editor-highlight {
  position: absolute;
  top: 12px;
  right: 2px;
  bottom: 12px;
  left: 16px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: var(--editor-line-height);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  transition: none;
  transform: none;
}


.editor-highlight .md-image-url {
  color: #0dbc79;
}

.editor-highlight .md-image-part {
  color: #0dbc79;
}

.editor-highlight .md-link-part,
.editor-highlight .md-link-url {
  color: #0dbc79;
}

.editor-highlight .md-image-bang {
  color: #333;
}

.editor-highlight .md-image-url.md-image-url-active {
  color: #d33636;
}

.editor-highlight .md-link-url.md-image-url-active {
  color: #d33636;
}

.editor-highlight .md-heading-line {
  color: #2ea44f;
  text-shadow: 0.35px 0 currentColor;
}

.editor-highlight .md-quote-line {
  color: #090;
}

.editor-highlight .md-list-line {
  color: #166c9d;
}

.editor-highlight .md-quote-marker-hidden {
  color: transparent;
}

.editor-highlight .md-code-line {
  color: #a50;
}

.editor-highlight .md-code-bracket-active {
  color: #0dbc79;
  text-shadow: 0.35px 0 currentColor;
}

.editor-highlight .md-bold-text {
  text-shadow: 0.35px 0 currentColor;
}

.editor-highlight .md-italic-text {
  font-style: italic;
}

.editor-highlight .md-del-text {
  text-decoration: line-through;
}

.editor-highlight .md-trailing-line-placeholder {
  color: transparent;
}

.md-editor.is-fullscreen .editor-area {
  height: 100%;
}

.md-editor.is-fullscreen .split-view-container.mode-split .editor-area {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.md-editor.is-fullscreen .split-view-container:not(.mode-split) .editor-area {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.line-number-gutter {
  position: absolute;
  left: -15px;
  top: 12px;
  bottom: 12px;
  width: 38px;
  padding-right: 8px;
  border-right: 1px solid #e5e7eb;
  color: #9ca3af;
  text-align: right;
  font-size: 14px;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  line-height: var(--editor-line-height);
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  display: none;
}

.line-number-list {
  height: 100%;
  white-space: pre;
  transform: translateY(0);
}

.md-editor.show-line-numbers .line-number-gutter {
  display: block;
}

.md-editor.show-line-numbers .editor-textarea {
  padding-left: 25px;
}

.md-editor.show-line-numbers .editor-highlight {
  padding-left: 25px;
}

.editor-textarea {
  width: 100%;
  min-height: 320px;
  height: 320px;
  flex: none;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  outline: none;
  resize: vertical;
  font-size: 14px;
  font-weight: 400;
  line-height: var(--editor-line-height);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--editor-scrollbar-thumb) transparent;
  transition: none;
  transform: none;
}

.editor-textarea:active,
.editor-textarea:focus,
.editor-highlight,
.editor-highlight * {
  transition: none !important;
  transform: none !important;
}

.editor-textarea::placeholder {
  color: #9ca3af;
}

.editor-textarea::selection {
  color: transparent;
  background: rgba(59, 130, 246, 0.28);
}

.editor-textarea::-moz-selection {
  color: transparent;
  background: rgba(59, 130, 246, 0.28);
}

.editor-textarea::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

.editor-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.editor-textarea::-webkit-scrollbar-thumb {
  background: var(--editor-scrollbar-thumb) !important;
  border-radius: 999px;
}

.editor-textarea::-webkit-scrollbar-thumb:hover {
  background: var(--editor-scrollbar-thumb-hover) !important;
}

.md-editor.is-fullscreen .split-view-container.mode-split .editor-textarea {
  flex: 1;
  min-height: 0;
  height: auto;
  resize: none;
}

.md-editor.is-fullscreen .split-view-container:not(.mode-split) .editor-textarea {
  flex: 1;
  min-height: 0;
  height: auto;
  resize: none;
}

.md-editor.is-fullscreen .split-view-container.mode-split .upload-hint-text {
  display: none;
}

.md-editor,
.md-editor * {
  scrollbar-width: thin;
  scrollbar-color: var(--editor-scrollbar-thumb) transparent;
}

.md-editor ::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

.md-editor ::-webkit-scrollbar-track {
  background: transparent;
}

.md-editor ::-webkit-scrollbar-thumb {
  background: var(--editor-scrollbar-thumb) !important;
  border-radius: 999px;
}

.md-editor ::-webkit-scrollbar-thumb:hover {
  background: var(--editor-scrollbar-thumb-hover) !important;
}

.markHtml-wrapper {
  display: none;
  border-left: 1px solid #e5e7eb;
  background: #fafafa;
  height: 100%;
  overflow: hidden;
}

.split-view-container.mode-preview .markHtml-wrapper,
.split-view-container.mode-split .markHtml-wrapper {
  display: block;
}

.post-content {
  padding: 12px 16px;
  min-height: 320px;
  height: 100%;
  line-height: 1.7;
  overflow-y: auto;
  box-sizing: border-box;
}

.topic-select {
  position: relative;
  z-index: 1;
  overflow: visible;
  flex-shrink: 0;
}

.md-editor.is-fullscreen .split-view-container.mode-split .post-content {
  min-height: 100%;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin: 0.8em 0 0.35em;
  font-size: 17px;
  line-height: 1.5;
  color: #2ea44f;
  font-weight: 700;
  border-bottom: 1px solid #e9e9e9;
  border-top: none;
}

.post-content p {
  margin: 0.5em 0;
  white-space: pre-wrap;
}

.post-content ul {
  list-style-type: "- ";
  list-style-position: outside;
  padding-left: 24px;
  margin-left: 0;
  margin: 0.5em 0;
  font-size: 13px;
}

.post-content ol {
  list-style-type: decimal;
  list-style-position: outside;
  padding-left: 24px;
  margin-left: 0;
  margin: 0.5em 0;
  font-size: 13px;
}

.post-content li {
  margin: 0.2em 0;
}

.post-content a {
  color: #0dbc79;
  text-decoration: none;
}

.post-content hr {
  border-bottom: 1px solid #e9e9e9;
  border-top: none;
  border-left: none;
  border-right: none;
}

.post-content img {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: inline-block;
  margin: 8px 0;
}

.post-content img.img-fallback {
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

.oc-done {
  background-color: #0000000d;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 8px 0;
  border-left: 3px solid #d5d5d5;
  quotes: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
}

.oc-done p {
  font-family: "Microsoft Yahei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #333333;
  margin: 0;
  padding: 0;
}

.oc-done s,
.oc-done del {
  color: #666666;
  text-decoration: line-through;
}

.oc-done em {
  color: #333333;
  font-style: italic;
  font-weight: normal;
}

.oc-done strong {
  color: #222222;
  font-weight: 700;
  font-style: normal;
}

.post-content pre {
  background-color: #f6f6f7;
  border-radius: 6px;
  padding: 24px;
  margin: 16px 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  color: #333;
  line-height: 1.6;
  position: relative;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-content pre .copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #c1c7cd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.post-content pre .copy-code .iconpark-icon {
  width: 100%;
  height: 100%;
}

.post-content pre .copy-code:hover {
  color: #333;
  background: transparent;
}

.post-content pre .copy-code.is-copied {
  color: #166534;
  background: transparent;
}

.post-content table {
  width: auto;
  max-width: 100%;
  border-collapse: unset;
  margin-bottom: 18px;
  overflow: hidden;
  font-size: 13px;
  background: #f2f6fc;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  border-spacing: 0;
  table-layout: auto;
  box-sizing: border-box;
  outline: 0;
  text-align: center;
}

.post-content th,
.post-content td {
  border: none;
  padding: 8px;
}

.post-content th {
  font-weight: 500;
  background: #ebeef5;
  border-right: 1px solid #dcdcdc;
  border-bottom: 1px solid #dcdcdc;
}

.post-content td {
  padding: 8px;
  border-right: 1px solid #dcdcdc;
  border-bottom: 1px solid #dcdcdc;
}

.post-content tr > *:last-child {
  border-right: none;
}

.post-content tbody tr:last-child td {
  border-bottom: none;
}

.post-content td img,
.post-content th img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0;
}

.content-area.drag-active {
  background: #eff6ff;
  outline: 2px dashed #60a5fa;
  outline-offset: -2px;
}

.topic-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
}

.topic-select-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
}

.topic-select select {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.submit.btn {
  background: #00b42a;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
}

.editor-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  background: #111827;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 9999;
  opacity: 0;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  pointer-events: none;
}

.editor-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
