/* 搜索优化样式 */

/* 搜索结果高亮 */
.search-highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
}

/* 搜索结果列表 */
.search-result-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 20px;
}

/* 搜索结果项 - 新布局 */
.search-result-item {
    display: block;
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid #f0f0f0;
}

.search-result-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #e0e0e0;
}

/* 搜索结果内容区 */
.search-result-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 搜索结果标题 */
.search-result-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-title span {
    color: inherit;
}

/* 搜索结果摘要 */
.search-result-snippet {
    display: none;
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 搜索结果元信息 */
.search-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.search-result-date {
    font-size: 12px;
    color: #999;
}

/* 搜索框容器 */
.navbar-search-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
}

/* 搜索触发按钮（放大镜图标） */
.search-trigger {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #666;
    font-size: 14px;
    background: transparent;
}

.search-trigger:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* 搜索面板（展开后的搜索框） */
.search-panel {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.search-panel.active {
    width: 300px;
    opacity: 1;
    visibility: visible;
}

/* 搜索输入框包装器 */
.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    padding: 4px 4px 4px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

/* 搜索输入框 */
.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 6px 8px;
    font-size: 14px;
    color: #333;
    min-width: 0;
    width: 100%;
}

.search-input::placeholder {
    color: #aaa;
}

/* 搜索按钮 */
.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 搜索结果统计 - 重构后 */
.search-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    margin: 0 20px 24px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    font-size: 15px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.search-stats .stats-icon {
    display: none;
}

.search-stats .stats-content {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.search-stats .count {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.search-stats .keyword {
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    /* 搜索结果列表 */
    .search-result-list {
        padding: 0 15px;
        gap: 12px;
    }

    /* 搜索结果项 */
    .search-result-item {
        padding: 16px 18px;
        border-radius: 10px;
    }

    /* 搜索结果标题 */
    .search-result-title {
        font-size: 15px;
        -webkit-line-clamp: 2;
    }

    /* 搜索结果摘要 */
    .search-result-snippet {
        font-size: 12px;
    }

    /* 搜索框适配 */
    .navbar-search-wrapper {
        margin-left: 5px;
    }

    .search-trigger {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .search-panel.active {
        width: calc(100vw - 80px);
        max-width: 240px;
        right: 0;
    }

    .search-input-wrapper {
        padding: 3px 3px 3px 12px;
    }

    .search-input {
        padding: 8px 6px;
        font-size: 14px;
    }

    .search-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* 搜索统计 - 移动端适配 */
    .search-stats {
        margin: 10px 15px 20px 15px;
        padding: 14px 18px;
        border-radius: 10px;
        font-size: 14px;
        gap: 6px;
    }

    .search-stats .count {
        font-size: 14px;
    }

    .search-stats .keyword {
        max-width: 120px;
        font-size: 14px;
    }
}

/* 小屏幕手机适配 */
@media (max-width: 480px) {
    /* 搜索结果列表 */
    .search-result-list {
        padding: 0 10px;
        gap: 10px;
    }

    /* 搜索结果项 */
    .search-result-item {
        padding: 14px 16px;
        border-radius: 8px;
    }

    /* 搜索结果标题 */
    .search-result-title {
        font-size: 14px;
    }

    /* 搜索结果摘要 */
    .search-result-snippet {
        font-size: 11px;
    }

    /* 搜索日期 */
    .search-result-date {
        font-size: 11px;
    }

    .search-panel.active {
        width: calc(100vw - 60px);
        max-width: 220px;
    }

    .search-input-wrapper {
        padding: 2px 2px 2px 10px;
    }

    .search-input {
        padding: 6px 4px;
        font-size: 13px;
    }

    .search-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .search-stats {
        margin: 8px 10px 16px 10px;
        padding: 12px 14px;
        border-radius: 8px;
        font-size: 13px;
        gap: 4px;
    }

    .search-stats .count {
        font-size: 13px;
    }

    .search-stats .keyword {
        max-width: 100px;
        font-size: 13px;
    }
}

/* 搜索按钮loading状态 */
.search-btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.search-btn.loading i {
    margin-right: 4px;
}
