/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #e74c3c 100%);
    box-shadow: var(--shadow);
    padding: 0.4rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-decoration: none !important;
}

.navbar-brand:hover {
    color: white !important;
    text-decoration: none !important;
}

.navbar-brand:focus {
    color: white !important;
    text-decoration: none !important;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    transition: all 0.3s ease;
    border-radius: 16px;
    margin: 0 0.15rem;
    font-size: 0.9rem;
}

.navbar-nav .nav-link.active {
    color: white !important;
    background: rgba(255,255,255,0.3);
}

/* 用户菜单样式 */
.user-dropdown-toggle {
    background: rgba(255,255,255,0.1);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.user-dropdown-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.user-dropdown-toggle:hover .avatar-img {
    transform: scale(1.05);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.username {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

.user-level {
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    line-height: 1;
}

.dropdown-arrow {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.user-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 15px;
    margin-top: 0.5rem;
    min-width: 280px;
    padding: 0;
    overflow: hidden;
}

.user-profile-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), #e74c3c);
    margin: -0.5rem -0.5rem 0.5rem -0.5rem;
    border-radius: 15px 15px 0 0;
}

.preview-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    object-fit: cover;
}

.preview-info {
    flex: 1;
}

.username {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.preview-name {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.preview-level {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
}

.user-dropdown-menu .dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    border-radius: 0;
    margin: 0;
}

.user-dropdown-menu .dropdown-item:hover {
    background: var(--primary-color);
    color: white;
    transform: none;
}

.user-dropdown-menu .dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.user-dropdown-menu .dropdown-divider {
    margin: 0;
    border-color: rgba(0,0,0,0.1);
    border-width: 1px;
}

/* 导航栏响应式 */
.navbar-toggler {
    border: none;
    color: white;
    font-size: 1.2rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* 搜索框样式 */
.search-box {
    position: relative;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
    z-index: 2;
}

.search-box input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding-left: 40px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-box input:focus {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 0 0 0.2rem rgba(255,255,255,0.25);
    color: white;
}

.search-box input:focus::placeholder {
    color: rgba(255,255,255,0.5);
}

/* 移动端导航栏优化 */
@media (max-width: 991.98px) {
    .navbar-nav {
        margin-top: 1rem;
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        margin: 0.2rem 0;
        padding: 0.75rem 1rem;
    }
    
    .user-dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        margin-top: 0.5rem;
        min-width: auto;
    }
    
    .user-dropdown-toggle {
        justify-content: center;
        width: 100%;
        margin: 0.2rem 0;
    }
    
    .user-profile-preview {
        margin: -0.5rem -1rem 0.5rem -1rem;
        border-radius: 0;
    }
    
    .search-box {
        width: 100%;
        margin: 0.5rem 0;
    }
}
