/*!
* HomePage: https://www.misterma.com
* GithubPage: https://github.com/changbin1997
* ProjectPage: https://github.com/changbin1997/MWordStar
* author: Changbin (changbin1997)
* Licensed under MIT
*/

$articleFontSize: 15px; //  文章字体大小
$shadow: 0 1px 3px rgba(26, 26, 26, 0.1); //  区块阴影

//  通用的文章信息样式
@mixin articleInfo {
  padding: 10px 25px;
  .info {
    float: left;
    margin-right: 20px;
    height: 29px;
  }
  a,
  span {
    font-size: 12px;
    line-height: 29px;
  }
  a:hover {
    color: #76839b;
  }
  .icon {
    margin-right: 4px;
    font-size: 12px;
    line-height: 29px;
  }
  .tags a,
  .category a {
    margin-right: 3px;
  }
}

//  通用文章标题样式
@mixin entryHeader {
  .entry-title {
    font-size: 28px;
    font-weight: 700;
    padding: 20px 20px 12px 20px;
    a {
      color: #222222;
    }
  }
}

//  通用文章标题样式手机版
@mixin entryHeaderM {
  .entry-title {
    font-size: 20px;
    padding: 20px 20px 12px 20px;
  }
}

//  通用文章头图样式
@mixin postThumbnail {
  width: 100%;
  .fixed {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
  }
  .fixed:after {
    content: '';
    padding-bottom: 37.5%;
    display: block;
  }
  img {
    width: 100%;
  }
}

