/* ============================================
   搜索区域修复 - 适配您的HTML结构
   将这些CSS添加到 <style> 标签中，替换原有的搜索相关样式
   ============================================ */

/* 搜索容器 - 主布局 */
.search-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* 搜索输入框包装器（如果使用方案2） */
.search-input-wrapper {
    flex: 1;
    position: relative;
    max-width: 800px;
}

/* 搜索输入框 */
.search-box {
    width: 100%;
    padding: 1.2rem 3.5rem 1.2rem 1.8rem;  /* 右边留空给放大镜 */
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.search-box:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 方案1：外部搜索按钮改为放大镜图标 */
.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

.search-btn:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* 方案2：内部放大镜按钮（如果使用新结构） */
.search-icon-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon-btn svg {
    width: 20px;
    height: 20px;
}

.search-icon-btn:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

/* 提交评价按钮 */
.btn-submit-review {
    padding: 1.2rem 2rem;
    background: var(--accent-color);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 1.1rem;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-submit-review:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ============================================
   搜索联想框 - 关键修复
   ============================================ */

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;  /* 关键：与搜索框同宽 */
    background: white;
    border-radius: 12px;
    margin-top: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    display: none;
}

.search-suggestions.active {
    display: block;
}

/* 滚动条样式 */
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}

/* 搜索建议项 */
.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
}

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

.suggestion-item:hover,
.suggestion-item.selected {
    background: #f8fafc;
}

/* 企业Logo图标 */
.company-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.company-logo-placeholder svg {
    width: 20px;
    height: 20px;
    color: #64748b;
}

.company-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

/* 企业信息 */
.suggestion-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: left;
}

.suggestion-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-name mark {
    background: #fef08a;
    color: #854d0e;
    padding: 1px 2px;
    border-radius: 2px;
}

.suggestion-meta {
    font-size: 0.85rem;
    color: #64748b;
}

/* 右侧信息 */
.suggestion-right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
    margin-left: 12px;
}

.suggestion-rating {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2563eb;
    white-space: nowrap;
}

.suggestion-count {
    font-size: 0.85rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* 加载和空状态 */
.suggestions-loading,
.suggestions-empty {
    padding: 16px 24px 8px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}
.suggestions-create {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 24px;
    color: var(--primary-color, #2563eb);
    font-size: 0.9rem;
    text-decoration: none;
    border-top: 1px solid #f1f5f9;
    transition: background .15s;
}
.suggestions-create:hover { background: #f0f6ff; }
.suggestions-create-icon {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-color, #2563eb);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
}

/* 确保父容器不隐藏 */
.hero {
    overflow: visible !important;
}

.container {
    overflow: visible !important;
}

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        gap: 12px;
        padding: 0 20px;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
    
    .search-box {
        padding: 1rem 3rem 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .search-btn,
    .search-icon-btn {
        width: 36px;
        height: 36px;
    }
    
    .search-btn svg,
    .search-icon-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .btn-submit-review {
        width: 100%;
        justify-content: center;
    }
    
    .search-suggestions {
        max-height: 300px;
    }