/* 全局重置 & 基础样式（1:1复刻Hexo Butterfly） */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #4c4948;
  background-color: #efefef;
  overflow-x: hidden;
}

/* 隐藏博客园原生元素 */
#header, #blogTitle, #navigator, #sideBar, .dayTitle, .postSeparator, #footer {
  display: none !important;
}

/* 背景容器 */
#web_bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #efefef;
  z-index: -999;
}

/* 左侧侧边栏（复刻sidebar） */
#custom-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 12px rgba(0,0,0,0.05);
  z-index: 9999;
  padding: 20px 0;
  text-align: center;
  overflow-y: auto;
}

#custom-sidebar .avatar-img img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 15px;
  object-fit: cover;
}

#custom-sidebar .site-data {
  display: flex;
  justify-content: space-around;
  margin: 20px 0;
}

#custom-sidebar .site-data a {
  text-decoration: none;
  color: #4c4948;
}

#custom-sidebar .site-data .headline {
  font-size: 12px;
  color: #999;
  margin-bottom: 5px;
}

#custom-sidebar .site-data .length-num {
  font-size: 18px;
  font-weight: 600;
  color: #4299e1;
}

#custom-sidebar .menus_items {
  margin-top: 20px;
}

#custom-sidebar .menus_item {
  margin: 10px 0;
}

#custom-sidebar .menus_item a {
  display: block;
  padding: 8px 0;
  color: #4c4948;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

#custom-sidebar .menus_item a:hover {
  color: #4299e1;
}

#custom-sidebar .menus_item a i {
  margin-right: 8px;
  font-size: 14px;
}

/* 主页面容器（复刻body-wrap） */
#custom-body-wrap {
  margin-left: 240px;
  min-height: 100vh;
}

/* 顶部header（复刻page-header） */
#custom-page-header {
  width: 100%;
  height: 200px;
  background: url("https://Qianmo-su.github.io/img/bg.jpg") no-repeat center center;
  background-size: cover;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  text-align: center;
}

#custom-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#custom-nav .nav-site-title {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

#custom-nav .menus_items {
  display: flex;
  gap: 20px;
}

#custom-nav .menus_item a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
}

#custom-nav .menus_item a i {
  margin-right: 5px;
}

#custom-site-info {
  margin-top: 40px;
}

#custom-site-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
}

#custom-subtitle {
  font-size: 16px;
  opacity: 0.9;
}

/* 主内容区（复刻content-inner） */
#custom-content-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
  display: grid;
  grid-template-columns: calc(100% - 300px) 300px;
  gap: 20px;
}

/* 文章列表（复刻recent-posts） */
#custom-recent-posts {
  width: 100%;
}

.custom-recent-post-item {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: box-shadow 0.3s;
}

.custom-recent-post-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.custom-article-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.custom-article-title a {
  color: #4c4948;
  text-decoration: none;
  transition: color 0.3s;
}

.custom-article-title a:hover {
  color: #4299e1;
}

.custom-article-meta-wrap {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-article-meta-wrap i {
  font-size: 12px;
}

.custom-article-meta-wrap a {
  color: #999;
  text-decoration: none;
  transition: color 0.3s;
}

.custom-article-meta-wrap a:hover {
  color: #4299e1;
}

.custom-article-content {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 分页（复刻pagination） */
#custom-pagination {
  margin: 30px 0;
  text-align: center;
}

#custom-pagination .pagination {
  display: inline-flex;
  gap: 5px;
}

#custom-pagination .page-number {
  display: inline-block;
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: #fff;
  border-radius: 4px;
  color: #666;
  text-decoration: none;
  transition: all 0.3s;
}

#custom-pagination .page-number.current {
  background: #4299e1;
  color: #fff;
}

#custom-pagination .page-number:hover:not(.current) {
  background: #f5f5f5;
  color: #4299e1;
}

#custom-pagination .extend {
  display: inline-block;
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: #fff;
  border-radius: 4px;
  color: #666;
  text-decoration: none;
  transition: all 0.3s;
}

#custom-pagination .extend:hover {
  background: #f5f5f5;
  color: #4299e1;
}

/* 右侧侧边栏（复刻aside-content） */
#custom-aside-content {
  width: 100%;
}

.custom-card-widget {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.custom-card-widget .item-headline {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-card-widget .item-headline i {
  margin-right: 8px;
  color: #4299e1;
}

.custom-card-widget .item-headline .card-more-btn {
  font-size: 12px;
  color: #999;
  text-decoration: none;
}

/* 个人信息卡片（复刻card-info） */
.custom-card-info {
  text-align: center;
}

.custom-card-info .avatar-img img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 10px;
  object-fit: cover;
}

.custom-card-info .author-info-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
}

.custom-card-info .author-info-description {
  font-size: 12px;
  color: #999;
  margin-bottom: 15px;
}

.custom-card-info .site-data {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
}

.custom-card-info .site-data a {
  text-decoration: none;
  color: #4c4948;
}

.custom-card-info .site-data .headline {
  font-size: 12px;
  color: #999;
  margin-bottom: 5px;
}

.custom-card-info .site-data .length-num {
  font-size: 18px;
  font-weight: 600;
  color: #4299e1;
}

.custom-card-info #card-info-btn {
  display: inline-block;
  padding: 8px 20px;
  background: #4299e1;
  color: #fff;
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.3s;
}

.custom-card-info #card-info-btn:hover {
  background: #3182ce;
}

.custom-card-info #card-info-btn i {
  margin-right: 5px;
}

