.markdown-section {
  background-color: #fff;
  font-family: sans-serif;
  color: var(--text-color);
  margin: 0 auto;
  content-visibility: auto;
}

/* Header
-------------------- */

.markdown-section h1 {
  font-size: 32px;
}

.markdown-section h2 {
  padding-bottom: 8px;
  font-size: 28px;
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section h5,
.markdown-section h6 {
  position: relative;
  margin: 8px;
  width: fit-content;
  margin-left: 0;
}
.markdown-section h1:hover,
.markdown-section h2:hover,
.markdown-section h3:hover,
.markdown-section h4:hover,
.markdown-section h5:hover,
.markdown-section h6:hover {
  cursor: pointer;
}
.markdown-section h1:hover::before,
.markdown-section h2:hover::before,
.markdown-section h3:hover::before,
.markdown-section h4:hover::before,
.markdown-section h5:hover::before,
.markdown-section h6:hover::before
{
  position: absolute;
  top: 0;
  color: #66B1FF;
  padding-right: 8px;
}
.markdown-section h1:hover::before {
  content: '#1';
  left: -48px;
}
.markdown-section h2:hover::before {
  content: '#2';
  left: -40px;
}
.markdown-section h3:hover::before {
  content: '#3';
  left: -28px;
}
.markdown-section h4:hover::before {
  content: '#4';
  left: -24px;
}
.markdown-section h5:hover::before {
  content: '#5';
  left: -18px;
}
.markdown-section h6:hover::before {
  content: '#6';
  left: -10px;
}

/* Text Formating
-------------------- */

.markdown-section p {
  margin: 16px 0;
}

.markdown-section code {
  padding: 4px 5px;
  margin: 2px 0;
  border-radius: 2px;
  // color: #d4d4d4;
}

/* Horizontal Rule
-------------------- */

.markdown-section hr {
  height: 2px;
  margin: 16px 0;
  border: none;
  background-color: #ccc;
}

/* Cites
-------------------- */

.markdown-section blockquote {
  border-left: 4px solid #409EFF;
  color: var(--text-color);
  background-color: #ECF5FF;
  padding: 10px;
  margin: 0;
  margin-top: 10px;
}

/* Table
-------------------- */
.table-wrapper {
  overflow-x: auto;
}

.markdown-section table {
  border-spacing: 0;
  border-collapse: collapse;
}

.markdown-section table th, .markdown-section table td {
  padding: 6px 12px;
  text-align: left;
  border: 1px solid #dfe2e5;
}

.markdown-section table tr {
  background-color: #fff;
}

.markdown-section table thead tr, .markdown-section table tbody tr:nth-child(even) {
  background-color: #f5f8fa;
}

/* Code Block
-------------------- */

.markdown-section pre code {
  display: block;
  padding: 16px 20px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 22px;
  white-space: pre;
  overflow-x: auto;
}

.markdown-section pre {
  border-radius: 4px;
}

/* List
-------------------- */

.markdown-section ul {
  padding-left: 20px;
  list-style-type: disc;
}

.markdown-section li {
  margin: 10px 0;
}
.markdown-section ul ul {
  list-style-type: circle;
}

.markdown-section ul ul ul {
  list-style-type: square;
}

/* Link
-------------------- */

.markdown-section a {
  color: #409eff;
  text-decoration: none;
}
.markdown-section a.potential-link {
  color: #97cbff;
}

.markdown-section a.potential-link:hover {
  text-decoration: none;
}

.markdown-section a:hover {
  text-decoration: underline;
}

/* Image
-------------------- */

.markdown-section img {
  display: block;
  max-width: 60%;
  height: auto;
  margin: 16px auto;
}

/* markdown 图片样式 */
.img-wrapper {
  text-align:center;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.img-title {
  text-align: center;
  color: #999;
  padding: 0;
  margin: 0;
}

/* 标签系统样式 */
.doc-tag {
  position: absolute;
  transition: all 0.2s;
  margin-left: -10px;
  margin-top: -12px;
  display:none;
}
.doc-tag:hover {
  transition: all 0.2s;
  display: inline;
}
.doc-tag-main {
  transition: all 0.2s;
  cursor: pointer;
}
.doc-tag-main:hover + .doc-tag {
  transition: all 0.2s;
  display: inline;
}

/* latex样式 */
.tex {
  text-align: center;
}
/* mermaid样式 */
div[id^=mermaid-] {
  text-align: center;
}
.mermaid-wrapper {
  position: relative;
}
.mermaid-wrapper .fullscreen {
  position: absolute;
  right: 0;
  display: none;
  button {
    padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #3498db;
  color: #fff;
  transition: background-color 0.3s ease;
  }
}
.mermaid-wrapper .fullscreen button:hover {
  background-color: #2980b9;
}
.mermaid-wrapper:hover .fullscreen {
  display: block;
}

body[theme=dark] {
  background-color:var(--main-dark-bg-color);
  color: var(--main-dark-text-color);
  .markdown-section {
    background-color:var(--main-dark-bg-color);
    color: var(--main-dark-text-color);
    blockquote {
      background-color: #222b36;
    }
  }
  img {
    filter: invert(25%);
  }
    /* Table
  -------------------- */
  .markdown-section table th, .markdown-section table td {
    border: 1px solid var(--default-dark-border-color);
  }
  .markdown-section table tr {
    background-color: var(--main-dark-bg-color);
  }
  .markdown-section table thead tr, .markdown-section table tbody tr:nth-child(even) {
    background-color: var(--second-dark-bg-color);
  }
}