.markdown {
  text-align: justify;
  font-size: $font-size-normal;
  line-height: $line-height-block;

  .loading {
    position: relative;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    transform: translateY(50%);

    .dot {
      display: inline-block;
      margin: 5px;
      width: 10px;
      height: 10px;
      border-radius: 100%;
      background-color: $loading-bg;
      animation: slide 1s infinite;
    }
    .dot:nth-child(1) {
      animation-delay: 0.1s;
      background-color: $loading-color-one;
    }
    .dot:nth-child(2) {
      animation-delay: 0.2s;
      background-color: $loading-color-two;
    }
    .dot:nth-child(3) {
      animation-delay: 0.3s;
      background-color: $loading-color-three;
    }
    .dot:nth-child(4) {
      animation-delay: 0.4s;
      background-color: $loading-color-four;
    }
    .dot:nth-child(5) {
      animation-delay: 0.5s;
      background-color: $loading-color-five;
    }
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin: 20px 16px 15px;
    transition: color 0.3s ease;
    font-weight: bold;
    line-height: 1.5;
    i {
      padding-right: 6px;
    }
    .icon-gift::before,
    .icon-pagelines::before {
      transform: translateY(-2px);
    }
    &:hover {
      color: $purple-deep;
    }
  }

  h1 + h2,
  h2 + h3,
  h3 + h4,
  h4 + h5,
  h5 + h6 {
    margin-top: 0;
    padding-top: 0;
  }

  @for $i from 1 through 6 {
    @include pc-layout {
      h#{$i} {
        font-size: $font-size-headings-base - $font-size-headings-step * $i;
      }
    }
    @include sp-layout {
      h#{$i} {
        font-size: $font-size-headings-base - $font-size-headings-step * $i - 4px;
      }
    }
  }

  p {
    margin: 0 16px 25px;
    word-break: break-all;
    &:last-child {
      margin-bottom: 0;
    }
  }

  pre,
  blockquote {
    margin-bottom: 25px;
  }

  pre {
    position: relative;
    padding: 36px 0 0;

    &::before {
      content: ' ';
      position: absolute;
      top: 12px;
      left: 12px;
      height: 12px;
      width: 12px;
      background: $code-color-red;
      border-radius: 50%;
      box-shadow: 20px 0 $code-color-yello, 40px 0 $code-color-green;
    }

    &:hover {
      .code-copy {
        opacity: 1;
      }
    }

    code {
      padding-bottom: 10px;
      padding-left: 12px;
    }

    .code-copy {
      opacity: 0;
      position: absolute;
      top: 4px;
      right: 0;
      height: 36px;
      width: 36px;
      font-size: $font-size-large;
      line-height: 32px;
      text-align: center;
      color: #888;
      transition: all ease 0.3s;
      &:hover {
        color: $purple;
        transform: translateY(-3px);
      }
    }
  }

  ol {
    margin: 25px 16px 25px 62px;
  }
  ul {
    margin: 25px 16px 25px 52px;
  }

  ol,
  ul {
    li {
      p {
        margin-left: 0;
      }

      ol {
        margin-left: 44px;
      }
      ul {
        margin-left: 34px;
      }
    }
  }

  p,
  ol,
  ul {
    code {
      padding: 2px 4px;
      color: $purple-deep;
      font-size: $font-size-code;
      word-wrap: break-word;
      border-radius: 3px;
      background-color: $bg-dark;
    }
  }

  strong {
    font-weight: $font-weight-bold;
  }

  a {
    @include link;
  }

  blockquote {
    position: relative;
    padding: 36px 0;
    font-style: italic;
    box-shadow: $block-shadow;

    & > p {
      margin: 10px 46px;
    }

    &::before,
    &::after {
      position: absolute;
      font-family: Fontello;
      font-style: normal;
      font-weight: $font-weight-normal;
      font-size: $font-size-icon;
      text-decoration: inherit;
    }
    &::before {
      content: '\f10d';
      top: 6px;
      left: 16px;
    }
    &::after {
      content: '\f10e';
      bottom: 6px;
      right: 16px;
    }
  }

  span[class*='img-box'] {
    position: relative;
    display: block;
    margin: 0 auto 25px;
    text-align: center;
    border-radius: 3px;

    &.full {
      margin: 0 -16px;
      .bg,
      img {
        border-radius: unset;
      }
    }

    .bg {
      display: flex;
      justify-content: center;
      align-content: center;
      position: absolute;
      top: 0;
      left: 50%;
      max-width: 100%;
      border-radius: 3px;
      background-color: $bg-dark;
      transform: translateX(-50%);
    }

    img {
      position: relative;
      margin: 0 auto;
      max-width: 100%;
      opacity: 0;
      border-radius: 3px;
      overflow: hidden;
      box-shadow: $card-shadow;
      transition: all 0.3s ease-out, opacity 0.8s ease-out;
    }

    .title {
      display: block;
      padding-top: 8px;
      font-style: italic;
    }
  }

  .table-wrapper {
    margin: 0 16px 25px;
    max-width: 100%;
    overflow-x: auto;
    @include scrollBar;

    & > table {
      margin: 0 auto;
      border-radius: 3px;
      border-spacing: 2px;
      border-collapse: separate;
      border: 1px solid #dfdfdf;
      tr {
        height: 32px;
      }
      th {
        background-color: $bg-dark;
      }
      td,
      th {
        padding: 0 36px;
        border: 1px solid #dfdfdf;
      }
    }
  }
}
