/* 导航栏样式 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    height: 80px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
}

.logo i {
    font-size: 32px;
    color: var(--primary-color);
    transform: rotate(-10deg);
    display: flex;
    align-items: center;
}

.logo h1 {
    font-size: 28px;
    color: #333;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.logo span {
    color: var(--primary-color);
    margin-left: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    height: 100%;
}

.nav-links li {
    margin: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-color);
    padding: 0 4px;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links li a:hover {
    color: var(--primary-color);
}

.nav-links li a:hover::after {
    width: 100%;
}

.user-profile {
    display: flex;
    align-items: center;
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.user-profile:hover .user-dropdown {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: #f5f5f5;
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

.dropdown-item.logout {
    color: #ff4d4f;
}

.dropdown-item.logout:hover {
    background: #fff1f0;
}

/* 添加按钮点击效果 */
.auth-buttons button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 移动菜单按钮样式 */
.mobile-menu {
    display: none;
}
/* 为不支持渐变文字的浏览器提供备选样式 */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
    .section-title {
        background: none;
        color: var(--primary-color);
        -webkit-text-fill-color: initial;
    }
}

/* 导航栏现化 */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

/* 移动端导航样式优化 */
@media screen and (max-width: 768px) {
    /* 用户信息模块隐藏 */
    #user-section {
        display: none !important;
    }
    
    /* 防止水平滚动 */
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .navbar {
        height: 60px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        width: 100vw;
        max-width: 100%;
    }

    .navbar .container {
        height: 100%;
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.95));
        backdrop-filter: blur(10px);
        padding: 80px 30px 30px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
        z-index: 999;
        justify-content: flex-start;
        overflow-y: auto;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .nav-links.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
        width: 100%;
        max-width: 100vw;
    }

    /* 确保内容不会超出容器 */
    .nav-links li {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .nav-links li a {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 18px 15px;
    }

    /* 修复移动端菜单按钮位置 */
    .mobile-menu {
        position: relative;
        z-index: 1001;
        margin-right: -5px;
    }

    .nav-links li {
        margin: 8px 0;
        width: 100%;
        text-align: center;
        height: auto;
        display: block;
        transform: translateX(-30px);
        opacity: 0;
        transition: all 0.3s ease;
    }

    .nav-links.active li {
        transform: translateX(0);
        opacity: 1;
    }

    /* 为菜单项添加延迟动画 */
    .nav-links li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links li:nth-child(2) { transition-delay: 0.15s; }
    .nav-links li:nth-child(3) { transition-delay: 0.2s; }
    .nav-links li:nth-child(4) { transition-delay: 0.25s; }
    .nav-links li:nth-child(5) { transition-delay: 0.3s; }
    .nav-links li:nth-child(6) { transition-delay: 0.35s; }

    .nav-links li a {
        font-size: 18px;
        padding: 18px;
        display: block;
        text-align: center;
        position: relative;
        overflow: hidden;
        color: var(--text-color);
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    .nav-links li a::before {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 1px;
        background: var(--primary-color);
        transform: scaleX(0);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-links li a:hover::before {
        transform: scaleX(1);
    }

    .mobile-menu {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        font-size: 24px;
        color: var(--primary-color);
        cursor: pointer;
        padding: 0;
        position: relative;
        z-index: 1000;
        transition: all 0.3s ease;
    }

    .mobile-menu i {
        font-size: 24px;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-menu.active i {
        transform: rotate(180deg);
    }

    /* 添加滚动条样式 */
    .nav-links::-webkit-scrollbar {
        width: 5px;
    }

    .nav-links::-webkit-scrollbar-track {
        background: transparent;
    }

    .nav-links::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 10px;
    }

    .user-profile,
    .auth-buttons {
        display: none;
    }

    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    /* 移动端个人中心链接样式 */
    .nav-links li.mobile-only {
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav-links li.mobile-only .merchant-nav {
        color: var(--primary-color);
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px 20px;
        border: 1px solid rgba(33, 150, 243, 0.3);
        border-radius: 6px;
        transition: all 0.3s ease;
    }
    
    .nav-links li.mobile-only .merchant-nav:hover {
        background: rgba(33, 150, 243, 0.05);
        border-color: var(--primary-color);
    }
    
    .nav-links li.mobile-only i {
        margin-right: 8px;
        font-size: 16px;
    }
}

@media screen and (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: flex !important;
    }
}

/* 防止菜单打开时页面滚动 */
body.overflow-hidden {
    overflow: hidden;
} 

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    padding: 0 4px;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
    transform: translateY(-1px);
} 

/* 未登录状态的按钮 */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    min-width: fit-content;
}

#merchant-section {
    margin-right: 0;
}

#auth-section {
    margin-left: 0;
}

.auth-buttons .auth-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 6px;
    white-space: nowrap;
}

.auth-buttons .auth-link:hover {
    color: var(--primary-color);
    background: rgba(33, 150, 243, 0.08);
}

.auth-buttons .merchant-link {
    color: var(--primary-color);
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.auth-buttons .merchant-link:hover {
    border-color: var(--primary-color);
    background: rgba(33, 150, 243, 0.05);
}