/* ==========================================================================
   HT-社区主题 搜索样式（AJAX 实时搜索、搜索建议下拉）
   ========================================================================== */

/* ---------- 头部搜索图标 ---------- */
.ht-search-trigger {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    margin-right: 4px;
}
.ht-search-trigger:hover { background: rgba(255,255,255,.12); }

/* ---------- 搜索浮层 ---------- */
.ht-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,.5);
    z-index: 9998;
    display: none;
    padding: 80px 20px 0;
}
.ht-search-overlay.active { display: block; }
.ht-search-box {
    max-width: 640px;
    margin: 0 auto;
    background: var(--ht-bg-card);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    overflow: hidden;
}
.ht-search-input-wrap {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ht-border);
}
.ht-search-icon { font-size: 20px; color: var(--ht-text-muted); margin-right: 12px; }
.ht-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: var(--ht-text);
}
.ht-search-input::placeholder { color: var(--ht-text-muted); }
.ht-search-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--ht-text-muted);
    cursor: pointer;
    padding: 4px 8px;
}
.ht-search-close:hover { color: var(--ht-text); }

/* ---------- 搜索建议下拉 ---------- */
.ht-search-suggestions {
    max-height: 400px;
    overflow-y: auto;
}
.ht-search-group-title {
    padding: 10px 20px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ht-text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.ht-search-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    color: inherit;
}
.ht-search-item:hover { background: var(--ht-bg-hover, #f5f7fa); }
.ht-search-item-type {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
}
.ht-search-item-type.type-文章 { background: #e8f0fe; color: #1a73e8; }
.ht-search-item-type.type-帖子 { background: #f3e8fe; color: #7c3aed; }
.ht-search-item-type.type-圈子 { background: #e6f7ed; color: #2b8a52; }
.ht-search-item-body { flex: 1; min-width: 0; }
.ht-search-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 3px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ht-search-item-excerpt {
    font-size: 12px;
    color: var(--ht-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ht-search-item-views {
    font-size: 11px;
    color: var(--ht-text-muted);
    flex-shrink: 0;
    margin-top: 4px;
}
.ht-search-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--ht-text-muted);
    font-size: 14px;
}
.ht-search-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--ht-border);
    text-align: center;
}
.ht-search-footer a {
    color: var(--ht-primary);
    font-size: 13px;
    font-weight: 500;
}

/* ---------- 搜索结果页 ---------- */
.ht-search-result-item {
    background: var(--ht-bg-card);
    border-radius: var(--ht-radius);
    box-shadow: var(--ht-shadow);
    padding: 18px 22px;
    margin-bottom: 14px;
    transition: box-shadow .2s;
}
.ht-search-result-item:hover { box-shadow: 0 4px 16px rgba(20,30,60,.1); }
.ht-search-result-title {
    font-size: 17px;
    margin: 0 0 8px;
}
.ht-search-result-title a { color: var(--ht-text); }
.ht-search-result-title a:hover { color: var(--ht-primary); }
.ht-search-result-excerpt {
    font-size: 14px;
    color: var(--ht-text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}
.ht-search-result-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--ht-text-muted);
}
.ht-search-highlight {
    background: #fff3cd;
    color: #856404;
    padding: 0 2px;
    border-radius: 2px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .ht-search-overlay { padding-top: 60px; }
    .ht-search-box { border-radius: 10px; }
    .ht-search-input-wrap { padding: 12px 16px; }
    .ht-search-item { padding: 10px 16px; }
}
