/*  
 * Copyright (c) 2024 YiDing, all rights reserved. 
 *  
 * This is an example file of the site. You can freely copy,
 * fork, clone and download the file to your local machine.
 * But attention to replace it by your own file before you
 * deploying the site.
 */

/* sidebar主要代码 */
.sidebar {
    border-right: 1px solid rgba(0, 0, 0, 0.07);
    overflow-y: auto;
    padding: 40px 0 0;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    transition: transform 250ms ease-out;
    width: 300px;
    z-index: 20;
}
.sidebar > h1 {
    margin: 0 auto 1rem;
    font-size: 1.3rem;
    font-weight: 300;
    text-align: center;
}
.sidebar > h1 a {
    color: inherit;
    text-decoration: none;
}
.sidebar > h1 .app-nav {
    display: block;
    position: static;
}
.sidebar .sidebar-nav {
    line-height: 2em;
    padding-bottom: 40px;
}
.sidebar li.collapse .app-sub-sidebar {
    display: none;
}
.sidebar ul {
    margin: 0 0 0 15px;
    padding: 0;
}
.sidebar li > p {
    font-weight: 700;
    margin: 0;
}
.sidebar ul,
.sidebar ul li {
    list-style: none;
}
.sidebar ul li a {
    /* a 为页面跳转链接 */
    border-bottom: none;
    display: block;
}
.sidebar ul li ul {
    padding-left: 20px;
}
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}
.sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(136, 136, 136, 0.4);
}
.sidebar:hover::-webkit-scrollbar-track {
    background: rgba(136, 136, 136, 0.1);
}
.sidebar-toggle {
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    outline: none;
    padding: 10px;
    position: absolute;
    bottom: 0;
    left: 0;
    text-align: center;
    transition: opacity 0.3s;
    width: 284px;
    z-index: 30;
    cursor: pointer;
}
.sidebar-toggle:hover .sidebar-toggle-button {
    opacity: 0.4;
}
.sidebar-toggle span {
    background-color: var(
        --theme-color,
        #42b983
    ); /* --theme-color定义在index.html中, themeColor: "颜色"*/
    display: block;
    margin-left: 3px;
    margin-bottom: 5px;
    width: 25px;
    height: 4px;
    cursor: pointer;
}
body.sticky .sidebar,
body.sticky .sidebar-toggle {
    position: fixed;
}

/* sidebar小屏适配 */
body.close .sidebar {
    transform: translateX(-300px);
}
body.close .sidebar-toggle {
    width: auto;
}
body.close .content {
    left: 0;
}
@media print {
    .github-corner,
    .sidebar-toggle,
    .sidebar,
    .app-nav {
        display: none;
    }
}
@media screen and (max-width: 768px) {
    /* 移动端适配 */
    .markdown-section {
        max-width: none;
        padding: 10px;
    }
    /* my pin */
    .sidebar-pin {
        background-color: rgba(255, 255, 255, 0.8);
        appearance: none;
        position: fixed;
        width: 40px;
        height: 40px;
        cursor: pointer;
    }
    .github-corner,
    .sidebar-toggle,
    .sidebar {
        position: fixed;
    }
    .app-nav {
        margin-top: 16px;
    }
    .app-nav li ul {
        top: 30px;
    }
    main {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
    }
    .sidebar {
        left: -300px;
        transition: transform 250ms ease-out;
    }
    .content {
        left: 0;
        max-width: 100vw;
        position: static;
        padding-top: 20px;
        transition: transform 250ms ease;
    }
    .app-nav,
    .github-corner {
        transition: transform 250ms ease-out;
    }
    .sidebar-toggle {
        width: auto;
    }
    body.close .sidebar {
        transform: translateX(300px);
    }
    body.close .sidebar-toggle {
        background-color: rgba(255, 255, 255, 0.8);
        transition: 1s background-color;
        width: 284px;
    }
    body.close .content {
        transform: translateX(300px);
    }
    body.close .app-nav,
    body.close .github-corner {
        display: none;
    }
    .github-corner:hover .octo-arm {
        animation: none;
    }
    .github-corner .octo-arm {
        animation: octocat-wave 560ms ease-in-out;
    }
}
@keyframes octocat-wave {
    0%,
    100% {
        transform: rotate(0);
    }

    20%,
    60% {
        transform: rotate(-25deg);
    }

    40%,
    80% {
        transform: rotate(10deg);
    }
}
.sidebar-nav li {
    position: relative;
    margin: 0;
    cursor: pointer;
}
.sidebar-nav ul:not(.app-sub-sidebar) > li:not(.file)::before {
    content: "";
    display: block;
    position: absolute;
    top: 4px;
    left: -12px;
    height: 6px;
    width: 6px;
    border-right: 2px solid #505d6b;
    border-bottom: 2px solid #505d6b;
    transform: rotate(-45deg);
    transition: transform 0.15s;
}
.sidebar-nav ul:not(.app-sub-sidebar) > li.level-2:not(.file)::before {
    border-right: 1px solid #505d6b;
    border-bottom: 1px solid #505d6b;
}
.sidebar-nav ul:not(.app-sub-sidebar) > li.open::before {
    transform: rotate(45deg);
}
.sidebar-nav ul:not(.app-sub-sidebar) > li.collapse::before {
    transform: rotate(-45deg);
}

/* sidebar样式修改 */
.sidebar {
    background-color: #fff;
    color: #364149;
}
.sidebar li {
    margin: 3px 0 3px 0;
}
.sidebar ul > li.folder.level-1 p {
    /* 一级文件夹 */
    color: rgb(20, 20, 20);
    font-size: calc(var(--fontsize-main) + 0.05rem);
}
.sidebar ul li.folder.level-2 p {
    /* 二级文件夹 */
    color: rgba(20, 20, 20, 0.7);
    font-size: calc(var(--fontsize-main) - 0.05rem); /* 减号两边必须有空格 */
}
.sidebar ul li a {
    /* 在folder中的指向页面的a标签链接 */
    color: #003cff86;
    font-size: calc(var(--fontsize-main) - 0.2rem); /* 减号两边必须有空格 */
    font-weight: normal;
    overflow: hidden;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar ul li a:hover {
    text-decoration: underline;
}
.sidebar ul li ul {
    padding: 0;
}
.sidebar ul li.active > a {
    border-right: 2px solid;
    color: #42b983;
    color: var(--theme-color, #42b983);
    font-weight: 600;
}
.app-sub-sidebar li::before {
    content: "-";
    padding-right: 4px;
    float: left;
}

.sidebar {
    /* 调整sidebar宽度 */
    width: 300px;
    max-width: 60%;
    padding: 15px;
}
.sidebar-toggle {
    /* 调整sidebar的小方框 */
    padding: 10px;
}
.sidebar p,
.sidebar a {
    line-height: 18px;
}
.sidebar ul li.active > a {
    border-right: none;
    border-left: rgb(71, 79, 179) solid 5px;
    padding-left: 5px;
}
