/* ------------------------------------
 * Typecho Default Theme
 *
 * @author  Typecho Team
 * @link  http: //typecho.org/
 * @update  2013-10-28
 * --------------------------------- */

/* ------------------
 * Global style
 * --------------- */
body {
  background-color: #FFF;
  color: #444;
  /*font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;*/
  font-family: "Droid Serif", Georgia, "Times New Roman", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "WenQuanYi Micro Hei","Microsoft Yahei", serif;
  font-size: 87.5%;
}

a {
  color: #3354AA;
  text-decoration: none;
}
a:hover, a:active {
  color: #444;
}
pre, code { 
  background: #F3F3F3;
  font-family: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;
  font-size: .92857em;
}
code { padding: 2px 4px; color: #B94A48; }
pre {
  padding: 8px;
  overflow: auto;
  max-height: 400px;
}
pre code {
  padding: 3px;
  color: #444;
}

blockquote {
  margin: 1em 0;
  padding-left: 1.5em;
  border-left: 4px solid #eee;
  color: #666;
}

table {
  border: 1px solid #ddd;
  width: 100%;
}
table th,
table td {
  padding: 5px 10px;
  border: 1px solid #eee;
}
table th {
  background: #f3f3f3;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "WenQuanYi Micro Hei","Microsoft Yahei", sans-serif;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
  padding: 5px;
  border: 1px solid #E9E9E9;
  width: 100%;

  border-radius: 2px;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
textarea {
  resize: vertical;
}


/* Special link style */
.post-meta a,
.post-content a,
.widget a,
.comment-content a {
  border-bottom: 1px solid #EEE;
}

.post-meta a:hover,
.post-content a:hover,
.widget a:hover,
.comment-content a:hover {
  border-bottom-color: transparent;
}

/* ------------------
 * Header
 * --------------- */

#header {
  padding-top: 35px;
  border-bottom: 1px solid #EEE;
}

#logo {
  color: #333;
  font-size: 2.5em;
}
#logo img {
    max-height: 64px;
}

.description {
  margin: .5em 0 0;
  color: #999;
  font-style: italic;
}

/* Navigation menu */
#nav-menu {
  margin: 25px 0 0;
  padding: 0;
}
#nav-menu a {
  display: block;
  margin-right: -1px;
  padding: 0 20px;
  border: 1px solid #EEE;
  border-bottom: none;
  height: 32px;
  line-height: 32px;
  color: #444;
  float: left;
}
#nav-menu a:hover,
#nav-menu .current {
  background: #F6F6F6;
}

/* Search */
#search {
  position: relative;
  margin-top: 15px;
}
#search input {
  padding-right: 30px;
}
#search button {
  position: absolute;
  right: 4px;
  top: 2px;
  border: none;
  padding: 0;
  width: 24px;
  height: 24px;
  background: transparent url(img/icon-search.png) no-repeat center center;
  direction: ltr; /* fix RTL language */
  text-indent: -9999em;
}

@media 
(-webkit-min-device-pixel-ratio: 2), 
(min-resolution: 192dpi) {
  #search button {
    background-image: url(img/icon-search@2x.png);
    -webkit-background-size: 24px 24px;
    -moz-background-size: 24px 24px;
    -o-background-size: 24px 24px;
    background-size: 24px 24px;
  }
}


/* ------------------
 * Main
 * --------------- */

.post {
  padding: 15px 0 20px;
  border-bottom: 1px solid #EEE;
}
.post-title {
  margin: .83em 0;
  font-size: 1.4em;
}
.post-meta {
  margin-top: -0.5em;
  padding: 0;
  color: #999;
  font-size: .92857em;
}
.post-meta li {
  display: inline-block;
  margin: 0 8px 0 0;
  padding-left: 12px;
  border-left: 1px solid #EEE;
}
.post-meta li:first-child {
  margin-left: 0;
  padding-left: 0;
  border: none;
}
.post-content {
  line-height: 1.5;
}
.post .tags {
  clear: both;
}

.post-near {
  list-style: none;
  margin: 30px 0;
  padding: 0;
  color: #999;
}
.post-near li {
  margin: 10px 0;
}

.archive-title {
  margin: 1em 0 -1em;
  padding-top: 20px;
  color: #999;
  font-size: 1em;
}
.more {
  text-align: center;
}
.more a {
  border: none;
}
.protected .text {
  width: 50%;
}

/* Page nav */