//  通用的文章列表样式
@mixin post {
  margin-bottom: 30px;
  overflow: hidden;;
  //  文章头图
  .header-img {
    @include postThumbnail;
  }
  //  文章标题
  .entry-header {
    overflow: hidden;
    @include entryHeader;
    .entry-title {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
  //  文章摘要
  .entry-summary {
    padding: 20px;
    p {
      font-size: $articleFontSize;
      line-height: 25px;
    }
  }
  //  全文显示
  .post-content {
    @include postContent;
  }
  //  文章信息
  .article-info {
    @include articleInfo;
  }
  //  小头图模式
  .entry-summary[data-header-image-type="mini"] {
    //  图片区域
    .mini-header-image a {
      display: block;
      width: 100%;
      height: 100%;
      position: relative;
      overflow: hidden;
      background-size: cover;
      background-position: center;
      background-color: #E0E0E0;
      &:after {
        content: '';
        padding-bottom: 66.66%;
        display: block;
      }
    }
    //  文字区域
    .content-box p {
      max-height: 120px;
      overflow-y: hidden;
      margin-bottom: 0;
    }
  }
}

//  通用的文章列表样式手机版
@mixin postM {
  //  文章头图
  .header-img {
    @include postThumbnail;
  }
  //  文章标题
  .entry-header {
    @include entryHeaderM;
  }
  //  文章摘要
  .entry-summary {
    padding: 20px;
  }
  //  文章信息
  .article-info {
    padding: 10px 20px;
  }
}

//  通用的文章内容样式
@mixin postContent {
  font-size: $articleFontSize;
  word-break: break-all;
  ul,
  ol,
  img,
  pre,
  blockquote,
  h1,
  h2,
  h3,
  h4,
  h5,
  p {
    margin: 0 0 20px 0;
  }
  img {
    max-width: 100%;
    cursor: zoom-in;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }
  //  文章标题
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-weight: 700;
    color: #444444;
    > code {
      background: #ededed;
      color: #333333;
      padding: 0 4px;
    }
  }
  h1 {
    font-size: 30px;
    margin: 50px 0 20px 0;
  }
  h2 {
    font-size: 25px;
  }
  h3 {
    font-size: 20px;
  }
  h4 {
    font-size: 15px;
  }
  h5 {
    font-size: 12.45px;
  }
  h6 {
    font-size: 12px;
  }
  //  文章引用
  blockquote {
    border-left: 4px solid #1a1a1a;
    padding-left: 22.5px;
    font-size: 17px;
    color: #686868;
    font-style: italic;
  }
  table td {
    min-width: 90px;
  }
  // 响应式表格
  .table-responsive {
    margin-bottom: 20px;
    table {
      margin-bottom: 0;
    }
  }
  p {
    color: #444444;
    line-height: 25px;
  }
  li {
    color: #444444;
    padding: 2px 0;
  }
  p > code,
  li > code,
  th > code,
  td > code {
    background: #ededed;
    color: #333333;
    padding: 0 4px;
  }
  video {
    width: 100%;
  }
}


//  代码高亮的主题样式
//  stackoverflow-light 样式
.stackoverflow-light {
  pre {
    background: #F6F6F6;
    .line-box {
      background: #F6F6F6;
      div {
        color: #777777;
        border-right: 1px solid #777777;
      }
    }
  }
  @import "stackoverflow-light.min";
}
//  Github深色样式
.github-dark {
  pre {
    background: #0D1116;
    .line-box {
      background: #0D1116;
      div {
        color: #9B9B9B;
        border-right: 1px solid #9B9B9B;
      }
    }
  }
  @import "github-dark.min";
}
//  Sunburst高对比度样式
.sunburst {
  pre {
    background: #000000;
    .line-box {
      background: #000000;
      div {
        color: #AEAEAE;
        border-right: 1px solid #AEAEAE;
      }
    }
  }
  @import "sunburst.min";
}
// 通用的代码高亮样式
.enable-highlight {
  pre {
    position: relative;
    &:hover .copy-code-btn {
      display: block;
    }
    .line-box {
      width: 40px;
      position: absolute;
      top: 0;
      left: 0;
      padding-top: 12px;
      div {
        line-height: 22.5px;
        height: 22.5px;
        padding-right: 9px;
        font-size: 14px;
        -moz-user-select: none;
        -webkit-user-select: none;
        -ms-user-select: none;
        user-select: none;
      }
    }
    code {
      font-size: $articleFontSize;
      &::-webkit-scrollbar {
        height: 12px;
        background: #F1F1F1;
      }
      &::-webkit-scrollbar-thumb {
        background: #A8A8A8;
      }
    }
    .copy-code-btn {
      border-color: #BBBBBB;
      color: #BBBBBB;
      &:hover {
        background-color: #BBBBBB;
        color: #FFFFFF;
      }
    }
  }
}
//  包含行号的样式
.line-num-show {
  pre {
    code {
      padding: 12px 10px 12px 54px !important;
    }
  }
}
//  不包含行号的样式
.line-num-hide {
  pre {
    code {
      padding: 12px 16px !important;
    }
  }
}


body {
  background: #e4e4e4;
}
a {
  transition: 0.3s;
}

//  顶部导航条
header {
  width: 100%;
  z-index: 999;
  .navbar {
    box-shadow: 0 1px 3px rgba(26, 26, 26, 0.1);
    // 搜索区域
    .search-form {
      input:focus {
        box-shadow: none;
      }
      //  亮色的搜索按钮
      button {
        background: #f8f8f8;
        border: 1px solid #d3d3d3;
      }
      button:hover {
        background: #f0f0f0;
      }
      button:focus {
        background: #f0f0f0;
      }
    }
  }
}

// pjax的进度条
#progress-bar {
  width: 100%;
  height: 3px;
  position: fixed;
  top: 0;
  left: 0;
  background: #E0E0E0;
  z-index: 2000;
  #progress {
    height: 100%;
    width: 0;
  }
}

//  内容区域
.container .article-list {
  margin-top: 15px;
  //  文章列表
  .post {
    @include post;
  }
}
.main-content {
  margin-top: 15px;
}

// 首页
.home {
  // 没有文章的提示信息
  .no-post-message {
    padding: 20px;
  }
}

