/* ================= 网站公共页头样式 - header.css ================= */
/* 包含：页头布局、Logo、搜索框、用户区、用户菜单（电脑端） */

/* 页头整体布局 */
.site-header {
    width: 100%;
    background-color: #121212;
    border-bottom: 1px solid #1e1e1e;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1px;
}

/* Logo区域 */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.logo h1 {
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
    margin: 0;
}

/* 搜索区域 */
.search-area {
    flex: 1;
    max-width: 400px;
    margin: 0 15px;
    position: relative; /* 父容器相对定位 */
}

.search-area form {
    display: flex;
    align-items: center;
}

.search-area input {
    flex: 1;
    height: 36px;
    background-color: #2d2d2d;
    border: 1px solid #3d3d3d;
    border-radius: 18px 0 0 18px;
    padding: 0 15px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
}

.search-area input:focus {
    border-color: #00a8e8;
}

.search-area button {
    height: 36px;
    width: 60px;
    background-color: #2d8cf0;
    border: none;
    border-radius: 0 18px 18px 0;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
}
.input-area {
    display: flex;
    width: 100%;
    height: 100%;
}

/* ---------------- 用户区域（电脑端核心优化） ---------------- */
.user-area {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid #2d8cf0;
}

/* 用户弹出菜单：电脑端样式（解决错位+居中） */
.user-menu {
    position: absolute;
    top: 100%; /* 紧贴头像底部 */
    right: 0;
    margin-top: 5px; /* 小间距，不贴死 */
    background-color: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 0 !important; /* 取消旧的上下内边距，由子元素控制 */
    width: 140px; /* 电脑端合适宽度 */
    display: none; /* 默认隐藏 */
    z-index: 9999; /* 最上层 */
}

/* 菜单显示状态 */
.user-menu.show {
    display: block !important;
}

/* 用户名：电脑端居中，作为菜单标题 */
.user-menu-username { /* 替换旧的.user-info，避免冲突 */
    text-align: center !important; /* 强制居中 */
    padding: 8px 15px !important;
    font-size: 13px;
    color: #ffffff;
    border-bottom: 1px solid #2d2d2d;
    margin-bottom: 8px !important;
}

/* 菜单项：电脑端居中，统一间距 */
.menu-item {
    display: block !important;
    text-align: center !important; /* 强制居中，解决错位 */
    padding: 8px 15px !important;
    font-size: 13px;
    color: #e0e0e0;
    text-decoration: none;
    transition: background-color 0.2s;
    margin: 0 !important; /* 取消多余间距 */
}

/* 菜单项 hover 效果 */
.menu-item:hover {
    background-color: #2d2d2d;
}

/* 退出登录项：电脑端醒目红色 */
.logout-item {
    color: #ff6b6b !important;
}

