:root {
    --shared-shell-header: #070f1c;
    --shared-shell-blue: #2f76ff;
    --shared-shell-gold: #e0b763;
    --shared-shell-nav-height: 66px;
}

/*
 * Default to normal document scrolling. Only pages that provide their own
 * full-height content scroller may lock the root document. This prevents a
 * shared shell import from clipping project, member, admin, or utility pages
 * that rely on ordinary page scrolling.
 */
html {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

html:has(body > .site-header) {
    height: 100%;
    overflow: hidden;
}

body:has(> .site-header) {
    display: flex;
    height: 100dvh;
    overflow: hidden;
    flex-direction: column;
}

body:has(> .site-header) > .site-header {
    flex: 0 0 auto;
}

body:has(> .site-header) > .home-main,
body:has(> .site-header) > .hub-main {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

body:has(.personal-center-page) {
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

.personal-center-page {
    display: block;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    flex-direction: column;
}

.personal-center-page > .personal-center-header {
    flex: 0 0 auto;
}

.personal-center-page > .personal-center-main {
    min-height: 0;
    overflow: visible;
}

.site-header,
.personal-center-header {
    position: relative;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    background: var(--shared-shell-header);
    backdrop-filter: none;
}

.site-header__inner,
.personal-center-header-inner {
    display: flex;
    width: min(100%, 1180px);
    min-height: 94px;
    margin: 0 auto;
    padding: max(14px, env(safe-area-inset-top)) 12px 12px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.brand-lockup,
.personal-center-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    color: inherit;
    text-decoration: none;
}

.brand-lockup__logo,
.personal-center-brand img {
    display: block;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    box-shadow: none;
}

.brand-lockup__copy,
.personal-center-brand > span {
    display: block;
    min-width: 0;
}

.brand-lockup__copy h1,
.brand-lockup__copy .brand-title,
.personal-center-brand strong {
    display: block;
    max-width: none;
    margin: 0;
    overflow: visible;
    color: #f8f8f6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    font-size: 15.5px;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.22;
    text-overflow: clip;
    white-space: nowrap;
}

.brand-lockup__copy small,
.personal-center-brand small {
    display: block;
    margin-top: 5px;
    color: var(--shared-shell-gold);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 0.015em;
    line-height: 1.5;
    white-space: nowrap;
}

.desktop-nav,
.personal-center-desktop-nav {
    display: none;
}

.join-trigger,
.personal-center-header-actions .personal-center-join-trigger {
    display: inline-flex;
    width: 92px;
    min-width: 92px;
    min-height: 44px;
    flex: 0 0 92px;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border: 1px solid #397fff;
    border-radius: 10px;
    background: var(--shared-shell-blue);
    box-shadow: 0 9px 24px rgba(23, 104, 238, 0.23);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    font-size: 12px;
    font-weight: 780;
    line-height: 1;
    text-decoration: none;
}

.personal-center-header-actions {
    display: flex;
    min-width: 92px;
    flex: 0 0 92px;
    align-items: center;
    justify-content: flex-end;
}

.mobile-nav,
.personal-center-mobile-nav {
    position: fixed;
    z-index: 90;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: calc(var(--shared-shell-nav-height) + env(safe-area-inset-bottom));
    padding: 7px 12px env(safe-area-inset-bottom);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid #172638;
    background: rgba(3, 8, 14, 0.97);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

.mobile-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.mobile-nav a,
.personal-center-mobile-nav a {
    display: flex;
    min-width: 44px;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #8a95a4;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    font-size: 9.5px;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: none;
}

.mobile-nav a i,
.personal-center-mobile-nav a i {
    font-size: 19px;
    line-height: 1;
}

.mobile-nav a.is-active,
.personal-center-mobile-nav a.is-active {
    color: #3783ff;
}

@media (min-width: 768px) {
    .site-header,
    .personal-center-header {
        position: sticky;
        top: 0;
        background: rgba(5, 11, 19, 0.94);
        backdrop-filter: blur(18px);
    }

    .site-header__inner,
    .personal-center-header-inner {
        min-height: 82px;
        padding: 10px 24px;
        gap: 22px;
    }

    .brand-lockup__logo,
    .personal-center-brand img {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
    }

    .brand-lockup__copy h1,
    .brand-lockup__copy .brand-title,
    .personal-center-brand strong {
        font-size: 18px;
    }

    .desktop-nav,
    .personal-center-desktop-nav {
        display: flex;
        min-width: 0;
        margin-left: auto;
        padding: 0;
        align-items: center;
        gap: 4px;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .desktop-nav a,
    .personal-center-desktop-nav a {
        display: inline-flex;
        min-width: 58px;
        min-height: 44px;
        padding: 0 13px;
        align-items: center;
        justify-content: center;
        border-radius: 9px;
        background: transparent;
        color: #8f9cad;
        font-size: 13px;
        font-weight: 650;
        text-decoration: none;
    }

    .desktop-nav a.is-active,
    .personal-center-desktop-nav a.is-active {
        color: #5b98ff;
        background: transparent;
    }

    .join-trigger,
    .personal-center-header-actions .personal-center-join-trigger {
        width: 108px;
        min-width: 108px;
        flex-basis: 108px;
    }

    .personal-center-header-actions {
        min-width: 108px;
        flex-basis: 108px;
    }

    .mobile-nav,
    .personal-center-mobile-nav {
        display: none;
    }
}

@media (min-width: 1024px) {
    .site-header__inner,
    .personal-center-header-inner {
        min-height: 76px;
    }

    .brand-lockup__logo,
    .personal-center-brand img {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
    }
}

.research-filter-note {
    display: flex;
    margin-top: 16px;
    padding: 11px 13px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(55,131,255,.34);
    border-radius: 10px;
    background: rgba(47,118,255,.08);
}

.research-filter-note strong { color: #e8eef7; font-size: 13px; }
.research-filter-note a { color: #6aa0ff; font-size: 12px; font-weight: 700; text-decoration: none; }
