/* Header Styles - 匹配图片样式 */

/* 全局重置 - 确保100%宽度 */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
   
    overflow-x: hidden;
}

/* Skip Links */
.skip-links {
    position: absolute;
    left: -9999px;
}

.skip-links a {
    position: absolute;
    left: 0;
    top: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.skip-links a:focus {
    left: 0;
}

.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* 桌面端布局：Logo(左) | 导航(中) | 登录(右) */
@media (min-width: 993px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .header-logo {
        order: 1;
        flex: 0 0 auto;
    }
    
    .header-nav {
        order: 2;
        flex: 1 1 auto;
        justify-content: center;
        margin: 0 20px;
    }
    
    .header-login {
        order: 3;
        flex: 0 0 auto;
    }
}

/* Logo 区域 */
.header-logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.logo-image {
    height: 50px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    margin-left: 0;
}

.logo-text-main {
    font-size: 24px;
    font-weight: 700;
    color: #333333;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.2;
}

.logo-text-sub {
    font-size: 14px;
    font-weight: 400;
    color: #666666;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.2;
    margin-top: 2px;
}

/* 导航菜单区域 */
.header-nav {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    justify-content: center;
    margin: 0 20px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 32px;
    align-items: center;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0;
    transition: color 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.nav-menu a:hover {
    color: #0066cc;
}

/* Login 按钮区域 */
.header-login {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.login-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #e0e8ee;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    text-decoration: none;
    color: #1a4d7a;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.login-button:hover {
    background-color: #d0d8de;
    color: #1a4d7a;
}

.login-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231a4d7a'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* 用户信息包装器（已登录状态） */
.user-info-wrapper {
    position: relative;
    display: inline-block;
}

/* 用户信息按钮（已登录状态） */
.user-info-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    text-decoration: none;
    color: #1a4d7a;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.user-info-wrapper:hover .user-info-button {
    background-color: rgba(26, 77, 122, 0.08);
    color: #1a4d7a;
}

.user-info-wrapper:hover .dropdown-arrow {
    transform: rotate(180deg);
    color: #1a4d7a;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(26, 77, 122, 0.15);
    transition: all 0.3s ease;
}

.user-info-wrapper:hover .user-avatar {
    border-color: rgba(26, 77, 122, 0.3);
    box-shadow: 0 2px 8px rgba(26, 77, 122, 0.15);
}

.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
    border: 2px solid rgba(26, 77, 122, 0.15);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-info-wrapper:hover .user-avatar-placeholder {
    border-color: rgba(26, 77, 122, 0.3);
    box-shadow: 0 4px 12px rgba(26, 77, 122, 0.2);
    transform: scale(1.05);
}

.user-name {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.dropdown-arrow {
    font-size: 10px;
    color: #7f8c8d;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    margin-left: 2px;
}

/* 用户下拉菜单 - 默认隐藏 */
.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    min-width: 160px;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-8px) scale(0.95);
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(10px);
    pointer-events: none !important;
    display: block;
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    transform: rotate(45deg);
}

.user-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1);
    pointer-events: auto !important;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: #e74c3c;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.logout-button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.1), transparent);
    transition: width 0.3s ease;
}

.logout-button:hover {
    background-color: rgba(231, 76, 60, 0.08);
    color: #c0392b;
    padding-left: 22px;
}

.logout-button:hover::before {
    width: 3px;
}

.logout-button:hover .logout-icon {
    transform: translateX(2px);
}

.logout-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    display: inline-block;
    stroke: currentColor;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    color: #333;
    flex: 0 0 auto;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .header-container {
        padding: 15px 20px;
        width: 100%;
        box-sizing: border-box;
        justify-content: space-between;
    }
    
    /* 移动端布局：菜单按钮(左) | Logo(中) | 登录(右) */
    .mobile-menu-toggle {
        display: block;
        order: 1;
        flex: 0 0 auto;
        margin-right: 0;
    }
    
    .header-logo {
        order: 2;
        flex: 1 1 auto;
        justify-content: center;
        margin: 0;
        min-width: 0;
    }
    
    .header-login {
        order: 3;
        flex: 0 0 auto;
        margin-left: 0;
    }
    
    .header-nav {
        order: 4;
        width: 100%;
        margin: 0;
        margin-top: 15px;
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 1000;
        padding: 0;
    }
    
    .header-nav.active {
        display: block;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
        padding: 0;
        margin: 0;
    }
    
    .nav-menu li {
        border-bottom: 1px solid #e0e0e0;
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        display: block;
        padding: 12px 20px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 12px 15px;
        width: 100%;
    }
    
    .logo-text-main {
        font-size: 18px;
    }
    
    .logo-text-sub {
        font-size: 11px;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .login-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .login-icon {
        width: 16px;
        height: 16px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .user-avatar-placeholder {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .user-name {
        font-size: 13px;
        max-width: 80px;
    }
    
    .header-logo {
        margin: 0 5px;
    }
    
    .logo-link {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 10px 10px;
        width: 100%;
    }
    
    .logo-text {
        margin-left: 0;
    }
    
    .logo-text-main {
        font-size: 16px;
    }
    
    .logo-text-sub {
        font-size: 10px;
    }
    
    .logo-image {
        height: 35px;
    }
    
    .login-button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .login-icon {
        width: 14px;
        height: 14px;
    }
    
    .user-avatar {
        width: 24px;
        height: 24px;
    }
    
    .user-avatar-placeholder {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .user-name {
        font-size: 12px;
        max-width: 60px;
    }
    
    .user-info-button {
        padding: 4px 8px;
        gap: 6px;
    }
    
    .mobile-menu-toggle {
        padding: 6px;
        font-size: 20px;
    }
}

