:root {
    --navbar-height: 76px;
    --sj-nav-height: 76px;
}

.sj-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1100;
    height: var(--sj-nav-height);
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.sj-nav__inner {
    width: min(1320px, calc(100% - 40px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.sj-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    color: #0f172a;
}

.sj-brand__mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    background: linear-gradient(145deg, #2563eb, #1e3a8a);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .26);
}

.sj-brand__text {
    display: grid;
    line-height: 1.05;
}

.sj-brand__text strong {
    font-size: 19px;
    font-weight: 900;
    letter-spacing: .04em;
    color: #0f172a;
}

.sj-brand__text small {
    margin-top: 5px;
    color: #94a3b8;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .18em;
}

.sj-nav__links {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.sj-nav__group {
    position: relative;
}

.sj-nav__item {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.sj-nav__item:hover,
.sj-nav__item.is-active,
.sj-nav__group[open] > .sj-nav__item {
    color: #1d4ed8;
    background: #eff6ff;
}

.sj-nav__item.is-active {
    box-shadow: inset 0 -2px 0 #2563eb;
}

.sj-chevron {
    width: 7px;
    height: 7px;
    display: inline-block;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .18s ease;
}

.sj-nav__group[open] > .sj-nav__item .sj-chevron,
.sj-user[open] .sj-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.sj-nav__item::-webkit-details-marker,
.sj-user__trigger::-webkit-details-marker {
    display: none;
}

.sj-nav__item::marker,
.sj-user__trigger::marker {
    content: "";
}

.sj-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 448px;
    padding: 15px;
    border: 1px solid #e6ebf3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.sj-nav__group[open] > .sj-dropdown,
.sj-nav__group:hover > .sj-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.sj-dropdown__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 5px 12px;
    border-bottom: 1px solid #eef2f7;
}

.sj-dropdown__head div {
    display: grid;
}

.sj-dropdown__head strong {
    color: #0f172a;
    font-size: 14px;
}

.sj-dropdown__head span {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
}

.sj-dropdown__head > a {
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
}

.sj-subject-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-top: 10px;
}

.sj-subject-grid a {
    display: grid;
    padding: 10px 11px;
    border-radius: 12px;
    color: #334155;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.sj-subject-grid a:hover {
    color: #1d4ed8;
    background: #f8fafc;
    transform: translateY(-1px);
}

.sj-subject-grid b {
    font-size: 13px;
}

.sj-subject-grid span {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 10px;
}

.sj-search {
    height: 42px;
    min-width: 220px;
    max-width: 330px;
    flex: 1;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 7px 0 13px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.sj-search:focus-within {
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .08);
}

.sj-search__icon {
    position: relative;
    width: 15px;
    height: 15px;
    flex: none;
    border: 2px solid #94a3b8;
    border-radius: 50%;
}

.sj-search__icon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 2px;
    right: -6px;
    bottom: -2px;
    border-radius: 2px;
    background: #94a3b8;
    transform: rotate(45deg);
}

.sj-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font-size: 13px;
}

.sj-search input::placeholder {
    color: #a8b3c4;
}

.sj-search button {
    height: 30px;
    padding: 0 13px;
    flex: none;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    font-size: 12px;
    font-weight: 800;
    transition: filter .16s ease, transform .16s ease;
}

.sj-search button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.sj-nav__actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: none;
}

