
/* ===== Package 3:站内搜索样式 ===== */

.search-header {
  padding: 40px 0 30px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 30px;
}
.search-header h1 {
  font-size: 32px;
  margin: 0 0 8px;
  color: #0f172a;
}
.search-sub {
  color: #64748b;
  font-size: 15px;
  margin: 0 0 24px;
}

.search-box {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}
.search-box input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  outline: none;
  transition: all .2s;
  background: #fff;
  color: #1e293b;
  box-sizing: border-box;
}
.search-box input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .1);
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  pointer-events: none;
}

.search-status-bar {
  margin-top: 14px;
  font-size: 13px;
  color: #94a3b8;
}
.search-status-bar #search-count { margin-left: 8px; color: #6366f1; }

/* 结果列表 */
.search-results-list { margin: 0 0 60px; }

.search-item {
  padding: 22px 24px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 14px;
  transition: all .2s;
}
.search-item:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .08);
}
.search-item h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.4;
}
.search-item h3 a {
  color: #1e293b;
  text-decoration: none;
}
.search-item h3 a:hover { color: #6366f1; }

.search-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
}
.search-cat {
  background: #eef2ff;
  color: #4f46e5;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.search-desc {
  color: #475569;
  font-size: 14px;
  margin: 0 0 8px;
  line-height: 1.7;
}
.search-snippet {
  color: #64748b;
  font-size: 13px;
  margin: 0;
  line-height: 1.7;
  font-style: italic;
  border-left: 3px solid #e2e8f0;
  padding-left: 12px;
}

.search-item mark {
  background: linear-gradient(to bottom, transparent 55%, #fef08a 55%);
  padding: 0 2px;
  color: inherit;
  font-weight: 600;
}

.search-hint, .search-empty, .search-error {
  padding: 40px 24px;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  line-height: 1.9;
}
.search-error { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.search-hint a {
  display: inline-block;
  margin: 0 6px;
  padding: 4px 12px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 20px;
  text-decoration: none;
  font-size: 13px;
}
.search-hint a:hover { background: #c7d2fe; }

/* 顶部导航小搜索按钮 */
.nav-search-btn {
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-left: 4px;
  opacity: .7;
  transition: all .15s;
  text-decoration: none;
}
.nav-search-btn:hover { opacity: 1; background: #eef2ff; color: #4f46e5; }

/* —— 深色模式 —— */
html[data-theme="dark"] .search-box input {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme="dark"] .search-box input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(129, 140, 248, .15);
}
html[data-theme="dark"] .search-item {
  background: #1e293b;
  border-color: #334155;
}
html[data-theme="dark"] .search-item h3 a { color: #f1f5f9; }
html[data-theme="dark"] .search-item h3 a:hover { color: #a5b4fc; }
html[data-theme="dark"] .search-cat { background: #312e81; color: #c7d2fe; }
html[data-theme="dark"] .search-desc { color: #cbd5e1; }
html[data-theme="dark"] .search-snippet { color: #94a3b8; border-color: #475569; }
html[data-theme="dark"] .search-hint,
html[data-theme="dark"] .search-empty {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}
html[data-theme="dark"] .search-hint a { background: #312e81; color: #c7d2fe; }
html[data-theme="dark"] .search-item mark {
  background: linear-gradient(to bottom, transparent 55%, #a16207 55%);
  color: #fef3c7;
}
html[data-theme="dark"] .search-header { border-color: #334155; }
html[data-theme="dark"] .search-header h1 { color: #f1f5f9; }
html[data-theme="dark"] .nav-search-btn:hover { background: #312e81; color: #c7d2fe; }

@media (max-width: 768px) {
  .search-header { padding: 30px 0 20px; }
  .search-header h1 { font-size: 26px; }
  .search-box input { padding: 12px 16px 12px 42px; font-size: 15px; }
}


/* ===== Package 3 Hotfix:搜索按钮更醒目 ===== */
.nav-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4f46e5 !important;
  padding: 6px 14px 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  margin-left: 8px;
  text-decoration: none;
  transition: all .15s;
  opacity: 1;
  line-height: 1.3;
}
.nav-search-btn:hover {
  background: #c7d2fe;
  color: #312e81 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(99, 102, 241, .25);
}
.nav-search-icon { font-size: 13px; line-height: 1; }
.nav-search-label { font-size: 13px; }

html[data-theme="dark"] .nav-search-btn {
  background: rgba(99, 102, 241, .15);
  border-color: #4f46e5;
  color: #a5b4fc !important;
}
html[data-theme="dark"] .nav-search-btn:hover {
  background: rgba(99, 102, 241, .3);
  color: #c7d2fe !important;
}

@media (max-width: 640px) {
  .nav-search-label { display: none; }
  .nav-search-btn { padding: 6px 10px; }
}


.search-score {
  background: #fef3c7;
  color: #92400e;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
html[data-theme="dark"] .search-score {
  background: rgba(251, 191, 36, .15);
  color: #fbbf24;
}
