/* ====================================
   博客园深色主题 v5.0 - 深度修复版
   
   修复内容：
   1. 评论提交按钮 + 退出链接样式修复
   2. 空的 entrylistDescription 隐藏
   3. 标签列表页面完整样式 (.PostList)
   4. 标签管理页面表格美化 (#taglist)
   5. 主页搜索功能修复
   6. 广告区域完全隐藏
   7. 分类页面完整样式
   8. 代码块一体化设计
   9. 响应式优化
   ==================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    color: #333;
    background: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* ====================================
   广告隐藏 - 完整覆盖
   ==================================== */
#cnblogs_ch,
#cnblogs_c1,
#cnblogs_c2,
#under_post_card,
#under-post-card,
#under_post_news,
#under_post_kb,
#opt_under_post,
#ad_t2,
.c_ad_block,
.post_nav_block,
.post_recommend,
.cnblogs_code_toolbar,
div[id^="google_ads"],
div[id^="ad_"],
#HistoryToday,
.under-post-card,
.post-recommends,
.adsbygoogle,
ins.adsbygoogle,
#div-gpt-ad,
iframe[src*="ads"],
.vip-article-wrap,
#vip_qrcode,
.recommend-item,
.post-adds,
.card-item-ad,
#sidebar_topmedals,
.skin-vote,
#cnblogs_news,
#ks_rec,
.post-recommends-title,
.comment-tips-wrap,
#cnb-sponsor {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ====================================
   导航栏
   ==================================== */
#header {
    display: none !important;
}

#menu-box {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #f0f0f0;
    height: 65px;
}

#top-menu {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 30px;
}

.logo-site {
    padding: 10px 0;
}

.logo-site img {
    max-height: 45px;
    width: auto;
}

/* 搜索图标 */
.nav-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #f7fafc;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 15px;
    float: right;
    margin-top: 13px;
}

.nav-search:hover {
    background: #edf2f7;
    transform: scale(1.05);
}

.nav-search i {
    color: #4a5568;
    font-size: 16px;
}

/* 搜索框面板 */
#search-main {
    background: #fff;
    padding: 20px 30px;
    margin: 85px auto 20px;
    max-width: 1600px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

#search-main #searchbar {
    display: inline-block;
    margin-right: 20px;
}

#search-main #searchform {
    display: flex;
    align-items: center;
    gap: 10px;
}

#search-main .input_my_zzk,
#search-main input[name="wd"] {
    width: 300px;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
}

#search-main .input_my_zzk:focus,
#search-main input[name="wd"]:focus {
    border-color: #4a5568;
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1);
}

#search-main .btn_my_zzk,
#search-main button[type="submit"] {
    padding: 10px 24px;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#search-main .btn_my_zzk:hover,
#search-main button[type="submit"]:hover {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    transform: translateY(-1px);
}

#menu-menu {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
}

#menu-menu > li {
    margin: 0 2px;
    position: relative;
}

#menu-menu > li > a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#menu-menu > li > a:hover {
    background: #f5f5f5;
    color: #4a5568;
}

#menu-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 160px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    padding: 5px 0;
    list-style: none;
}

#menu-menu > li:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#menu-menu .sub-menu li {
    list-style: none;
    border: none !important;
    padding: 0 !important;
}

#menu-menu .sub-menu li a {
    display: block;
    padding: 8px 16px;
    color: #666;
    font-size: 13px;
    transition: all 0.2s ease;
}

#menu-menu .sub-menu li a:hover {
    background: #f5f5f5;
    color: #4a5568;
    padding-left: 20px;
}

/* ====================================
   主体布局
   ==================================== */
#home {
    margin: 85px auto 40px;
    width: 95%;
    max-width: 1600px;
    min-width: 950px;
    background: transparent;
    padding: 0;
}

#main {
    width: 100%;
    display: flex;
    gap: 20px;
}

#mainContent {
    flex: 1;
    min-width: 0;
}

#mainContent .forFlow {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* ====================================
   文章列表（首页）
   ==================================== */
.forFlow {
    padding: 0;
}

.day {
    background: #fff;
    margin-bottom: 24px !important;
    padding: 28px 32px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    border: 1px solid #edf2f7;
}

.day:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: rgba(49, 130, 206, 0.3);
}

/* 置顶文章特殊样式 */
.day.pinned {
    border-left: 4px solid #3182ce;
    background: linear-gradient(135deg, #fff 0%, #f7faff 100%);
}

.dayTitle {
    display: none;
}

.postTitle {
    margin-bottom: 16px;
    padding: 0;
    border: none;
    text-align: center !important;
}

.postTitle a {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.5;
    transition: color 0.2s ease;
    display: inline-block;
}

.postTitle a:hover {
    color: #3182ce;
}

/* 置顶标记 */
.pinned-post-mark {
    display: inline-block;
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: #fff !important;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    margin-right: 10px;
    font-weight: 500;
    vertical-align: middle;
}

.postCon,
.c_b_p_desc {
    color: #555;
    line-height: 1.8;
    font-size: 14px;
    margin: 14px 0;
    text-align: justify;
}

/* 阅读全文链接 */
.c_b_p_desc_readmore {
    color: #3182ce;
    font-weight: 500;
    margin-left: 6px;
    transition: color 0.2s ease;
}

.c_b_p_desc_readmore:hover {
    color: #2c5282;
    text-decoration: underline;
}

.postDesc {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
    color: #999;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.postDesc a {
    color: #4a5568;
    transition: color 0.2s ease;
}

.postDesc a:hover {
    color: #3182ce;
}

/* 同一天内多篇文章的分隔线 */
.postSeparator {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
    margin: 24px 0;
}

/* 分页导航 */
.topicListFooter {
    text-align: center;
    padding: 24px 0;
}

#nav_next_page a {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: #283041 !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#nav_next_page a:hover {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.3);
}

