/* 批次二百七十：全站搜索
 *
 * 两块：① 导航栏 / 搜索页共用的即时联想下拉（.ns-*）
 *       ② 搜索结果页版式（.ssearch-*）
 * 配色沿用站点既有紫系（#3d29a4 / #f4f2fc / #e3dff0），不引入新色。
 */

/* ============================================================
   ① 即时联想下拉
   容器动态插在输入框的 form 里。导航栏的 .rd-search 本身是 absolute 定位元素，
   子元素用 absolute 就以它为基准 —— 千万不要给 .rd-search 加 position:relative，
   那会把导航栏搜索框从右上角拽回文档流。
   ============================================================ */
.ns-sug {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1200;
    max-height: 424px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid #e3dff0;
    border-radius: 12px;
    box-shadow: 0 20px 44px -14px rgba(38, 28, 82, .22);
    -webkit-overflow-scrolling: touch;
}

.ns-sug[hidden] {
    display: none;
}

.ns-gh {
    padding: 9px 12px 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .06em;
    color: #9a94a8;
}

.ns-row {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
}

.ns-row:last-of-type {
    margin-bottom: 2px;
}

.ns-row:hover,
.ns-row.is-on {
    background: #f4f2fc;
    text-decoration: none;
}

.ns-row b {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: #2b2440;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ns-row i {
    display: block;
    margin-top: 1px;
    font-style: normal;
    font-size: 12px;
    line-height: 1.5;
    color: #8b8798;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ns-sug mark {
    padding: 0 1px;
    background: #efe9ff;
    color: #3d29a4;
    border-radius: 2px;
}

.ns-all {
    display: block;
    margin-top: 4px;
    padding: 9px 12px;
    border-top: 1px solid #f0edf8;
    border-radius: 0 0 8px 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #3d29a4;
    text-decoration: none;
}

.ns-all:hover,
.ns-all.is-on {
    background: #f4f2fc;
    text-decoration: none;
}

.ns-hint {
    padding: 12px;
}

.ns-hint b {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #2b2440;
}

.ns-hint i {
    display: block;
    margin-top: 3px;
    font-style: normal;
    font-size: 12px;
    line-height: 1.5;
    color: #8b8798;
}

.ns-empty {
    padding: 14px 12px 10px;
    font-size: 13px;
    line-height: 1.6;
    color: #6b6580;
}

.ns-empty span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #9a94a8;
}

/* 新闻页侧栏的搜索框（.rd-search-modern）改成全站搜索后，
   它的下拉需要一个定位基准。绝不能给 .rd-search 统一加 relative ——
   导航栏那个 .rd-search 本身是 absolute，一改就把它从右上角拽回文档流。 */
.rd-search-modern {
    position: relative;
}

/* ============================================================
   ② 搜索结果页
   ============================================================ */
.ssearch-hero {
    padding: 52px 0 34px;
    background: linear-gradient(180deg, #f8f7ff 0%, #fff 100%);
    border-bottom: 1px solid #f0edf8;
}

.ssearch-h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    color: #1f1a30;
}

.ssearch-sub {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: #6b6580;
}

.ssearch-sub b {
    color: #3d29a4;
    font-weight: 600;
}

.ssearch-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 640px;
    margin: 22px 0 0;
    padding: 5px 5px 5px 20px;
    background: #fff;
    border: 1px solid #e3dff0;
    border-radius: 999px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.ssearch-form:focus-within {
    border-color: #b9aee6;
    box-shadow: 0 0 0 4px rgba(61, 41, 164, .07);
}

.ssearch-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;
    line-height: 44px;
    color: #2b2440;
}

.ssearch-input::placeholder {
    color: #9a94a8;
}

.ssearch-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #3d29a4;
    color: #fff;
    cursor: pointer;
    transition: background .16s ease;
}

.ssearch-btn:hover {
    background: #2f1d84;
}

.ssearch-btn svg {
    display: block;
    width: 18px;
    height: 18px;
}

.ssearch-body {
    padding: 40px 0 76px;
}

.ssearch-group + .ssearch-group {
    margin-top: 42px;
}

.ssearch-gh {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eae7f4;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #2b2440;
}

.ssearch-gh em {
    font-style: normal;
    font-size: 12px;
    font-weight: 400;
    color: #9a94a8;
}

.ssearch-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ssearch-list li + li {
    border-top: 1px solid #eeeafa;
}

.ssearch-item {
    display: block;
    padding: 15px 12px;
    border-radius: 8px;
    text-decoration: none;
}

.ssearch-item:hover,
.ssearch-item:focus {
    background: #faf9ff;
    text-decoration: none;
}

.ssearch-item b {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: #2b2440;
}

.ssearch-item:hover b {
    color: #3d29a4;
}

.ssearch-item span {
    display: inline-block;
    margin-top: 7px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f4f2fc;
    font-size: 12px;
    line-height: 1.6;
    color: #6b6580;
}

.ssearch-item i {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 8px;
    font-style: normal;
    font-size: 14px;
    line-height: 1.7;
    color: #6b6580;
}

.ssearch-empty {
    padding: 40px 0 8px;
    text-align: center;
}

.ssearch-empty h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    color: #2b2440;
}

.ssearch-empty p {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: #6b6580;
}

.ssearch-more {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 22px;
}

.ssearch-more a {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid #e3dff0;
    border-radius: 999px;
    font-size: 14px;
    line-height: 1.4;
    color: #3d29a4;
    text-decoration: none;
    transition: background .16s ease, border-color .16s ease;
}

.ssearch-more a:hover {
    background: #f4f2fc;
    border-color: #cfc6ee;
    text-decoration: none;
}

@media (max-width: 767px) {
    .ssearch-hero {
        padding: 34px 0 24px;
    }

    .ssearch-h1 {
        font-size: 24px;
    }

    .ssearch-form {
        margin-top: 16px;
        padding-left: 16px;
    }

    .ssearch-body {
        padding: 28px 0 56px;
    }

    .ns-sug {
        max-height: 62vh;
    }

    .ns-row b {
        font-size: 13px;
    }
}
