/* ==============================================
   1. 隐藏文章详情页顶部的系统自带标题
   ============================================== */
#topics .postTitle {
    display: none !important;
}

/* ==============================================
   2. 左侧目录容器 (支持折叠箭头版)
   ============================================== */
#side-toc {
    position: fixed;
    left: 10px;
    top: 100px;
    width: 260px;
    max-height: 80vh;      /*稍微加高一点*/
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    background-color: transparent;
    padding: 10px;
    font-size: 13px;
    display: none;
    user-select: none;     /* 防止快速点击箭头时选中文本 */
}

/* 滚动条美化 */
#side-toc::-webkit-scrollbar { width: 3px; }
#side-toc::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* 目录链接基础样式 */
#side-toc a {
    display: block;
    color: #666;
    text-decoration: none;
    padding: 5px 0;
    line-height: 1.4;
    transition: color 0.2s;
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis; 
    position: relative;
    cursor: pointer;
}
#side-toc a:hover { color: #000; background-color: rgba(0,0,0,0.03); }

/* --- 箭头样式 --- */
.toc-arrow {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 2px;
    vertical-align: middle;
    transition: transform 0.2s ease; /* 旋转动画 */
    position: relative;
    top: -1px;
    cursor: pointer; /* 只有点箭头才是折叠，点文字是跳转 */
}

/* 使用 CSS 画一个三角形箭头 (无需图片) */
.toc-arrow::after {
    content: '';
    display: block;
    width: 0; 
    height: 0; 
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #999; /* 箭头颜色 */
    position: absolute;
    left: 2px;
    top: 4px;
}

/* 箭头悬停变色 */
.toc-arrow:hover::after { border-top-color: #E67E22; }

/* 折叠状态：箭头旋转 -90度 (指向右) */
.toc-arrow.collapsed {
    transform: rotate(-90deg);
}

/* 没有子菜单的项目，用透明占位符对齐文本 */
.toc-placeholder {
    display: inline-block;
    width: 14px; /* 和箭头宽度一致 */
}

/* --- 层级缩进 (调整缩进策略，配合箭头) --- */
.toc-h1 { margin-left: 0px; font-weight: bold; color: #333; margin-top: 5px; font-size: 14px; }
.toc-h2 { margin-left: 15px; }
.toc-h3 { margin-left: 30px; color: #555; font-size: 12px; }
.toc-h4 { margin-left: 45px; color: #777; font-size: 12px; }
.toc-h5, .toc-h6 { display: none; } /* 深层级隐藏 */

/* === 高亮样式 === */
#side-toc a.active {
    color: #E67E22;
    font-weight: bold;
    background-color: rgba(255, 165, 0, 0.08);
}
/* 高亮指示条 */
#side-toc a.active::before {
    content: "";
    position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%;
    background-color: #FFA500; border-radius: 2px;
}

/* ==============================================
   3. 笔记本屏幕适配
   ============================================== */
@media screen and (max-width: 1900px) {
    #side-toc {
        display: block !important;
        width: 180px;
        left: 2px;
        padding: 5px;
        font-size: 12px;
    }
    .toc-h4 { display: none; }
}
@media screen and (max-width: 1100px) {
    #side-toc { display: none !important; }
}