/* ====================================
   ★★★ 分页器完整样式 - 垂直居中修复 ★★★
   ==================================== */
.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px 0;
    font-size: 14px;
    font-weight: 500;
    color: #1a202c;
}

/* 分页链接 */
.pager a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: #fff;
    color: #4a5568 !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 40px;
}

.pager a:hover {
    background: #3182ce;
    color: #fff !important;
    border-color: #3182ce;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.3);
}

/* ★★★ 当前页码样式 - 核心修复 ★★★ */
/* 博客园分页器当前页码可能是span或纯文本 */
.pager .current-page,
.pager span:not(.pager-ellipsis) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.3);
    line-height: 40px;
}

/* 省略号样式 */
.pager .pager-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #a0aec0;
    font-weight: 400;
    line-height: 40px;
    background: transparent !important;
}

/* ====================================
   分类页面样式 - 文章分类/随笔分类
   ==================================== */

/* 分类标题 */
.entrylistTitle {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: #fff !important;
    padding: 20px 28px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.entrylistTitle::before {
    content: "📂";
    font-size: 22px;
}

.entrylistTitle a {
    color: #fff !important;
    transition: opacity 0.2s ease;
}

.entrylistTitle a:hover {
    opacity: 0.85;
}

.entrylistTitle .category-crumb-item {
    color: #63b3ed !important;
    font-weight: 700;
}

.entry-list-title-dropdown-prompt {
    display: none;
}

/* ====================================
   分类描述 - 隐藏空内容
   ==================================== */
.entrylistDescription {
    background: #fff;
    padding: 16px 24px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid #4a5568;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 隐藏空的分类描述框 */
.entrylistDescription:empty,
.entrylistDescription:has(.post-list-desc:empty) {
    display: none !important;
}

/* 额外兼容：当 post-list-desc 只有空白时隐藏 */
.post-list-desc:empty {
    display: none;
}

.entrylistDescription:has(.post-list-desc:empty),
.entrylistDescription:not(:has(.post-list-desc:not(:empty))) {
    display: none !important;
}

.post-list-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
}

/* 分类列表容器 */
.entrylist {
    background: transparent;
}

/* 单个分类项 */
.entrylistItem {
    background: #fff;
    margin-bottom: 16px;
    padding: 24px 28px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.entrylistItem::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #4a5568 0%, #718096 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.entrylistItem:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: rgba(74, 85, 104, 0.3);
}

.entrylistItem:hover::before {
    opacity: 1;
}

/* 分类项标题 */
.entrylistPosttitle {
    margin-bottom: 12px;
}

.entrylistItemTitle {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748 !important;
    line-height: 1.5;
    transition: color 0.2s ease;
    display: inline-block;
}

.entrylistItemTitle:hover {
    color: #4a5568 !important;
}

.entrylistItemTitle span {
    display: inline;
}

/* 分类项摘要 */
.entrylistPostSummary {
    margin: 14px 0;
}

.entrylistPostSummary .c_b_p_desc {
    color: #666;
    font-size: 14px;
    line-height: 1.9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c_b_p_desc_readmore {
    color: #4a5568 !important;
    font-weight: 500;
    margin-left: 8px;
    transition: color 0.2s ease;
}

.c_b_p_desc_readmore:hover {
    color: #2d3748 !important;
}

/* 分类项元信息 */
.entrylistItemPostDesc {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    color: #999;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.entrylistItemPostDesc a {
    color: #4a5568;
    transition: color 0.2s ease;
}

.entrylistItemPostDesc a:hover {
    color: #2d3748;
}

/* 阅读/评论/推荐计数 */
.post-view-count,
.post-comment-count,
.post-digg-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #718096;
    font-size: 12px;
    padding: 2px 8px;
    background: #f7fafc;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.post-view-count:hover,
.post-comment-count:hover,
.post-digg-count:hover {
    background: #edf2f7;
    color: #4a5568;
}

/* 分类项分隔线 */
.postSeparator {
    display: none;
}

/* ====================================
   ★★★ 标签列表页面样式 ★★★
   当前标签：xxx 页面
   ==================================== */

/* 标签页面标题 */
h1.PostListTitle {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: #fff !important;
    padding: 20px 28px;
    margin-bottom: 24px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

h1.PostListTitle::before {
    content: "🏷️";
    font-size: 22px;
}

/* 标签页面文章列表容器 */
#myposts {
    background: transparent;
}

/* 单个文章项 (.PostList) */
.PostList {
    background: #fff;
    margin-bottom: 16px;
    padding: 24px 28px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

.PostList::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #4a5568 0%, #718096 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.PostList:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: rgba(74, 85, 104, 0.3);
}

.PostList:hover::before {
    opacity: 1;
}

/* 标签页文章标题 */
.postTitl2 {
    margin-bottom: 10px;
}

.postTitl2 a {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.5;
    transition: color 0.2s ease;
    display: inline-block;
}

.postTitl2 a:hover {
    color: #4a5568;
}

.postTitl2 a span {
    color: inherit;
}

/* 标签页文章元信息 */
.postDesc2 {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    color: #999;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.postDesc2 a {
    color: #4a5568;
    transition: color 0.2s ease;
}

.postDesc2 a:hover {
    color: #2d3748;
}

/* 标签页文章内容（通常为空） */
.postText2 {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
    margin: 10px 0;
}

/* 标签页文章列表依次出现动画 */
.PostList:nth-child(1) { animation-delay: 0.05s; }
.PostList:nth-child(2) { animation-delay: 0.1s; }
.PostList:nth-child(3) { animation-delay: 0.15s; }
.PostList:nth-child(4) { animation-delay: 0.2s; }
.PostList:nth-child(5) { animation-delay: 0.25s; }
.PostList:nth-child(6) { animation-delay: 0.3s; }
.PostList:nth-child(7) { animation-delay: 0.35s; }
.PostList:nth-child(8) { animation-delay: 0.4s; }
.PostList:nth-child(9) { animation-delay: 0.45s; }
.PostList:nth-child(10) { animation-delay: 0.5s; }

/* ====================================
   ★★★ 标签管理页面表格样式 ★★★
   我的标签页面 (#taglist)
   ==================================== */

/* 标签管理标题区域 */
#taglist_main {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

#taglist_title_wrap {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    padding: 16px 24px;
    margin: 0;
}

#taglist_title {
    color: #fff !important;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

#taglist_title::before {
    content: "🏷️";
    font-size: 20px;
    margin-right: 8px;
}

