* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* sidebar styles only - no global body styles */

.sidebar-container {
    position: fixed;
    right: 20px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    z-index: 1000;
}

.sidebar {
    width: 88px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    border: 1px solid #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 15.75px rgba(27, 97, 174, 0.12);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.menu-item {
    width: 88px;
    height: 88px;
    border-bottom: 1px solid #cdd7e7;
    transition: all 0.2s ease;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    text-decoration: none;
    color: #7c8ba1;
    gap: 8px;
    transition: all 0.2s ease;
}

.menu-icon {
    width: 32px;
    height: 32px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 8px 8.75px rgba(158, 198, 255, 0.5));
}

/* 正常状态图标 */
.menu-item-znkf .menu-icon {
    background-image: url('../images/znkf.png');
}
.menu-item-zydh .menu-icon {
    background-image: url('../images/zydh.png');
}
.menu-item-bzzx .menu-icon {
    background-image: url('../images/bzzx.png');
}
.menu-item-lxwm .menu-icon {
    background-image: url('../images/lxwm.png');
}
.menu-item-fhdb .menu-icon {
    background-image: url('../images/fhdb.png');
}

/* Active 状态图标 - 使用 -hov 图片 */
.menu-item-znkf.active .menu-icon {
    background-image: url('../images/znkf-hov.png');
}
.menu-item-zydh.active .menu-icon {
    background-image: url('../images/zydh-hov.png');
}
.menu-item-bzzx.active .menu-icon {
    background-image: url('../images/bzzx-hov.png');
}
.menu-item-lxwm.active .menu-icon {
    background-image: url('../images/lxwm-hov.png');
}
.menu-item-fhdb.active .menu-icon {
    background-image: url('../images/fhdb-hov.png');
}

.menu-text {
    font-size: 14px;
    line-height: 1.4286;
    color: #7c8ba1;
    font-weight: normal;
    text-align: center;
}

.menu-item:hover {
    background: rgba(81, 153, 255, 0.08);
}

.menu-item:hover .menu-text {
    color: #1f6de8;
}

.menu-item:hover .menu-icon {
    filter: drop-shadow(0 8px 8.75px rgba(31, 109, 232, 0.6));
}

/* Hover 样式 */
.menu-item:hover {
    background: linear-gradient(136.11deg, #5199ff 0%, #1f6de8 100%);
    border-bottom: 1px solid #ffffff;
}

.menu-item:hover .menu-text {
    color: #ffffff;
}

.menu-item:hover .menu-icon {
    filter: drop-shadow(0 8px 8.75px rgba(255, 255, 255, 0.3));
}

/* Hover 时切换为 -hov 图片 */
.menu-item-znkf:hover .menu-icon {
    background-image: url('../images/znkf-hov.png');
}
.menu-item-zydh:hover .menu-icon {
    background-image: url('../images/zydh-hov.png');
}
.menu-item-bzzx:hover .menu-icon {
    background-image: url('../images/bzzx-hov.png');
}
.menu-item-lxwm:hover .menu-icon {
    background-image: url('../images/lxwm-hov.png');
}
.menu-item-fhdb:hover .menu-icon {
    background-image: url('../images/fhdb-hov.png');
}

/* 只移除 focus 效果，active 时保持 hover 效果 */
.menu-item:focus,
.menu-item:focus-within,
.menu-link:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 只有不在 hover 时的 focus 才恢复原样式 */
.menu-item:focus:not(:hover),
.menu-item:focus-within:not(:hover) {
    background: transparent;
    border-bottom: 1px solid #cdd7e7;
}

.menu-item:focus:not(:hover) .menu-text,
.menu-item:focus-within:not(:hover) .menu-text {
    color: #7c8ba1;
}

.menu-item:focus:not(:hover) .menu-icon,
.menu-item:focus-within:not(:hover) .menu-icon {
    filter: drop-shadow(0 8px 8.75px rgba(158, 198, 255, 0.5));
}

.menu-item-znkf:focus:not(:hover) .menu-icon,
.menu-item-znkf:focus-within:not(:hover) .menu-icon {
    background-image: url('../images/znkf.png');
}
.menu-item-zydh:focus:not(:hover) .menu-icon,
.menu-item-zydh:focus-within:not(:hover) .menu-icon {
    background-image: url('../images/zydh.png');
}
.menu-item-bzzx:focus:not(:hover) .menu-icon,
.menu-item-bzzx:focus-within:not(:hover) .menu-icon {
    background-image: url('../images/bzzx.png');
}
.menu-item-lxwm:focus:not(:hover) .menu-icon,
.menu-item-lxwm:focus-within:not(:hover) .menu-icon {
    background-image: url('../images/lxwm.png');
}
.menu-item-fhdb:focus:not(:hover) .menu-icon,
.menu-item-fhdb:focus-within:not(:hover) .menu-icon {
    background-image: url('../images/fhdb.png');
}

.back-to-top .menu-icon {
    filter: none;
}

.back-to-top:hover .menu-icon {
    filter: drop-shadow(0 8px 8.75px rgba(255, 255, 255, 0.3));
}

@media screen and (max-width: 768px) {
    .sidebar-container {
        right: 10px;
        top: auto;
        bottom: 20px;
        transform: none;
    }

    .sidebar {
        width: 60px;
    }

    .menu-item {
        width: 60px;
        height: 60px;
    }

    .menu-icon {
        width: 24px;
        height: 24px;
        transform: scale(0.85);
    }

    .menu-text {
        font-size: 11px;
    }

    .menu-item.active {
        padding: 8px;
    }
}

@media screen and (max-width: 480px) {
    .sidebar-container {
        right: 8px;
        bottom: 16px;
    }

    .sidebar {
        width: 52px;
        border-radius: 8px;
    }

    .menu-item {
        width: 52px;
        height: 52px;
    }

    .menu-link {
        gap: 4px;
    }

    .menu-icon {
        width: 20px;
        height: 20px;
        transform: scale(0.75);
    }

    .menu-text {
        font-size: 10px;
    }

    .menu-item.active {
        padding: 6px;
    }
}

.sidebar-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.sidebar-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: all 0.3s ease;
}

@media screen and (max-width: 768px) {
    .sidebar-hidden {
        transform: translateY(100px);
    }

    .sidebar-visible {
        transform: translateY(0);
    }
}
