/* 搜索弹窗样式 */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.search-overlay.active {
  display: flex;
}

.search-modal {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: searchSlideDown 0.3s ease-out;
}

@keyframes searchSlideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-header {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  gap: 12px;
}

.search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px 16px;
}

.search-input-wrapper svg {
  width: 20px;
  height: 20px;
  color: #666;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  outline: none;
  color: #333;
}

.search-input::placeholder {
  color: #999;
}

.search-close {
  background: #f0f0f0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #666;
  transition: all 0.2s;
}

.search-close:hover {
  background: #e0e0e0;
  color: #333;
}

.search-results {
  overflow-y: auto;
  padding: 16px;
  flex: 1;
}

.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.search-result-item {
  display: block;
  padding: 14px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
  margin-bottom: 8px;
}

.search-result-item:hover {
  background: #f5f5f5;
}

.search-result-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.search-result-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.search-result-badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 6px;
  font-weight: 500;
}

.search-result-badge.page {
  background: #e3f2fd;
  color: #1976d2;
}

.search-result-badge.service {
  background: #fff3e0;
  color: #f57c00;
}

.search-result-badge.case {
  background: #e8f5e9;
  color: #388e3c;
}

.search-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

.search-hint {
  padding: 12px 24px;
  border-top: 1px solid #e0e0e0;
  font-size: 12px;
  color: #999;
  text-align: center;
}

/* 导航栏搜索按钮 */
.nav-search-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
  color: inherit;
}

.nav-search-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

/* 语言切换器 */
.lang-switcher {
  position: relative;
}

.lang-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: inherit;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 120px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 1000;
}

.lang-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background 0.2s;
}

.lang-option:hover {
  background: #f5f5f5;
}

.lang-option.active {
  background: #e3f2fd;
  color: #1976d2;
  font-weight: 600;
}

/* 响应式 */
@media (max-width: 768px) {
  .search-overlay {
    padding-top: 60px;
  }
  
  .search-modal {
    width: 95%;
    max-height: 85vh;
  }
  
  .search-header {
    padding: 16px;
  }
  
  .search-results {
    padding: 12px;
  }
}