#taglist_title small {
    font-weight: 400;
    font-size: 13px;
}

#taglist_title small a {
    color: #63b3ed !important;
    transition: color 0.2s ease;
}

#taglist_title small a:hover {
    color: #90cdf4 !important;
}

#taglist_title > small:last-child {
    float: none !important;
    margin: 0;
}

#taglist_title > small:last-child a {
    color: #a0aec0 !important;
    margin: 0 8px;
    padding: 4px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

#taglist_title > small:last-child a:hover,
#taglist_title > small:last-child a.default-tag-order {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

/* 标签表格 */
#taglist {
    padding: 20px;
}

#taglist table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px;
}

#taglist table td {
    background: #f7fafc;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

#taglist table td:hover {
    background: #edf2f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

#taglist table td a {
    color: #2d3748;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

#taglist table td a:hover {
    color: #4a5568;
}

#taglist table td .small,
#taglist table td span.small {
    color: #718096;
    font-size: 12px;
    margin-left: 6px;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* ====================================
   文章详情页
   ==================================== */
#topics {
    background: #fff;
    padding: 35px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: 1px solid #f0f0f0;
}

#topics .postTitle {
    font-size: 28px;
    margin-bottom: 18px;
    text-align: center !important;
}

#topics .postTitle a {
    color: #2d3748;
    font-weight: 700;
    display: inline-block;
}

#topics .postDesc {
    background: #f7fafc;
    padding: 12px 18px;
    border-radius: 4px;
    border: none;
    margin: 16px 0 26px;
    justify-content: center;
}

/* 文章内容 */
#cnblogs_post_body {
    font-size: 16px;
    line-height: 1.9;
    color: #333;
}

#cnblogs_post_body h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 40px 0 20px;
    padding: 18px 24px;
    background: #2d3748;
    color: #fff;
    border-radius: 6px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.15);
}

#cnblogs_post_body h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 35px 0 18px;
    padding: 0 0 0 14px;
    color: #2d3748;
    border-left: 4px solid #4a5568;
}

#cnblogs_post_body h3 {
    font-size: 19px;
    font-weight: 600;
    margin: 30px 0 14px;
    padding: 10px 14px;
    background: #f7fafc;
    color: #4a5568;
    border-left: 3px solid #718096;
    border-radius: 3px;
}

#cnblogs_post_body h4 {
    font-size: 17px;
    font-weight: 600;
    margin: 26px 0 12px;
    padding-left: 10px;
    color: #4a5568;
    border-left: 3px solid #a0aec0;
}

#cnblogs_post_body h5,
#cnblogs_post_body h6 {
    font-size: 16px;
    font-weight: 600;
    margin: 22px 0 10px;
    color: #718096;
}

#cnblogs_post_body p {
    margin: 14px 0;
    text-indent: 0;
}

#cnblogs_post_body ul,
#cnblogs_post_body ol {
    margin: 16px 0;
    padding-left: 28px;
}

#cnblogs_post_body li {
    margin: 8px 0;
}

#cnblogs_post_body blockquote {
    margin: 20px 0;
    padding: 14px 18px;
    background: #f7fafc;
    border-left: 4px solid #4a5568;
    border-radius: 0 4px 4px 0;
    color: #666;
}

#cnblogs_post_body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    display: block;
}

#cnblogs_post_body table:not(.hljs-ln) {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#cnblogs_post_body table:not(.hljs-ln) th {
    background: #2d3748;
    color: #fff;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
}

#cnblogs_post_body table:not(.hljs-ln) td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

