/*生成博客目录的CSS*/
#uprightsideBar{
    font-size:12px;
    font-family:Arial, Helvetica, sans-serif;
    text-align:left;
    position:fixed;
    top:50px;
    right:0px;
    width: auto;
    height: auto; 
}
#sideBarTitle{
    font-size: 15px;
    color: #357ab8;
    font-weight: bold;
    text-align: center;
    margin: 0 0 8px 0;
    letter-spacing: 2px;
}
#sideBarTab{
    display: none; /* 隐藏原tab */
}
#sideBarContents{
    float:left;
    overflow:auto; 
    overflow-x:hidden !important;
    width:200px;
    min-height:108px;
    max-height:460px;
    border:1px solid #e5e5e5;
    border-right:none; 
    background:#ffffff;
    /* 不要强制 display: block !important; 以免影响动画 */
    padding-top: 0;
}
#sideBarContents dl{
    margin:0;
    padding:0;
}
#sideBarContents dt{
    margin-top:5px;
    margin-left:0;
    text-align: center;
    font-weight: bold;
    font-size: 1.08em;
}
#sideBarContents dd {
    font-size: 1em;
    margin-left: 0;
    text-align: left;
}
#sideBarContents dd.indent3 {
    font-size: 0.96em;
    margin-left: 20px;
}
#sideBarContents dd.indent4 {
    font-size: 0.92em;
    margin-left: 40px;
}
#sideBarContents dd.indent5 {
    font-size: 0.88em;
    margin-left: 60px;
}
#sideBarContents dd.indent6 {
    font-size: 0.84em;
    margin-left: 80px;
}
#sideBarContents dd, #sideBarContents dt {
    cursor: pointer;
}
@media (max-width: 700px) {
    /* 目录导航按钮始终在右侧中部悬浮 */
    #showCatalogBtn {
        display: block !important;
        position: fixed;
        right: 0;
        top: 40%;
        left: auto;
        bottom: auto;
        width: 11px;
        height: 60px;
        background: rgba(53,122,184,0.25);
        color: transparent;
        border: none;
        border-radius: 5px 0 0 5px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        cursor: pointer;
        z-index: 100000;
        transition: width 0.2s, background 0.2s, color 0.2s;
        overflow: hidden;
        padding: 0;
        text-align: center;
        outline: none;
    }
    #showCatalogBtn::before {
        content: '';
        display: none;
    }
    #showCatalogBtn::after {
        content: '目\A录\A导\A航';
        white-space: pre;
        display: block;
        position: absolute;
        left: 0;
        top: 50%;
        width: 100%;
        transform: translateY(-50%);
        font-size: 0.78em;
        color: #357ab8;
        opacity: 0.7;
        font-weight: bold;
        letter-spacing: 1px;
        line-height: 1.02;
        transition: color 0.2s, opacity 0.2s;
        pointer-events: none;
        text-align: center;
    }
    #showCatalogBtn:hover, #showCatalogBtn:active {
        width: 28px;
        background: rgba(53,122,184,0.85);
        color: #fff;
    }
    #showCatalogBtn:hover::after, #showCatalogBtn:active::after {
        color: #fff;
        opacity: 1;
    }
    /* 目录弹出时按钮隐藏 */
    #showCatalogBtn.hide {
        display: none !important;
    }
    /* 原有左上角按钮彻底隐藏 */
    #showCatalogBtn.lefttop {
        display: none !important;
    }
    /* 右侧抽屉式目录动画 */
    #uprightsideBar {
        right: -80vw;
        left: auto;
        top: 0;
        bottom: 0;
        width: 80vw;
        min-width: 0;
        max-width: 80vw;
        height: 100vh;
        border-radius: 12px 0 0 12px;
        box-shadow: -2px 0 16px rgba(0,0,0,0.18);
        display: none;
        background: #fff !important;
        border: 1px solid #e5e5e5;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(.4,0,.2,1), right 0s, background 0.2s;
        z-index: 99999;
    }
    #uprightsideBar.show {
        display: block !important;
        right: 0;
        transform: translateX(0);
        background: rgba(53,122,184,0.85) !important;
        border: 1px solid #e5e5e5;
    }
    #uprightsideBar.hide {
        display: none !important;
        right: -80vw;
        transform: translateX(100%);
    }
    #sideBarContents {
        float: none;
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
        background: transparent !important;
        height: calc(100vh - 0px);
        max-height: none;
    }
    #sideBarContents dl,
    #sideBarContents dt,
    #sideBarContents dd {
        background: transparent !important;
        color: #fff !important;
    }
    #sideBarTitle {
        color: #fff;
        background: none;
    }
    #uprightsideBar.show #sideBarTitle {
        display: none !important;
    }
    #catalogMask {
        display: none;
        position: fixed;
        z-index: 99998;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.15);
    }
}
@media (min-width: 701px) {
    #showCatalogBtn {
        display: none !important;
    }
    #uprightsideBar {
        display: block !important;
        position: fixed;
        right: 0px;
        top: 50px;
        bottom: auto;
        width: 200px;
        box-shadow: none;
        border-radius: 0;
        transform: none;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    #uprightsideBar.show, #uprightsideBar.hide {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
    }
    #catalogMask {
        display: none !important;
    }
}

