/* 搜索功能样式 */

/* 搜索容器 */
.search-wrapper {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding: 0 15px;
}

/* 搜索表单容器 */
.search-form-container {
    position: relative;
    margin-top: 0;
}

/* 搜索表单 */
.search-form {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.search-form:focus-within {
    border-color: #007bff;
}

/* 搜索引擎标签容器 - 融合到搜索框内 */
.search-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-right: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
}

/* 搜索引擎标签 */
.search-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    min-width: auto;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.search-tab.active {
    background: #007bff;
    color: white;
}

/* 搜索引擎图标 */
.search-tab-icon {
    width: 14px;
    height: 14px;
    margin-right: 2px;
    flex-shrink: 0;
}

.search-tab-name {
    font-weight: 500;
    white-space: nowrap;
}

/* 搜索输入框 */
.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: 16px;
    background: transparent;
    color: #495057;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.search-input::placeholder {
    color: #6c757d;
}

/* 搜索按钮 */
.search-btn {
    background: #007bff;
    border: none;
    color: white;
    padding: 14px 20px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border-left: 1px solid #dee2e6;
}

.search-btn:hover {
    background: #0056b3;
}

.search-btn:active {
    background: #004085;
}

/* 加载状态 */
.search-loading {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    display: none;
}

/* 搜索建议（预留） */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    border: 1px solid #dee2e6;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-suggestion {
    padding: 12px 25px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.search-suggestion:hover {
    background: #f8f9fa;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .search-wrapper {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .search-tabs {
        gap: 2px;
        padding: 6px 8px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .search-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .search-tab {
        padding: 4px 8px;
        font-size: 11px;
        min-width: auto;
        border-radius: 4px;
        flex-shrink: 0;
    }
    
    .search-tab-icon {
        width: 12px;
        height: 12px;
        margin-right: 2px;
    }
    
    .search-tab-name {
        display: none;
    }
    
    .search-form {
        border-radius: 8px;
        padding: 6px;
    }
    
    .search-input {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .search-btn {
        padding: 14px 20px;
        border-radius: 0 8px 8px 0;
        min-width: 100px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .search-wrapper {
        padding: 0 12px;
    }
    
    .search-tabs {
        gap: 1px;
        padding: 4px 6px;
    }
    
    .search-tab {
        flex-shrink: 0;
        padding: 3px 6px;
        font-size: 10px;
        min-width: auto;
        border-radius: 3px;
    }
    
    .search-tab-icon {
        width: 10px;
        height: 10px;
        margin-right: 1px;
    }
    
    .search-form {
        border-radius: 8px;
        padding: 4px;
    }
    
    .search-input {
        padding: 12px 18px;
        font-size: 14px;
    }
    
    .search-btn {
        padding: 12px 18px;
        font-size: 14px;
        min-width: 80px;
        border-radius: 0 8px 8px 0;
    }
}



/* 搜索统计（隐藏，用于数据收集） */
.search-stats {
    display: none;
}

/* 错误提示 */
.search-error {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #dc3545;
    color: white;
    padding: 10px 25px;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    display: none;
    z-index: 1001;
}

/* 成功提示 */
.search-success {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #28a745;
    color: white;
    padding: 10px 25px;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    display: none;
    z-index: 1001;
}

/* 深色模式支持（预留） */
@media (prefers-color-scheme: dark) {
    .search-tabs {
        background: rgba(45, 45, 45, 0.9);
    }
    
    .search-tab {
        color: #ccc;
    }
    
    .search-tab:hover {
        background: rgba(52, 152, 219, 0.2);
        color: #3498db;
    }
    
    .search-form {
        background: #2c2c2c;
    }
    
    .search-input {
        color: #fff;
    }
    
    .search-input::placeholder {
        color: #888;
    }
    
    .search-suggestions {
        background: #2c2c2c;
        border: 1px solid #444;
    }
    
    .search-suggestion {
        border-bottom-color: #444;
        color: #fff;
    }
    
    .search-suggestion:hover {
        background: #3c3c3c;
    }
}