/* 公告卡片（复刻card-announcement） */
.custom-card-announcement .announcement_content {
  font-size: 14px;
  color: #666;
}

/* 最新文章卡片（复刻card-recent-post） */
.custom-aside-list-item {
  margin-bottom: 10px;
}

.custom-aside-list-item .content .title {
  font-size: 14px;
  color: #4c4948;
  text-decoration: none;
  transition: color 0.3s;
  display: block;
  margin-bottom: 3px;
}

.custom-aside-list-item .content .title:hover {
  color: #4299e1;
}

.custom-aside-list-item .content time {
  font-size: 12px;
  color: #999;
}

/* 分类卡片（复刻card-categories） */
.custom-card-category-list {
  list-style: none;
}

.custom-card-category-list-item {
  margin-bottom: 8px;
}

.custom-card-category-list-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.custom-card-category-list-link:hover {
  color: #4299e1;
}

.custom-card-category-list-count {
  font-size: 12px;
  color: #999;
  background: #f5f5f5;
  padding: 1px 6px;
  border-radius: 10px;
}

/* 标签卡片（复刻card-tags） */
.custom-card-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-card-tag-cloud a {
  font-size: 14px;
  color: #99a9bf;
  text-decoration: none;
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.3s;
}

.custom-card-tag-cloud a:hover {
  background: #4299e1;
  color: #fff;
}

/* 归档卡片（复刻card-archives） */
.custom-card-archive-list {
  list-style: none;
}

.custom-card-archive-list-item {
  margin-bottom: 8px;
}

.custom-card-archive-list-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.custom-card-archive-list-link:hover {
  color: #4299e1;
}

.custom-card-archive-list-count {
  font-size: 12px;
  color: #999;
  background: #f5f5f5;
  padding: 1px 6px;
  border-radius: 10px;
}

/* 网站信息卡片（复刻card-webinfo） */
.custom-webinfo {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-webinfo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.custom-webinfo-item .item-name {
  color: #666;
}

.custom-webinfo-item .item-count {
  color: #4299e1;
  font-weight: 600;
}

/* 页脚（复刻footer） */
#custom-footer {
  margin-left: 240px;
  padding: 30px;
  text-align: center;
  background: #fff;
  border-top: 1px solid #f5f5f5;
}

#custom-footer .footer-copyright {
  font-size: 12px;
  color: #999;
}

#custom-footer .footer-copyright a {
  color: #4299e1;
  text-decoration: none;
}

#custom-footer .footer-separator {
  margin: 0 5px;
}

/* 右下角功能区（复刻rightside） */
#custom-rightside {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#custom-rightside button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  color: #666;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
}

#custom-rightside button:hover {
  background: #4299e1;
  color: #fff;
}

#custom-rightside .scroll-percent {
  font-size: 12px;
  margin-right: 5px;
}

/* 深色模式样式 */
html[data-theme="dark"] {
  --bg-color: #0d0d0d;
  --text-color: #e5e5e5;
  --card-bg: #1a1a1a;
  --border-color: #333;
}

html[data-theme="dark"] body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

html[data-theme="dark"] #web_bg {
  background-color: var(--bg-color);
}

html[data-theme="dark"] #custom-sidebar,
html[data-theme="dark"] .custom-recent-post-item,
html[data-theme="dark"] .custom-card-widget,
html[data-theme="dark"] #custom-footer,
html[data-theme="dark"] #custom-rightside button {
  background: var(--card-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

html[data-theme="dark"] a {
  color: #7ab0ff;
}

html[data-theme="dark"] a:hover {
  color: #4299e1;
}

/* 响应式适配 */
@media (max-width: 1200px) {
  #custom-content-inner {
    grid-template-columns: 1fr;
    padding: 20px;
  }
}

@media (max-width: 768px) {
  #custom-sidebar {
    display: none;
  }
  #custom-body-wrap, #custom-footer {
    margin-left: 0;
  }
  #custom-page-header {
    height: 150px;
  }
  #custom-site-title {
    font-size: 24px;
  }
  #custom-subtitle {
    font-size: 14px;
  }
}processSubtitle: (content, extraContents = []) => {
    if (true) {
      const sub = ["你在抱怨什么呢","为明天到来的事，说人生像是没有意义","没有选择会是唯一的路","这不是你自己的问题，人终归要好好去生活"].slice()

      if (extraContents.length > 0) {
        sub.unshift(...extraContents)
      }

      if (typeof content === 'string') {
        sub.unshift(content)
      } else if (Array.isArray(content)) {
        sub.unshift(...content)
      }

      sub.length > 0 && typedJSFn.init(sub)
    } else {
      document.getElementById('subtitle').textContent = typeof content === 'string' ? content :
        (Array.isArray(content) && content.length > 0 ? content[0] : '')
    }
  }
 /* ================= 【新增】Bug修复：图片优化 ================= */
img {
  max-width: 100%;
  height: auto;
  background-color: #f5f5f5; /* 图片加载前的占位背景，防止布局跳动 */
  transition: opacity 0.2s;
}

/* ================= 【新增】Bug修复：文章详情页容器样式 (复用原有卡片风格) ================= */
/* 这个容器默认隐藏，只有点进文章才显示 */
#custom-post-detail {
  display: none;
  width: 100%;
}

/* 确保详情页的文章内容不被截断 */
#custom-post-detail .custom-article-content {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

/* 详情页标题加大 */
#custom-post-detail .custom-article-title {
  font-size: 24px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 20px;
}