.menu-dropdown {
    position: relative;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
    transition: opacity 0.3s ease;
}

.menu-btn:hover {
    opacity: 0.8;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 14px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-text {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #1B3C59;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius, 8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1000;
    max-height: 80vh;
    overflow: hidden;
}

.menu-content {
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.menu-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* 添加active类用于控制菜单展开状态 */
.menu-dropdown.active .menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 菜单按钮动画效果 */
.menu-dropdown.active .hamburger-icon span:first-child {
    transform: translateY(6px) rotate(45deg);
}

.menu-dropdown.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.menu-dropdown.active .hamburger-icon span:last-child {
    transform: translateY(-6px) rotate(-45deg);
}

.menu-section {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.menu-section h3 {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.menu-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-section li {
    margin: 1px 0;
}

.menu-section a {
    display: block;
    padding: 6px 8px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.menu-section a:hover,
.menu-section a:focus {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.menu-section a:active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(1px);
}

/* 添加选中状态的样式 */
.menu-section a.active {
    background-color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

/* 添加波纹效果 */
.menu-section a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.4);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.menu-section a:focus:not(:active)::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.7;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* 菜单动画改进 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-section:nth-child(1) {animation: fadeIn 0.2s forwards;}
.menu-section:nth-child(2) {animation: fadeIn 0.3s forwards;}
.menu-section:nth-child(3) {animation: fadeIn 0.4s forwards;}
.menu-section:nth-child(4) {animation: fadeIn 0.5s forwards;}
.menu-section:nth-child(5) {animation: fadeIn 0.6s forwards;}

@media (max-width: 768px) {
    .menu-panel {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        max-height: calc(100vh - 60px);
        transform: translateY(-100%);
        z-index: 100;
    }
    
    .menu-content {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }
    
    .menu-content::-webkit-scrollbar {
        display: none; /* Chrome, Safari and Opera */
    }

    .menu-dropdown.active .menu-panel {
        transform: translateY(0);
    }
    
    /* 移动端菜单样式调整 */
    .nav-menu {
        position: relative;
        justify-content: flex-end;
        align-items: center;
    }
    
    .menu-btn {
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 调整菜单按钮大小 */
    .hamburger-icon {
        margin-right: 0;
    }
    
    /* 文字显示在更大尺寸上 */
    @media (max-width: 480px) {
        .menu-text {
            display: none;
        }
    }
    
    /* 确保菜单内链接在移动端有足够的点击区域 */
    .menu-section a {
        padding: 8px 12px;
        font-size: 15px;
    }
    
    /* 移动端优化布局间距 */
    .menu-section {
        padding: 12px;
    }
    
    .menu-section h3 {
        font-size: 13px;
        margin-bottom: 8px;
    }
} 