/* ============================================================
   站内搜索：头部即时下拉 + 搜索结果页
   仅作用于 .nav-search 与 .search-page，避免影响其他模块
   ============================================================ */

/* ---------------- 头部即时下拉 ---------------- */
.nav-search .search-suggest {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border, #e8e8e8);
  max-height: 360px;
  overflow-y: auto;
}

.nav-search .search-suggest[hidden] {
  display: none;
}

.ss-item {
  display: block;
  padding: 8px 8px;
  border-radius: 6px;
  text-decoration: none;
}

.ss-item:hover,
.ss-item.is-active {
  background: #f5f7fa;
}

.ss-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ss-cat {
  flex: none;
  padding: 0 4px;
  border-radius: 3px;
  background: #fdecef;
  color: #da0029;
  font-size: 11px;
  line-height: 16px;
}

.ss-cat-solution {
  background: #edf3ff;
  color: #2f6bff;
}

.ss-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-desc {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 18px;
  color: #8c8c8c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-title mark,
.ss-desc mark,
.search-result mark {
  background: none;
  color: #da0029;
  font-weight: 600;
}

.ss-all {
  display: block;
  margin-top: 4px;
  padding: 9px 8px;
  border-top: 1px dashed #e8e8e8;
  font-size: 13px;
  color: #da0029;
  text-align: center;
  text-decoration: none;
}

.ss-all:hover {
  background: #fafafa;
}

.ss-status {
  margin: 8px;
  font-size: 13px;
  color: #8c8c8c;
}

/* ---------------- 搜索结果页 ---------------- */
.search-page {
  background: #f5f7fa;
  /* 顶部固定导航占位，避免搜索标题被导航遮挡 */
  margin-top: var(--nav-height);
  padding-bottom: 72px;
}

.search-page-head {
  background: #fff;
  border-bottom: 1px solid #eef0f3;
  padding: 48px 0 0;
}

.search-page-title {
  margin: 0 0 20px;
  font-size: 28px;
  font-weight: 600;
  color: #1a1a1a;
}

.search-page-form {
  display: flex;
  max-width: 640px;
  height: 46px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.search-page-form:focus-within {
  border-color: #da0029;
}

.search-page-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 0 14px;
  font-size: 14px;
  color: #333;
  background: transparent;
}

.search-page-input::placeholder {
  color: #9a9a9a;
}

.search-page-submit {
  flex: none;
  width: 92px;
  border: none;
  background: #da0029;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-page-submit:hover {
  background: #bd0023;
}

.search-page-summary {
  margin: 20px 0 0;
  font-size: 14px;
  color: #666;
}

.search-page-summary strong {
  color: #da0029;
  font-weight: 600;
}

.search-page-tabs {
  display: flex;
  gap: 28px;
  margin-top: 18px;
}

.search-tab {
  position: relative;
  padding: 0 0 14px;
  font-size: 15px;
  color: #57575c;
  text-decoration: none;
}

.search-tab span {
  margin-left: 4px;
  font-size: 12px;
  color: #9a9a9a;
}

.search-tab.is-active {
  color: #da0029;
  font-weight: 600;
}

.search-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #da0029;
}

.search-page-body {
  padding-top: 24px;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.search-result:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.search-result-main {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
}

.search-result-desc {
  margin: 0;
  font-size: 13px;
  line-height: 22px;
  color: #777;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.search-result-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.search-result-cat {
  padding: 0 8px;
  border-radius: 3px;
  background: #fdecef;
  color: #da0029;
  font-size: 12px;
  line-height: 22px;
}

.search-result-group {
  font-size: 12px;
  color: #9a9a9a;
}

.search-loading,
.search-empty,
.search-error {
  padding: 60px 0;
  text-align: center;
  font-size: 14px;
  color: #8c8c8c;
}

.search-empty-tips {
  margin-top: 12px;
  font-size: 13px;
  color: #9a9a9a;
}

.search-empty-tips a {
  margin: 0 4px;
  color: #da0029;
  text-decoration: none;
}

.search-retry {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 20px;
  border: 1px solid #da0029;
  border-radius: 4px;
  background: #fff;
  color: #da0029;
  font-size: 13px;
  cursor: pointer;
}

.search-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.search-page-btn {
  min-width: 34px;
  height: 34px;
  line-height: 32px;
  padding: 0 6px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  color: #57575c;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
}

.search-page-btn.is-active {
  border-color: #da0029;
  background: #da0029;
  color: #fff;
}

.search-page-btn:hover {
  border-color: #da0029;
  color: #da0029;
}

.search-page-btn.is-active:hover {
  color: #fff;
}

@media (max-width: 1200px) {
  .search-page-title {
    font-size: 26px;
  }
}

@media (max-width: 768px) {
  .search-page {
    padding-bottom: 48px;
  }

  .search-page-head {
    padding: 28px 0 0;
  }

  .search-page-title {
    margin-bottom: 14px;
    font-size: 22px;
  }

  .search-page-form {
    height: 42px;
  }

  .search-page-submit {
    width: 76px;
  }

  .search-page-tabs {
    gap: 20px;
    margin-top: 14px;
  }

  .search-tab {
    font-size: 14px;
    padding-bottom: 12px;
  }

  .search-page-body {
    padding-top: 16px;
  }

  .search-result {
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    flex-direction: column;
  }

  .search-result-title {
    font-size: 16px;
  }

  .search-result-side {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .search-page-summary {
    margin-top: 14px;
    font-size: 13px;
  }

  .search-result-desc {
    -webkit-line-clamp: 3;
  }
}
