/* 独立搜索区域样式 */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3); /* 透明背景 */
  z-index: 2000;
  display: none;
  pointer-events: none; /* 不拦截点击事件 */
}

.search-overlay.active {
  display: block;
}

.search-box-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 400px; /* 宽度变宽 */
  padding: 20px;
  position: absolute;
  top: 45px; /* 位置往上调整，更靠近触发按钮 */
  right: 5px; /* 距离右边更近 */
  opacity: 0;
  transform: translateY(-10px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto; /* 允许点击事件 */
}

.search-overlay.active .search-box-container {
  opacity: 1;
  transform: translateY(0);
}

.search-box-container .input-group {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: border-color 0.3s ease;
}

.search-box-container .input-group:focus-within {
  border-color: #0d6efd;
}

.search-box-container .form-control {
  border: none;
  padding: 12px 15px;
  font-size: 16px;
  box-shadow: none;
}

.search-box-container .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: none;
    outline: none;
}

.search-box-container .btn {
  border: none;
  border-radius: 0 6px 6px 0;
  padding: 0 20px;
}

.search-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.search-close:hover {
  background-color: #f8f9fa;
  color: #000;
}

/* 搜索建议 */
.search-suggestions {
  margin-top: 15px;
}

.search-suggestions h4 {
  font-size: 14px;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 10px;
}

.suggestion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggestion-tag {
  background-color: #f1f3f5;
  color: #495057;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.suggestion-tag:hover {
  background-color: #0d6efd;
  color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .search-overlay {
    padding-top: 80px;
  }
  
  .search-box-container {
    width: 95%;
    padding: 15px;
  }
  
  .search-box-container .form-control {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .search-box-container .btn {
    padding: 0 15px;
  }
}