* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(139, 134, 128, 0.1);
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 15px 5%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2C2C2C;
    background: #FFFFFF;
    line-height: 1.6;
    padding-top: 80px; /* 为固定导航栏留出空间 */
}

.logo {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.logo span {
    color: #C73E3A;
    font-weight: 400;
}

.nav-menu {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav-menu a {
    text-decoration: none;
    color: #2C2C2C;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: #C73E3A;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #C73E3A;
    transition: width 0.3s ease;
}

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

.nav-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* 统一所有导航动作项的样式 */
.nav-actions a {
    text-decoration: none;
    color: #2C2C2C;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px; /* 统一高度 */
    line-height: 1;
    position: relative;
}

.nav-actions a:hover {
    color: #C73E3A;
}

/* 为所有导航动作项添加下划线悬停效果 */
.nav-actions a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #C73E3A;
    transition: width 0.3s ease;
}

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

/* 统一图标样式 */
.nav-actions .icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.nav-actions .icon:hover {
    transform: scale(1.1);
}

.nav-actions .cart-icon:hover path,
.nav-actions .account-icon:hover path {
    fill: #C73E3A;
}

/* Logout 按钮的特殊处理 - 移除背景形状 */
.nav-actions a[href*="logout"] {
    padding: 8px 12px;
    border-radius: 0;
    transition: color 0.3s ease;
}

.nav-actions a[href*="logout"]:hover {
    background: transparent;
    color: #C73E3A;
}

/* Login/Register links styling */
.auth-links {
    text-decoration: none;
    color: #2C2C2C;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 6px;
    height: 40px;
    line-height: 1;
    position: relative;
}

.auth-links:hover {
    color: #C73E3A;
    background: rgba(199, 62, 58, 0.1);
}

.auth-links span {
    color: #999;
    font-size: 12px;
}

/* 为登录/注册链接添加下划线效果 */
.auth-links::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #C73E3A;
    transition: width 0.3s ease;
}

.auth-links:hover::after {
    width: 100%;
}

/* 购物车图标样式 */
.cart-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #C73E3A;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid white;
}

/* 图标按钮容器 */
.icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.icon-button:hover {
    background: rgba(199, 62, 58, 0.1);
}

/* 为图标按钮添加下划线效果 */
.icon-button::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #C73E3A;
    transition: width 0.3s ease;
}

.icon-button:hover::after {
    width: 100%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        padding: 15px 3%;
        flex-wrap: wrap;
        gap: 15px;
    }

    nav.scrolled {
        padding: 12px 3%;
    }

    body {
        padding-top: 70px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-menu {
        gap: 20px;
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .nav-menu a {
        font-size: 13px;
    }

    .nav-actions {
        gap: 15px;
    }

    .nav-actions a,
    .auth-links {
        font-size: 13px;
        height: 36px;
    }

    .nav-actions a[href*="logout"] {
        padding: 6px 10px;
    }

    .nav-actions .icon {
        width: 18px;
        height: 18px;
    }

    .cart-icon-wrapper,
    .icon-button {
        width: 36px;
        height: 36px;
    }

    .cart-count {
        width: 16px;
        height: 16px;
        font-size: 10px;
        top: -2px;
        right: -2px;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 12px 3%;
        gap: 10px;
    }

    nav.scrolled {
        padding: 10px 3%;
    }

    body {
        padding-top: 60px;
    }

    .logo {
        font-size: 18px;
    }

    .nav-menu {
        gap: 15px;
    }

    .nav-menu a {
        font-size: 12px;
    }

    .nav-actions {
        gap: 12px;
    }

    .auth-links {
        font-size: 12px;
        height: 32px;
        padding: 6px 10px;
    }

    .nav-actions a[href*="logout"] {
        padding: 5px 8px;
        height: 32px;
        font-size: 12px;
    }

    .nav-actions .icon {
        width: 16px;
        height: 16px;
    }

    .cart-icon-wrapper,
    .icon-button {
        width: 32px;
        height: 32px;
    }

    .cart-count {
        width: 14px;
        height: 14px;
        font-size: 9px;
        top: -1px;
        right: -1px;
    }
}

/* 移动端菜单切换（如果需要的话） */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #2C2C2C;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 12px 0;
        font-size: 16px;
    }
}