/* ===== 导航栏 ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(10, 37, 64, 0.95); backdrop-filter: blur(10px);
    padding: 0 24px; height: 56px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    font-family: 'Noto Sans SC', sans-serif;
}
/* Logo */
.nav-logo {
    display: flex; align-items: center; flex-shrink: 0; text-decoration: none;
}
.nav-logo img {
    width: 32px; height: 32px; border-radius: 8px;
}
/* PC端两组导航 */
.nav-group { display: flex; align-items: center; gap: 20px; }
.nav-group a {
    color: rgba(255,255,255,0.8); text-decoration: none; font-size: 16px; font-weight: 500;
    white-space: nowrap; transition: color 0.2s;
    font-family: 'Noto Sans SC', sans-serif;
}
.nav-group a:hover { color: var(--accent); }
.nav-group-shop { border-left: 1px solid rgba(255,255,255,0.15); padding-left: 20px; }
/* 购物车角标 */
.cart-badge {
    display: inline-block; background: var(--accent); color: #fff;
    font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px;
    text-align: center; line-height: 16px; font-weight: 700; padding: 0 4px;
    vertical-align: middle; font-family: 'Noto Sans SC', sans-serif;
}
.cart-badge:empty, .cart-badge:not(.show) { display: none; }

/* === PC端右侧用户区 === */
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-left: auto; }
.nav-right .btn-login {
    display: inline; color: var(--accent); font-weight: 600; font-size: 16px;
    background: none; border: none; cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
}
.nav-right .nav-user { display: none; align-items: center; gap: 8px; color: #fff; font-size: 16px; font-family: 'Noto Sans SC', sans-serif; }
.nav-right .btn-logout { color: rgba(255,255,255,0.5); font-size: 16px; background: none; border: none; cursor: pointer; font-family: 'Noto Sans SC', sans-serif; }
.nav-right .btn-logout:hover { color: #fff; }
/* PC端登录态：.active 切换 */
.nav-right.active .btn-login { display: none; }
.nav-right.active .nav-user { display: flex; }
#navOrdersLink { display: none; }
.nav-right.active ~ .nav-group #navOrdersLink,
.navbar.active #navOrdersLink { display: inline; }

/* === 手机端按钮组（PC端隐藏） === */
.mobile-btns { display: none; align-items: center; gap: 8px; }
.mobile-btn {
    background: none; border: none;
    color: #fff; font-size: 16px; padding: 4px 8px; cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
}
.mobile-btn.active { color: var(--accent); }

/* === 手机端右侧用户区（PC端隐藏） === */
.mobile-right { display: none; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.mobile-right .btn-login-m { display: inline; color: var(--accent); font-weight: 600; font-size: 16px; background: none; border: none; cursor: pointer; font-family: 'Noto Sans SC', sans-serif; }
.mobile-right .nav-user-m { display: none; align-items: center; gap: 6px; color: #fff !important; font-size: 16px; font-family: 'Noto Sans SC', sans-serif; }
.mobile-right .nav-user-m span { color: #fff !important; font-family: 'Noto Sans SC', sans-serif; }
.mobile-right .btn-logout-m { color: rgba(255,255,255,0.5); font-size: 16px; background: none; border: none; cursor: pointer; font-family: 'Noto Sans SC', sans-serif; }
.mobile-right .btn-logout-m:hover { color: #fff; }
/* 手机端登录态：.active 切换 */
.mobile-right.active .btn-login-m { display: none; }
.mobile-right.active .nav-user-m { display: flex; }
#navOrdersLinkMobile { display: none; }
.mobile-right.active ~ .mobile-dropdown #navOrdersLinkMobile { display: block; }

/* 手机端下拉面板 */
.mobile-dropdown {
    display: none; position: fixed; top: 56px; left: 0; right: 0;
    background: rgba(10,37,64,0.98); z-index: 999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.mobile-dropdown.show { display: block; }
.mobile-dropdown a {
    display: block; padding: 13px 24px; color: rgba(255,255,255,0.85);
    text-decoration: none; font-size: 16px; font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-family: 'Noto Sans SC', sans-serif;
}
.mobile-dropdown a:hover { color: var(--accent); }
.mobile-dropdown .divider { border-top: 1px solid rgba(255,255,255,0.12); }

/* 手机端响应式 */
@media (max-width: 768px) {
    .nav-group { display: none !important; }
    .nav-right { display: none !important; }
    .mobile-btns { display: flex !important; }
    .mobile-right { display: flex !important; }
}

/* 导航昵称 & 头像字母 — 显式字体，移动端避免继承失效 */
#navNickname, #navNicknameM, #navAvatar, #navAvatarM {
    font-family: 'Noto Sans SC', sans-serif;
}
