/* ===== 全站搜索样式 ===== */
.search-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30, 20, 10, 0.55);
  z-index: 99999;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: searchFadeIn 0.2s ease;
}
@keyframes searchFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.search-overlay.active { display: flex; justify-content: center; align-items: flex-start; padding-top: 80px; }

.search-modal {
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  background: #fffcf6;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(100, 70, 20, 0.18), 0 2px 8px rgba(252, 176, 64, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: searchSlideIn 0.25s ease;
  border: 1px solid #f0ddb5;
}
@keyframes searchSlideIn {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 24px 18px;
  background: linear-gradient(135deg, #fff8ee 0%, #fef3dc 100%);
}
.search-input-inner {
  flex: 1;
  display: flex;
  align-items: center;
  border-radius: 20px;
  border: 1px solid #e8d5b0;
  background: rgba(255,255,255,0.6);
  padding: 0 14px;
  transition: border-color 0.2s, background 0.2s;
}
.search-input-inner:focus-within {
  border-color: #d4a545;
  background: rgba(255,255,255,0.9);
}
.search-input-inner svg {
  flex-shrink: 0;
  margin-right: 8px;
  color: #b8935a;
  width: 16px;
  height: 16px;
}
.search-input-inner input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: #3a2a10;
  font-family: inherit;
  padding: 8px 0;
  min-width: 0;
  border-radius: 20px;
  -webkit-appearance: none;
  appearance: none;
}
.search-input-inner input::placeholder { color: #c4a870; }
.search-input-wrap .search-clear {
  display: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #e8d5b0;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #8a7040;
  line-height: 22px;
  text-align: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s;
  margin-left: 8px;
}
.search-input-wrap .search-clear:hover { background: #dcc89a; }
.search-input-wrap .search-clear.visible { display: inline-block; }

.search-hint {
  padding: 10px 18px;
  font-size: 12px;
  color: #b09860;
  border-bottom: 1px solid #f5e8d0;
  background: #fffdf8;
}

.search-results {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}
.search-results::-webkit-scrollbar { width: 5px; }
.search-results::-webkit-scrollbar-thumb { background: #e0d0b0; border-radius: 3px; }

.search-item {
  display: block;
  padding: 12px 18px;
  text-decoration: none;
  color: #3a2a10;
  transition: background 0.15s, border-color 0.15s;
  border-left: 3px solid transparent;
}
.search-item:hover {
  background: #fff5e6;
  border-left-color: #fcb040;
  text-decoration: none;
}
.search-item-title {
  font-size: 15px;
  font-weight: 600;
  color: #5a3e1b;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-item-title em {
  font-style: normal;
  background: rgba(252, 176, 64, 0.25);
  color: #b87a10;
  border-radius: 2px;
  padding: 0 2px;
}
.search-item-cat {
  font-size: 11px;
  color: #fff;
  background: #e8a830;
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  line-height: 16px;
}
.search-item-desc {
  font-size: 13px;
  color: #8a7a60;
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.search-item-sep {
  color: #c4a870;
  margin: 0 4px;
}
.search-item-desc em {
  font-style: normal;
  background: rgba(252, 176, 64, 0.2);
  color: #b87a10;
  border-radius: 2px;
  padding: 0 2px;
}
.search-empty {
  text-align: center;
  padding: 32px 18px;
  color: #b09860;
  font-size: 14px;
}
.search-empty svg { margin-bottom: 8px; opacity: 0.4; }

/* 导航栏搜索按钮 */
.nav-search-btn {
  cursor: pointer !important;
}
.nav-search-btn svg {
  vertical-align: -2px;
  margin-right: 4px;
}

@media (max-width: 768px) {
  .search-overlay.active { padding-top: 50px; }
  .search-modal { width: 95%; max-height: 75vh; border-radius: 16px; }
}
