/* 统一导航组件样式 */
.game-navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    height: 70px;
    gap: 2rem; /* 添加统一的间距 */
}

/* 品牌区域 */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0; /* 防止品牌区域被压缩 */
    min-width: 0; /* 允许内容收缩 */
}

.nav-logo {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.nav-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.nav-subtitle {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    gap: 1rem;
    flex: 1; /* 占据剩余空间 */
    justify-content: center; /* 居中对齐 */
    align-items: center;
}

.nav-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    white-space: nowrap; /* 防止文字换行 */
}

.nav-menu-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.nav-menu-item.active {
    background: rgba(255,255,255,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.nav-icon {
    font-size: 1.2rem;
}

/* 操作区域 */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0; /* 防止操作区域被压缩 */
}

/* 搜索框 */
.nav-search {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-icon {
    position: absolute;
    left: 12px;
    font-size: 1rem;
    opacity: 0.7;
}

.nav-search-input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(10px);
    width: 200px;
    transition: all 0.3s ease;
}

.nav-search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.nav-search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    width: 250px;
}

/* 通知 */
.nav-notification {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav-notification:hover {
    background: rgba(255,255,255,0.2);
}

.nav-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 用户菜单 */
.nav-user-menu {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav-user-menu:hover {
    background: rgba(255,255,255,0.2);
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.nav-user-details {
    display: flex;
    flex-direction: column;
}

.nav-user-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.nav-user-role {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* 下拉菜单 */
.nav-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
    cursor: pointer;
}

.nav-dropdown-item:hover {
    background: #f8f9fa;
}

.nav-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.nav-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* 当只有一个菜单项时（如游客状态的Login），应用完整圆角 */
.nav-dropdown-item:only-child {
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 0.5rem;
        height: 60px;
        gap: 1rem; /* 减少间距 */
    }
    
    .nav-title {
        font-size: 1.2rem;
    }
    
    .nav-subtitle {
        display: none;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-search-input {
        width: 150px;
    }
    
    .nav-search-input:focus {
        width: 180px;
    }
    
    .nav-user-details {
        display: none;
    }
}

@media (max-width: 480px) {
    .nav-search {
        display: none;
    }
    
    .nav-notification {
        display: none;
    }
}

/* 主题支持 */
.game-navigation[data-theme="dark"] {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.game-navigation[data-theme="light"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-dropdown.show {
    animation: fadeIn 0.3s ease;
} 