/* ============================================================
   茶室 - 搜索页样式
   ============================================================ */

.search-page {
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 40px;
}

/* ============================================================
   搜索头部
   ============================================================ */
.search-header {
    padding: 20px 0 24px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.search-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-header h1 i {
    color: var(--accent);
    font-size: 20px;
}

.search-form {
    position: relative;
    display: flex;
    gap: 10px;
}

.search-input-wrap {
    position: relative;
    flex: 1;
}

.search-input-wrap .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 44px 12px 46px;
    background: rgba(11, 15, 20, 0.6);
    border: 1px solid var(--border-light);
    border-radius: 26px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    background: rgba(11, 15, 20, 0.85);
    box-shadow: 0 0 0 4px rgba(232, 164, 55, 0.12);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    text-decoration: none;
    transition: var(--transition);
}

.search-clear:hover {
    background: var(--danger);
    color: #fff;
}

.search-submit {
    padding: 0 28px;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #1a1a1a;
    border: none;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(232, 164, 55, 0.3);
    white-space: nowrap;
}

.search-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 6px 20px rgba(232, 164, 55, 0.4);
}

/* ============================================================
   Tab
   ============================================================ */
.search-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.search-tabs::-webkit-scrollbar {
    display: none;
}

.search-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-tab:hover {
    background: rgba(232, 164, 55, 0.06);
    color: var(--text-primary);
}

.search-tab.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #1a1a1a;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(232, 164, 55, 0.25);
}

.search-tab .count {
    font-size: 11px;
    padding: 0 7px;
    height: 17px;
    line-height: 17px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.10);
    font-variant-numeric: tabular-nums;
    color: inherit;
}

.search-tab.active .count {
    background: rgba(0, 0, 0, 0.15);
}

/* ============================================================
   结果概述
   ============================================================ */
.search-summary {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.search-summary strong {
    color: var(--accent-bright);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin: 0 2px;
}

/* ============================================================
   帖子结果
   ============================================================ */
.search-section {
    margin-bottom: 28px;
}

.search-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.search-section-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.search-section-header h2 i {
    color: var(--accent);
    font-size: 13px;
}

.search-section-more {
    font-size: 12.5px;
    color: var(--text-muted);
    transition: var(--transition);
}

.search-section-more:hover {
    color: var(--accent-bright);
}

.search-post-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-post-list .post-card {
    padding: 14px 18px;
}

/* 命中关键词加亮 */
mark {
    background: rgba(232, 164, 55, 0.25);
    color: var(--accent-bright);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 500;
}

/* ============================================================
   话题结果
   ============================================================ */
.search-topic-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topic-result {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.topic-result:hover {
    background: var(--bg-card-hover);
    border-color: rgba(232, 164, 55, 0.35);
}

.topic-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(232, 164, 55, 0.10);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.topic-result-body {
    flex: 1;
    min-width: 0;
}

.topic-result-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.topic-result-title .hash {
    color: var(--accent);
    opacity: 0.8;
}

.topic-result-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.topic-result-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.topic-result-meta .item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   用户结果
   ============================================================ */
.search-user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.user-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.user-result:hover {
    background: var(--bg-card-hover);
    border-color: rgba(232, 164, 55, 0.35);
    transform: translateY(-1px);
}

.user-result-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.user-result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-result-body {
    flex: 1;
    min-width: 0;
}

.user-result-nick {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.user-result-sig {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   空状态
   ============================================================ */

/* ★ 修复：只用直接子元素选择器，避免污染按钮里的图标 */
.search-empty > i {
    font-size: 44px;
    color: var(--accent);
    opacity: 0.25;
    margin-bottom: 16px;
    display: block;
}

.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.search-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.search-empty p {
    font-size: 13.5px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.search-empty-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------
   空状态按钮（自包含，不依赖全局 .btn）
   防止将来任何 .search-empty i 之类的选择器误伤
   ------------------------------------------------------------ */
.search-empty-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

/* 明确覆盖：按钮内图标保持行内、正常大小、不透明 */
.search-empty-actions .btn i {
    font-size: 13px;
    opacity: 1;
    display: inline-block;
    margin: 0;
    color: inherit;
}

.search-empty-actions .btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(232, 164, 55, 0.3);
}

.search-empty-actions .btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 6px 20px rgba(232, 164, 55, 0.4);
}

.search-empty-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.search-empty-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(232, 164, 55, 0.35);
    color: var(--accent-bright);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
    .search-header h1 {
        font-size: 20px;
    }
    .search-input {
        font-size: 14px;
        padding: 10px 40px 10px 42px;
    }
    .search-submit {
        padding: 0 20px;
        font-size: 13.5px;
    }
    .search-user-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .search-form {
        flex-direction: column;
    }
    .search-submit {
        width: 100%;
        padding: 12px 20px;
    }
    .search-tabs {
        padding: 3px;
    }
    .search-tab {
        padding: 7px 12px;
        font-size: 12.5px;
    }
    .search-tab .count {
        display: none;
    }
}