/* 公共样式文件 */

/* 桌面端导航链接样式 */
.nav-links {
    display: flex;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    padding-bottom: 5px; /* 防止滚动时内容被截断 */
}

.nav-links::-webkit-scrollbar {
    display: none; /* Chrome Safari */
}

.nav-links li {
    margin-left: 1.5rem;
    flex-shrink: 0; /* 防止项目在小屏幕上压缩 */
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    white-space: nowrap; /* 防止文字换行 */
}

.nav-links a:hover,
.nav-links a.active {
    color: #ffd700;
}

/* 移动端导航菜单样式 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        width: 100%;
        flex-direction: column;
        background-color: white;
        padding: 1rem;
        box-shadow: 0 5px 15px rgba(0,0,0,0.15);
        border-radius: 8px;
        margin-top: 1rem;
        /* 使用opacity和transform实现更流畅的动画 */
        opacity: 0;
        transform: translateY(-20px);
        visibility: hidden;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1000;
        /* 添加边框 */
        border: 1px solid #eee;
        /* 优化过渡效果 */
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .nav-links.active {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }
    
    .nav-links li {
        margin: 0.5rem 0;
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
        padding: 0.5rem 0;
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-links a {
        color: #333;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
        padding: 0.8rem 1rem;
        border-radius: 5px;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        color: var(--primary-color);
        background-color: #f8f8f8;
        transform: translateX(5px);
    }
    
    /* 移动端导航切换按钮样式 */
    .nav-toggle {
        display: flex; /* 在移动端显示 */
        font-size: 1.8rem;
        color: white;
        cursor: pointer;
        position: absolute;
        right: 1rem;
        top: 1.2rem;
        z-index: 1001;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }
    
    .nav-toggle:hover {
        background-color: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }
    
    .nav-toggle:active {
        transform: scale(0.95);
    }
    
    /* 汉堡菜单图标动画 */
    .nav-toggle i {
        transition: all 0.3s ease;
    }
    
    .nav-toggle.active i:before {
        content: "\eb99"; /* 使用remix图标中的关闭图标 */
    }
}

/* 小屏幕设备优化 */
@media (max-width: 480px) {
    .nav-links li {
        margin-left: 1rem;
    }
}