.sj-vip,
.sj-login,
.sj-register {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

.sj-vip {
    padding: 0 14px;
    color: #b45309;
    border: 1px solid #fcd34d;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.sj-vip:hover {
    color: #fff;
    border-color: #f59e0b;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 8px 18px rgba(245, 158, 11, .24);
}

.sj-login {
    padding: 0 13px;
    color: #475569;
}

.sj-login:hover {
    color: #1d4ed8;
    background: #eff6ff;
}

.sj-register {
    padding: 0 17px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
}

.sj-register:hover {
    transform: translateY(-1px);
    box-shadow: 0 11px 22px rgba(37, 99, 235, .3);
}

.sj-user {
    position: relative;
}

.sj-user__trigger {
    height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 5px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    list-style: none;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.sj-user__trigger:hover,
.sj-user[open] .sj-user__trigger {
    border-color: #bfdbfe;
    background: #f8fbff;
    box-shadow: 0 7px 18px rgba(15, 23, 42, .07);
}

.sj-avatar {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    flex: none;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, #3b82f6, #1e40af);
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .2);
}

.sj-user__name {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 750;
}

.sj-user__menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    padding: 9px;
    border: 1px solid #e6ebf3;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .17);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.sj-user[open] .sj-user__menu,
.sj-user:hover .sj-user__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.sj-user__head {
    display: grid;
    margin-bottom: 6px;
    padding: 9px 10px 11px;
    border-bottom: 1px solid #eef2f7;
}

.sj-user__head strong {
    color: #0f172a;
    font-size: 13px;
}

.sj-user__head span {
    color: #94a3b8;
    font-size: 11px;
}

.sj-user__menu > a,
.sj-user__menu form button {
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    color: #475569;
    background: transparent;
    font-size: 12.5px;
    font-weight: 700;
    text-align: left;
}

.sj-user__menu > a:hover,
.sj-user__menu form button:hover {
    color: #1d4ed8;
    background: #eff6ff;
}

.sj-user__menu form {
    margin: 4px 0 0;
    padding-top: 4px;
    border-top: 1px solid #eef2f7;
}

.sj-user__menu form button {
    color: #dc2626;
}

.sj-mobile-toggle,
.sj-mobile-only,
.sj-search--mobile {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1200px) {
    .sj-nav__inner {
        gap: 12px;
    }

    .sj-nav__item {
        padding: 0 10px;
        font-size: 13px;
    }

    .sj-search {
        max-width: 260px;
        min-width: 180px;
    }

    .sj-user__name {
        display: none;
    }
}

@media (max-width: 1200px) {
    .sj-mobile-toggle {
        width: 42px;
        height: 42px;
        display: inline-grid;
        place-content: center;
        gap: 4px;
        margin-left: auto;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #fff;
        cursor: pointer;
    }

    .sj-mobile-toggle span:not(.sr-only) {
        width: 18px;
        height: 2px;
        display: block;
        border-radius: 2px;
        background: #334155;
        transition: transform .18s ease, opacity .18s ease;
    }

    .sj-mobile-toggle.is-open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .sj-mobile-toggle.is-open span:nth-child(2) {
        opacity: 0;
    }

    .sj-mobile-toggle.is-open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .sj-nav__links {
        position: absolute;
        top: calc(100% + 1px);
        left: 16px;
        right: 16px;
        max-height: calc(100vh - var(--sj-nav-height) - 24px);
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        padding: 14px;
        overflow-y: auto;
        border: 1px solid #e6ebf3;
        border-radius: 0 0 20px 20px;
        background: #fff;
        box-shadow: 0 24px 60px rgba(15, 23, 42, .16);
    }

    .sj-nav__links.is-open {
        display: flex;
    }

    .sj-nav__group,
    .sj-nav__links > .sj-nav__item {
        width: 100%;
    }

    .sj-nav__item {
        width: 100%;
        height: 44px;
        justify-content: space-between;
        padding: 0 13px;
        border-radius: 10px;
    }

    .sj-nav__item.is-active {
        box-shadow: none;
    }

    .sj-dropdown {
        position: static;
        width: 100%;
        display: none;
        margin-top: 5px;
        padding: 12px;
        border-radius: 13px;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
    }

    .sj-nav__group[open] > .sj-dropdown {
        display: block;
    }

    .sj-search--desktop {
        display: none;
    }

    .sj-search--mobile {
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 5px 0 8px;
        display: flex;
    }

    .sj-nav__actions {
        display: none;
    }

    .sj-mobile-only {
        display: block;
        padding-top: 8px;
        border-top: 1px solid #eef2f7;
    }

    .sj-mobile-user {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 10px;
        margin-bottom: 4px;
        border-radius: 12px;
        background: #f8fafc;
    }

    .sj-mobile-user div {
        display: grid;
    }

    .sj-mobile-user strong {
        color: #0f172a;
        font-size: 13px;
    }

    .sj-mobile-user small {
        color: #94a3b8;
        font-size: 10px;
    }

    .sj-mobile-only > a,
    .sj-mobile-only > form button,
    .sj-mobile-action {
        width: 100%;
        height: 42px;
        display: flex;
        align-items: center;
        padding: 0 12px;
        border: 0;
        border-radius: 10px;
        color: #475569;
        background: transparent;
        font-size: 13px;
        font-weight: 750;
    }

    .sj-mobile-only > a:hover,
    .sj-mobile-only > form button:hover {
        color: #1d4ed8;
        background: #eff6ff;
    }

    .sj-mobile-only > form button {
        color: #dc2626;
    }

    .sj-mobile-only .sj-mobile-action {
        justify-content: center;
        margin-top: 7px;
    }

    .sj-mobile-only .sj-mobile-action.is-vip {
        color: #b45309;
        background: #fffbeb;
    }

    .sj-mobile-only .sj-mobile-action.is-primary {
        color: #fff;
        background: linear-gradient(135deg, #2563eb, #1e40af);
    }
}

@media (max-width: 620px) {
    .sj-nav__inner {
        width: calc(100% - 28px);
    }

    .sj-brand__text small {
        display: none;
    }

    .sj-brand__mark {
        width: 39px;
        height: 39px;
    }

    .sj-subject-grid {
        grid-template-columns: 1fr;
    }

    .sj-dropdown__head {
        align-items: flex-start;
        flex-direction: column;
    }
}
