/* 导航容器 */

.topnavbar {
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem 5%;
    position: fixed;
    width: 100vw;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    visibility: hidden;
    transition: visibility 0.3s;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}


/* 品牌标识 */

.topnav-brand {
    font-family: 'MapleMono', monospace;
    font-size: 1.8rem;
    color: #2c3e50;
    text-decoration: none;
    transition: opacity 0.3s;
    flex-shrink: 0;
}

.topnav-brand:hover {
    opacity: 0.8;
}


/* 导航链接容器 */

.topnav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin-left: auto;
    padding-right: 2%;
}


/* 导航项 */

.topnav-item {
    font-family: 'MapleMono', monospace;
    position: relative;
    padding: 0.5rem 0;
}


/* 导航链接 */

.topnav-link {
    color: #34495e;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.topnav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease;
}

.topnav-link:hover::after {
    width: 100%;
}

.topnav-link.active {
    color: #3498db;
}


/* 汉堡菜单 */

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.menu-icon {
    font-size: 1.8rem;
    color: #2c3e50;
    transition: transform 0.3s ease;
}

.music-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.music-icon {
    font-size: 1.4rem;
    color: #34495e;
    transition: transform 0.2s ease;
}

/* 按下状态 */
.music-toggle.active .music-icon {
    color: #3498db;
    transform: scale(1.1);
}

.music-toggle:hover .music-icon {
    color: #2980b9;
}

/* 移动端适配 */

@media screen and (max-width: 768px) {
    .topnavbar {
        z-index: 1000;
        /* 导航栏 */
    }

    .topnav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.5rem;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    .topnav-links.active {
        right: 0;
    }
    .music-toggle {
        z-index: 1001;
        margin-left: auto;
        order: 2;
    }

    .menu-toggle {
        z-index: 1002;
        order: 3;
        margin-left: 1rem;
    }

    .menu-toggle,
    .music-toggle {
        display: flex !important;
        position: relative;
        z-index: 1002;
    }
}