@import "./custom";

section.markdown {
  margin: 0;
}

.markdown section, .markdown {
  .github-btn {
    display: inline-block;
    margin-left: 8px;
  }
  .text-center {
    text-align: center;
  }
  & p {
    font-size: 14px;
  }
  & .toc {
    font-size: 14px;
    margin: 20px 0;
    background: #f6f7f8;
    border-left: 1px solid #e8e8e8;
    padding: 8px 0 8px 10px;
    & a {
      color: @text-color;
      &:hover {
        color: @link-active-color;
      }
    }
  }
  & > h2, & > h3, & > h4 {
    color: @markdown-title-color;
    & a {
      opacity: 0;
      transition: opacity @animate-duration @ease-out;
    }
    &:hover {
      & a {
        opacity: 1;
      }
    }
  }
  & > h1 {
    font-weight: 500;
    font-size: 28px;
    color: @markdown-title-color;
    margin: 0 auto 10px;
    & > .subtitle, & > i {
      font-style: normal;
      margin-left: 8px;
      font-size: 20px;
    }
  }
  & > h2 {
    font-size: 22px;
    font-weight: 400;
  }
  & > h2, & > h3 {
    margin: 1.6em 0 1em 0;
    clear: both;
  }
  & > h3 {
    font-size: 18px;
    font-weight: 400;
  }
  & > h4 {
    font-size: 14px;
    margin: 1em auto;
    font-weight: 400;
  }
  & > p {
    line-height: 1.8;
    margin: 1em 0;
  }
  & img {
    vertical-align: middle;
  }
  & code {
    margin: 0 3px;
    border-radius: 3px;
    font-size: .8rem;
    border: 1px solid #e9e9e9;
    background: #f7f7f7;
  }
  & pre {
    margin: 1em 0;
    border-radius: 6px;
    border: 1px solid @line-color;
    background-color: #fff;
    padding: 0;
    & code {
      background: transparent;
      margin: 0;
      border: none;
      display: block;
      line-height: 1.5;
      font-size: 13px;
      white-space: pre;
    }
    &::-webkit-scrollbar {
      width: 2px;
      height: 2px;
    }
    &::-webkit-scrollbar-thumb {
      background: @scrollbar-color;
      border-radius: 2px;
    }
    &::-webkit-scrollbar-corner,
    &::-webkit-scrollbar-track-piece,
    &::-webkit-scrollbar-button,
    &::-webkit-scrollbar-track {
      display: none;
    }
  }
  & .bold {
    font-weight: bold;
  }

  & blockquote {
    font-size: 90%;
    color: #999;
    border-left: 4px solid #e9e9e9;
    padding-left: .8em;
    margin: 1em 0;
  }
  & > ul > li {
    list-style: circle;
    margin-left: 20px;
    padding-left: 4px;
  }
  & .demo-icon {
    font-size: 14px;
    opacity: 0.5;
    transition: opacity @animate-duration @ease-out;
    cursor: pointer;
    &:hover, &:active, &&-active {
      opacity: 1;
    }
  }
  & .content-wrapper {
    & h3 {
      font-weight: normal;
      font-size: 14px;
      margin: 20px auto;
    }
    .content {
      padding: 20px;
      overflow: auto;
      display: block;
      background: #fff;
      .page-pro();
      & .demo-wrapper {
        // width: 100%;
        width: 450px;
        margin: 20px auto;
        height: 61px;
        position: relative;
        overflow: hidden;
        & .east {
          & .line {
            // width: calc(~"100% - 120px");
            width: 330px;
            height: 1px;
            background: @line-deep-color;
            display: block;
            position: absolute;
            left: 60px;
            top: 30px;
          }
          & .arrow {
            width: 10px;
            height: 10px;
            display: block;
            position: absolute;
            right: 60px;
            top: 26px;
            border-right: solid;
            border-top: solid;
            border-width: 1px;
            border-color: @line-deep-color;
            transform: rotate(45deg);
          }
        }
      }
    }
  }
  & .text-highlight {
    color: @primary-color;
  }

  & .circle, & .circle-dashed {
    width: 40px;
    height: 40px;
    position: absolute;
    background: fade(@primary-color, 15);
    border-radius: 20px;
    border: 1px solid @primary-color;
    top: 10px;
  }
  & .circle {
    z-index: 1;
    background: @primary-color;
  }
  .circle-dashed {
    border-style: dashed;
    right: 0;
  }

  & > table {
    border-collapse: collapse;
    border-spacing: 0;
    empty-cells: show;
    border: 1px solid #e8e8e8;
    width: 100%;
    margin-bottom: 24px;
    & th {
      background: rgba(0, 0, 0, .02);
      white-space: nowrap;
      color: #5c6b77;
      font-weight: 600;
    }
    & th, & td {
      border: 1px solid #e8e8e8;
      padding: 8px 16px;
      text-align: left;
    }
  }
  & .toc-affix {
    z-index: 1000;
    top: 0;
    position: absolute;
    width: 100px;
  }
  & .demos-anchor {
    color: #aaa;
    position: absolute;
    margin-right: 24px;
    top: 24px;
    right: 0;
    z-index: 100;
    background: #fff;
    font-size: 12px;
  }
  & .content-img {
    margin: 20px 0;
    max-width: 800px;
    position: relative;
  }
  & .ant-steps-step {
    & > * {
      background: transparent;
      & .ant-steps-title {
        background: transparent;
      }
    }
  }
}

.markdown.api-container table {
  font-size: @font-size-base;
  line-height: @line-height-base;
  font-family: @code-family;
  border-width: 0;
  margin: 2em 0;
  th, td {
    padding: 14px 16px;
    border-width: 1px 0;
    border-color: @border-color-split;
  }
  th {
    border-width: 0 0 2px 0;
    position: relative;
  }
  td {
    position: relative;
    &:before {
      content: '';
      display: block;
      position: absolute;
      width: 1px;
      height: 8px;
      bottom: 0;
      right: 0;
      background: @border-color-split;
    }
  }
  td:first-child {
    font-weight: 500;
    color: @blue-9;
  }
  td:nth-child(2) {
    font-size: @font-size-base - 1px;
    color: @magenta-7;
  }
  td:nth-child(3) {
    font-size: @font-size-base - 1px;
  }
  td:last-child {
    &:before {
      display: none;
    }
  }
}

@media screen and (max-width: 414px) {
  .markdown section, .markdown {
    .content-wrapper {
      .demo-wrapper {
        transform: scale(.73);
        transform-origin: left center;
      }
    }
    &.api-container > table {
      border: none;
      > thead {
        display: none;
      }
      > tbody {
        border-bottom: 3px solid #e8e8e8;
        tr {
          border-top: 3px solid #e8e8e8;
          td {
            border: none;
            border-bottom: 1px solid #e8e8e8;
            display: block;
            &:before {
              display: inline-block;
              content: '';
              margin-right: 5px;
              position: static;
              width: auto;
              height: 17px;
              bottom: auto;
              right: auto;
              vertical-align: middle;
              background: transparent;
            }
            &:nth-child(1):before {
              content: '参数: ';
            }
            &:nth-child(2):before {
              content: '类型: ';
            }
            &:nth-child(3):before {
              content: '默认: ';
            }
            &:nth-child(4) {
              border-bottom: none;
              &:before {
                display: inline-block !important;
                content: '说明: ';
              }
            }
          }
        }
      }
    }
  }
}
