/* ==========================================================================
   模板 5 · 寻搜极简风 —— 搜索结果页
   标题 / 搜索框 / 筛选 / 排序 / 结果 / 分页全部收在同一张卡片里。
   ========================================================================== */

.xs-page-search { padding-bottom: 56px; }

.xs-page-search .xs-hero { padding-top: 40px; }

/* 结果页卡片：顶部留给标题，底部少留一点，避免分页贴边 */
.xs-card--results { padding: 38px 56px 30px; }

.xs-search-head { text-align: center; }

.xs-search-head__title {
  margin: 0;
  font-size: 42px;
  line-height: 1.22;
  letter-spacing: -.5px;
  font-weight: 800;
}

.xs-search-head__title em {
  font-style: normal;
  background: var(--xs-grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.xs-search-head__sub {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--xs-muted);
}

.xs-search-head__sub strong { color: var(--xs-text); }

/* ---------------------------- 工具条 ---------------------------- */

.xs-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 640px;
  margin: 18px auto 0;
}

.xs-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.xs-tab {
  border: 1px solid var(--xs-line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  color: #4b5563;
  transition: all .15s ease;
}

.xs-tab:hover { border-color: #c7d7fb; color: var(--xs-brand-dark); }

.xs-tab.is-active {
  background: var(--xs-text);
  border-color: var(--xs-text);
  color: #fff;
  box-shadow: 0 6px 16px rgba(17, 24, 39, .16);
}

.xs-seg {
  display: inline-flex;
  flex: none;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 3px;
}

.xs-seg__btn {
  border: 0;
  background: transparent;
  padding: 5px 14px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--xs-muted);
  border-radius: 999px;
  transition: all .15s ease;
}

.xs-seg__btn:hover { color: var(--xs-text); }

.xs-seg__btn.is-active {
  background: #fff;
  color: var(--xs-text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

/* ---------------------------- 结果流 ---------------------------- */

.xs-results-wrap {
  position: relative;
  margin-top: 24px;
  text-align: left;
  min-height: 320px;
}

.xs-results {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--xs-line-2);
}

.xs-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--xs-line-2);
  transition: background .15s ease;
}

