/* ==========================================================
   站内搜索
   页面：search.html / search_result.html
   风格与新闻频道页保持一致（宋体 / 深棕主色 / 轻边框）
========================================================== */

.search-page,
.search-page * {
    box-sizing: border-box;
}

.search-page {
    width: 100%;

    background: #ffffff;
}

/* ==========================================================
   顶部搜索区
========================================================== */

.search-hero {
    position: relative;

    padding: 68px 20px 56px;

    overflow: hidden;

    background: #faf7f6;
}

.search-hero::before {
    content: "";

    position: absolute;

    top: -140px;
    right: -120px;

    width: 420px;
    height: 420px;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(246, 240, 236, .95) 0%,
        rgba(250, 247, 246, 0) 70%
    );

    pointer-events: none;
}

/* 使用栏目图片作为 Banner：只展示图片，不叠加任何文字 */

.search-hero--banner {
    min-height: 460px;

    padding: 0;

    background: #2b191a;
}

.search-hero--banner::before {
    display: none;
}

.search-hero--compact.search-hero--banner {
    min-height: 320px;

    padding: 0;
}

.search-hero-media {
    position: absolute;
    z-index: 0;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

/* 仅屏幕阅读器可见（保留页面语义标题） */
.search-sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    margin: -1px;
    padding: 0;

    overflow: hidden;

    border: 0;

    clip: rect(0 0 0 0);

    white-space: nowrap;
}

.search-hero--compact {
    padding: 48px 20px 42px;
}

/* ==========================================================
   Banner 下方的搜索条
========================================================== */

.search-bar {
    width: 100%;

    border-bottom: 1px solid #f0e6e1;

    background: #faf7f6;
}

.search-bar-inner {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;

    padding: 28px 20px 24px;
}

.search-bar .search-form {
    max-width: none;

    margin-top: 0;
}

.search-bar .search-hot {
    margin-top: 16px;
}

.search-hero-inner {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 1200px;

    margin: 0 auto;
}

.search-hero-label {
    color: #b7a5a2;

    font-size: 12px;

    letter-spacing: .26em;

    text-transform: uppercase;
}

.search-hero-title {
    margin: 12px 0 0;

    color: #2b191a;

    font-size: 36px;
    font-weight: 600;

    line-height: 1.4;
}

.search-hero--compact .search-hero-title {
    margin-top: 8px;

    font-size: 26px;
}

.search-hero-desc {
    margin: 12px 0 0;

    color: #8a7472;

    font-size: 15px;

    line-height: 1.8;
}

/* 搜索表单 */

.search-form {
    display: flex;
    flex-wrap: wrap;

    gap: 12px;

    max-width: 860px;

    margin-top: 28px;
}

.search-hero--compact .search-form {
    margin-top: 22px;
}

.search-form-field {
    display: flex;

    flex: 1 1 320px;

    height: 54px;

    padding: 0 20px;

    align-items: center;

    border: 1px solid #e8dcd8;
    border-radius: 999px;

    background: #ffffff;

    transition: border-color .2s ease, box-shadow .2s ease;
}

.search-form-field:focus-within {
    border-color: #331d1e;

    box-shadow: 0 0 0 4px rgba(51, 29, 30, .06);
}

.search-form-icon {
    flex: 0 0 auto;

    width: 18px;
    height: 18px;

    margin-right: 10px;

    color: #b7a5a2;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.search-form-input {
    flex: 1 1 auto;

    width: 100%;
    height: 100%;

    min-width: 0;

    border: 0;

    background: transparent;

    color: #3f2d2c;

    font-size: 15px;

    outline: none;
}

.search-form-input::placeholder {
    color: #b7a5a2;
}

.search-form-input::-webkit-search-cancel-button {
    -webkit-appearance: none;

    appearance: none;
}

.search-form-select {
    flex: 0 0 auto;

    height: 54px;

    padding: 0 44px 0 22px;

    border: 1px solid #e8dcd8;
    border-radius: 999px;

    background-color: #ffffff;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%239c8683' stroke-width='1.4' stroke-linecap='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
    background-position: right 20px center;
    background-repeat: no-repeat;

    color: #6b5553;

    font-family: inherit;
    font-size: 14px;

    cursor: pointer;

    -webkit-appearance: none;
    appearance: none;
}