.page-navigator {
  list-style: none;
  margin: 25px 0;
  padding: 0;
  text-align: center;
}
.page-navigator li {
  display: inline-block;
  margin: 0 4px;
}
.page-navigator a {
  display: inline-block;
  padding: 0 10px;
  height: 30px;
  line-height: 30px;
}
.page-navigator a:hover {
  background: #EEE;
  text-decoration: none;
}

.page-navigator .current a {
  color: #444;
  background: #EEE;
}

/* ------------------
 * Comment list
 * --------------- */
#comments {
  padding-top: 15px;
}
.comment-list, .comment-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comment-list li {
  padding: 14px;
  margin-top: 10px;
  border: 1px solid #EEE;
}
.comment-list li.comment-level-odd {
  background: #F6F6F3;
}
.comment-list li.comment-level-even {
  background: #FFF;
}
.comment-list li.comment-by-author {
  background: #FFF9E8;
}
.comment-list li .comment-reply {
  text-align: right;
  font-size: .92857em;
}
.comment-meta a {
  color: #999;
  font-size: .92857em;
}
.comment-author {
  display: block;
  margin-bottom: 3px;
  color: #444;
}
.comment-author .avatar {
  float: left;
  margin-right: 10px;
}
.comment-author cite {
  font-weight: bold;
  font-style: normal;
}

/* Comment reply */
.comment-list .respond {
  margin-top: 15px;
  border-top: 1px solid #EEE;
}
.respond .cancel-comment-reply {
  float: right;
  margin-top: 15px;
  font-size: .92857em;
}
#comment-form label {
  display: block;
  margin-bottom: .5em;
  font-weight: bold;
}
#comment-form .required:after {
  content: " *";
  color: #C00;
}

/* ------------------
 * secondary
 * --------------- */
#secondary {
  padding-top: 15px;
  word-wrap: break-word;
}
.widget {
  margin-bottom: 30px;
}
.widget-list {
  list-style: none;
  padding: 0;
}
.widget-list li {
  margin: 5px 0;
  line-height: 1.6;
}

.widget-list li ul {
  margin-left: 15px;
}


/* ------------------
 * Footer 
 * --------------- */
#footer {
  padding: 3em 0;
  line-height: 1.5;
  text-align: center;
  color: #999;
}


/* -----------------
 * Error page
 * -------------- */
.error-page {
  margin-top: 100px;
  margin-bottom: 100px;
}


/* -----------------
 * Content format
 *--------------- */
.post-content, .comment-content {
  line-height: 1.5;
  word-wrap: break-word;
}
.post-content h2, .comment-content h2 {
  font-size: 1.28571em;
}
.post-content img, .comment-content img,
.post-content video, .comment-content video {
  max-width: 100%;
}
.post-content a img,
.comment-content a img {
  background: #FFF;
  position: relative;
  bottom: -4px;  /* hidden img parent link border  */
}
.post-content hr, .comment-content hr {
  margin: 2em auto;
  width: 100px;
  border: 1px solid #E9E9E9;
  border-width: 2px 0 0 0;
}


/* -----------------
 * Misc
 *--------------- */
.aligncenter, div.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.alignleft {
  float: left;
}
.alignright {
  float: right;
}
img.alignleft {
  margin: 0 15px 0 0;
}
img.alignright {
  margin: 0 0 0 15px;
}


/* -----------------
 * Responsive
 *--------------- */
@media (max-width: 767px) {
  body {
    font-size: 81.25%;
  }
  #nav-menu a {
    float: none;
    display: inline-block;
    margin: 0 -2px;
  }
}

@media (max-width: 768px) {
  #header,
  .post-title,
  .post-meta {
    text-align: center;
  }
}

@media (min-width: 992px) {

}

@media (min-width: 1200px) {
  .container {
    max-width: 952px;
  }
}


/*
* Hide from both screenreaders and browsers: h5bp.com/u
*/
.hidden {
  display: none !important;
  visibility: hidden; }

/*
* Hide only visually, but have it available for screenreaders: h5bp.com/v
*/
.sr-only {
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px; }

/*
* Extends the .sr-only class to allow the element to be focusable
* when navigated to via the keyboard: h5bp.com/p
*/
.sr-only.focusable:active,
.sr-only.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto; }

/*
* Hide visually and from screenreaders, but maintain layout
*/
.invisible {
  visibility: hidden; }

.post-content p {
    text-indent: 2em; /* 这里的 2em 就是缩进的距离，一个中文字符等于 1em */
}

/* 标签云容器样式 */
.tag-cloud-page {
    text-align: center; /* 标签居中显示 */
    padding: 20px 0;
}