#cnblogs_post_body table:not(.hljs-ln) tr:hover {
    background: #f7fafc;
}

#cnblogs_post_body a {
    color: #4a5568;
    font-weight: 500;
}

#cnblogs_post_body a:hover {
    color: #2d3748;
}


/* ====================================
   行内代码样式
   ==================================== */
#cnblogs_post_body p > code,
#cnblogs_post_body li > code,
#cnblogs_post_body td > code,
#cnblogs_post_body th > code,
#cnblogs_post_body blockquote > code,
#cnblogs_post_body a > code {
    background: #fef3f2 !important;
    color: #dc2626 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'JetBrains Mono', 'Monaco', 'Menlo', monospace !important;
    font-size: 0.9em !important;
    border: 1px solid #fecaca !important;
    font-weight: 500 !important;
}

/* ====================================
   ★★★ 代码块样式 - 完整修复版 ★★★
   Atom One Dark 主题 + 工具栏 + 行号居中
   ==================================== */

/* 代码块容器 */
pre.highlighter-hljs {
    position: relative !important;
    margin: 24px 0 !important;
    padding: 0 !important;
    background: #282c34 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #21252b !important;
}

/* ★★★ 代码工具栏 - hover时显示 ★★★ */
.cnb-code-toolbar {
    position: absolute !important;
    top: 6px !important;
    right: 8px !important;
    z-index: 20 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
}

/* hover代码块时显示工具栏 */
pre.highlighter-hljs:hover .cnb-code-toolbar {
    opacity: 1 !important;
}

/* 工具栏按钮样式 */
.cnb-code-toolbar-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 4px 8px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 4px !important;
    color: #abb2bf !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: none !important;
}

.cnb-code-toolbar-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
}

/* 工具栏图标 */
.cnb-code-toolbar-icon {
    width: 14px !important;
    height: 14px !important;
    fill: currentColor !important;
}

/* Mac 风格顶栏 */
pre.highlighter-hljs[data-mac-style="true"] {
    padding-top: 0 !important;
}

pre.highlighter-hljs[data-mac-style="true"]::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 38px !important;
    background: linear-gradient(180deg, #3c4049 0%, #21252b 100%) !important;
    border-bottom: 1px solid #181a1f !important;
    z-index: 10 !important;
}

/* Mac 三色圆点 */
pre.highlighter-hljs[data-mac-style="true"]::after {
    content: "" !important;
    position: absolute !important;
    top: 13px !important;
    left: 14px !important;
    width: 12px !important;
    height: 12px !important;
    background: #ff5f56 !important;
    border-radius: 50% !important;
    box-shadow: 
        20px 0 0 #ffbd2e,
        40px 0 0 #27c93f !important;
    z-index: 11 !important;
}

/* 代码内容区域 - 紧贴Mac头部 */
pre.highlighter-hljs > code {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    margin-top: 38px !important;
    background: #282c34 !important;
    color: #abb2bf !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border: none !important;
}

/* ★★★ 行号表格 - 核心修复 ★★★ */
pre.highlighter-hljs .hljs-ln {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    border: none !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
}

pre.highlighter-hljs .hljs-ln tbody {
    display: table-row-group !important;
}