/* 新增辅助类，便于JS控制显隐 */
#showCatalogBtn.hide {
    display: none !important;
}
#showCatalogBtn.show {
    display: block !important;
}
#uprightsideBar.hide {
    display: none !important;
}
#uprightsideBar.show {
    display: block !important;
}
@media (max-width: 700px) {
    /* 一级标题居中 */
    #sideBarContents dt {
        text-align: center;
        font-weight: bold;
        font-size: 1.08em;
        margin-left: 0;
    }
    /* 二级标题顶格 */
    #sideBarContents dd {
        font-size: 1em;
        margin-left: 0;
        text-align: left;
    }
    /* 三级及以下标题按级别缩进 */
    #sideBarContents dd.indent3 {
        font-size: 0.96em;
        margin-left: 20px;
    }
    #sideBarContents dd.indent4 {
        font-size: 0.92em;
        margin-left: 40px;
    }
    #sideBarContents dd.indent5 {
        font-size: 0.88em;
        margin-left: 60px;
    }
    #sideBarContents dd.indent6 {
        font-size: 0.84em;
        margin-left: 80px;
    }
    /* 手机端唤出目录时，目录标题颜色与按钮一致 */
    #sideBarTitle {
        color: rgba(53,122,184,0.7);
        background: none;
    }
    #uprightsideBar.show #sideBarTitle {
        color: #fff;
        background: rgba(53,122,184,0.85);
        border-radius: 0 0 8px 8px;
        padding: 6px 0 4px 0;
        margin-bottom: 8px;
        transition: background 0.2s, color 0.2s;
    }
    /* 手机端唤出目录时，整个目录背景与按钮高亮一致 */
    #uprightsideBar.show {
        background: rgba(53,122,184,0.85) !important;
        border: 1px solid #e5e5e5;
    }
    #sideBarTitle {
        color: #fff;
        background: none;
    }
    #sideBarContents,
    #sideBarContents dl,
    #sideBarContents dt,
    #sideBarContents dd {
        color: #fff !important;
        background: transparent !important;
    }
    /* 目录弹出时隐藏目录标题 */
    #uprightsideBar.show #sideBarTitle {
        display: none !important;
    }
    /* 右侧抽屉式目录宽度仅占屏幕1/3 */
    #uprightsideBar,
    #uprightsideBar.show,
    #uprightsideBar.hide {
        width: 33.33vw;
        max-width: 33.33vw;
        right: -33.33vw;
        border-radius: 12px 0 0 12px;
    }
    #uprightsideBar.show {
        right: 0;
        transform: translateX(0);
    }
    #uprightsideBar.hide {
        right: -33.33vw;
        transform: translateX(100%);
    }
}
@media (max-width: 700px) {
    /* 右侧抽屉式目录宽高自适应内容，最多宽50vw，最多高80vh，内容多少显示多高 */
    #uprightsideBar,
    #uprightsideBar.show,
    #uprightsideBar.hide {
        width: auto;
        min-width: 120px;
        max-width: 50vw;
        height: auto;
        max-height: none;
        right: -50vw;
        border-radius: 12px 0 0 12px;
        box-sizing: border-box;
        overflow-y: visible;
        overflow-x: hidden;
    }
    #uprightsideBar.show {
        right: 0;
        transform: translateX(0);
    }
    #uprightsideBar.hide {
        right: -50vw;
        transform: translateX(100%);
    }
    #sideBarContents {
        width: auto;
        min-width: 120px;
        max-width: 50vw;
        height: auto;
        max-height: none;
        box-sizing: border-box;
        overflow-y: visible;
        overflow-x: hidden;
    }
}
