/* 搜索框样式 */
.search-container {
  display: flex;
  align-items: center;
  margin-left: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 5px 15px;
  transition: all 0.3s ease;
}

.search-box:hover {
  background: rgba(255, 255, 255, 0.2);
}

.search-box input {
  border: none;
  background: transparent;
  color: #fff;
  padding: 5px 10px;
  width: 200px;
  outline: none;
  font-size: 14px;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-box button {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
}

.search-box button:hover {
  opacity: 0.8;
}

.search-icon {
  width: 18px;
  height: 18px;
}

/* 搜索结果模态框 */
.search-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(30, 64, 175, 0.3));
  backdrop-filter: blur(10px);
  animation: fadeIn 0.4s;
  justify-content: center;
  align-items: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.search-modal-content {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  margin: auto;
  padding: 0;
  border-radius: 24px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow: hidden;
  animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 25px 80px rgba(59, 130, 246, 0.4), 0 0 100px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.search-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f97316, #ea580c, #3b82f6, #2563eb);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.search-input-wrapper {
  padding: 28px 28px 20px;
  position: relative;
  border-bottom: 2px solid #e5e7eb;
}

.search-input-wrapper::after {
  content: '';
  position: absolute;
  top: 36px;
  left: 28px;
  width: 22px;
  height: 22px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%233b82f6" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>');
  background-size: contain;
  pointer-events: none;
  opacity: 0.6;
}

.search-input-wrapper input[type="text"] {
  width: 100%;
  padding: 12px 60px 12px 60px;
  font-size: 20px;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
}

.deep-search-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.deep-search-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.deep-search-toggle:hover {
  color: #3b82f6;
}

.search-results-wrapper {
  padding: 20px 28px 28px;
  max-height: calc(85vh - 120px);
  overflow-y: auto;
}

@keyframes slideDown {
  from {
    transform: translate(-50%, -60%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.close-search {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
}

.close-search:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  transform: rotate(90deg);
}

.close-search::before,
.close-search::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background: #64748b;
  transition: background 0.3s;
}

.close-search:hover::before,
.close-search:hover::after {
  background: #ef4444;
}

.close-search::before {
  transform: rotate(45deg);
}

.close-search::after {
  transform: rotate(-45deg);
}

.search-results-header {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.search-results-header h2 {
  margin: 0;
  color: #333;
  font-size: 24px;
}

#searchResults {
  margin-top: 20px;
}

.search-result-item {
  padding: 18px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(8px);
  border-left-color: #f97316;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.15);
}

.search-result-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.search-result-item h3 {
  margin: 0;
  color: #0066cc;
  font-size: 18px;
  flex: 1;
}

.search-result-item:hover h3 {
  color: #0052a3;
}

.result-lang {
  background: #e0e0e0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
}

.search-result-url {
  color: #666;
  font-size: 13px;
  margin: 0;
}

.search-category {
  font-weight: 600;
  color: #f97316;
  margin: 20px 0 10px 0;
  padding-bottom: 5px;
  border-bottom: 2px solid #f97316;
  font-size: 14px;
  text-transform: uppercase;
}

.search-count {
  color: #666;
  font-size: 14px;
  margin-bottom: 20px;
}

mark {
  background: #fff3cd;
  padding: 2px 4px;
  border-radius: 2px;
  font-weight: 500;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.no-results svg {
  color: #ccc;
  margin-bottom: 20px;
}

.no-results p {
  margin: 10px 0;
  font-size: 16px;
}

.search-tip {
  color: #999;
  font-size: 14px;
  margin-top: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .search-box input {
    width: 150px;
  }
  
  .search-modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 20px;
  }
  
  .search-container {
    margin-left: 10px;
  }
}

@media (max-width: 480px) {
  .search-box input {
    width: 100px;
    font-size: 12px;
  }
  
  .search-results-header h2 {
    font-size: 20px;
  }
  
  .search-result-item h3 {
    font-size: 16px;
  }
}