//  侧边栏区域
.sidebar {
  section {
    margin-left: 20px;
    margin-bottom: 30px;
    //  侧边栏个区域的标题
    h4 {
      line-height: 22px;
      padding: 12px 2px;
      font-size: 16px;
      border-bottom: 2px solid #6c757d;
      margin: 0 18px 10px 18px;
      font-weight: 700;
    }
    //  侧边栏的列表
    ul {
      list-style: none;
      padding: 0 18px 18px 18px;
      li {
        padding: 8px 0;
        font-size: 13px;
        a {
          font-size: 14px;
          font-weight: 500;
        }
        .avatar {
          border-radius: 50%;
        }
      }
    }
    // 没有内容时的提示信息
    .message {
      padding: 0 18px 18px 18px;
    }
    //  个人资料卡
    .personal-information {
      padding: 0 18px 18px 18px;
      .user {
        width: 100%;
        .avatar {
          width: 72px;
          height: 72px;
          display: block;
          margin: 0 auto;
          transition: 0.4s;
          border-radius: 50%;
        }
        .pingback {
          width: 72px;
          height: 72px;
          line-height: 72px;
          border-radius: 50%;
          font-size: 24px;
        }
        .user-name {
          display: block;
          font-size: 16px;
        }
        .user-name,
        .introduction {
          margin: 0;
          text-align: center;
          line-height: 20px;
        }
        .introduction {
          font-size: 14px;
        }
      }
      .website {
        padding-top: 18px;
        margin-top: 18px;
        .info {
          width: 33.33%;
          text-align: center;
          font-size: 14px;
          .quantity {
            font-size: 20px;
            margin: 0;
          }
        }
      }
    }
    //  标签云
    .tag-list {
      padding: 0 18px 18px 18px;
      .tag-link {
        margin: 0 4px 4px 0;
        font-size: 12px;
        border-radius: 4px;
        font-weight: 500;
      }
    }
  }
  //  日历
  .calendar {
    table {
      width: 100%;
      td a {
        font-size: 16px;
      }
      .active {
        background: #F2F2F2;
      }
    }
    nav a {
      font-size: 14px;
    }
  }
  //  最新文章区域
  .latest-articles {
    li a {
      transition: 0.4s;
      .article-img {
        display: none;
        transition: 0.4s;
      }
      p {
        margin: 0;
      }
    }
    .latest-articles-active {
      overflow: hidden;
      position: relative;
      display: block;
      width: 100%;
      .article-img {
        display: block;
        width: 100%;
        height: 100%;
        background-size: cover;
        background-position: center;
        position: absolute;
        top: 0;
        left: 0;
      }
      p {
        width: 100%;
        position: absolute;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        color: #ffffff;
        padding: 7px;
      }
      img {
        display: inline;
        width: 100%;
      }
    }
    .latest-articles-active:after {
      content: '';
      display: block;
      padding-bottom: 44%;
    }
  }
  .category {
    li {
      padding-left: 24px;
    }
    .indentation-0 {
      padding-left: 0;
    }
  }
  //  最新回复
  .latest-comment {
    .media-body,
    .comment-content {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .avatar {
      width: 40px;
      height: 40px;
    }
    .pingback {
      line-height: 40px;
    }
  }
  // 目录
  .directory {
    padding: 0 18px;
    > .article-directory {
      overflow-y: auto;
      padding: 0;
      &::-webkit-scrollbar {
        width: 6px;
        background: #F1F1F1;
      }
      &::-webkit-scrollbar-thumb {
        background: #A8A8A8;
      }
      .article-directory {
        margin-bottom: 0 !important;
        padding-bottom: 0;
      }
    }
  }
  // 自定义 HTML
  .customize-html {
    font-size: 14px;
    padding: 0 18px 18px 18px;
    word-break: break-all;
    img {
      max-width: 100%;
    }
  }
  // 目录宽度参考线
  .reference-line {
    margin-left: 20px;
  }
}

//  章节目录高亮效果
.directory-active {
  font-weight: 600 !important;
}

//  文章分页区域
.pagination-nav {
  width: 100%;
  text-align: center;
  margin-bottom: 30px;
  li {
    border-radius: unset;
    a {
      border-radius: unset;
    }
  }
}

//  底部
footer {
  .container {
    padding: 20px 20px;
    text-align: center;
    a,
    span {
      margin: 0 5px;
      color: #525252;
      font-size: 15px;
    }
  }
}

//  文章页
.article-page {
  margin-top: 15px;
  main {
    margin-bottom: 30px;
    .entry-header {
      @include entryHeader;
    }
    //  文章头图
    .header-img {
      @include postThumbnail;
      .fixed:after {
        content: '';
        display: block;
        padding-bottom: 44%;
      }
    }
    //  文章页的文章信息
    .article-info {
      @include articleInfo;
    }
    article {
      padding: 20px;
      // 失效警示信息
      .warning-info {
        background-color: #E5E6EB;
      }
      //  文章页的文章内容
      .post-content {
        margin-top: 10px;
        width: 100%;
        @include postContent;
        .load-img {
          width: 100%;
          display: block;
          background-color: #F0F0F0;
        }
        .protected {
          p {
            text-align: center;
          }
        }
      }
    }
  }
  //  上一篇文章和下一篇文章的导航
  .post-navigation {
    overflow-x: hidden;
    > div {
      padding: 20px;
      .previous,
      .next,
      .next-box {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
  }
  // 文章二维码和分享链接
  #qr-link {
    .link-box {
      margin: 0 auto;
      width: 96px;
      display: flex;
      justify-content: space-between;
      a {
        font-size: 20px;
        &:hover {
          text-decoration: none;
        }
      }
    }
  }
  // 打赏二维码区域
  #reward-qr .qr {
    padding: 0 20px;
    img {
      max-width: 100%;
    }
  }
  // 文章底部的交互按钮区域
  .agree-and-share > div button:last-child {
    margin-right: 0 !important;
  }
}

//  分享二维码区域
#share-box {
  #qrcode {
    img {
      margin: 0 auto;
    }
  }
}

