/* 蓝湖 04 搜索浮层 / 05 搜索结果共用控件。 */
html { scrollbar-gutter: stable; }
html.search-is-open { overflow: hidden; }

.search-overlay {
    position: fixed;
    inset: 0;
    display: none;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 2rem var(--safe-area) calc(15dvh + 2rem);
    border: 0;
    color: #000;
    background: transparent;
    overflow: auto;
    overscroll-behavior: contain;
}
.search-overlay[open] { display: flex; align-items: center; justify-content: center; }
.search-overlay:focus { outline: none; }
.search-overlay::backdrop { background: rgb(0 0 0 / 70%); }
.search-dialog {
    position: relative;
    width: 100%;
    max-height: calc(85dvh - 4rem);
    padding: 1.875rem 2.1875rem 3.375rem;
    border-radius: 1.25rem;
    background: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.search-dialog__title { margin: 0 0 1rem; font-size: 1.375rem; font-weight: 600; line-height: 1.875rem; }
.search-dialog__close {
    position: absolute;
    top: .625rem;
    right: .625rem;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    color: #000;
    background: transparent;
}
.search-dialog__close .icon { width: 1.5rem; height: 1.5rem; stroke-width: 2.5; }
.search-overlay[data-search-state="opening"]::backdrop {
    transform-origin: top;
    animation: site-search-mask-down .3s ease-out both;
}
.search-overlay[data-search-state="opening"] .search-dialog {
    animation: site-search-form-in .5s ease-out .3s both;
}
@keyframes site-search-mask-down {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}
@keyframes site-search-form-in {
    from { opacity: 0; transform: translateY(1.5rem); }
    to { opacity: 1; transform: translateY(0); }
}

.search-field {
    display: flex;
    align-items: center;
    gap: .625rem;
    width: 100%;
    min-height: 3.75rem;
    padding: .5625rem 1.25rem .5625rem 1.5625rem;
    border: 1px solid #000;
    border-radius: .5rem;
    background: #f8f8f8;
}
.search-field:focus-within { border-color: #033491; box-shadow: 0 0 0 .125rem rgb(3 52 145 / 12%); }
.search-field__icon { flex: 0 0 1.125rem; width: 1.125rem; height: 1.125rem; color: #000; }
.search-field input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: none;
    color: #171717;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1.75rem;
    -webkit-appearance: none;
    appearance: none;
}
.search-field input::placeholder { color: #727272; opacity: 1; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field__actions { display: flex; flex: 0 0 auto; align-items: center; gap: 1rem; }
.search-field__clear {
    display: grid;
    flex: 0 0 2.75rem;
    place-items: center;
    width: 2.75rem;
    height: 2.5rem;
    margin-inline: -.8125rem;
    padding: 0;
    border: 0;
    color: #000;
    background: transparent;
}
.search-field__clear .icon { width: 1.125rem; height: 1.125rem; }
.search-field__divider { height: 1.75rem; border-left: 1px solid #d8d8d8; }
.search-field__submit {
    flex: 0 0 6.25rem;
    min-width: 6.25rem;
    min-height: 2.5rem;
    padding: .25rem 1rem;
    border: 0;
    border-radius: 1.25rem;
    color: #fff;
    background: #033491;
    font-size: 1.25rem;
    line-height: 1.75rem;
}
.search-field__submit:hover { background: #164dab; }

/* 搜索结果沿用内页头部和横幅，内容为 1200 基准通栏。 */
.search-page .site-header { background: rgb(3 52 145 / 80%); box-shadow: none; transition: none; }
.search-results { padding-block: 2.25rem; }
.search-results__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #f0f0f0;
}
.search-results__heading h1 { font-size: 1.375rem; font-weight: 600; line-height: 1.875rem; }
.search-results__heading .breadcrumbs { color: #171717; }
.search-results__list { display: grid; gap: 1.875rem; margin-top: 1.75rem; }
.search-result {
    display: block;
    min-height: 9.5rem;
    padding: 1.625rem 1.25rem 1.5625rem;
    background: #f0f3f9;
}
.search-result__title { color: #000; font-size: 1.125rem; font-weight: 600; line-height: 1.5625rem; overflow-wrap: anywhere; }
.search-result__excerpt {
    display: -webkit-box;
    overflow: hidden;
    max-height: 3.75rem;
    margin-top: 1rem;
    color: #727272;
    font-size: 1rem;
    line-height: 1.875rem;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.search-result mark { color: #f00; background: transparent; }
.search-result:hover .search-result__title { color: #033491; }
.search-results__empty { margin-top: 1.75rem; padding: 3rem 1.25rem; color: #727272; background: #f0f3f9; text-align: center; font-size: 1rem; }
.search-pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .375rem; margin-top: 1.875rem; }
.search-pagination a,
.search-pagination span { display: grid; place-items: center; min-width: 1.6875rem; min-height: 1.6875rem; padding: .25rem .4375rem; border: 1px solid #e3e3e3; border-radius: .1875rem; font-size: .8125rem; line-height: 1; }
.search-pagination a[aria-current="page"] { color: #fff; background: #3791dc; border-color: #3791dc; }
.search-pagination .icon { width: .875rem; height: .875rem; }

@media (max-width: 760px) {
    .search-results__heading { flex-wrap: wrap; gap: .5rem; }
    .search-results__heading .breadcrumbs { flex-basis: 100%; justify-content: flex-start; text-align: left; }
    .search-results__heading .breadcrumbs ol { justify-content: flex-start; text-align: left; }
    .search-results__list { gap: 1.25rem; }
}
@media (max-width: 600px) {
    .search-overlay { padding-block: 1rem calc(15dvh + 1rem); }
    .search-dialog { max-height: calc(85dvh - 2rem); padding: 1.5rem 1rem 2rem; }
    .search-dialog__title { padding-right: 2rem; font-size: 1.25rem; }
    .search-dialog__close { top: .5rem; right: .5rem; }
    .search-field { gap: .5rem; padding: .4375rem .5rem .4375rem .75rem; }
    .search-field input { font-size: 1rem; line-height: 1.5rem; }
    .search-field__actions { gap: .5rem; }
    .search-field__clear { height: 2.75rem; }
    .search-field__divider { height: 1.5rem; }
    .search-field__submit { flex-basis: 4rem; min-width: 4rem; min-height: 2.75rem; padding-inline: .5rem; font-size: 1rem; }
    .search-results { padding-block: 1.5rem 2rem; }
    .search-results__heading { margin-top: 1.75rem; }
    .search-result { min-height: 0; padding: 1.25rem 1rem; }
    .search-result__title { font-size: 1.0625rem; line-height: 1.625rem; }
    .search-result__excerpt { margin-top: .75rem; max-height: 3.5rem; line-height: 1.75rem; }
    .search-pagination a, .search-pagination span { min-width: 2rem; min-height: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .search-overlay::backdrop, .search-dialog { animation: none !important; }
}
