/* ========================================
   header.css - 顶部导航栏专用样式
   ======================================== */

.top-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.top-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 主导航 */
.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 20px;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
}

.header-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.header-logo-text {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

/* 导航菜单 */
.header-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    justify-content: center;
}

.header-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-nav a:hover,
.header-nav a.active {
    background: rgba(233, 69, 96, 0.3);
    color: #ffd700;
}

/* 搜索框 */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-search {
    position: relative;
    flex-shrink: 0;
}

.header-search form {
    display: flex;
    align-items: center;
    position: relative;
}

.header-search input {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 25px;
    padding: 10px 40px 10px 16px;
    color: #fff;
    width: 180px;
    font-size: 14px;
    transition: all 0.3s ease;
    height: 40px;
    box-sizing: border-box;
}

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

.header-search input:focus {
    background: rgba(255,255,255,0.18);
    border-color: #e94560;
    outline: none;
    width: 220px;
}

.header-search button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.header-search button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.4);
}

/* 发布按钮 */
.publish-btn {
    background: linear-gradient(135deg, #ff5f6d, #ff9966);
    color: #fff;
    padding: 0 18px;
    height: 40px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.publish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 100, 100, 0.4);
}

/* 用户区 */
.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.desktop-only { display: flex; gap: 8px; }

.btn-login {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-login:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.1);
}

.btn-register {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

/* 手机端用户头像图标 */
.mobile-user-avatar {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    text-decoration: none;
    border: 2px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.mobile-user-avatar:hover { border-color: #fff; transform: scale(1.05); }
.mobile-user-avatar i { font-size: 22px; }

/* 用户头像下拉 */
.user-dropdown { position: relative; }

.user-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.user-avatar-btn:hover { border-color: #fff; transform: scale(1.05); }

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    min-width: 180px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown:hover .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 15px;
    color: #fff;
    text-align: center;
}

.user-menu-name { font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.user-menu-role { font-size: 11px; opacity: 0.8; }

.user-menu-list { list-style: none; padding: 8px 0; }

.user-menu-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.user-menu-list li a:hover { background: #f5f5f5; color: #e94560; }
.user-menu-list li a i { width: 18px; text-align: center; }

.user-menu-divider { height: 1px; background: #eee; margin: 8px 0; }

.badge {
    background: #e94560;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
}

/* 响应式 */
@media (max-width: 1024px) {
    .header-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .header-search input { width: 140px; }
}

@media (max-width: 768px) {
    .header-main { position: relative; }
    .header-logo-text { display: none; }
    .header-logo { display: none !important; }

    .mobile-menu-btn {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        display: block;
        order: -1;
        z-index: 10;
    }

    .header-right { margin-left: auto; }
    .header-search { display: none; }
    .desktop-only { display: none !important; }
    .mobile-user-avatar { display: flex !important; }

    .top-header-inner { padding: 0 15px; }
    .header-main { padding: 10px 0; padding-left: 45px; }
}