//  点赞的效果样式
#agree-p {
  font-weight: 700;
  font-size: 18px;
  color: red;
  position: absolute;
}

//  Emoji表情区域
#emoji-panel {
  width: 400px;
  height: 300px;
  position: absolute;
  z-index: 100;
  display: none;
  background-color: #ffffff;
  //  表情选择区
  #emoji-classification {
    overflow-x: auto;
    button {
      font-size: 16px;
    }
    button:hover {
      background: #E4E4E4;
    }
  }
  //  表情列表
  #emoji-list {
    max-height: 217px;
    overflow-y: auto;
    //  表情
    .emoji {
      float: left;
      font-size: 16px;
      margin: 0;
      cursor: pointer;
      &:hover {
        background: #E4E4E4;
      }
      &:focus {
        background: #E4E4E4;
      }
    }
  }
}

//  评论区
#comments {
  h2 {
    font-size: 25px;
    font-weight: 700;
    margin-bottom: 30px;
  }
  .comments-off {
    padding: 0 20px;
  }
  //  评论列表
  .comments-lists {
    padding: 40px 20px 0 20px;
    .comment-list {
      list-style: none;
      padding: 0;
      .comment-body {
        border-top: 1px solid #ebf2fc;
        padding: 20px 0;
        .comment-box {
          width: 100%;
        }
        .comment-author {
          width: 100%;
        }
        //  头像
        .avatar {
          width: 42px;
          height: 42px;
          margin-right: 10px;
          float: left;
          border-radius: 50%;
        }
        //  引用的头像
        .pingback {
          line-height: 42px;
        }
        //  评论者名字和发表时间
        .comment-info {
          a {
            line-height: 22px;
            font-size: 15px;
          }
          .comment-time {
            color: #686868;
            font-size: 12px;
            display: block;
          }
        }
        //  回复评论的链接
        .comment-reply {
          a {
            line-height: 30px;
            font-size: 12px;
            width: 60px;
            height: 32px;
            background: #ffffff;
            display: block;
            text-align: center;
            border-radius: 4px;
          }
        }
        //  评论内容
        .comment-content {
          margin-left: 52px;
          @include postContent;
        }
        //  评论的子内容，也就是回复的内容
        .comment-children {
          li {
            padding-bottom: 0;
            .comment-children {
              margin-left: 0;
            }
          }
        }
        //  回复表单区域
        .respond {
          background: #eeeeee;
        }
      }
    }
  }
  //  发表评论区
  .respond {
    padding: 20px;
    //  评论内容输入框
    #textarea {
      width: 100%;
      height: 150px;
      display: block;
    }
    //  发表评论的用户
    .comment-user {
      margin-bottom: 20px;
    }
  }
}