pre.highlighter-hljs .hljs-ln tr {
    display: table-row !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

pre.highlighter-hljs .hljs-ln tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* ★★★ 行号单元格 - 垂直居中 ★★★ */
pre.highlighter-hljs .hljs-ln td {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    vertical-align: middle !important;  /* ★ 垂直居中 ★ */
}

/* ★★★ 行号列 - 水平居中 ★★★ */
pre.highlighter-hljs .hljs-ln-numbers {
    display: table-cell !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    text-align: center !important;  /* ★ 水平居中 ★ */
    padding: 3px 0 !important;
    color: #5c6370 !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    font-size: 13px !important;
    background: rgba(0, 0, 0, 0.15) !important;
    border-right: 1px solid #3e4451 !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;  /* ★ 垂直居中 ★ */
}

/* 行号数字容器 */
pre.highlighter-hljs .hljs-ln-n {
    display: block !important;
    color: #5c6370 !important;
}

/* ★★★ 代码内容列 - 垂直居中 ★★★ */
pre.highlighter-hljs .hljs-ln-code {
    display: table-cell !important;
    padding: 3px 16px 3px 12px !important;
    width: auto !important;
    box-sizing: border-box !important;
    white-space: pre !important;
    word-wrap: normal !important;
    vertical-align: middle !important;  /* ★ 垂直居中 ★ */
}

/* 首行和末行额外间距 */
pre.highlighter-hljs .hljs-ln tr:first-child td {
    padding-top: 12px !important;
}

pre.highlighter-hljs .hljs-ln tr:last-child td {
    padding-bottom: 12px !important;
}

/* ★★★ Atom One Dark 语法高亮 ★★★ */
/* pre.highlighter-hljs .hljs-keyword { color: #c678dd !important; font-weight: 500 !important; }
pre.highlighter-hljs .hljs-built_in { color: #e5c07b !important; }
pre.highlighter-hljs .hljs-type { color: #e5c07b !important; }
pre.highlighter-hljs .hljs-literal { color: #d19a66 !important; }
pre.highlighter-hljs .hljs-number { color: #d19a66 !important; }
pre.highlighter-hljs .hljs-operator { color: #56b6c2 !important; }
pre.highlighter-hljs .hljs-punctuation { color: #abb2bf !important; }
pre.highlighter-hljs .hljs-property { color: #e06c75 !important; }
pre.highlighter-hljs .hljs-regexp { color: #98c379 !important; }
pre.highlighter-hljs .hljs-string { color: #98c379 !important; }
pre.highlighter-hljs .hljs-char { color: #98c379 !important; }
pre.highlighter-hljs .hljs-subst { color: #abb2bf !important; }
pre.highlighter-hljs .hljs-symbol { color: #61aeee !important; }
pre.highlighter-hljs .hljs-variable { color: #e06c75 !important; }
pre.highlighter-hljs .hljs-template-variable { color: #e06c75 !important; }
pre.highlighter-hljs .hljs-link { color: #61aeee !important; }
pre.highlighter-hljs .hljs-selector-attr { color: #d19a66 !important; }
pre.highlighter-hljs .hljs-selector-pseudo { color: #d19a66 !important; }
pre.highlighter-hljs .hljs-function { color: #61aeee !important; }
pre.highlighter-hljs .hljs-title { color: #61aeee !important; }
pre.highlighter-hljs .hljs-class { color: #e5c07b !important; }
pre.highlighter-hljs .hljs-attr { color: #d19a66 !important; }
pre.highlighter-hljs .hljs-attribute { color: #98c379 !important; }
pre.highlighter-hljs .hljs-params { color: #abb2bf !important; }
pre.highlighter-hljs .hljs-comment { color: #5c6370 !important; font-style: italic !important; }
pre.highlighter-hljs .hljs-doctag { color: #c678dd !important; }
pre.highlighter-hljs .hljs-meta { color: #e06c75 !important; }
pre.highlighter-hljs .hljs-section { color: #e06c75 !important; }
pre.highlighter-hljs .hljs-tag { color: #e06c75 !important; }
pre.highlighter-hljs .hljs-name { color: #e06c75 !important; }
pre.highlighter-hljs .hljs-selector-tag { color: #e06c75 !important; }
pre.highlighter-hljs .hljs-selector-id { color: #61aeee !important; }
pre.highlighter-hljs .hljs-selector-class { color: #d19a66 !important; }
pre.highlighter-hljs .hljs-deletion { color: #e06c75 !important; background: rgba(224, 108, 117, 0.1) !important; }
pre.highlighter-hljs .hljs-addition { color: #98c379 !important; background: rgba(152, 195, 121, 0.1) !important; }
pre.highlighter-hljs .hljs-bullet { color: #61aeee !important; }
pre.highlighter-hljs .hljs-code { color: #98c379 !important; }
pre.highlighter-hljs .hljs-emphasis { font-style: italic !important; }
pre.highlighter-hljs .hljs-strong { font-weight: bold !important; }
pre.highlighter-hljs .hljs-formula { color: #c678dd !important; }
pre.highlighter-hljs .hljs-quote { color: #5c6370 !important; font-style: italic !important; } */

/* 代码块滚动条美化 */
pre.highlighter-hljs > code::-webkit-scrollbar {
    height: 8px !important;
    background: #21252b !important;
}

pre.highlighter-hljs > code::-webkit-scrollbar-thumb {
    background: #4b5263 !important;
    border-radius: 4px !important;
}

pre.highlighter-hljs > code::-webkit-scrollbar-thumb:hover {
    background: #5c6370 !important;
}

/* ====================================
   侧边栏 - 固定宽度，不跟随滚动
   ==================================== */
#sideBar {
    width: 320px;
    flex-shrink: 0;
}

#sideBarMain {
    /* 移除 sticky 定位，保持静态 */
    position: static;
}

/* 侧边栏卡片 */
.sidebar-block,
.newsItem,
.catListPostCategory,
.catListArticleCategory,
.catListArticleArchive,
.catListView,
.catListTag {
    background: #fff;
    border-radius: 8px;
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

/* 侧边栏标题 */
.catListTitle {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 14px 18px;
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
}

.catListTitle a {
    color: #fff !important;
}

/* 我的信息卡片 - 作为公告的子区域，不要用深色标题 */
.myprofile {
    background: #fff;
    border-radius: 0;
    overflow: hidden;
}

/* "请关注"标题 - 使用简洁优雅的样式 */
.myprofile h3 {
    background: transparent !important;
    color: #4a5568 !important;
    padding: 14px 18px 10px !important;
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-bottom: none !important;
    letter-spacing: 1px;
    position: relative;
}

/* 添加小装饰线 */
.myprofile h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 18px;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #3182ce, transparent);
    border-radius: 1px;
}

.myprofile-top {
    padding: 14px 18px 18px;
}

.profile-info p {
    margin: 10px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.profile-info p b {
    font-weight: 500;
}

.profile-info a {
    color: #3182ce;
    font-weight: 500;
    transition: color 0.2s ease;
}

.profile-info a:hover {
    color: #2c5282;
}

#p_b_follow {
    margin-top: 16px;
}

#p_b_follow a {
    display: inline-block;
    padding: 10px 28px;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: #fff !important;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.2);
}

#p_b_follow a:hover {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.3);
}

.myprofile-bottom {
    padding: 14px 18px;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

.myprofile-bottom ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    margin: 0;
    padding: 0;
}

