/* 设置tongqingliu顶部间距*/
h1 {
    margin-top: 20px;
}

/* 设置tongqingliu方框及背景*/
#top {
    color: #333;
    margin-left: 50px;
    margin-right: 50px;
    border-radius: 10px;
    background-color: royalblue;
    border-top:0px;
    padding-bottom: 35px;
    text-align: center;
}

/* 设置tongqingliu字体及大小*/
#top a, #top a:link, #top a:visited, #top a:active, #top a:hover {
    font-family: "Comic Sans MS";
    font-size: larger;
    color: whitesmoke;
}

/* 设置保持学习的态度 */
#tagline {
    margin-top: 20px;
    font-size: large;
    color:white;
}

/* 导航及以文字所在方框的位置 */
#leftmenu {
    margin-top: 100px;
}

/* 导航，统计信息 */
#leftmenu h3 {
    font-family: palatino,georgia,times new roman,serif;
    color: whitesmoke;
    background-color: royalblue;
    font-size: 1.5em;
    font-weight: normal;
    padding: 3px;
    margin-top: 0;
    line-height: 1.5;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* 首页，联系，管理，随笔，文章，评论 */
#leftmenu ul {
    font-size: 14px;
}

/* 置顶随笔及以下所在方框 */
#main {
    margin-top: 50px;
}

/* 置顶随笔， 日期  */
p.date {
    color: black;
    font-family: Palatino,georgia,times new roman,serif;
    font-size: 1em;
    font-weight: bold;
    padding-top: 15px;
    padding-bottom: 10px;
    display: none;
}

/* 设置首页目录 */
div.post h2 a:link {
    font-family: Palatino,Georgia,Verdana,arir,Sans-Serif;
    font-size: 18pt;
    font-weight: bold;
    color: whitesmoke;
    background-color: green;
    line-height: 40px;
    text-decoration: none;
}
div.post h2 a:visited {
    font-family: Palatino,Georgia,Verdana,arir,Sans-Serif;
    font-size: 18pt;
    font-weight: bold;
    line-height: 40px;
    color: whitesmoke;
    background-color: green;
    text-decoration: none;
}
div.post h2 {
    font-family: palatino,georgia,verdana,arial,sans-serif;
    font-size: 18pt;
    /* color: #606060; */
    font-weight: bold;
    /* background: #fff; */
    line-height: 40px;
    margin-top: 28px;
    background-color: green;
    text-decoration: none;
}
#home {
    margin: 0 auto;
    width: 80%;/*原始65*/
    min-width: 980px;/*页面顶部的宽度*/
    background-color: rgba(245, 245, 245, 0.7);
    padding: 30px;
    margin-top: 50px;
    margin-bottom: 50px;
    box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
}
body {
    background: rgba(12, 100, 129, 1) url('https://images.cnblogs.com/cnblogs_com/Penn000/1013849/o_123.jpg') fixed no-repeat;
    background-position: 50% 5%; 
    background-size: cover;
}
#blogTitle {
    height: 100px;  /*高度*/
    clear: both;
    background-color: rgba(245, 245, 245, 0);
}
#blogTitle h1 {
    font-size: 36px;
    font-weight: bold;
    line-height: 1.8em;/*原始 1.6em*/
    margin-top: 10px;/*原始 15px */
    color: #548B54;
}
#blogTitle h2 {
    font-weight: normal;
    font-size: 17px;/*原始 16px ；font-size: 1.0rem;*/      
    line-height: 1.8;
    color: #111;
    font-weight: bold;
    text-align: right;
    float: right; 
}
#navigator{
    background-color: rgba(33, 160, 139, 0.9);
}
#navList a:link, #navList a:visited, #navList a:active{
    color: #eee;
    font-size: 18px;
    font-weight: bold;
}
.blogStats{
    color: #eee;
}
.postTitle {
    border-left: 8px solid rgba(33, 160, 139, 0.68);
    margin-left: 10px;
    margin-bottom: 10px;
    font-size: 20px;
    float: right;
    width: 100%;
    clear: both;
}
.postTitle a:link, .postTitle a:visited, .postTitle a:active {
    color: #21759b;
    transition: all 0.4s linear 0s;
}
.postTitle a:hover {
    margin-left: 30px;
    color: #0f3647;
    text-decoration: none;
}
.postCon {
    float: right;
    line-height: 1.5em;
    width: 100%;
    clear: both;
    padding: 10px 0;
}

.day .postTitle a {
    padding-left: 10px;
}
.day {
    background: rgba(255, 255, 255, 0.5);
}
/*文章附加信息*/
.postDesc {   
    background: url(images/posted_time.png) no-repeat 0 1px;
    color: #757575;
    float: left;
    width: 100%;
    clear: both;
    text-align: left;     
    font-family: "微软雅黑" , "宋体" , "黑体" ,Arial;
    font-size: 13px;
    padding-right: 20px;/*5px  padding-left: 90px;posted 发表时间左边距离*/
    margin-top: 20px;
    line-height: 1.8;
    padding-bottom: 35px;
}

.newsItem, .catListEssay, .catListLink, .catListNoteBook, .catListTag, .catListPostCategory, 
.catListPostArchive, .catListImageCategory, .catListArticleArchive, .catListView, 
.catListFeedback, .mySearch, .catListComment, .catListBlogRank, .catList, .catListArticleCategory ,#blog-calendar
{
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 35px;
    word-wrap: break-word;
}

.CalTitle{
    background: rgba(255, 255, 255, 0);
}
.catListTitle{
    background-color: rgba(33, 160, 139, 0.9);
}

#topics{
    background: rgba(255, 255, 255, 0.5);
}

.c_ad_block{
    display: none;
}

#tbCommentBody{
    width: 100%;
    height: 200px;
    background: rgba(255, 255, 255, 0.5);
}

#q{background: rgba(255, 255, 255, 0);}

.CalNextPrev{background: rgba(255, 255, 255, 0);}

.cnblogs_code{
    background: rgba(255, 255, 255, 0);    
}

.cnblogs_code div{
    background: rgba(255, 255, 255, 0);    
}

.cnblogs_code_toolbar{
    background: rgba(255, 255, 255, 0);  
}
#main{min-width: 640px;}
.entrylist{
    background: rgba(255, 255, 255, 0.5);  
}






/*************************************************************************************
 * 评论区 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/jingmoxukong/\'>静默虚空</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();
   });
 });