/* 标签列表容器 */
.tag-cloud-page .tags-list {
    display: inline-block;
    max-width: 100%;
}

/* 标签a链接基础样式 */
.tag-cloud-page .tags-list a {
    display: inline-block;
    padding: 8px 15px;
    margin: 5px;
    background-color: #f0f0f0;
    color: #555;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease-in-out;
}

/* 标签a链接悬停效果 */
.tag-cloud-page .tags-list a:hover {
    background-color: #e9ecef;
    color: #555;
    transform: translateY(-2px); /* 悬停时向上轻微移动 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 根据标签文章数量，调整字体大小 */
/* 你可以根据自己的实际情况调整这些数值 */
.tag-cloud-page .tags-list a[title$=" 1 篇博客"] {
    font-size: 14px;
}
.tag-cloud-page .tags-list a[title$=" 2 篇博客"] {
    font-size: 16px;
}
.tag-cloud-page .tags-list a[title$=" 5 篇博客"] {
    font-size: 18px;
}
.tag-cloud-page .tags-list a[title$=" 10 篇博客"] {
    font-size: 20px;
    font-weight: bold;
}
.tag-cloud-page .tags-list a[title$=" 20 篇博客"] {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c; /* 突出显示热门标签 */
}

/* 子分类列表容器样式 */
.sub-category-list {
    position: relative; /* 确保子元素可以基于它定位 */
    padding-left: 20px; /* 为时间线留出左侧空间 */
    padding-top: 20px;
}

/* 垂直时间线 */
.sub-category-list::before {
    content: '';
    position: absolute;
    left: 6px; /* 调整位置使其与圆点对齐 */
    top: 5px;
    bottom: 0;
    width: 2px; /* 时间线宽度 */
    background-color: #e0e0e0; /* 时间线颜色 */
}

/* 每个列表项（<li>）的样式 */
.sub-category-list ul {
    list-style: none; /* 移除默认的列表标记 */
    padding: 0;
    margin: 0;
}

.sub-category-list li {
    position: relative;
    padding: 10px 0 10px 30px; /* 调整间距 */
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border-radius: 8px; /* 圆角与标签页相似 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.sub-category-list li:hover {
    background-color: #e9ecef;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 时间线上的圆点 */
.sub-category-list li::before {
    content: '';
    position: absolute;
    left: 8px; /* 调整位置 */
    top: 50%; /* 相对父元素顶部偏移50% */
    transform: translateY(-50%); /* 向上移动自身高度的50%，实现垂直居中 */
    width: 8px;
    height: 8px;
    background-color: #3354AA; /* 圆点颜色 */
    border: 2px solid #fff; /* 圆点边框 */
    border-radius: 50%;
    z-index: 1; /* 确保圆点在时间线上方 */
}

/* 列表项中的链接和文章数量 */
.sub-category-list li a {
    text-decoration: none;
    color: #333;
    font-size: 1.1em;
    font-weight: bold;
}

.sub-category-list li .post-count {
    color: #888;
    font-size: 0.9em;
    margin-left: 5px;
}

/* ------------------------------------
 * 返回顶部按钮 - 优化方案
 * --------------------------------- */
#return-to-top {
    /* 通用样式，也适用于移动端 */
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 24px;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

#return-to-top:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

#return-to-top::after {
    content: '⇧';
}

/* 桌面端定位调整，保证按钮在文章内容区域右下角 */
@media (min-width: 992px) {
    #return-to-top {
        /*
         * Typecho 默认主题的布局结构：
         * .container 容器：最大宽度 952px
         * .row: 包含文章内容和侧边栏的 flex 容器
         * .col-mb-12.col-9：文章内容列，占 75% 宽度
         * .col-mb-12.col-3：侧边栏列，占 25% 宽度
         *
         * 计算公式：
         * 页面右侧空白区域 = (视口宽度 - .container最大宽度) / 2
         * 文章内容区域的右边界 = 页面右侧空白区域 + .row 的 25% (侧边栏)
         * 因此，right = (100vw - 952px) / 2 + 侧边栏宽度 + 额外的间距
         * 侧边栏在 992px 屏幕下宽度为 200px 左右
         *
         * right: calc((100vw - 952px) / 2 + 200px + 20px);
         *
         * 注：952px 是 Typecho 默认主题在 @media (min-width: 1200px) 下的 .container 宽度，
         * 992px 是 .container 宽度为 970px 左右
         */
        right: calc((100vw - 970px) / 2 + 250px);
    }
}