/* 搜索相关样式 */

/* 桌面端搜索容器 */
.search-container {
  position: relative;
  width: 100%;
  min-width: 200px;
}

/* 搜索输入框 */
.search-input {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  background-color: #f9fafb;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s;
}

.dark .search-input {
  background-color: #1f2937;
  border-color: #374151;
  color: #f3f4f6;
}

.search-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* 搜索图标 */
.search-icon {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  width: 1.25rem;
  height: 1.25rem;
  pointer-events: none;
}

/* 搜索结果容器 */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 0.25rem;
  background-color: white;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 50;
  overflow-y: auto;
  max-height: 300px;
  display: none;
}

.dark .search-results {
  background-color: #1f2937;
  border-color: #374151;
}

/* 搜索结果项 */
.search-result-item {
  padding: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #e5e7eb;
}

.dark .search-result-item {
  border-color: #374151;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: #f3f4f6;
}

.dark .search-result-item:hover {
  background-color: #374151;
}

.search-result-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #1f2937;
}

.dark .search-result-title {
  color: #f9fafb;
}

.search-result-preview {
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dark .search-result-preview {
  color: #d1d5db;
}

/* 空结果状态 */
.search-no-results {
  padding: 1rem;
  text-align: center;
  color: #6b7280;
}

.dark .search-no-results {
  color: #9ca3af;
}

/* 移动端搜索面板 */
.mobile-search-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: white;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 60;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  height: 80vh;
  display: flex;
  flex-direction: column;
}

.dark .mobile-search-panel {
  background-color: #1f2937;
}

.mobile-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .mobile-search-header {
  border-color: #374151;
}

.mobile-search-title {
  font-weight: 600;
  font-size: 1.125rem;
}

.mobile-search-close {
  background: none;
  border: none;
  color: #6b7280;
  width: 1.5rem;
  height: 1.5rem;
  cursor: pointer;
}

.dark .mobile-search-close {
  color: #9ca3af;
}

.mobile-search-input-container {
  padding: 1rem;
}

.mobile-search-results {
  flex-grow: 1;
  padding: 0 1rem;
  overflow-y: auto;
}

/* 响应式调整 */
@media (max-width: 1023px) {
  .desktop-search {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .mobile-search-button {
    display: none !important;
  }
  .desktop-search {
    display: flex !important;
  }
} 