//  404页
.container-404 {
  h1 {
    margin-top: 20px;
    font-size: 150px;
    text-align: center;
    font-weight: 700;
  }
  h2 {
    text-align: center;
    font-weight: 700;
  }
  h5 {
    text-align: center;
  }
  .search-box {
    margin: 20px 0;
  }
}

//  文章搜索和分类页
.archives-list {
  margin-top: 15px;
  .archives {
    .page-header {
      margin-bottom: 30px;
      padding: 20px;
      h1 {
        font-size: 30px;
        font-weight: 700;
      }
      span {
        font-size: 13px;
        color: #777777;
      }
    }
    .post {
      @include post;
    }
    .post > .post-title {
      padding: 20px 25px;
    }
  }
}

//  独立页面
.page {
  @extend .article-page;
}
/*独立页面-文章归档*/
.archive {
  @extend .article-page;
  .archives {
    position: relative;
    &::before {
      width: 2px;
      height: 100%;
      background: #BBBBBB;
      display: block;
      content: "";
      position: absolute;
      top: 0;
      left: 49px;
    }
    .archives-item {
      position: relative;
      h2 {
        font-size: 12px !important;
        background: #FCFCFC;
        width: 84px;
        line-height: 24px;
        text-align: center;
        border-radius: 4px;
        position: relative;
        z-index: 10;
        left: 8px;
        cursor: pointer;
        border: 1px solid #BBBBBB;
      }
      ul {
        padding-left: 0;
        list-style: none;
        li {
          font-size: 14px;
          display: flex;
          align-items: center;
          padding: 6px 0;
          &:hover {
            .timeline {
              background: #6C757D;
            }
          }
          .day {
            display: block;
            width: 36px;
            text-align: center;
            flex: none;
          }
          .timeline {
            width: 8px;
            height: 8px;
            background: #BBBBBB;
            border-radius: 50%;
            margin: 0 10px;
            flex: none;
          }
        }
      }
    }
  }
}

