html {
    scroll-behavior: smooth;
}

.icon-nav {
    width: 62px;
    list-style: none;
    background-color: #231f2e;
    padding: 0 12px 12px 12px;
    /* 弹性布局 垂直排列 */
    display: flex;
    flex-direction: column;
    /* 均匀排列每个元素 首个元素在起点 末尾元素在终点 */
    justify-content: space-between;
    border-radius: 10px;
    /* 阴影 */
    box-shadow: 0 10px 50px rgba(6, 5, 59, 0.25);
    /* 初始化 */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    position: fixed;
    left: 15px;
    z-index: 2;
}

/* 手机端：侧栏折叠为汉堡按钮 */
.sidebar-toggle {
    position: fixed;
    left: 15px;
    top: 86px;
    z-index: 4;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background-color: #231f2e;
    box-shadow: 0 10px 50px rgba(6, 5, 59, 0.25);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar-hamburger,
.sidebar-hamburger::before,
.sidebar-hamburger::after {
    content: "";
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}

.sidebar-hamburger::before {
    transform: translateY(-6px);
}

.sidebar-hamburger::after {
    transform: translateY(4px);
}

.sidebar-toggle.active .sidebar-hamburger {
    opacity: 0;
}

.sidebar-toggle.active .sidebar-hamburger::before {
    transform: translateY(0) rotate(45deg);
}

.sidebar-toggle.active .sidebar-hamburger::after {
    transform: translateY(-2px) rotate(-45deg);
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 900px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 3;
    }

    .sidebar-backdrop.active {
        display: block;
    }

    .icon-nav {
        top: 140px;
        width: 230px;
        max-height: calc(100vh - 160px);
        overflow: auto;
        padding: 10px;
        border-radius: 12px;
        transform: translateX(-130%);
        opacity: 0;
        pointer-events: none;
        transition: transform .18s ease, opacity .18s ease;
        z-index: 4;
    }

    .icon-nav.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .icon-nav a {
        width: 100%;
        height: 48px;
        justify-content: flex-start;
        gap: 10px;
        padding: 0 12px;
    }

    /* 手机端没有 hover：直接把文本当作菜单项内容展示 */
    .icon-nav a span {
        position: static;
        left: auto;
        background: transparent;
        padding: 0;
        border-radius: 0;
        transform: none;
        opacity: 1;
        white-space: normal;
        font-size: 14px;
    }

    .icon-nav a span::before {
        display: none;
    }

    .icon-nav a:hover span,
    .icon-nav a:focus span,
    .icon-nav a:active span {
        transform: none;
        opacity: 1;
    }

    .icon-nav li.split {
        margin-top: 12px;
        padding-top: 12px;
    }
}



/* 分割线 */
.icon-nav li.split {
    margin-top: 80px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.icon-nav a {
    color: #fff;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 70px;
    border-radius: 8px;
    position: relative;
}

.icon-nav a i {
    font-size: 20px;
    font-weight: bold;
    font-family: Arial, sans-serif;
}

/* 提示层 */
.icon-nav a span {
    position: absolute;
    /* 计算位置 */
    left: calc(100% + 24px);
    background-color: #ff8181;
    font-size: 15px;
    /* 不换行 */
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 6px;
    /* 默认隐藏 */
    transform: scale(0);
    opacity: 0;
    /* 设置基点 */
    transform-origin: center left;
    /* 设置过渡 */
    transition: 0.15s ease;
    z-index: 99;
    /* 新增 */
}

/* 提示层 小三角 */
.icon-nav a span::before {
    content: "";
    width: 12px;
    height: 12px;
    background-color: #ff8181;
    position: absolute;
    left: -5px;
    top: 50%;
    border-radius: 3px;
    transform: translateY(-50%) rotate(45deg);
}

.icon-nav a:hover,
.icon-nav a:focus,
.icon-nav a:active {
    background-color: #fa5c51;
    outline: none;

}

.icon-nav a:hover span,
.icon-nav a:focus span,
.icon-nav a:active span {
    transform: scale(1);
    opacity: 1;

}