/* 定制博客背景图片，url里面是你的图片位置信息 */
body { 
     background-color: #efefef;
     background-image:url(https://images2.alphacoders.com/465/thumb-1920-465708.jpg); 
     background-repeat: no-repeat; 
     background-attachment: fixed; 
     background-position: center 0; 
     background-size: cover; 
    padding-top:0px;
  }
/*主面板 粘在CSS框*/
/*建议先自己拿F12调试一下效果*/
#home {
    margin: 0 auto;
        margin-top: 0px;
        margin-bottom: 0px;
    width: 75%;/*大白框的宽度*/
    min-width: 650px;/*最小宽度*/
    background-color: #ffffffe6;/*颜色 我比较喜欢不特别透的*/
    padding: 30px;
    margin-top: 70px;
    margin-bottom: 50px;
    box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
}
#cnblogs_post_body
{
    color: black;      
    font: 0.875em/1.5em "微软雅黑" , "PTSans" , "Arial" ,sans-serif;
    font-size: 15px;
}
/*粘在CSS框*/
/*编辑h1*/
#cnblogs_post_body h1 {
    background: #6FB7B7;
    border-radius: 6px 6px 6px 6px;
    color: #1d1626;/*字体颜色*/
    font-family: "微软雅黑" , "宋体" , "黑体" ,Arial;
    font-size: 20px;
    font-weight: bold;
    height: 35px;/*框框高度*/
    line-height: 34px;/*文本框高度*/
    margin: 18px 0 !important;
    padding: 8px 0 5px 7px;
    text-shadow: 2px 2px 3px #222222;
    /*下面三句是加左边那条线的*/
    border-left-color: rgb(29, 60, 74);
    border-left-style: solid;
    border-left-width: 3px;
}
#cnblogs_post_body h2 {
    background: #5CADAD;
    border-radius: 6px 6px 6px 6px;
    color: #1d1626;
    font-family: "微软雅黑" , "宋体" , "黑体" ,Arial;
    font-size: 17px;
    font-weight: bold;
    height: 25px;
    line-height: 25px;
    margin: 18px 0 !important;
    padding: 8px 0 5px 7px;
    text-shadow: 2px 2px 3px #222222;
}
#cnblogs_post_body h3 {
    background: #81C0C0;
    border-radius: 6px 6px 6px 6px;
    color: #1d1626;
    font-family: "微软雅黑" , "宋体" , "黑体" ,Arial;
    font-size: 16px;
    font-weight: bold;
    height: 17px;
    line-height: 17px;
    margin: 12px 0 !important;
    padding: 5px 0 5px 5px;
    text-shadow: 2px 2px 3px #222222;
    border-left-color: rgb(107, 171, 234);
    border-left-style: solid;
    border-left-width: 3px;
}
#div_digg{
  position:fixed;
  bottom:-10px;
  width:120px;
  right:20px;
  box-shadow: 0 0 6px #0000FF;
  border:2px solid #FF0000;
  padding:4px;
  background-color:#fff;
  border-radius:4px 4px 4px 4px !important;
}
#blogTitle h2{
  font-family: "游ゴシック" !important;
}
.SidePara {
            color: red;
            opacity: 0.7;
            font-size: 17px;
            font-family: Georgia, 'Times New Roman', Times, serif;
            font-style: italic;
}
#Header1_HeaderTitle{
   font-family: Georgia !important;
   font-style: italic !important;
   
}
#yiyan {
            border: 1px solid gold;
            border-style: solid;
            border-width: 1px;
            border-radius: 30px;
            font-weight: 400;
            font-family: "游ゴシック";
color:skyblue;
        }

.icon_favorite {
    background: transparent url('https://images.cnblogs.com/cnblogs_com/shwee/1218109/o_kj.gif') no-repeat 0 0;
    padding-left: 15px;
}

#blog_post_info_block a {
    text-decoration: none;
    color: #5B9DCA;
    padding: 3px;
}
/*************************************************************************************
 * 评论区 BEGIN
 *************************************************************************************/