//  独立页面-友情链接
.link-page {
  .link-box {
    background: #f9f9f9;
    margin: 0 0 20px 0;
    .link-grid {
      padding: 15px;
      border-radius: 4px;
      .link {
        background: #ffffff;
        box-shadow: 0 2px 0 rgba(170, 170, 170, 0.1);
        padding: 10px;
        display: block;
        .link-logo {
          width: 32px;
          height: 32px;
          margin: 0 10px 0 0;
        }
        .icon-logo {
          background: #0a73b3;
          color: #ffffff;
          text-align: center;
          line-height: 32px;
        }
        .link-name {
          display: inline-block;
          line-height: 32px;
        }
        p {
          font-size: 12px;
          margin: 10px 0 0 0;
          line-height: 18px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
        img {
          background: #E0E0E0;
        }
      }
      .link:hover {
        box-shadow: 1px 5px 1px rgba(170, 170, 170, 0.1);
      }
    }
  }
}

//  独立页面 - 网站统计
.data-page a{
  //  卡片区域
  .statistics-card {
    background: #B3D8FF;
  }
}

// 独立页面 - 分类目录
.category-page .category-list {
  list-style: none;
  li {
    align-items: center;
  }
}

.archive-page,
.post-page,
.link-page {
  margin-bottom: 20px;
}

//  >= 1200
@media screen and (min-width: 1200px) {
  //  侧边栏
  .sidebar {
    margin-top: 15px;
  }
  //  评论区
  #comments {
    .comment-list {
      .comment-children {
        margin-left: 52px;
      }
    }
  }
  // 文章页图片的默认尺寸
  .load-img {
    height: 350px;
  }
}
//  >= 992 且 <= 1199
@media screen and (min-width: 992px) and (max-width: 1199px) {
  //  小头图模式的文章列表
  .entry-summary[data-header-image-type="mini"] {
    .content-box p {
      overflow-y: hidden;
      max-height: 100px !important;
    }
  }
  //  侧边栏
  .sidebar {
    margin-top: 15px;
  }
  //  评论区
  #comments {
    .comment-list {
      .comment-children {
        margin-left: 52px;
      }
    }
  }
  // 文章页图片的默认尺寸
  .load-img {
    height: 350px;
  }
}
//  >= 768 且 <=991
@media screen and (min-width: 768px) and (max-width: 991px) {
  //  小头图模式的文章列表
  .entry-summary[data-header-image-type="mini"] {
    .content-box p {
      overflow-y: hidden;
      max-height: 120px !important;
    }
  }
  //  侧边栏
  .sidebar section {
    margin-left: 0;
  }
  //  评论区
  #comments {
    .comment-list {
      .comment-children {
        margin-left: 52px;
      }
    }
  }
  // 文章页图片的默认尺寸
  .load-img {
    height: 350px;
  }
}
//  >= 576 且 <= 767
@media screen and (min-width: 576px) and (max-width: 767px) {
  //  小头图模式的文章列表
  .entry-summary[data-header-image-type="mini"] {
    .content-box p {
      overflow-y: hidden;
      max-height: 100px !important;
    }
  }
  //  侧边栏的文章头图
  .latest-articles-active {
    height: 222px;
  }
  //  侧边栏
  .sidebar section {
    margin-left: 0;
  }
  //  评论区
  #comments {
    .comment-list {
      .comment-children {
        margin-left: 22px;
      }
    }
  }
  // 文章页图片的默认尺寸
  .load-img {
    height: 300px;
  }
}
//  < 575
@media screen and (max-width: 575px) {
  //  文章列表
  .container .article-list {
    .post {
      @include postM;
    }
  }
  //  小头图模式的文章列表
  .entry-summary[data-header-image-type="mini"] {
    .content-box p {
      overflow-y: hidden;
      max-height: 70px !important;
    }
  }
  //  文章页
  .article-page {
    main {
      /*文章标题*/
      .entry-header {
        @include entryHeaderM;
      }
      /*文章页的文章信息*/
      .article-info {
        padding: 10px 20px;
      }
      article {
        padding: 20px;
      }
    }
  }
  .container .col-md-12 {
    padding: 0 10px;
  }

  // 文章页图片的默认尺寸
  .load-img {
    height: 200px;
  }

  //  文章搜索和分类页
  .archives-list {
    .archives {
      .post {
        @include postM;
        .post-title {
          font-size: 20px;
        }
        .header-img {
          height: 145px;
        }
      }
      .page-header {
        .archive-title {
          font-size: 20px;
        }
      }
    }
  }
  //  侧边栏
  .sidebar section {
    margin-left: 0;
  }
  //  Emoji面板
  #emoji-panel {
    width: 93% !important;
  }
  //  评论区
  #comments {
    .comment-list {
      .comment-children {
        margin-left: 22px;
      }
    }
  }
}

@media screen and (max-width: 374px) {
  //  评论区
  #comments {
    .comment-list {
      .comment-reply {
        a {
          display: inline !important;
          border: none !important;
          font-size: 14px !important;
        }
      }
    }
  }
}

@import "universal";
@import "light-color";
@import "primary-color";
@import "info-color";
@import "success-color";
@import "dark-color";