/**
 * 21-search.css —— 搜索结果区补充样式。
 *
 * 源站的搜索浮层骨架（.search-view / .search-header / .search-body /
 * .search-pagination / .search-tag）样式已经完整，但结果容器 .search-body-content
 * 是 repeat(6, 1fr) 的网格 —— 那是给源站的缩略图卡片用的。
 * 我们渲染的是一个站点列表，所以让它跨满整行，再自己排列表。
 */

/* 结果列表跨满 6 列 */
.search-body-content > .search-result-list {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

.search-result-item {
  border-bottom: 1px solid #f2f2f6;
}

.search-result-item:last-child {
  border-bottom: 0;
}

.search-result-link {
  display: grid;
  grid-template-columns: 26px 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.14s ease;
}

.search-result-link:hover {
  background: #fffaf2;
}

.search-result-rank {
  font-size: 11px;
  font-weight: 600;
  color: #c2c2cc;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.search-result-icon {
  width: 16px;
  height: 16px;
  transform: scale(1.1);
  flex-shrink: 0;
}

.search-result-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: #ececf2;
  color: #a8a8b4;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.search-result-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.search-result-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-link:hover .search-result-name {
  color: #ff9701;
}

.search-result-desc {
  font-size: 11px;
  line-height: 1.4;
  color: #9a9aa5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 无结果 */
.search-empty {
  grid-column: 1 / -1;
  padding: 40px 16px;
  text-align: center;
  color: #9a9aa5;
  font-size: 13px;
}

/* 分类筛选按钮 */
.search-header-item {
  flex-shrink: 0;
  padding: 14px 12px;
  border: 0;
  background: none;
  color: #55555f;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.14s ease;
}

.search-header-item:hover {
  color: #ff9701;
}

.search-header-item.is-active {
  color: #ff9701;
  font-weight: 700;
}

.search-header-count {
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #f2f2f6;
  color: #9a9aa5;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 深色模式 */
.dark .search-result-item {
  border-bottom-color: #3a3b42;
}

.dark .search-result-link:hover {
  background: #34353d;
}

.dark .search-result-name {
  color: #ececf2;
}

.dark .search-result-desc {
  color: #8b8b97;
}

.dark .search-result-rank {
  color: #6b6b76;
}

.dark .search-result-initial {
  background: #3a3b42;
  color: #8b8b97;
}

.dark .search-header-item {
  color: #9d9daa;
}

.dark .search-header-item.is-active {
  color: #ff9701;
}

.dark .search-header-count {
  background: #3a3b42;
  color: #9d9daa;
}

.dark .search-empty {
  color: #8b8b97;
}

/* 命中词高亮 */
.search-result-name mark,
.search-result-desc mark {
  padding: 0 1px;
  background: #fff0d4;
  color: inherit;
  font-weight: 700;
  border-radius: 2px;
}

/* 键盘选中态 */
.search-result-link.is-active {
  background: #fffaf2;
  outline: 2px solid #ff9701;
  outline-offset: -2px;
}

.dark .search-result-name mark,
.dark .search-result-desc mark {
  background: #4a3a1e;
  color: #ffe9c2;
}

.dark .search-result-link.is-active {
  background: #34353d;
}