.xs-result:hover { background: #fafbff; }

.xs-result__index {
  width: 26px;
  flex: none;
  text-align: center;
  color: #b6bcc9;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.xs-result__index.is-top { color: var(--xs-brand); font-weight: 700; }

.xs-result__body { flex: 1; min-width: 0; }

.xs-result__title {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--xs-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s ease;
}

.xs-result__title:hover { color: var(--xs-brand); }

.xs-result__title mark {
  background: rgba(37, 99, 235, .12);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.xs-result__meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 12px;
  color: var(--xs-faint);
}

.xs-pan {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--xs-brand-soft);
  color: var(--xs-brand);
  white-space: nowrap;
}

.xs-pan[data-pan="baidu"] { background: #eef2ff; color: #4338ca; }
.xs-pan[data-pan="quark"] { background: #ecfeff; color: #0e7490; }
.xs-pan[data-pan="uc"] { background: #fff3e8; color: #c2410c; }
.xs-pan[data-pan="xunlei"] { background: #e6f7f8; color: #0e7490; }
.xs-pan[data-pan="aliyun"] { background: #f5f3ff; color: #6d28d9; }
.xs-pan[data-pan="seed"] { background: #f1f5f9; color: #475569; }

.xs-result__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.xs-files-btn {
  border: 1px solid #d6dbe6;
  background: #fff;
  color: #374151;
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 13px;
  white-space: nowrap;
  transition: all .15s ease;
}

.xs-files-btn:hover { border-color: var(--xs-brand); color: var(--xs-brand-dark); }

.xs-get-btn {
  flex: none;
  border: none;
  border-radius: 9px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--xs-brand), var(--xs-brand-dark));
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}

.xs-get-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(37, 99, 235, .26); }

/* ------------------------- 自动入库状态徽标 ------------------------- */

.xs-ingest {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  background: #eef2f8;
  color: #5b6474;
}

.xs-ingest[data-state="pending"] { background: #eef2f8; color: #64748b; }
.xs-ingest[data-state="success"] { background: rgba(16, 185, 129, .12); color: #047857; }
.xs-ingest[data-state="duplicate"] { background: rgba(37, 99, 235, .1); color: var(--xs-brand-dark); }

.xs-ingest[data-state="failed"] {
  background: rgba(239, 68, 68, .1);
  color: #b91c1c;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.xs-ingest[data-state="failed"]:hover { background: rgba(239, 68, 68, .17); }

/* ---------------------- 测活：健康徽章 / 失效屏蔽条 ---------------------- */

.xs-health {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.xs-health::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}

.xs-health.is-ok { background: rgba(16, 185, 129, .12); color: #047857; }
.xs-health.is-warn { background: rgba(245, 158, 11, .14); color: #b45309; }
.xs-health.is-bad { background: rgba(239, 68, 68, .1); color: #b91c1c; }

.xs-deadbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, .1);
  border: 1px solid rgba(245, 158, 11, .22);
  color: #92400e;
  font-size: 13px;
}

.xs-deadbar.is-showing {
  background: rgba(100, 116, 139, .09);
  border-color: rgba(100, 116, 139, .2);
  color: #475569;
}

/* 扫描中：中性靛蓝 + 呼吸点，避免还没判定就先摆出告警脸 */
.xs-deadbar.is-scanning:not(.is-showing) {
  background: rgba(99, 102, 241, .07);
  border-color: rgba(99, 102, 241, .2);
  color: #4338ca;
}

.xs-deadbar.is-scanning:not(.is-showing) .xs-deadbar__text::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  animation: xs-scan-pulse 1.1s ease-in-out infinite;
}

@keyframes xs-scan-pulse {
  0%, 100% { opacity: .25; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .xs-deadbar.is-scanning:not(.is-showing) .xs-deadbar__text::before {
    animation: none;
    opacity: .8;
  }
}

.xs-deadbar__text strong { font-weight: 700; }

.xs-deadbar__btn {
  margin-left: auto;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}

.xs-deadbar__btn:hover { background: rgba(255, 255, 255, .55); }

/* 「显示失效」模式下把失效行压低，避免误点 */
.xs-result.is-dead { opacity: .55; }
.xs-result.is-dead .xs-result__title { text-decoration: line-through; text-decoration-color: rgba(185, 28, 28, .5); }

/* ---------------------------- 分页 ---------------------------- */

.xs-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0 2px;
  flex-wrap: wrap;
}

.xs-page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--xs-line);
  background: #fff;
  color: #4b5563;
  font-size: 13.5px;
  transition: all .15s ease;
}

.xs-page-btn:hover:not(:disabled) { border-color: var(--xs-brand); color: var(--xs-brand); }

.xs-page-btn.is-active {
  background: linear-gradient(135deg, var(--xs-brand), var(--xs-brand-dark));
  border-color: transparent;
  color: #fff;
}

.xs-page-btn:disabled { opacity: .45; cursor: not-allowed; }

.xs-page-ellipsis { color: var(--xs-faint); padding: 0 4px; }

/* ---------------------------- 空态 / 加载 ---------------------------- */

.xs-state {
  padding: 56px 20px;
  text-align: center;
  color: var(--xs-muted);
  font-size: 14px;
}

.xs-state p { margin: 6px 0 0; }

.xs-state__title { font-size: 16px; color: var(--xs-text); font-weight: 600; }

.xs-state__icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: #f2f5fb;
  color: #9aa2b1;
  font-size: 20px;
}

.xs-state .xs-spinner { margin: 0 auto 4px; }

/* 结果骨架（首批结果到达前给个形状，避免卡片高度跳动） */
.xs-skel { padding: 14px 4px; border-bottom: 1px solid var(--xs-line-2); }

.xs-skel i {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f3f8 25%, #e8ebf3 37%, #f1f3f8 63%);
  background-size: 400% 100%;
  animation: xsShimmer 1.3s ease infinite;
}

.xs-skel i + i { margin-top: 9px; width: 42%; }

@keyframes xsShimmer {
  0% { background-position: 100% 50%; }
  to { background-position: 0 50%; }
}
