/* PC端导航栏样式 */
.navbar, .pc-header {
    background: var(--primary);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px var(--shadow); /* 减少阴影 */
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 0; /* 减少垂直内边距，更紧凑 */
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 页头响应式内边距 */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
        padding: 0 3rem;
    }
}

@media (min-width: 1440px) and (max-width: 1919px) {
    .container {
        max-width: 1400px;
        padding: 0 2.5rem;
    }
}

@media (min-width: 1200px) and (max-width: 1439px) {
    .container {
        max-width: 1200px;
        padding: 0 2rem;
    }
}

@media (max-width: 1199px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.8rem;
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    width: 100%;
}

/* 白色模式下的导航栏 */
:root .navbar, :root .pc-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

/* 黑色模式下的导航栏 */
[data-theme="dark"] .navbar, [data-theme="dark"] .pc-header {
    background: #1a1a2e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Logo样式 */
.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
    flex-basis: 200px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.3s ease;
}

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

/* PC端Logo图片样式 - 自适应 */
.logo-image {
    /* 限制高度为主要约束 */
    max-height: 50px;
    /* 宽度根据高度自动计算以保持比例 */
    width: auto;
    /* 确保不超过容器最大宽度 */
    max-width: 200px;
    /* 最小高度确保小logo也有合适的尺寸 */
    min-height: 30px;
    /* 保持图片原始比例，防止变形 */
    object-fit: contain;
    /* 图片在容器中的对齐方式 */
    object-position: left center;
    /* 平滑过渡动画 */
    transition: all 0.3s ease;
    /* 块级元素显示 */
    display: block;
    /* 防止图片下方出现空隙 */
    vertical-align: middle;
    /* 图片加载失败时的边框样式 */
    border: none;
    outline: none;
    /* 现代浏览器支持：保持宽高比 */
    aspect-ratio: auto;
}

/* Logo文字回退样式 */
.logo-text {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.logo-text.fallback {
    display: none;
}

/* 响应式Logo调整 */
@media (max-width: 1200px) {
    .logo-image {
        max-height: 45px;
        max-width: 180px;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .logo-image {
        max-height: 40px;
        max-width: 150px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .logo {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo-image {
        max-height: 35px;
        max-width: 120px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
}

/* Logo容器样式补充 */
.logo {
    /* 设置最小宽度防止过度收缩 */
    min-width: 100px;
}

/* 主导航菜单样式 */
.main-nav {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex-grow: 1;
    justify-content: center;
    min-width: 0;
}

.nav-item {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--success);
}

.nav-item.active {
    background: var(--category-color, var(--success));
    color: white;
    border-radius: 6px;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-brand:hover {
    color: var(--success);
    transition: color 0.3s ease;
}

/* 搜索表单样式 */
.search-form {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px 0 0 20px;
    outline: none;
    width: 240px;
    background: var(--primary);
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.search-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #3a7bc8;
}

/* 响应式搜索框调整 */
@media (max-width: 1200px) {
    .search-input {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .search-input {
        width: 120px;
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .search-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .search-input {
        width: 100px;
    }
    
    .header-content {
        gap: 1rem;
    }
}

/* 认证按钮样式 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
    flex-basis: 200px;
    justify-content: flex-end;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.login-btn {
    color: var(--text);
    border: 1px solid var(--border-color);
    background: transparent;
}

.login-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.register-btn {
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
}

.register-btn:hover {
    background: #3a7bc8;
    border-color: #3a7bc8;
}

.auth-btn i {
    font-size: 0.85rem;
}

/* 用户菜单样式 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.user-profile:hover {
    background: var(--hover-bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-avatar {
    width: 100%;
    height: 100%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.username {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.logout-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.logout-btn i {
    font-size: 0.85rem;
}

/* 头部导航响应式调整 */
@media (max-width: 1200px) {
    .header-content {
        gap: 2rem;
    }
    
    .main-nav {
        gap: 2rem;
    }
    
    .logo {
        flex-basis: 150px;
    }
    
    .header-actions {
        flex-basis: 150px;
        gap: 1rem;
    }
    
    .search-input {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .header-content {
        gap: 1rem;
    }
    
    .main-nav {
        gap: 1rem;
    }
    
    .nav-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .logo {
        flex-basis: auto;
        min-width: 120px;
    }
    
    .header-actions {
        flex-basis: auto;
        gap: 0.8rem;
    }
    
    .auth-actions {
        gap: 0.4rem;
    }
    
    .auth-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .user-menu {
        gap: 0.5rem;
    }
    
    .username {
        display: none;
    }
    
    .logout-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .search-input {
        width: 120px;
    }
}

/* PC端页脚样式 */
.pc-footer {
    background: var(--secondary);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    padding: 2rem 0 1rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p,
.footer-section a {
    color: var(--text-muted);
    line-height: 1.6;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.footer-section a:hover {
    color: var(--success);
    transition: color 0.3s ease;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-contact .contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-contact .contact-item i {
    color: var(--success);
    width: 16px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-disclaimer {
    background: var(--accent);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 响应式页脚 */
@media (max-width: 1200px) {
    .footer-main {
        gap: 2rem;
    }
    
    .footer-content {
        padding: 0 1.5rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .pc-footer {
        padding: 1.5rem 0 1rem;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .footer-disclaimer {
        font-size: 0.85rem;
        padding: 0.7rem;
    }
}

@media (max-width: 480px) {
    .footer-content {
        padding: 0 0.5rem;
    }
    
    .footer-main {
        gap: 1rem;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.8rem;
    }
    
    .footer-disclaimer {
        font-size: 0.8rem;
        padding: 0.6rem;
    }
    
    .footer-copyright {
        font-size: 0.8rem;
    }
}