$monospace-font: Menlo, Monaco, Consolas, 'Courier New', monospace;
$h1-color: #773098;
$h2-color: #916dd5;
$h3-color: #d89cf6;
$code-color: #916dd5;
$i-em-color: #916dd5;
$b-strong-color: #916dd5;
$a-color: #916dd5;
$a-hover-active-color: #773098;

.markdown-body {
  line-height: 1.75;
  font-family: $monospace-font;
  letter-spacing: 2px;
  word-break: break-all;
  font-weight: 400;
  font-size: 15px;
  overflow-x: hidden;
  color: #333;

  h1 {
    font-size: 25px;
    margin-top: 24px;
    margin-bottom: 20px;
    font-weight: bold;
    padding-left: 10px;
    border-left: 5px solid $h1-color;
  }
  h2 {
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 20px;
    font-weight: bold;
    padding-left: 10px;
    border-left: 5px solid $h2-color;
  }
  h3 {
    font-size: 16px;
    font-weight: bold;
    margin-top: 24px;
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 5px solid $h3-color;
  }
  h4 {
    font-size: 16px;
    margin-top: 24px;
    margin-bottom: 20px;
  }
  h5 {
    font-size: 15px;
    margin-top: 24px;
    margin-bottom: 20px;
  }
  h6 {
    margin-top: 24px;
    margin-bottom: 20px;
  }

  p {
    line-height: inherit;
    margin-top: 0;
    margin-bottom: 20px;
  }

  img {
    border-radius: 6px;
    display: block;
    margin: 20px auto;
    object-fit: contain;
    box-shadow: 2px 4px 7px #999;
  }

  hr {
    border-top: 1px solid #ddd;
    border-bottom: none;
    border-left: none;
    border-right: none;
    margin-top: 32px;
    margin-bottom: 32px;
  }

  code {
    font-weight: bold;
    font-family: $monospace-font;
    font-size: 1em;
    color: $code-color;
    word-break: break-all;
    overflow-x: auto;
    background-color: transparent;
    border-radius: 2px;
  }

  pre {
    font-family: $monospace-font;
    overflow: auto;
    position: relative;
    line-height: 1.75;
    
    >code {
      display: block;
      font-size: 12px;
      padding: 16px 12px;
      margin: 0;
      color: #333;
      word-break: normal;
      overflow-x: auto;
      background: #f8f8f8;
    }
  }

  a {
    text-decoration: none;
    color: $a-color;
    font-weight: bold;
    border-bottom: 1px solid $a-color;
    &:hover,
    &:active {
      color: $a-hover-active-color;
    }
  }

  table {
    display: inline-block !important;
    font-size: 12px;
    width: auto;
    max-width: 100%;
    overflow: auto;
    border: solid 1px $a-color;
  }
  thead {
    background-color: $a-color;
    color: #fff;
    text-align: left;
  }
  tr:nth-child(2n) {
    background-color: #d89cf677;
  }
  th,
  td {
    padding: 12px 7px;
    line-height: 24px;
  }
  td {
    min-width: 120px;
  }

  blockquote {
    color: #666;
    padding: 1px 23px;
    margin: 20px 0;
    border-left: 4px solid #d89cf6;
    background-color: #f4eeff;
    &::after {
      display: block;
      content: '';
    }
    & > p {
      margin: 10px 0;
      line-height: 26px;
    }
  }

  ol {
    padding-left: 36px;
  }

  ul {
    padding-left: 24px;
  }

  ol,
  ul {
    margin-bottom: 20px;

    li {
      margin-bottom: 0;
      list-style: inherit;

      & + li {
        margin-top: 0.25em;
      }

      ul,
      ol {
        margin-top: 0;
        margin-bottom: 0;
      }

      & .task-list-item {
        list-style: none;
        ul,
        ol {
          margin-top: 0;
        }
      }
    }
  }

  b,
  strong {
    color: $b-strong-color;
    font-weight: bold;

    &::before {
      content: '「';
    }

    &::after {
      content: '」';
    }
  }

  i,
  em {
    color: $i-em-color;
  }

  .footnote-num {
    color: $a-color;
    opacity: .8;
  }

  .footnote-link,
  .footnote-title {
    color: $a-color;
    display: block;
  }

  .footnote-title {
    font-weight: bold;
  }

  .footnote-link {
    border: 0;
  }

  @media (max-width: 720px) {
    h1 {
      font-size: 24px;
    }
    h2 {
      font-size: 20px;
    }
    h3 {
      font-size: 18px;
    }
  }

  .qrcode-box,
  .figure {
    margin-bottom: 20px;
  }
}