//添加 评论区的 形象照
function addImage() {
  var spen_html = '<span class=\'bot\' ></span>\
                         <span class=\'top\'></span>';
  $('.blog_comment_body').append(spen_html);

  $('.blog_comment_body')
    .before('<div class=\'body_right\' style=\'float: left;\'><a target=\'_blank\'><img  /></a></div>');
  var feedbackCon = $('.feedbackCon').addClass('clearfix');
  for (var i = 0; i < feedbackCon.length; i++) {
    var span = $(feedbackCon[i]).find('span:last')[0].innerHTML || 'https://pic.cnitblog.com/face/sample_face.gif';
    $(feedbackCon[i]).find('.body_right img').attr('src', span);
    var href = $(feedbackCon[i]).parent().find('.comment_date').next().attr('href');
    $(feedbackCon[i]).find('.body_right a').attr('href', href);

  }
}
//移动一个单位 评论
function nextRecTop() {
  var rec = $('#RecentCommentsBlock');
  if (rec.length) {
    var top = rec.scrollTop();
    top++;
    rec.scrollTop(top);
    if (top != rec.scrollTop())
      rec.scrollTop(0);
  }
}
//移动评论
function MobileComment() {
  var RecCommentTime = 80;
  var RecintervalId = setInterval(function () {
    nextRecTop();
  }, RecCommentTime);

  $('#RecentCommentsBlock').hover(function () {//移进
    clearInterval(RecintervalId);
  }, function () {//移出
    RecintervalId = setInterval(function () {
      nextRecTop();
    }, RecCommentTime);
  });
}

//添加评论区 背景
function addtbCommentBody_bg() {
  var tbcomment = $('#tbCommentBody');
  if (!tbcomment.hasClass('tbCommentBody_bg')) {
    tbcomment.addClass('tbCommentBody_bg');
    tbcomment.focus(function () {
      removetbCommentBody_bg();
    });
  }
}

function focusoutCommentBody_bg() {
  $('#tbCommentBody').focusout(function () { addtbCommentBody_bg(); });
}
//移除评论区 背景
function removetbCommentBody_bg() {
  !$('.tbCommentBody_bg').removeClass('tbCommentBody_bg');
  $('#tbCommentBody').unbind('focus');
}
/*************************************************************************************
 * 评论区 END
 *************************************************************************************/

/*************************************************************************************
 * 根据文章中标题自动生成目录 BEGIN
 *************************************************************************************/
String.prototype.replaceAll = function (FindText, RepText) {
  regExp = new RegExp(FindText, 'gm');
  return this.replace(regExp, RepText);
}

/**
 * resolve the string to fit cnblog's rules
 */
function resolveTitle(title) {
  var result;
  result = title.replaceAll(' ', '-');
  result = result.replaceAll('\\(', '');
  result = result.replaceAll('\\)', '');
  result = result.replaceAll('（', '');
  result = result.replaceAll('）', '');
  result = result.toLowerCase();
  return result;
}
function GenerateContentList() {
  var nodes = $('#cnblogs_post_body :header');

  var content = '<a name="_labelTop"></a>';
  content += '<div id="navCategory">';
  content += '<blockquote><p style="font-size: 18pt; color:#a2b4ba"><b>目录</b></p>';
  content += '<div>';

  for (var i = 0; i < nodes.length; i++) {
    var item = '';
    var originTitle = $(nodes[i]).text();
    var resolvedTitle = resolveTitle(originTitle);

    if (nodes[i].tagName === 'H1') {
      item = '<a style="font-size:18px" href="#' + resolvedTitle + '">' + $(nodes[i]).text() + '</a><br>';
    } else if (nodes[i].tagName === 'H2') {
      item = '<a style="font-size:16px" href="#' + resolvedTitle + '">&emsp;&emsp;' + $(nodes[i]).text() + '</a><br>';
    }

    content += item;
  }
  content += '</blockquote></div>';
  var len = $('#cnblogs_post_body').length;
  if ($('#cnblogs_post_body').length != 0) {
    $($('#cnblogs_post_body')[0]).prepend(content);
  }

  $($('#cnblogs_post_body')[len - 1])
    .append('<div id=\'signature\'><p>作者：<a href=\'https://www.cnblogs.com/NeosKnight/\'>NeosKnight</a></br>欢迎任何形式的转载，但请务必注明出处。</br>限于本人水平，如果文章和代码有表述不当之处，还请不吝赐教。</p></div>');
}
/*************************************************************************************
 * 根据文章中标题自动生成目录 END
 *************************************************************************************/