.myprofile-bottom ul li {
    text-align: center;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    flex: 1;
}

.myprofile-bottom ul li:hover {
    background: transparent !important;
}

.myprofile-bottom ul li a {
    color: #4a5568 !important;
    font-size: 13px;
    line-height: 1.8;
    display: block;
}

.myprofile-bottom ul li a:hover {
    color: #3182ce !important;
}

/* 侧边栏列表 */
#sideBar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#sideBar ul li {
    padding: 8px 16px;
    border-bottom: 1px dashed #f0f0f0;
    transition: background 0.2s ease;
}

#sideBar ul li:last-child {
    border-bottom: none;
}

#sideBar ul li:hover {
    background: #f7fafc;
}

#sideBar a {
    color: #666;
    font-size: 14px;
}

#sideBar a:hover {
    color: #4a5568;
}

/* 侧边栏标签样式 */
#sidebar_toptags ul li {
    display: inline-block;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

#sidebar_toptags ul li:hover {
    background: transparent !important;
    padding: 0 !important;
}

#sidebar_toptags ul {
    padding: 16px !important;
}

#sidebar_toptags ul li a {
    display: inline-block;
    margin: 3px;
    padding: 4px 10px;
    background: #f7fafc;
    color: #4a5568;
    border-radius: 12px;
    font-size: 12px;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

#sidebar_toptags ul li a:hover {
    background: #2d3748;
    color: #fff;
    border-color: #2d3748;
}

.tag-count {
    color: #a0aec0;
    font-size: 11px;
    margin-left: 2px;
}

/* ====================================
   ★★★ 评论区样式深度修复 ★★★
   ==================================== */
.feedback_area_title {
    font-size: 17px;
    font-weight: 700;
    margin: 32px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a5568;
    color: #2d3748;
}

.feedbackItem {
    margin: 18px 0;
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    border-left: 3px solid #4a5568;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.feedbackItem:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.feedbackListSubtitle {
    color: #999;
    margin-bottom: 10px;
    font-size: 13px;
}

.feedbackListSubtitle a {
    color: #4a5568;
    font-weight: 600;
}

.feedbackCon {
    color: #333;
    line-height: 1.9;
    padding: 10px 0;
    font-size: 15px;
}

/* 评论表单容器 */
#comment_form_container,
#commentform_container {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

/* 评论输入框 */
.commenttb,
.commentTextBox,
#comment_form_container .comment_textarea,
#tbCommentBody,
textarea[name="tbCommentBody"] {
    width: 100% !important;
    min-height: 120px !important;
    padding: 14px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    line-height: 1.8 !important;
    transition: all 0.2s ease !important;
    font-family: inherit !important;
    outline: none !important;
    resize: vertical !important;
    background: #fff !important;
}

.commenttb:focus,
.commentTextBox:focus,
#comment_form_container .comment_textarea:focus,
#tbCommentBody:focus,
textarea[name="tbCommentBody"]:focus {
    border-color: #4a5568 !important;
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1) !important;
}

/* ★★★ 评论操作区域 - 深度修复 ★★★ */
#commentbox_opt {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    margin-top: 16px !important;
    padding-top: 16px !important;
    border-top: 1px solid #f0f0f0 !important;
    flex-wrap: wrap !important;
}

/* 评论提交按钮 - 核心修复 */
#btn_comment_submit,
#commentbox_opt input[type="button"],
input.comment_btn,
.comment_btn {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.2) !important;
    margin: 0 !important;
    line-height: 1.5 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
}

#btn_comment_submit:hover,
#commentbox_opt input[type="button"]:hover,
input.comment_btn:hover,
.comment_btn:hover {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%) !important;
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* ★★★ 退出链接样式 - 关键修复 ★★★ */
#commentbox_opt > a,
#commentbox_opt a[onclick*="logout"] {
    display: inline-flex !important;
    align-items: center !important;
    padding: 10px 20px !important;
    color: #e53e3e !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    background: #fff5f5 !important;
    border: 1px solid #feb2b2 !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    min-height: 44px !important;
}

#commentbox_opt > a:hover,
#commentbox_opt a[onclick*="logout"]:hover {
    background: #fed7d7 !important;
    border-color: #fc8181 !important;
    color: #c53030 !important;
}

/* 取消编辑链接 */
#span_comment_canceledit {
    display: inline-flex !important;
    align-items: center !important;
}

#span_comment_canceledit a {
    padding: 10px 16px !important;
    color: #718096 !important;
    font-size: 13px !important;
    background: #f7fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
}

#span_comment_canceledit a:hover {
    background: #edf2f7 !important;
    color: #4a5568 !important;
}

/* 快捷键提示 */
#commentbox_opt::after {
    content: "[Ctrl+Enter快捷键提交]";
    color: #a0aec0;
    font-size: 12px;
    margin-left: auto;
}

/* ====================================
   标签云（文章底部）
   ==================================== */
#EntryTag,
#BlogPostCategory {
    margin: 20px 0;
    padding: 16px 0;
    border-top: 1px solid #f0f0f0;
}

#EntryTag a,
#BlogPostCategory a {
    display: inline-block;
    margin: 4px;
    padding: 5px 12px;
    background: #f7fafc;
    color: #4a5568;
    border-radius: 14px;
    font-size: 13px;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

