/* 基础目录样式 */
#page-nav{
    margin: 20px 0;
    padding: 20px;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#page-nav-alt {
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* 浮动样式 */
.floating {
    position: fixed;
    top: 100px;
    z-index: 1000;
    max-width: 320px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.floating:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* 目录标题 */
#page-nav h2 {
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0.5px;
}
#page-nav-alt h2 {
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0.5px;
    display: none;
}
/* 目录列表 */
#dir-list,
#dir-list-side {
    margin: 0;
    padding: 0;
    list-style: none;
    animation: fadeIn 0.3s ease-out;
background-image: url(../img/posui.webp);
    
}

/* 目录背景开始*/

/* 目录背景结束*/


#dir-list li,
#dir-list-side li {
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: center;
}


#dir-list a,
#dir-list-side a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.5;
    transition: all 0.3s;
    display: block;
    position: relative;
}

#dir-list a:before,
#dir-list-side a:before {
    position: absolute;
    left: 0;
    color: #6c757d;
    font-size: 20px;
    line-height: 1;
    opacity: 0.8;
}

#dir-list a:hover,
#dir-list-side a:hover {
    color: #ff1313;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.5);
}

/* 最后一个列表项去掉底部边框 */
#dir-list li:last-child,
#dir-list-side li:last-child {
    border-bottom: none;
}

/* 切换按钮样式 */
#list-switch {
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 15px;
    background: linear-gradient(125deg, #47b6e0 0, #cf84ef 100%);
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    text-align: center;
}
#list-switch-side {
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(125deg, #47b6e0 0, #cf84ef 100%);
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    text-align: center;
}
#list-switch:hover,
#list-switch-side:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .floating {
        position: static;
        max-width: 100%;
        margin: 20px 0;
    }
    
    #page-nav{
        padding: 15px;
    }
    
    #dir-list a,
    #dir-list-side a {
        font-size: 14px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    #page-nav,
    #page-nav-alt {
        background: #1a1a1a;
        box-shadow: 0 2px 15px rgba(0,0,0,0.2);
    }
    
    .floating {
        background: rgba(26, 26, 26, 0.95);
    }
    
    #page-nav h2,
    #page-nav-alt h2 {
        color: #e1e1e1;
        border-bottom-color: #333;
    }
    
    #dir-list a,
    #dir-list-side a {
        color: #d1d1d1;
    }
    
    #dir-list a:hover,
    #dir-list-side a:hover {
        color: #3498db;
    }
    
    #list-switch,
    #list-switch-side {
        background: linear-gradient(145deg, #1a1a1a, #252525);
        border-color: #333;
        color: #e1e1e1;
    }
    
    #list-switch:hover,
    #list-switch-side:hover {
        background: linear-gradient(145deg, #252525, #1a1a1a);
        color: #3498db;
    }
}

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

/* 小工具样式 */
.widget_toc_widget {
    margin-bottom: 30px;
}

.widget_toc_widget #page-nav,
.widget_toc_widget #page-nav-alt {
    margin: 0;
    padding: 15px;
}

/* 小工具标题样式 */
.widget_toc_widget .widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: #2c3e50;
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .widget_toc_widget .widget-title {
        color: #e1e1e1;
        border-bottom-color: #333;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .widget_toc_widget {
        margin-bottom: 20px;
    }
    
    .widget_toc_widget #page-nav,
    .widget_toc_widget #page-nav-alt {
        padding: 10px;
    }
}

