/**
 * 通用导航样式
 * 处理顶部导航栏的所有样式
 */

/* 导航栏基础样式 */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* 导航容器 */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 70px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo区域 */
.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: bold;
    position: relative;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.logo-icon::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-radius: 2px;
    background-color: transparent;
}

.logo-text {
    display: flex;
    flex-direction: column;
    color: #333;
}

.logo-main {
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 2px;
}

.logo-sub {
    font-size: 12px;
    opacity: 0.7;
    line-height: 1;
}

/* 中部搜索与发布区域 */
.nav-search-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 32px;
}

.nav-search-input {
    flex: 1;
    max-width: 420px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
}

.nav-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: #fff;
}

.nav-search-btn {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid #667eea;
    background: #667eea;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-search-btn:hover {
    background: #5665d0;
    border-color: #5665d0;
    box-shadow: 0 2px 8px rgba(86, 101, 208, 0.4);
}

.nav-publish-btn {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    background: rgba(102, 126, 234, 0.08);
    color: #4a4a4a;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-publish-btn:hover {
    background: rgba(102, 126, 234, 0.16);
    border-color: rgba(102, 126, 234, 0.6);
}

/* 导航菜单 */
.site-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.site-nav li {
    margin: 0;
}

.site-nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.site-nav a:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.site-nav a.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
}

.site-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #667eea;
    border-radius: 1px;
}

/* 用户操作区 */
.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 顶部右侧“商家入驻”按钮样式与搜索按钮一致 */
.user-actions .btn-primary {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid #667eea;
    background: #667eea;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.user-actions .btn-primary:hover {
    background: #5665d0;
    border-color: #5665d0;
    box-shadow: 0 2px 8px rgba(86, 101, 208, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    color: #333;
    font-size: 14px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 8px 15px;
        height: auto;
        flex-wrap: wrap;
    }

    .nav-search-area {
        order: 3;
        width: 100%;
        margin: 8px 0 0;
    }

    .nav-search-input {
        max-width: none;
        font-size: 13px;
    }

    .nav-search-btn,
    .nav-publish-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .user-actions {
        gap: 10px;
    }
    
    .btn-primary {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .btn-outline {
        padding: 8px 16px;
        font-size: 15px;
    }
    
    .user-info {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }
    
    .site-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        gap: 10px;
    }
    
    .user-actions {
        order: 2;
    }
    
    .site-logo {
        order: 1;
    }
}

/* 页面内容区域需要为固定导航栏留出空间 */
body {
    padding-top: 70px;
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 80px;
    }
}
