/* ========================================================================== 
   Header 样式 - Modern主题
   ========================================================================== */

/* 基础header样式 */
.header {
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
    position: sticky;
    top: 0;
    z-index: 99990;
}

.header.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* 导航栏布局 */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Logo部分 */
.logo-section {
    flex-shrink: 0;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #4A90E2;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo:hover {
    color: #357ABD;
}

/* 导航链接 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    text-decoration: none;
}

.nav-link:hover {
    color: #4A90E2;
    background: #f8f9fa;
}

.nav-link svg {
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.nav-link:hover svg {
    transform: scale(1.1);
    opacity: 1;
}

/* 搜索表单 */
.search-form {
    flex: 1;
    max-width: 650px;
    margin: 0 20px;
    min-width: 0;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.search-wrapper:focus-within {
    border-color: #4A90E2;
    background: white;
}

.search-input {
    flex: 1;
    padding: 14px 24px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #333;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    background: #4A90E2;
    color: white;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    min-width: 50px;
    min-height: 46px;
}

.search-btn:hover {
    background: #357ABD;
}

.search-icon {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    color: white;
    font-style: normal;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.search-btn:hover .search-icon {
    transform: scale(1.1);
}

.search-btn:hover svg {
    transform: rotate(15deg) scale(1.1);
}

/* 用户菜单 */
.user-menu {
    position: relative;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: none;
    border: 1px solid transparent;
    border-radius: 20px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.user-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.user-btn span {
    font-size: 14px;
    font-weight: 500;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
}

.dropdown-item:hover {
    background: #f8f9ff;
    color: #667eea;
}

.dropdown-divider {
    height: 1px;
    background: #e1e5e9;
    margin: 4px 0;
}

/* 认证链接 */
.auth-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.auth-link {
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-link {
    color: #333;
    border: 1px solid #e1e5e9;
}

.login-link:hover {
    background: #f8f9ff;
    color: #667eea;
    border-color: #667eea;
}

.register-link {
    background: #667eea;
    color: white;
    border: 1px solid #667eea;
}

.register-link:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: #667eea;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

/* 移动端菜单 */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    z-index: 99998;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-content {
    padding: 80px 20px 20px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: #555;
    font-weight: 500;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    background: rgba(248, 249, 252, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.mobile-nav-link:hover {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border-color: transparent;
}

.mobile-nav-link svg {
    opacity: 0.8;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

/* 移动端用户信息卡片 */
.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.mobile-user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mobile-user-details {
    flex: 1;
}

.mobile-username {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.mobile-user-status {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
}

/* 移动端菜单分隔线 */
.mobile-menu-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
    margin: 15px 0;
}

/* 退出登录按钮特殊样式 */
.mobile-nav-link.logout-link {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.mobile-nav-link.logout-link:hover {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
}

/* 移动端遮罩 */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-open {
    overflow: hidden;
}

/* ==========================================================================
   响应式设计
   ========================================================================== */

/* 平板端 */
@media (max-width: 1024px) {
    .search-form {
        max-width: 520px;
    }
}

/* 手机端 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .navbar {
        padding: 15px 0;
        gap: 12px;
        align-items: center;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .search-form {
        flex: 1;
        margin: 0 10px;
        max-width: none;
        min-width: 200px;
    }

    .search-wrapper {
        border-radius: 6px;
        display: flex;
        width: 100%;
    }

    .search-input {
        padding: 12px 16px;
        font-size: 14px;
        flex: 1;
        min-width: 0;
    }

    .search-btn {
        padding: 10px 14px;
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
    }

    .search-icon {
        font-size: 18px;
    }
    
    /* 移动端隐藏用户菜单，统一放入汉堡菜单 */
    .user-menu {
        display: none !important;
    }
    
    /* 确保头部在移动端有最高优先级 */
    .header {
        z-index: 999990 !important;
    }
}

/* 小手机端 */
@media (max-width: 480px) {
    .navbar {
        padding: 12px 0;
        gap: 10px;
    }

    .logo {
        font-size: 24px;
    }

    .search-form {
        margin: 0 8px;
        min-width: 150px;
    }

    .search-wrapper {
        border-radius: 4px;
        display: flex;
        width: 100%;
    }

    .search-input {
        padding: 10px 12px;
        font-size: 14px;
        flex: 1;
        min-width: 0;
    }

    .search-btn {
        padding: 8px 12px;
        min-width: 40px;
        min-height: 40px;
        flex-shrink: 0;
    }

    .search-icon {
        font-size: 16px;
    }

    .user-btn {
        padding: 6px 10px;
        border-radius: 16px;
    }

    .user-btn span {
        font-size: 13px;
    }

    .auth-link {
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 16px;
    }
} 