/* 头部导航样式 */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 主导航 */
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    padding: 8px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
    background: rgba(255, 107, 53, 0.05);
}

.nav-item.active {
    color: var(--primary);
}

/* 下拉菜单 */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 100;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    font-size: 0.875rem;
    color: var(--gray-600);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(255, 107, 53, 0.05);
    color: var(--primary);
}

.icon-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 4px;
}

/* 右侧功能 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 搜索框 */
.search-box {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    padding: 4px;
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    background: var(--white);
    box-shadow: 0 0 0 2px var(--primary);
}

.search-input {
    border: none;
    background: transparent;
    padding: 8px 12px;
    width: 200px;
    font-size: 0.875rem;
    outline: none;
}

.search-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* 操作按钮 */
.action-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--gray-100);
}

.action-icon {
    font-size: 1.25rem;
}

.action-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 用户菜单 */
.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-info:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--gray-200);
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    margin-top: 8px;
    display: none;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.user-dropdown.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 登录/注册按钮容器 */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--gray-600);
    transition: all var(--transition-fast);
}

.dropdown-link:hover {
    background: rgba(255, 107, 53, 0.05);
    color: var(--primary);
}

.dropdown-link.text-danger:hover {
    background: rgba(255, 59, 48, 0.05);
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 8px 0;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    height: 2px;
    background: var(--dark);
    border-radius: 1px;
    transition: all var(--transition-fast);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 移动端导航 */
.mobile-nav {
    display: none;
    flex-direction: column;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.mobile-nav.show {
    display: flex;
    max-height: 500px;
}

.mobile-nav-item {
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark);
    border-bottom: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
}

.mobile-nav-item:hover {
    background: rgba(255, 107, 53, 0.05);
    color: var(--primary);
    padding-left: 28px;
}

/* 占位元素 */
.header-placeholder {
    height: 64px;
}

/* 登录注册弹窗 */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.auth-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

.auth-box-sm {
    max-width: 380px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
}

.auth-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-close:hover {
    background: var(--gray-200);
}

/* 滑动切换标签 */
.auth-tabs-wrapper {
    position: relative;
    display: flex;
    padding: 0 24px;
    margin-top: 16px;
}

.auth-tabs-slider {
    position: absolute;
    top: 0;
    left: 24px;
    width: 50%;
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    z-index: 0;
}

.auth-tab {
    position: relative;
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

.auth-tab.active {
    color: var(--white);
}

.auth-tab:hover:not(.active) {
    color: var(--gray-700);
}

.auth-forms-container {
    position: relative;
    min-height: 350px;
}

.auth-form-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: all 0.3s ease;
}

.auth-form-wrapper[style*="display: block"] {
    animation: formFadeIn 0.3s ease;
}

@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.1);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.form-link {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
}

.form-link:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.auth-divider span {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.auth-social {
    margin-top: 8px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-icon {
    font-size: 1.125rem;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 响应式 */
@media (max-width: 768px) {
    .main-nav,
    .search-box {
        display: none;
    }

    .header-actions {
        gap: 8px;
    }

    .user-name {
        display: none;
    }
}