/* Standalone Menu Styles - 独立菜单样式 */

.standalone-menu {
    width: 250px;
    flex-shrink: 0;
    background: #3F4257;
    padding: 0;
    height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    align-self: flex-start; /* 确保菜单顶部对齐 */
    scrollbar-width: thin;
    scrollbar-color: #686B83 #3f4369;
}

/* 菜单标题样式 */
.menu-title {
    padding: 1rem 1rem 1rem 2.5rem;
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background: #3F4257;
    z-index: 10;
}

/* 蓝色竖线样式 */
.blue-line {
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: #1E90FF;
    margin-right: 8px;
    border-radius: 2px;
}

/* 滚动条样式 */
.standalone-menu::-webkit-scrollbar {
    width: 8px;
}

.standalone-menu::-webkit-scrollbar-track {
    background: #3F4257;
    border-radius: 3px;
}

.standalone-menu::-webkit-scrollbar-thumb {
    background: #5A5E7D;
    border-radius: 3px;
}

.standalone-menu::-webkit-scrollbar-thumb:hover {
    background: #6B729A;
}

.standalone-menu-list::-webkit-scrollbar {
    width: 6px;
}

.standalone-menu-list::-webkit-scrollbar-track {
    background: #3F4257;
    border-radius: 3px;
}

.standalone-menu-list::-webkit-scrollbar-thumb {
    background: #5A5E7D;
    border-radius: 3px;
}

.standalone-menu-list::-webkit-scrollbar-thumb:hover {
    background: #6B729A;
}

.standalone-menu-list {
    list-style: none;
    margin: 0;
    padding: 0 0 80px 0; /* 为菜单列表添加底部空间以适配Microsoft Edge */
    min-height: 100%;
    overflow-y: visible;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #686B83 #3f4369;
    background: #3F4257;
    width: 100%;
    box-sizing: border-box;
}

.standalone-menu-list li {
    margin-bottom: 0;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.standalone-menu-list li.menu-item-has-children {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.standalone-menu-list a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    color: #ffffff;
    border-radius: 0;
    transition: all 0.3s ease;
    font-size: 16px;
    text-decoration: none;
    white-space: pre-wrap;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    background: #3F4257;
    /* 确保文本内容正确对齐 */
    text-align: left;
}

.standalone-menu-list a:hover {
    background: #5A5E7D;
    color: #ffffff;
    border-radius: 0;
    transform: translateX(0);
    box-shadow: none;
}

/* 展开/收起按钮 */
.expand-btn {
    cursor: pointer;
    padding: 0;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: Arial, sans-serif;
    flex-shrink: 0;
    align-self: center;
}

.expand-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.3);
}

.expand-btn.active {
    transform: rotate(0deg);
}

.standalone-menu-list li.menu-item-has-children > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    position: relative;
    background: #3F4257;
}

/* 一级分类悬停效果 */
.standalone-menu-list li.menu-item-has-children > a:hover {
    background: #5A5E7D;
    color: #ffffff;
    transform: translateX(0);
    box-shadow: none;
}

/* 展开的一级菜单项样式 */
.standalone-menu-list li.menu-item-has-children > a + .sub-menu.show + a {
    background: #383B4C;
}

/* 子菜单样式 */
.standalone-menu-list .sub-menu {
    display: none;
    margin-left: 0;
    margin-top: 0;
    padding-left: 0;
    list-style: none;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    max-height: 0;
    background: #383B4C;
    border-radius: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.standalone-menu-list .sub-menu.show {
    display: block;
    opacity: 1;
    max-height: 1000px;
}

.standalone-menu-list .sub-menu li {
    margin-bottom: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.standalone-menu-list .sub-menu li:before {
    display: none;
}

.standalone-menu-list .sub-menu a {
    padding: 0.75rem 1rem 0.75rem 3.5rem;
    font-size: 16px;
    color: #ffffff;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #383B4C;
    /* 确保文本内容正确对齐 */
    text-align: left;
    overflow: hidden;
    margin: 0;
}

.standalone-menu-list .sub-menu a:hover {
    background: #5A5E7D;
    color: #ffffff;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
    transform: translateX(0);
    box-shadow: none;
    margin: 0;
}

.standalone-menu .widget {
    margin-bottom: 2rem;
}

.standalone-menu .widget-title {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #5A5E7D;
}

/* 当前菜单项样式 */
/* 当前菜单项样式 */
.standalone-menu-list .current-menu-item > a {
    background: #5A5E7D !important;
    color: white !important;
    border-radius: 0;
}

.standalone-menu-list .sub-menu .current-menu-item > a {
    background: #5A5E7D !important;
    color: white !important;
}


.standalone-menu-list .current-menu-ancestor > a {
    background: #3F4257 !important;
    color: white !important;
    border-radius: 0;
}

/* 展开一级分类时的背景色 */
.standalone-menu-list li.menu-item-has-children > .sub-menu.show ~ a,
.standalone-menu-list li.menu-item-has-children > a + .sub-menu.show {
    background: #383B4C;
}

/* 当子菜单被选中时，确保一级菜单保持自己的背景色 */
.standalone-menu-list .current-menu-ancestor.menu-item-has-children > a {
    background: #3F4257 !important;
}

/* 确保子菜单的父级菜单项不受子菜单选中状态影响 */
.standalone-menu-list li.menu-item-has-children.current-menu-ancestor > a {
    background: #3F4257 !important;
}

/* 菜单文本样式 - 支持省略号显示 */
.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
    display: inline-block;
}

/* 菜单统计数字样式 */
.menu-count {
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 2px 8px;
    min-width: 20px;
    text-align: center;
    display: inline-block;
    flex-shrink: 0;
    line-height: 1;
    align-self: center;
}

/* 响应式设计 */
@media (max-width: 1100px) {
    .standalone-menu {
        width: 100%;
        margin: 0 0 2rem 0;
        max-height: none;
        position: relative;
        top: 0;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 60px); /* 增加更多安全区域底部内边距以适配Microsoft Edge */
    }
    
    .menu-title {
        position: relative;
    }
}

@media (max-width: 768px) {
    .standalone-menu {
        display: none;
    }
    
    /* 移动端菜单项悬停效果 */
    .standalone-menu-list a:hover {
        transform: translateX(0);
        box-shadow: none;
    }
    
    .standalone-menu-list .sub-menu a:hover {
        transform: translateX(0);
        box-shadow: none;
    }
    
    .standalone-menu-list li.menu-item-has-children > a:hover {
        transform: translateX(0);
        box-shadow: none;
    }
}