/* ==================== 搜索面板样式 ====================
 * 
 * 从 styles.css 抽取，包含搜索浮层面板的全部 CSS 规则。
 * 包含：遮罩层、面板容器、头部输入框、内容区、结果卡片、底部操作等。
 * 通过 @import 或 <link> 引入即可使用。
 */


/* ---- 遮罩层 ---- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(24px, 16vh, 172px) 12px 24px;
  background: rgba(7, 19, 49, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

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


/* ---- 面板容器 ---- */
.search-panel {
  width: min(580px, 100%);
  max-height: calc(100dvh - clamp(48px, 24vh, 260px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(148, 163, 184, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  animation: searchPanelIn 0.2s ease-out;
}

@keyframes searchPanelIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}


/* ---- 头部 ---- */
.search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f7;
}

.search-input-wrap {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #dfe6f2;
  border-radius: 9px;
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input-wrap:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-panel-icon {
  font-size: 17px;
  line-height: 1;
  color: #516382;
  flex-shrink: 0;
}

.search-input-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  color: #071331;
}

.search-input-wrap input::placeholder {
  color: #94a3b8;
}

.search-clear-btn {
  width: 22px;
  height: 22px;
  display: none;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  color: #94a3b8;
  flex-shrink: 0;
}

.search-clear-btn:hover {
  background: #eef1f6;
  color: #374151;
}

.search-header-actions {
  display: flex;
  gap: 4px;
}

.search-settings-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 17px;
  color: #536381;
}

.search-settings-btn:hover {
  background: #eef4ff;
  color: #374151;
}


/* ---- 内容区 ---- */
.search-body {
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-color: #c4cdda transparent;
  scrollbar-width: thin;
}

.search-body::-webkit-scrollbar {
  width: 5px;
}

.search-body::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: #c4cdda;
}


/* 统计栏 */
.search-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 4px;
  font-size: 13px;
  color: #61708d;
  font-weight: 500;
}

.search-esc-hint {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}


/* 分组标题 */
.search-group-title {
  padding: 12px 20px 6px;
  font-size: 14px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: -0.01em;
}


/* 结果列表 */
.search-results-list {
  padding: 4px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}


/* 单条结果卡片 */
.search-result-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  border-radius: 9px;
  color: #15203a;
  transition: background 0.12s;
}

.search-result-card:hover {
  background: #f4f8ff;
}

.search-card-icon {
  flex-shrink: 0;
  font-size: 18px;
  margin-top: 1px;
  line-height: 1;
}

.search-card-body {
  flex: 1;
  min-width: 0;
}

.search-card-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #0a1628;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-card-title mark,
.search-card-snippet mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #fef08a;
  color: inherit;
}

.search-card-snippet {
  font-size: 13px;
  line-height: 1.45;
  color: #61708d;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-source {
  font-size: 12px;
  font-style: italic;
  color: #94a3b8;
  margin-top: 3px;
}

.search-card-time {
  flex-shrink: 0;
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  margin-top: 2px;
  font-weight: 450;
}


/* 空状态 / 错误 */
.search-empty,
.search-error {
  padding: 48px 24px;
  text-align: center;
  color: #8a96ae;
  font-size: 14px;
}

.search-empty p,
.search-error p {
  margin: 0;
  line-height: 1.6;
}


/* ---- 底部 ---- */
.search-footer {
  padding: 8px 16px 14px;
  border-top: 1px solid #edf1f7;
}

.view-all-btn {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-radius: 8px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s;
}

.view-all-btn:hover {
  background: #eef4ff;
}

.view-all-btn span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.view-all-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