/* 固定位置小工具 */
.widget_toc_widget.fixed {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 300px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    /* 确保不会超出视窗 */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* 暗色模式下的固定位置小工具 */
@media (prefers-color-scheme: dark) {
    .widget_toc_widget.fixed {
        background: rgba(26, 26, 26, 0.95);
        box-shadow: 0 2px 15px rgba(0,0,0,0.2);
    }
}

/* 移动端特殊处理 */
@media (max-width: 768px) {
    /* 移动端包装器样式 */
    .toc-widget-wrapper {
        display: block !important; /* 强制显示 */
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background: #fff;
        padding: 10px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        max-height: 50vh; /* 最大高度为视窗高度的50% */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 重置小工具在移动端的样式 */
    .toc-widget-wrapper .widget_toc_widget {
        margin: 0 !important;
        width: 100% !important;
        position: static !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    /* 移动端标题样式调整 */
    .toc-widget-wrapper .widget-title {
        font-size: 16px !important;
        margin-bottom: 10px !important;
        padding-bottom: 5px !important;
    }

    /* 添加收起按钮 */
    .toc-widget-wrapper:before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 0 auto 10px;
    }

    /* 暗色模式支持 */
    @media (prefers-color-scheme: dark) {
        .toc-widget-wrapper {
            background: #1a1a1a;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
        }

        .toc-widget-wrapper:before {
            background: #333;
        }
    }

    /* 适配底部安全区域 */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .toc-widget-wrapper {
            padding-bottom: calc(10px + env(safe-area-inset-bottom));
        }
    }
}

/* 添加展开/收起动画 */
@media (max-width: 768px) {
    .toc-widget-wrapper {
        transform: translateY(0);
        transition: transform 0.3s ease-in-out;
    }

    .toc-widget-wrapper.collapsed {
        transform: translateY(calc(100% - 30px));
    }
}

/* 子比主题暗黑模式适配 */
.dark-theme #page-nav,
.dark-theme #page-nav-alt {
    background: #2d2d2d;
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
    border-color: #383838;
}

.dark-theme .floating {
    background: rgba(45, 45, 45, 0.95);
}

.dark-theme #page-nav h2,
.dark-theme #page-nav-alt h2 {
    color: #e5e5e5;
    border-bottom-color: #383838;
}

.dark-theme #dir-list,
.dark-theme #dir-list-side {
    background-image: url(../img/posuideta2.webp);
    border-bottom-color: #383838;
}

.dark-theme #dir-list a,
.dark-theme #dir-list-side a {
    color: #e9e4e4;
}

.dark-theme #dir-list a:before,
.dark-theme #dir-list-side a:before {
    color: #666;
}

.dark-theme #dir-list a:hover,
.dark-theme #dir-list-side a:hover {
    color: #ff5473;
}

/* 暗黑模式按钮样式 */
.dark-theme #list-switch,
.dark-theme #list-switch-side {
    background: linear-gradient(125deg, #cf84ef 0, #47b6e0 100%);
    border-color: #383838;
    color: #fff;
}

.dark-theme #list-switch:hover,
.dark-theme #list-switch-side:hover {
    opacity: 0.9;
}

/* 暗黑模式小工具样式 */
.dark-theme .widget_toc_widget {
    background: #2d2d2d;
}

.dark-theme .widget_toc_widget .widget-title {
    color: #e5e5e5;
    border-bottom-color: #383838;
}

.dark-theme .widget_toc_widget.fixed {
    background: rgba(45, 45, 45, 0.95);
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
}

/* 暗黑模式移动端样式 */
@media (max-width: 768px) {
    .dark-theme .toc-widget-wrapper {
        background: #2d2d2d;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    }

    .dark-theme .toc-widget-wrapper:before {
        background: #383838;
    }

    .dark-theme .toc-widget-wrapper .widget_toc_widget {
        background: transparent !important;
    }
}

/* 暗黑模式动画和过渡效果 */
.dark-theme .toc-widget-wrapper,
.dark-theme #page-nav,
.dark-theme #page-nav-alt,
.dark-theme .widget_toc_widget {
    transition: all 0.3s ease;
}

/* 暗黑模式下的虚线边框 */
.dark-theme #dir-list li,
.dark-theme #dir-list-side li {
    border-bottom-color: rgba(136, 136, 136, 0.1);
} 