/* ============================================================
   Site Navigation ?Sticky h-16 white/95 backdrop-blur
   魔力指数风格: 6 menu items with Lucide icons + 登录 CTA
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-100);
}

.nav {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gray-800);
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}
.nav-brand:hover { color: var(--primary-700); }
.nav-brand .nav-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}
.nav-brand .mark {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-700), var(--primary-500));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.nav-menu {
    display: flex;
    gap: 4px;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
}
.nav-menu li { list-style: none; }
.nav-menu a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all var(--t-fast);
    white-space: nowrap;
}
.nav-menu a:hover {
    background: var(--bg-light);
    color: var(--primary-700);
}
.nav-menu a.is-active {
    background: var(--bg-light);
    color: var(--primary-700);
}
.nav-menu a svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-700);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius);
    flex-shrink: 0;
    transition: all var(--t-fast);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
}
.nav-cta:hover {
    background: var(--primary-800);
    color: var(--white);
    box-shadow: var(--shadow-md);
}
.nav-cta-sm { padding: 6px 12px; font-size: 0.8125rem; }

/* Auth group (logged-out): 登录 link + 免费注册 button */
.nav-auth {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.nav-auth-login {
    color: var(--gray-700);
    font-size: 0.875rem;
    text-decoration: none;
    padding: 6px 8px;
    font-weight: 500;
    transition: color var(--t-fast);
    border-bottom: none;
}
.nav-auth-login:hover { color: var(--primary-700); }

/* User pill (logged-in): avatar + name + link to account */
.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px 4px 4px;
    background: var(--bg-light);
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--t-fast);
    flex-shrink: 0;
    border-bottom: none;
}
.nav-user:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-700);
}
.nav-user-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary-700), var(--primary-500));
    color: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 0.875rem;
    flex-shrink: 0;
}
.nav-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-700);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: var(--radius);
}
.nav-toggle:hover { background: var(--bg-light); }

/* Mobile drawer */
@media (max-width: 960px) {
    .nav-menu { display: none; }
    .nav-menu.is-open {
        display: flex;
        position: absolute;
        top: 64px;
        left: 0; right: 0;
        flex-direction: column;
        background: var(--white);
        border-top: 1px solid var(--gray-100);
        border-bottom: 1px solid var(--gray-200);
        padding: 16px var(--gutter);
        gap: 4px;
        align-items: stretch;
        box-shadow: var(--shadow-md);
    }
    .nav-menu.is-open a {
        padding: 12px 16px;
        font-size: 1rem;
    }
    .nav-toggle { display: flex; }
    .nav-cta,
    .nav-auth,
    .nav-user { display: none; }
}