#EntryTag a:hover,
#BlogPostCategory a:hover {
    background: #2d3748;
    color: #fff;
    border-color: #2d3748;
}

/* ====================================
   分页
   ==================================== */
.Pager {
    text-align: center;
    margin: 28px 0;
}

.Pager a {
    display: inline-block;
    margin: 0 5px;
    padding: 8px 18px;
    background: #fff;
    color: #4a5568;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.Pager a:hover {
    background: #2d3748;
    color: #fff;
    border-color: #2d3748;
}

/* ====================================
   页脚
   ==================================== */
#footer {
    color: #999;
    text-align: center;
    padding: 28px 0;
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 8px 8px 0 0;
}

#footer a {
    color: #4a5568;
}

#footer a:hover {
    color: #2d3748;
}

/* ====================================
   返回顶部按钮
   ==================================== */
#customGoTop {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#customGoTop::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-left: 2px solid #fff;
    border-top: 2px solid #fff;
    transform: translate(-50%, -30%) rotate(45deg);
}

#customGoTop.visible {
    opacity: 1;
    visibility: visible;
}

#customGoTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* ====================================
   目录面板 - 滚动时固定在侧边栏顶部
   ==================================== */
#customTocPanel {
    background: #fff !important;
    border-radius: 8px !important;
    margin-bottom: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    border: 1px solid #edf2f7 !important;
    /* 关键：sticky定位，滚动时固定 */
    position: sticky !important;
    top: 80px !important;
    z-index: 100 !important;
    max-height: calc(100vh - 100px) !important;
    /* 确保可见 */
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#customTocPanel.toc-collapsed .toc-content {
    display: none !important;
}

#customTocPanel .toc-header {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%) !important;
    color: #fff !important;
    padding: 12px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    user-select: none !important;
}

#customTocPanel .toc-header-title {
    font-weight: 600 !important;
    font-size: 14px !important;
}

#customTocPanel .toc-actions {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
}

#customTocPanel .toc-action-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    border: none !important;
    color: #fff !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#customTocPanel .toc-action-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

#customTocPanel .toc-toggle-btn {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 16px !important;
    cursor: pointer !important;
    padding: 0 4px !important;
    opacity: 0.8 !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
}

#customTocPanel .toc-toggle-btn:hover {
    opacity: 1 !important;
}

#customTocPanel.toc-collapsed .toc-toggle-btn {
    transform: rotate(180deg) !important;
}

#customTocPanel .toc-progress {
    height: 3px !important;
    background: #e2e8f0 !important;
}

#customTocPanel .toc-progress-bar {
    height: 100% !important;
    background: linear-gradient(90deg, #3182ce 0%, #63b3ed 100%) !important;
    width: 0% !important;
    transition: width 0.2s ease !important;
}

#customTocPanel .toc-content {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 10px 6px !important;
    max-height: calc(100vh - 200px) !important;
}

#customTocPanel .toc-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#customTocPanel .toc-item {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

#customTocPanel .toc-item-row {
    display: flex !important;
    align-items: center !important;
    padding: 2px 0 !important;
}

#customTocPanel .toc-toggle {
    width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #a0aec0 !important;
    font-size: 9px !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    border-radius: 3px !important;
    margin-right: 2px !important;
}

#customTocPanel .toc-toggle:hover {
    background: #edf2f7 !important;
    color: #4a5568 !important;
}

#customTocPanel .toc-toggle.expanded {
    transform: rotate(90deg) !important;
}

#customTocPanel .toc-toggle.no-children {
    visibility: hidden !important;
}

#customTocPanel .toc-link {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    padding: 6px 8px !important;
    color: #4a5568 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    border-left: 2px solid transparent !important;
    word-break: break-word !important;
    min-width: 0 !important;
}

#customTocPanel .toc-link:hover {
    background: #f7fafc !important;
    color: #2d3748 !important;
    border-left-color: #cbd5e0 !important;
}

#customTocPanel .toc-item.active > .toc-item-row > .toc-link {
    background: linear-gradient(90deg, #ebf4ff 0%, #f7fafc 100%) !important;
    color: #2b6cb0 !important;
    border-left-color: #3182ce !important;
    font-weight: 600 !important;
}

#customTocPanel .toc-item.parent-active > .toc-item-row > .toc-link {
    color: #2d3748 !important;
    font-weight: 500 !important;
}

#customTocPanel .toc-level-1 > .toc-item-row { padding-left: 2px !important; }
#customTocPanel .toc-level-2 > .toc-item-row { padding-left: 2px !important; }
#customTocPanel .toc-level-3 > .toc-item-row { padding-left: 6px !important; }
#customTocPanel .toc-level-4 > .toc-item-row { padding-left: 10px !important; }
#customTocPanel .toc-level-5 > .toc-item-row { padding-left: 14px !important; }
#customTocPanel .toc-level-6 > .toc-item-row { padding-left: 18px !important; }

#customTocPanel .toc-children {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 0 0 10px !important;
    overflow: hidden !important;
    max-height: 0 !important;
    opacity: 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#customTocPanel .toc-children.expanded {
    max-height: 2000px !important;
    opacity: 1 !important;
}

