/* ==========================================
   Header 模块样式
   ========================================== */

.gh-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: var(--gh-header-bg);
    box-shadow: var(--gh-header-shadow);
    transition: background-color var(--gh-header-transition), box-shadow var(--gh-header-transition), transform var(--gh-header-transition);
}

.gh-header.is-scrolled {
    background: var(--gh-header-bg-strong);
}

.gh-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1920px;
    min-height: 76px;
    margin: 0 auto;
    padding: 14px 32px 18px;
}

.gh-header__brand {
    display: inline-flex;
    align-items: center;
    width: 184px;
    min-width: 184px;
    flex-shrink: 0;
}

.gh-header__brand-image {
    width: 158px;
    height: 44px;
    object-fit: contain;
}

.gh-header__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.gh-header__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 16px;
    border-radius: 10px;
    color: var(--gh-header-text);
    font-size: 13px;
    line-height: 19.5px;
    letter-spacing: -0.08px;
    white-space: nowrap;
    opacity: 0.95;
    transition: color var(--gh-header-transition), background-color var(--gh-header-transition), opacity var(--gh-header-transition), transform var(--gh-header-transition);
}

.gh-header__link img {
    width: 16px;
    height: 16px;
    transition: transform var(--gh-header-transition);
}

.gh-header__link:hover,
.gh-header__link:focus-visible,
.gh-header__link.is-active {
    color: var(--gh-header-text);
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.gh-header__link:focus-visible,
.gh-header__action:focus-visible,
.gh-header__lang-trigger:focus-visible,
.gh-header__toggle:focus-visible,
.gh-header__search-submit:focus-visible,
.gh-header__search-input:focus-visible,
.gh-header__quick-link:focus-visible,
.gh-header__lang-option:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 2px;
}

.gh-header__link.is-active {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.24px;
}

.gh-header__link--featured.is-active img,
.gh-header__link--featured:hover img,
.gh-header__link--featured:focus-visible img {
    transform: translateY(1px) rotate(180deg);
}

.gh-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 250px;
    flex-shrink: 0;
}

.gh-header__action,
.gh-header__lang-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--gh-header-text);
    cursor: pointer;
    transition: background-color var(--gh-header-transition), transform var(--gh-header-transition), opacity var(--gh-header-transition);
}

.gh-header__action {
    width: 36px;
    height: 36px;
}

.gh-header__action img {
    width: 18px;
    height: 18px;
}

.gh-header__action:hover,
.gh-header__lang-trigger:hover,
.gh-header__action.is-open,
.gh-header__lang-trigger.is-open {
    background: rgba(255, 255, 255, 0.1);
}

.gh-header__lang {
    position: relative;
}

.gh-header__lang-trigger {
    gap: 6px;
    min-width: 72px;
    min-height: 32px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
}

.gh-header__lang-trigger img {
    width: 16px;
    height: 16px;
}

.gh-header__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
}

.gh-header__toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 3px auto;
    border-radius: 999px;
    background: var(--gh-header-text);
    transition: transform var(--gh-header-transition), opacity var(--gh-header-transition);
}

.gh-header__toggle.is-open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.gh-header__toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.gh-header__toggle.is-open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.gh-header__search-panel,
.gh-header__lang-panel {
    position: absolute;
    background: var(--gh-header-panel-bg);
    border: 1px solid var(--gh-header-panel-border);
    box-shadow: var(--gh-header-panel-shadow);
}

.gh-header__search-panel {
    top: calc(100% + 12px);
    right: 32px;
    width: min(520px, calc(100% - 64px));
    border-radius: 20px;
}

.gh-header__search-shell {
    padding: 20px;
}

.gh-header__search-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gh-header__search-title {
    color: var(--gh-header-panel-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.gh-header__search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 12px 0 14px;
    border: 1px solid rgba(0, 77, 122, 0.12);
    border-radius: 16px;
    background: #f7fbfe;
}

.gh-header__search-field img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.gh-header__search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--gh-header-panel-text);
    font-size: 14px;
    line-height: 20px;
}