function generateTagClouds() {
  $('.catListTag>ul').wrap('<div class=\'wrap\' ></div>').parent().css({ 'width': '240px', 'height': '240px' });

  var options = {
    'range': [-200, 300],
    'gravity': -10,
    'xPos': 0.5,
    'yPos': 0.5,
    'gravityVector': [0, 0, 1],
    'interval': 100,
    'hoverGravityFactor': 0
  };

  $('div.wrap').starfieldTagCloud(options);
}

// 自定义定时器[当元素加载完成是执行回调函数]
function customTimer(inpId, fn) {
  if ($(inpId).length) {
    fn();
  }
  else {
    var intervalId = setInterval(function () {
      if ($(inpId).length) {  //如果存在了
        clearInterval(intervalId);  // 则关闭定时器
        customTimer(inpId, fn);              //执行自身
      }
    }, 100);
  }
}

// execute the func after the page have loaded
$(function () {
  customTimer('#div_digg', function () {
    var div_html = '<div class=\'\'>\
                        <a href=\'javascript:void(0);\' onclick=\'c_follow();\'>关注</a>\
                         &nbsp;|&nbsp;\
                        <a href=\'#top\'>顶部</a>\
                         &nbsp;|&nbsp;\
                        <a href=\'javascript:void(0);\' onclick=" $(\'#tbCommentBody\').focus();">评论</a>\
                   </div>';
    $('#div_digg').append(div_html);
    //tbCommentBody
  });

  GenerateContentList();

  customTimer('.catListTag', generateTagClouds);

  //添加 评论区的 形象照
  MobileComment();//移动评论
  customTimer('.blog_comment_body', addImage);
  customTimer('#tbCommentBody', function () {
    addtbCommentBody_bg();
    focusoutCommentBody_bg();
  });
});


pre {
    /*控制代码不换行*/
    white-space: pre;
    word-wrap: normal;
}

/* Atelier-Forest Comment */
.cnblogs-markdown .hljs-comment,
.cnblogs-markdown .hljs-quote {
  color: #9c9491;
}

/* Atelier-Forest Red */
.cnblogs-markdown .hljs-variable,
.cnblogs-markdown .hljs-template-variable,
.cnblogs-markdown .hljs-attribute,
.cnblogs-markdown .hljs-tag,
.cnblogs-markdown .hljs-name,
.cnblogs-markdown .hljs-regexp,
.cnblogs-markdown .hljs-link,
.cnblogs-markdown .hljs-name,
.cnblogs-markdown .hljs-selector-id,
.cnblogs-markdown .hljs-selector-class {
  color: #f22c40;
}

/* Atelier-Forest Orange */
.cnblogs-markdown .hljs-number,
.cnblogs-markdown .hljs-meta,
.cnblogs-markdown .hljs-built_in,
.cnblogs-markdown .hljs-builtin-name,
.cnblogs-markdown .hljs-literal,
.cnblogs-markdown .hljs-type,
.cnblogs-markdown .hljs-params {
  color: #df5320;
}

/* Atelier-Forest Green */
.cnblogs-markdown .hljs-string,
.cnblogs-markdown .hljs-symbol,
.cnblogs-markdown .hljs-bullet {
  color: #7b9726;
}

/* Atelier-Forest Blue */
.cnblogs-markdown .hljs-title,
.cnblogs-markdown .hljs-section {
  color: #407ee7;
}

/* Atelier-Forest Purple */
.cnblogs-markdown .hljs-keyword,
.cnblogs-markdown .hljs-selector-tag {
  color: #6666ea;
}

.cnblogs-markdown .hljs {
  display: block;
  overflow-x: auto;
  background: #1b1918 !important;
  color: #a8a19f;
  padding: 0.5em;
}

.cnblogs-markdown .hljs-emphasis {
  font-style: italic;
}

.cnblogs-markdown .hljs-strong {
  font-weight: bold;
}

.newsItem, .catListEssay, .catListLink, .catListNoteBook, .catListTag, .catListPostCategory, .catListPostArchive, .catListImageCategory, .catListArticleArchive, .catListView, .catListFeedback, .mySearch, .catListComment, .catListBlogRank, .catList, .catListArticleCategory {
    background: rgba(255, 255, 255, 0);
    margin-bottom: 35px;
    word-wrap: break-word;
}