.search-form-select:focus {
    border-color: #331d1e;

    outline: none;
}

.search-form-submit {
    flex: 0 0 auto;

    height: 54px;

    padding: 0 36px;

    border: 0;
    border-radius: 999px;

    background: #331d1e;

    color: #ffffff;

    font-family: inherit;
    font-size: 15px;

    letter-spacing: .08em;

    cursor: pointer;

    transition: background .2s ease, transform .2s ease;
}

.search-form-submit:hover {
    background: #4a2b2c;
}

.search-form-submit:active {
    transform: translateY(1px);
}

/* 热门搜索 */

.search-hot {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 24px;

    align-items: center;

    color: #9c8683;

    font-size: 13px;
}

.search-hot-label {
    margin-right: 2px;

    color: #8a7472;
}

.search-hot-tag {
    padding: 5px 15px;

    border: 1px solid #ece0db;
    border-radius: 999px;

    background: #ffffff;

    color: #6b5553;

    font-size: 13px;

    line-height: 1.6;

    text-decoration: none;

    transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.search-hot-tag:hover {
    border-color: #d8c8c3;

    background: #faf7f6;

    color: #331d1e;
}

/* ==========================================================
   结果区
========================================================== */

.search-container {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;

    padding: 26px 20px 56px;
}

.search-main {
    width: 100%;

    min-width: 0;
}

/* 结果统计 */

.search-summary {
    display: flex;
    flex-wrap: wrap;

    gap: 8px 16px;

    margin-top: 0;

    align-items: baseline;
    justify-content: space-between;
}

.search-summary-title {
    margin: 0;

    color: #3f2d2c;

    font-size: 16px;
    font-weight: 500;

    line-height: 1.7;
}

.search-summary-title em {
    color: #a8342a;

    font-style: normal;
}

.search-summary-time {
    color: #b7a5a2;

    font-size: 12px;
}

/* 筛选项 */

.search-filters {
    display: flex;
    flex-direction: column;

    gap: 12px;

    margin-top: 20px;
}

.search-filter-group {
    display: flex;
    flex-wrap: wrap;

    gap: 8px 12px;

    align-items: center;
}

.search-filter-label {
    flex: 0 0 auto;

    color: #9c8683;

    font-size: 13px;
}

.search-filter-options {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.search-filter-option {
    display: inline-flex;
}

.search-filter-option a {
    display: inline-flex;

    padding: 5px 15px;

    align-items: center;

    border: 1px solid transparent;
    border-radius: 999px;

    background: #faf7f6;

    color: #6b5553;

    font-size: 13px;

    line-height: 1.7;

    text-decoration: none;

    transition: color .18s ease, background .18s ease;
}

.search-filter-option a:hover {
    background: #f2e9e5;

    color: #331d1e;
}

.search-filter-option a.is-active {
    background: #331d1e;

    color: #ffffff;
}

/* 结果列表 */

.search-list {
    margin: 8px 0 0;
    padding: 0;

    list-style: none;
}

.search-row {
    position: relative;

    display: grid;

    grid-template-columns: 208px minmax(0, 1fr);

    gap: 26px;

    padding: 26px 0;
}

.search-row.is-row-clickable {
    cursor: pointer;
}

.search-row:not(:last-child)::after {
    content: "";

    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;

    height: 1px;

    background: #f5ece8;
}

.search-row-thumb {
    display: flex;

    overflow: hidden;

    width: 100%;

    aspect-ratio: 4 / 3;

    align-items: center;
    justify-content: center;

    border-radius: 6px;

    background: #f6f0ec;

    text-decoration: none;
}

.search-row-thumb img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .3s ease;
}

.search-row:hover .search-row-thumb img {
    transform: scale(1.03);
}

.search-row-thumb-mark {
    color: #c8b4ae;

    font-size: 26px;

    letter-spacing: .1em;
}

.search-row-info {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.search-row-title {
    margin: 0;

    color: #3f2d2c;

    font-size: 19px;
    font-weight: 500;

    line-height: 1.6;
}

.search-row-title a {
    display: block;

    overflow: hidden;

    color: inherit;

    text-decoration: none;

    transition: color .18s ease;
}

.search-row-title a:hover {
    color: #a8342a;
}

/* 关键词高亮（兼容 cms_highlightKeyword 输出的行内样式） */
.search-row-title span[style],
.search-row-desc span[style] {
    color: #a8342a !important;

    font-weight: 600;
}

.search-row-desc {
    display: -webkit-box;

    overflow: hidden;

    margin: 10px 0 0;

    color: #8a7472;

    font-size: 14px;

    line-height: 1.85;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.search-row-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: auto;
    padding-top: 14px;

    align-items: center;

    color: #b7a5a2;

    font-size: 12.5px;
}

.search-meta-dot {
    width: 3px;
    height: 3px;

    border-radius: 50%;

    background: #d8c8c3;
}

.search-row-cat {
    padding: 2px 10px;

    border-radius: 2px;

    background: #faf7f6;

    color: #8a7472;
}

/* 空状态 */

.search-empty {
    padding: 90px 20px;

    text-align: center;
}

.search-empty-icon {
    display: inline-flex;

    width: 64px;
    height: 64px;

    margin-bottom: 18px;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #faf7f6;

    color: #c8b4ae;

    font-size: 26px;
}

.search-empty-icon svg {
    width: 26px;
    height: 26px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.search-empty-title {
    margin: 0;

    color: #3f2d2c;

    font-size: 17px;
    font-weight: 500;
}

.search-empty-desc {
    margin: 10px 0 0;

    color: #9c8683;

    font-size: 13.5px;

    line-height: 1.8;
}

.search-empty-desc a {
    color: #331d1e;

    text-decoration: underline;

    text-underline-offset: 3px;
}

/* 分页（与新闻列表页 .cms-pager 同一套样式） */

.search-pagination {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;

    gap: 24px;

    margin-top: 34px;
}

/* 条数统计 */
.search-pagination .cms-pager-summary {
    flex: 0 0 auto;

    color: #8a7472;

    font-size: 13px;

    line-height: 1;

    white-space: nowrap;
}

.search-pagination .cms-pager-summary em {
    margin: 0 1px;

    color: #331d1e;

    font-style: normal;
    font-weight: 600;
}

/* 页码 + 跳转 */
.search-pagination .cms-pager-main {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;

    gap: 26px;

    margin: 0;
}

.search-pagination .cms-pager-list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;

    gap: 2px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.search-pagination .cms-pager-btn,
.search-pagination .cms-pager-num {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 34px;
    height: 34px;

    padding: 0 8px;

    border: 0;
    border-radius: 0;

    background: none;

    color: #8a7472;

    font-size: 13px;

    line-height: 1;

    text-decoration: none;

    transition: color .18s ease;
}

/* 页码下划指示线 */
.search-pagination .cms-pager-num::after {
    content: "";

    position: absolute;
    left: 50%;
    bottom: 5px;

    width: 14px;
    height: 1px;

    background: currentColor;

    opacity: 0;

    transform: translateX(-50%) scaleX(0);
    transform-origin: center;

    transition:
        opacity .2s ease,
        transform .2s ease;
}

.search-pagination a.cms-pager-btn:hover,
.search-pagination a.cms-pager-num:hover {
    color: #331d1e;
}

.search-pagination a.cms-pager-num:hover::after {
    opacity: 1;

    transform: translateX(-50%) scaleX(1);
}

.search-pagination .cms-pager-num.is-current {
    color: #331d1e;

    font-weight: 600;

    cursor: default;
}

.search-pagination .cms-pager-num.is-current::after {
    opacity: 1;

    transform: translateX(-50%) scaleX(1);
}

.search-pagination .cms-pager-btn {
    padding: 0 10px;

    gap: 6px;
}

.search-pagination .cms-pager-prev::before,
.search-pagination .cms-pager-next::after {
    content: "";

    width: 6px;
    height: 6px;

    border-bottom: 1px solid currentColor;
}

.search-pagination .cms-pager-prev::before {
    border-left: 1px solid currentColor;

    transform: rotate(45deg);
}

.search-pagination .cms-pager-next::after {
    border-right: 1px solid currentColor;

    transform: rotate(-45deg);
}

.search-pagination .cms-pager-btn.is-disabled {
    color: #cfc1bd;

    cursor: not-allowed;
}

.search-pagination .cms-pager-gap {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 24px;
    height: 34px;

    color: #c4b3af;

    font-size: 12px;
}

/* 页码跳转 */
.search-pagination .cms-pager-jump {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    margin: 0;

    color: #8a7472;

    font-size: 13px;
}

.search-pagination .cms-pager-input {
    width: 38px;
    height: 24px;

    padding: 0;

    border: 0;
    border-bottom: 1px solid #ddcfca;
    border-radius: 0;

    background: none;

    color: #5c4645;

    font-size: 12px;

    line-height: 24px;

    text-align: center;

    vertical-align: middle;

    transition: border-color .18s ease;
}

.search-pagination .cms-pager-input:focus {
    border-bottom-color: #331d1e;

    outline: none;
}

.search-pagination .cms-pager-input::placeholder {
    color: #c9b9b5;
}

.search-pagination .cms-pager-input::-webkit-outer-spin-button,
.search-pagination .cms-pager-input::-webkit-inner-spin-button {
    -webkit-appearance: none;

    margin: 0;
}

.search-pagination .cms-pager-goto {
    height: auto;

    padding: 0;

    border: 0;
    border-bottom: 1px solid currentColor;

    background: none;

    color: #6f5a57;

    font-size: 12px;

    line-height: 1.6;

    cursor: pointer;

    transition: color .18s ease;
}

.search-pagination .cms-pager-goto:hover {
    color: #331d1e;
}

/* ==========================================================
   响应式
========================================================== */

@media screen and (max-width: 768px) {
    .search-hero {
        padding: 46px 16px 40px;
    }

    .search-hero--compact {
        padding: 34px 16px 32px;
    }

    .search-hero--banner {
        min-height: 220px;

        padding: 0;
    }

    .search-hero--compact.search-hero--banner {
        min-height: 180px;

        padding: 0;
    }

    .search-bar-inner {
        padding: 20px 16px 18px;
    }

    .search-bar .search-form {
        margin-top: 0;
    }

    .search-hero-title {
        font-size: 27px;
    }

    .search-hero--compact .search-hero-title {
        font-size: 22px;
    }

    .search-hero-desc {
        font-size: 14px;
    }

    .search-form {
        gap: 10px;

        margin-top: 22px;
    }

    .search-form-field {
        flex: 1 1 100%;

        height: 48px;

        padding: 0 16px;
    }

    .search-form-select,
    .search-form-submit {
        height: 48px;
    }

    .search-form-select {
        flex: 1 1 auto;
    }

    .search-form-submit {
        flex: 1 1 120px;

        padding: 0 24px;
    }

    .search-container {
        padding: 20px 16px 44px;
    }

    .search-row {
        grid-template-columns: 132px minmax(0, 1fr);

        gap: 16px;

        padding: 20px 0;
    }

    .search-row-title {
        font-size: 16px;
    }

    .search-row-desc {
        margin-top: 8px;

        font-size: 13px;

        -webkit-line-clamp: 2;
    }

    .search-row-meta {
        gap: 8px;

        padding-top: 10px;

        font-size: 12px;
    }

    .search-empty {
        padding: 64px 12px;
    }

    .search-pagination {
        gap: 14px;

        margin-top: 26px;
    }

    .search-pagination .cms-pager-main {
        gap: 16px;

        margin: 0;
    }

    .search-pagination .cms-pager-btn,
    .search-pagination .cms-pager-num {
        min-width: 28px;
        height: 30px;

        padding: 0 5px;

        font-size: 12px;
    }

    .search-pagination .cms-pager-num::after {
        bottom: 3px;
    }

    .search-pagination .cms-pager-btn {
        padding: 0 6px;
    }

    .search-pagination .cms-pager-gap {
        min-width: 16px;
        height: 30px;
    }

    /* 窄屏隐藏条数统计，保证单行不散 */
    .search-pagination .cms-pager-summary {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .search-hero-title {
        font-size: 23px;
    }

    .search-row {
        grid-template-columns: 104px minmax(0, 1fr);

        gap: 14px;

        padding: 18px 0;
    }

    .search-row-thumb-mark {
        font-size: 20px;
    }

    .search-row-title {
        font-size: 15px;
    }

    .search-row-desc {
        -webkit-line-clamp: 2;
    }

    .search-summary-title {
        font-size: 14.5px;
    }
}