#customTocPanel .toc-number {
    color: #718096 !important;
    font-weight: 600 !important;
    margin-right: 6px !important;
    font-size: 11px !important;
    font-family: 'JetBrains Mono', 'Monaco', 'Menlo', monospace !important;
    flex-shrink: 0 !important;
}

#customTocPanel .toc-text {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#customTocPanel .toc-content::-webkit-scrollbar {
    width: 5px !important;
}

#customTocPanel .toc-content::-webkit-scrollbar-track {
    background: transparent !important;
}

#customTocPanel .toc-content::-webkit-scrollbar-thumb {
    background: #cbd5e0 !important;
    border-radius: 10px !important;
}

#customTocPanel .toc-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0 !important;
}

#customTocPanel .toc-empty {
    padding: 30px 16px !important;
    text-align: center !important;
    color: #a0aec0 !important;
    font-size: 13px !important;
}

/* ====================================
   隐藏原有目录和其他不需要的元素
   ==================================== */
#sideToolbar,
#sideCatalog,
#sideCatalogBtn,
#gotop,
.sideCatalog-dot,
#sideToolbar-up,
#sideCatalog-sidebar,
#sidebar_search {
    display: none !important;
}

/* ====================================
   文章详情页：侧边栏样式调整
   目录面板由JS控制显示，其他内容由JS隐藏
   ==================================== */

/* 目录面板始终显示并固定 */
#customTocPanel {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 确保侧边栏有正确的布局 */
#sideBarMain {
    position: relative;
}

/* ====================================
   全局滚动条
   ==================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

::selection {
    background: #3182ce;
    color: #fff;
}

/* ====================================
   动画效果
   ==================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.day,
#topics,
.entrylistItem {
    animation: fadeIn 0.3s ease-out;
}

/* 分类项依次出现动画 */
.entrylistItem:nth-child(1) { animation-delay: 0.05s; }
.entrylistItem:nth-child(2) { animation-delay: 0.1s; }
.entrylistItem:nth-child(3) { animation-delay: 0.15s; }
.entrylistItem:nth-child(4) { animation-delay: 0.2s; }
.entrylistItem:nth-child(5) { animation-delay: 0.25s; }
.entrylistItem:nth-child(6) { animation-delay: 0.3s; }
.entrylistItem:nth-child(7) { animation-delay: 0.35s; }
.entrylistItem:nth-child(8) { animation-delay: 0.4s; }
.entrylistItem:nth-child(9) { animation-delay: 0.45s; }
.entrylistItem:nth-child(10) { animation-delay: 0.5s; }

/* ====================================
   响应式设计
   ==================================== */
@media (max-width: 1400px) {
    #home {
        width: 96%;
    }
}

@media (max-width: 1200px) {
    #home {
        width: 98%;
        min-width: auto;
    }
    
    #main {
        flex-direction: column;
    }
    
    #sideBar {
        width: 100%;
        margin-top: 20px;
    }
    
    /* 平板端目录面板 - 取消sticky */
    #customTocPanel {
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
    }
    
    #customTocPanel .toc-content {
        max-height: 350px !important;
    }
    
    .entrylistTitle,
    h1.PostListTitle {
        font-size: 18px;
        padding: 16px 20px;
    }
    
    .entrylistItem,
    .PostList {
        padding: 20px 22px;
    }
}

@media (max-width: 768px) {
    #home {
        margin: 75px auto 30px;
        padding: 0 10px;
    }
    
    .day,
    #topics {
        padding: 20px 16px;
    }
    
    .entrylistTitle,
    h1.PostListTitle {
        font-size: 16px;
        padding: 14px 16px;
    }
    
    .entrylistItem,
    .PostList {
        padding: 16px 18px;
        margin-bottom: 12px;
    }
    
    .entrylistItemTitle,
    .postTitl2 a {
        font-size: 16px;
    }
    
    .entrylistItemPostDesc,
    .postDesc2 {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    #customGoTop,
    #customTocBtn {
        display: none !important;
    }
    
    #customTocPanel {
        display: none !important;
    }
    
    /* 移动端评论区优化 */
    #commentbox_opt {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    #btn_comment_submit,
    #commentbox_opt > a {
        width: 100% !important;
        text-align: center !important;
    }
    
    #commentbox_opt::after {
        text-align: center;
        margin: 8px 0 0 0;
    }
}

/* ================================
 * 文章页侧边栏：只显示目录，隐藏其他内容
 * ================================ */

/* 当存在文章正文时（即文章详情页），隐藏侧边栏其他内容 */
body:has(#cnblogs_post_body) #sideBarMain > *:not(#customTocPanel) {
    display: none !important;
}

/* 确保目录面板显示 */
body:has(#cnblogs_post_body) #customTocPanel {
    display: block !important;
}

/* 备用方案：如果浏览器不支持 :has() 选择器，用JS添加class */
.post-detail-page #sideBarMain > *:not(#customTocPanel) {
    display: none !important;
}

/* ====================================
   打印样式
   ==================================== */
@media print {
    #menu-box,
    #sideBar,
    #footer,
    #customGoTop,
    #customTocBtn,
    #customTocPanel,
    #cnblogs_ch,
    .c_ad_block {
        display: none !important;
    }
    
    #home {
        margin: 0 !important;
        width: 100% !important;
    }
    
    .day,
    #topics,
    .entrylistItem,
    .PostList {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}