/* ===== Header组件样式 ===== */
/* 职责：定义Header组件的视觉外观和布局 */
/* 复现旧版UI设计风格，使用固定值而非CSS变量 */

/* === 主体内容边距调整 === */
body {
    /* 与旧版一致的页边距 */
    padding-top: 70px;
}

/* === 组件主容器 === */
#main-header {
    /* 固定定位 - 旧版样式 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    
    /* 布局 - 旧版样式 */
    background: white;
    height: 60px;
    display: flex;
    align-items: center;
    
    /* 内边距 - 旧版样式 */
    padding: 0 20px;
    
    /* 阴影 - 旧版无阴影 */
    box-shadow: none;
}

/* === 左侧容器 === */
.header-left {
    /* 旧版样式 - 允许增长 */
    display: flex;
    align-items: center;
    flex-grow: 1;
}

/* === 侧边栏切换按钮 === */
#main-header .sidebar-toggle {
    /* 旧版样式 */
    background-color: transparent;
    padding: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    color: #555;
    
    /* 旧版 -5px左边距 */
    margin-left: -5px;
}

#main-header .sidebar-toggle:hover {
    color: #ff4500;
    transform: scale(1.1);
}

/* === Logo样式 === */
/* Logo样式 - 确保使用旧版样式 */
#main-header .logo,
#main-header .header-left .logo,
header#main-header .logo {
    /* 旧版字体样式 - 重要：使用!important确保不被覆盖 */
    font-size: 32px !important;
    font-weight: 700 !important;
    margin-left: 0px !important;
    font-family: 'Montserrat', 'Microsoft YaHei', sans-serif !important;
    
    /* 旧版渐变色文字 - 重要：使用!important确保不被覆盖 */
    background: #ff4500 !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    display: inline-block !important;
    padding: 0 12px !important;
    text-decoration: none !important;
    
    /* 确保不被全局a标签样式覆盖 */
    color: transparent !important;
}

/* === 搜索框容器 === */
#main-header .search-container {
    /* 旧版样式 - 居中，占据更多空间 */
    display: flex;
    justify-content: center;
    flex-grow: 2;
    min-width: 300px;
}

/* === 搜索输入框 === */
#main-header .header-search {
    /* 旧版样式 */
    width: 280px;
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 20px 0 0 20px;
    outline: none;
    transition: all 0.3s ease;
    font-size: 13px;
    box-sizing: border-box;
    height: 32px;
}

/* === 搜索标签按钮 === */
#main-header .search-label {
    /* 旧版样式 */
    background: #f8f9fa;
    padding: 0 16px;
    border: 1px solid #ddd;
    border-radius: 0 20px 20px 0;
    color: #666;
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 40px;
}

#main-header .search-label i {
    font-size: 14px;
}

/* === 搜索交互效果 === */
#main-header .search-container:hover .header-search,
#main-header .search-container:hover .search-label {
    border-color: #ff4500;
}

#main-header .search-container:hover .search-label {
    background: #ff4500;
    color: white;
}

#main-header .header-search:focus {
    border-color: #ff4500;
    box-shadow: 0 0 10px rgba(255,69,0,0.3);
}

#main-header .header-search:focus + .search-label {
    border-color: #ff4500;
    background: #ff4500;
    color: white;
}

/* === 用户操作区域 === */
#main-header .user-actions {
    /* 旧版样式 */
    display: flex;
    gap: 12px;
    padding-top: 2px;
    flex-grow: 1;
    justify-content: flex-end;
}

/* === 通用按钮样式 === */
#main-header .user-btn {
    /* 旧版样式 */
    height: 32px;
    padding: 0 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    box-sizing: border-box;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;
    transition: none;
}

/* === 创作按钮 === */
.create-btn {
    /* 旧版样式 */
    border: 1px solid #e0e0e0;
    background: #f0f0f0;
    color: #ff4500 !important;
}

.create-btn:hover {
    /* 旧版样式 */
    border: 1px solid #e0e0e0;
    background: #f0f0f0;
    transform: none;
    box-shadow: none;
}

/* === 登录按钮 === */
.signup-btn {
    /* 旧版样式 */
    border: 1px solid #e0e0e0;
    background: #f0f0f0;
    color: black !important;
}

/* === 登录按钮特定样式 === */
.nav-login, .nav-login span {
    color: black !important;
    text-decoration: none !important;
}
.nav-login {
    border: 1px solid #e0e0e0 !important;
    background: #f0f0f0 !important;
}

/* === 头像按钮样式 === */
.avatar-btn {
    padding: 0 !important;
    min-width: 32px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 1px solid #e0e0e0 !important;
    background: #f0f0f0 !important;
}

/* === 用户头像容器 === */
.user-avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* === 用户头像样式 === */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: none;
    border: none;
}

.user-avatar:hover {
    transform: none;
    box-shadow: none;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* === 用户菜单样式 === */
.user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    margin-top: 8px;
    min-width: 60px;
    max-width: 100px;
    z-index: 10000;
    padding: 6px 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0.95;
}

.user-menu a {
    display: block;
    padding: 12px 24px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
}

.user-menu a:hover {
    background-color: #fff0f0;
    color: #ff4500;
}