/* 搜索页顶栏 */
.search-top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.search-back {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #475569;
    text-decoration: none;
    transition: background 0.2s ease;
}

.search-back:active {
    background: #f1f5f9;
}

.search-back .iconify {
    font-size: 24px;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 7px 14px;
    transition: border-color 0.2s ease;
}

.search-box:focus-within {
    border-color: #2563eb;
    background: #fff;
}

.search-box-icon {
    font-size: 18px;
    color: #94a3b8;
    flex-shrink: 0;
}

.search-box-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #1f2937;
    font-size: 14px;
}

.search-box-input::placeholder {
    color: #9aa3b2;
}

.search-go {
    flex-shrink: 0;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 999px;
    padding: 7px 18px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-go:active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* 无关键词空态 */
.search-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px;
    gap: 14px;
    color: #94a3b8;
    text-align: center;
}

.search-empty-icon {
    font-size: 64px;
    color: #cbd5e1;
}

.search-empty-state p {
    font-size: 14px;
    color: #94a3b8;
}

/* 搜索记录 */
.search-history {
    padding: 4px 16px 24px;
}

.search-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    margin-bottom: 4px;
}

.search-history-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.search-history-clear {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
}

.search-history-clear:active {
    color: #64748b;
}

.search-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-history-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 5px 12px;
    color: #475569;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.search-history-item:hover {
    border-color: rgba(37, 99, 235, 0.4);
    color: #2563eb;
}

.search-history-icon {
    font-size: 15px;
    color: #94a3b8;
}

/* 搜索页内容区与顶栏间距 */
.search-page {
    padding: 16px 0;
}

.search-count {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 0;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #eef1f6;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.search-item:hover .result-title {
    color: #2563eb;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item-link {
    display: flex;
    gap: 16px;
    text-decoration: none;
    color: inherit;
}

.result-footer {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
}

.result-stats {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 6px;
}

.result-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 999px;
    padding: 6px 18px;
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.result-read-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.result-cover {
    width: 110px;
    min-height: 154px;
    height: auto;
    align-self: stretch;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f1f5f9 url('/assets/images/default_cover.png') center/cover no-repeat;
}

.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.result-title {
    font-size: 17px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* 搜索关键词高亮（XS 自带 / 本地高亮统一样式） */
.result-title em.search-hl,
.result-desc em.search-hl,
.result-author em.search-hl {
    font-style: normal;
    font-weight: 700;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    border-radius: 3px;
    padding: 0 2px;
}

.result-author {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 6px;
}

.result-desc {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.no-results {
    text-align: center;
    padding: 60px 0;
    color: #94a3b8;
    font-size: 16px;
}

.no-results-sub {
    color: #94a3b8;
    font-size: 14px;
    margin-top: 8px;
}
