/* 深色页头：首页（template-homepage）、作品页（template-zp-index）与会员空间（template-member）共用。
   包含 logo、一级栏目导航、手机端折叠菜单。浅色页头请勿引用。 */

:is(.template-homepage, .template-zp-index, .template-member) {
    --site-blue: #034eff;
}

/* 宽屏内容区：首页与作品页共用 */
:is(.template-homepage, .template-zp-index, .template-member) .gh-container {
    max-width: 1280px;
}

/* ===== 页头容器 ===== */
:is(.template-homepage, .template-zp-index, .template-member) .gh-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: #0b0b0d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-header-inner {
    min-height: 64px;
}

/* ===== 品牌与 logo ===== */
:is(.template-homepage, .template-zp-index, .template-member) .gh-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-brand:hover {
    color: #ffffff;
    text-decoration: none;
}

.gh-brand-logo {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-brand:hover .gh-brand-logo {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 78, 255, 0.5);
}

/* ===== 一级栏目导航 ===== */
:is(.template-homepage, .template-zp-index, .template-member) .gh-nav {
    display: flex;
    align-items: center;
    margin-left: 22px;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-nav-menu {
    display: flex;
    align-items: center;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-nav-link {
    position: relative;
    display: inline-block;
    padding: 0 11px;
    line-height: 64px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.76);
    transition: color 0.2s ease;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-nav-link:hover {
    color: #ffffff;
    text-decoration: none;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-nav-link.is-active {
    color: #ffffff;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-nav-link.is-active::after {
    content: "";
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: 0;
    height: 4px;
    border-radius: 2px 2px 0 0;
    background-color: var(--site-blue);
}

/* ===== 账号区按钮 ===== */
:is(.template-homepage, .template-zp-index, .template-member) .gh-user {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.62);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-btn {
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background-color: transparent;
    color: #ffffff;
    font-size: 13px;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-btn:hover {
    border-color: var(--site-blue);
    background-color: var(--site-blue);
    color: #ffffff;
    text-decoration: none;
}

/* ===== 账号菜单：深色页头 ===== */
:is(.template-homepage, .template-zp-index, .template-member) .gh-account-trigger {
    border-color: rgba(255, 255, 255, 0.18);
    background-color: rgba(255, 255, 255, 0.06);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-trigger:hover {
    border-color: rgba(255, 255, 255, 0.42);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-name {
    color: #ffffff;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-role {
    color: rgba(255, 255, 255, 0.58);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-caret {
    color: rgba(255, 255, 255, 0.72);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-menu {
    border-color: rgba(255, 255, 255, 0.12);
    background-color: #141418;
    box-shadow: 0 22px 46px -18px rgba(0, 0, 0, 0.7);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-menu-head {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-menu-head strong {
    color: #ffffff;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-menu-head span {
    color: rgba(255, 255, 255, 0.55);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-item {
    color: rgba(255, 255, 255, 0.82);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-item-danger {
    color: #ff8f8a;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-account-item-danger:hover {
    background-color: rgba(255, 92, 92, 0.14);
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-btn-primary {
    border-color: var(--site-blue);
    background-color: var(--site-blue);
    color: #ffffff;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-btn-primary:hover {
    border-color: #2f6bff;
    background-color: #2f6bff;
}

/* ===== 汉堡按钮：桌面隐藏，手机端显示 ===== */
.gh-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background-color: transparent;
    cursor: pointer;
}

.gh-nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background-color: #ffffff;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

:is(.template-homepage, .template-zp-index, .template-member) .gh-nav-toggle {
    display: none;
}

@media (max-width: 860px) {
    :is(.template-homepage, .template-zp-index, .template-member) .gh-nav-link {
        line-height: 60px;
        padding: 0 8px;
    }

    :is(.template-homepage, .template-zp-index, .template-member) .gh-nav-link.is-active::after {
        left: 8px;
        right: 8px;
    }
}

/* 手机端：导航折叠为右上角汉堡菜单，点击展开下拉面板 */
@media (max-width: 620px) {
    :is(.template-homepage, .template-zp-index, .template-member) .gh-header-inner {
        position: relative;
    }

    :is(.template-homepage, .template-zp-index, .template-member) .gh-header-actions {
        margin-left: 10px;
    }

    :is(.template-homepage, .template-zp-index, .template-member) .gh-nav {
        margin-left: auto;
    }

    :is(.template-homepage, .template-zp-index, .template-member) .gh-nav-toggle {
        display: flex;
    }

    .gh-nav.is-open .gh-nav-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

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

    .gh-nav.is-open .gh-nav-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    :is(.template-homepage, .template-zp-index, .template-member) .gh-nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 6px 0 8px;
        background-color: #0b0b0d;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 18px 28px -12px rgba(0, 0, 0, 0.55);
    }

    .gh-nav.is-open .gh-nav-menu {
        display: flex;
    }

    :is(.template-homepage, .template-zp-index, .template-member) .gh-nav-link {
        padding: 0 18px;
        line-height: 48px;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    :is(.template-homepage, .template-zp-index, .template-member) .gh-nav-link:last-child {
        border-bottom: 0;
    }

    :is(.template-homepage, .template-zp-index, .template-member) .gh-nav-link.is-active {
        color: #ffffff;
        box-shadow: inset 3px 0 0 var(--site-blue);
    }

    :is(.template-homepage, .template-zp-index, .template-member) .gh-nav-link.is-active::after {
        display: none;
    }
}