.gh-header__search-input::placeholder {
    color: #8091a4;
}

.gh-header__search-submit {
    min-width: 72px;
    height: 38px;
    border-radius: 12px;
    background: var(--gh-header-bg);
    color: #ffffff;
    cursor: pointer;
    transition: opacity var(--gh-header-transition), transform var(--gh-header-transition);
}

.gh-header__search-submit:hover {
    opacity: 0.92;
}

.gh-header__search-status {
    color: var(--gh-header-panel-muted);
    font-size: 12px;
    line-height: 18px;
}

.gh-header__quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.gh-header__quick-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 14px;
    border-radius: 999px;
    background: #eef7fd;
    color: #0f5780;
    font-size: 12px;
    line-height: 16px;
    transition: background-color var(--gh-header-transition), color var(--gh-header-transition);
}

.gh-header__quick-link:hover {
    background: #dff0fb;
}

.gh-header__lang-panel {
    top: calc(100% + 12px);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
    padding: 8px;
    border-radius: 16px;
}

.gh-header__lang-option {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--gh-header-panel-text);
    text-align: left;
    cursor: pointer;
    transition: background-color var(--gh-header-transition), color var(--gh-header-transition);
}

.gh-header__lang-option:hover,
.gh-header__lang-option.is-active {
    background: #eef7fd;
    color: #0a648e;
}

@media (max-width: 1200px) {
    .gh-header__inner {
        gap: 16px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .gh-header__actions {
        min-width: auto;
    }

    .gh-header__nav {
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .gh-header__nav::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 968px) {
    .gh-header__inner {
        min-height: 72px;
        padding: 12px 24px;
        gap: 12px;
    }

    .gh-header__brand,
    .gh-header__brand-image {
        width: auto;
        min-width: 0;
    }

    .gh-header__brand-image {
        height: 40px;
    }

    .gh-header__actions {
        gap: 8px;
        margin-left: auto;
    }

    .gh-header__toggle {
        display: inline-flex;
        flex-direction: column;
    }

    .gh-header__nav {
        position: absolute;
        top: calc(100% + 8px);
        left: 24px;
        right: 24px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 14px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(0, 82, 130, 0.08);
        box-shadow: 0 18px 42px rgba(0, 73, 117, 0.14);
        overflow: visible;
    }

    .gh-header__nav.is-open {
        display: flex;
    }

    .gh-header__link,
    .gh-header__link.is-active {
        justify-content: space-between;
        min-height: 44px;
        padding: 12px 14px;
        border-radius: 12px;
        color: #23405d;
        font-size: 14px;
        font-weight: 500;
        line-height: 20px;
        letter-spacing: 0;
    }

    .gh-header__link:hover,
    .gh-header__link:focus-visible,
    .gh-header__link.is-active {
        background: rgba(0, 146, 216, 0.08);
        color: #0a648e;
    }

    .gh-header__link img {
        filter: brightness(0) saturate(100%) invert(29%) sepia(84%) saturate(1695%) hue-rotate(171deg) brightness(97%) contrast(92%);
    }

    .gh-header__lang-trigger span {
        display: none;
    }

    .gh-header__lang-trigger {
        min-width: 36px;
        padding: 8px;
    }

    .gh-header__search-panel {
        right: 24px;
        left: 24px;
        width: auto;
    }
}

@media (max-width: 750px) {
    .gh-header__inner {
        min-height: 68px;
        padding: 12px 16px;
    }

    .gh-header__brand-image {
        height: 36px;
    }

    .gh-header__nav {
        left: 16px;
        right: 16px;
    }

    .gh-header__search-panel {
        left: 16px;
        right: 16px;
    }

    .gh-header__search-shell {
        padding: 16px;
    }

    .gh-header__search-field {
        flex-wrap: wrap;
        padding: 12px;
    }

    .gh-header__search-submit {
        width: 100%;
    }
}