@media (max-width: 768px) {
    /* 移动端主菜单（侧边栏）样式 */
    .nav-menu {
        position: fixed;
        top: 60px;
        right: -300px;
        width: 300px;
        height: calc(100vh - 60px);
        background: rgba(20, 20, 20, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
        display: flex;
        flex-direction: column;
        padding: 2rem 1rem;
        gap: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
        overflow-y: auto;
        z-index: 1000;
    }

    .nav-menu.show {
        transform: translateX(0);
        opacity: 1;
        right: 0;
    }

    .navbar {
        position: fixed;
        width: 100%;
        z-index: 1050;
    }

    body {
        padding-top: 60px; /* 防止导航栏遮挡内容 */
    }

    .nav-link {
        color: #fff !important;
        padding: 1rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        cursor: pointer;
    }

    /* 下拉菜单基础样式（未展开） */
    .dropdown {
        position: static;
        background: rgba(40, 40, 40, 0.9);
        flex-direction: column;
        padding: 1rem;
        margin: 0;
        border-left: none;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        visibility: hidden;
        transform: translateY(-10px);
        transition: max-height 0.3s ease, opacity 0.2s ease, transform 0.3s ease;
    }

    .nav-item.active .dropdown {
        max-height: 1000px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* 多图列样式 */
    .dropdown-column {
        min-width: auto;
        padding: 0.5rem 0;
    }

    .dropdown-image {
        display: block;
        height: 100px;
        width: 80%;
        margin: 1rem auto;
        object-fit: cover;
    }

    .nav-item.has-dropdown > .nav-link::after {
        content: "›";
        float: right;
        transform: rotate(90deg);
        transition: transform 0.3s;
    }

    .nav-item.active.has-dropdown > .nav-link::after {
        transform: rotate(270deg);
    }

    /* 登录注册按钮区域 */
    .nav-auth {
        margin-top: auto;
        padding: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: center;
    }

    .btn-auth {
        width: 100%;
        text-align: center;
        border-color: #5b23e8 !important;
    }

    /* 汉堡图标样式 */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 1100;
    }

    .hamburger span {
        width: 25px;
        height: 3px;
        background: #fff;
        transition: all 0.3s ease;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* 黑色半透明遮罩层 */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(3px);
        z-index: 900;
    }

    .mobile-menu-overlay.active {
        display: block;
    }
}






@media (max-width: 768px) {
    .nav-item .dropdown {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        visibility: hidden; /* 关键：防止残留显示 */
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    .nav-item.active .dropdown {
        max-height: 1000px;
        opacity: 1;
        visibility: visible; /* 恢复显示 */
        transform: translateY(0);
    }

    /* 防止 dropdown 默认为 flex 占位 */
    .dropdown {
        display: none;
    }

    .nav-item.active .dropdown {
        display: flex; /* 激活时显示 */
        flex-direction: column;
    }
}

.nav-item.active .dropdown > * {
    animation: fadeSlideIn 0.4s ease forwards;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}





