/* ============================================================
 * 本地站点搜索弹窗样式
 * 移植自主题 search.scss（algolia_search 关闭时该 partial 不参与编译），
 * 并将图标字形替换为自托管 SVG mask（规避自定义 iconfont 缺字形问题）
 * ============================================================ */

/* ---- 弹窗主体 ---- */
.popup {
  visibility: hidden;
  position: fixed;
  top: 10%;
  left: 50%;
  width: 700px;
  max-height: 80%;
  margin-left: -350px;
  background: var(--color-wrap);
  color: var(--grey-9);
  z-index: 9999;
  border-radius: 10px;
  opacity: 0;
  transform: scale(0.5);
  transition: 0.3s;
  box-shadow: 0 0 10px var(--color-meta-shadow);
}

.popup.show {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
}

@media screen and (max-width: 767px) {
  .popup {
    top: 0;
    left: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-height: 100%;
  }
}

@media screen and (min-width: 768px) {
  .popup {
    min-height: 350px;
  }
}

.reimu-popup {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ---- 关闭按钮（SVG ×，替代 iconfont 字形） ---- */
.popup-btn-close {
  color: var(--red-1);
  padding: 4px;
  flex-shrink: 0;
  cursor: pointer;
  cursor: var(--cursor-pointer, pointer);
  transition: 0.3s;
}

.popup-btn-close:hover {
  opacity: 0.8;
}

.popup-btn-close:before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("../images/icons/close.svg") center / contain no-repeat;
  mask: url("../images/icons/close.svg") center / contain no-repeat;
  vertical-align: middle;
}

/* ---- 搜索输入区 ---- */
.reimu-search {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--grey-9);
  flex-shrink: 0;
}

.reimu-search-input-icon {
  display: inline-block;
  width: 20px;
  font-size: 18px;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}

.reimu-search-input-icon:before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: url("../images/icons/search.svg") center / contain no-repeat;
  mask: url("../images/icons/search.svg") center / contain no-repeat;
  vertical-align: -0.15em;
}

#reimu-search-input {
  flex: 1;
}

#reimu-search-input input {
  width: 100%;
  outline: none;
  border: none;
  background: transparent;
  color: var(--grey-9);
  font-size: 16px;
  vertical-align: middle;
  font-family: inherit;
}

/* ---- 结果区 ---- */
.reimu-results {
  position: relative;
  overflow: auto;
  padding: 16px 32px;
  box-sizing: border-box;
  flex: 1;
}

@media screen and (max-width: 767px) {
  .reimu-results {
    padding: 12px 18px;
  }
}

#reimu-stats {
  font-size: 13px;
  opacity: 0.7;
  min-height: 1em;
}

#reimu-hits {
  margin-top: 12px;
}

#reimu-hits mark {
  background: var(--red-1);
  color: #fff;
}

/* 命中项：标题 + 摘要两行，左侧保留主题小红条 */
.reimu-hit-item-link {
  display: block;
  position: relative;
  text-decoration: none;
  color: var(--red-2);
  padding: 10px 0 10px 24px;
}

.reimu-hit-item-link:before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 6px;
  height: 12px;
  background: var(--color-h2-after);
  box-shadow: var(--shadow-red-6-shadow);
  opacity: 0.5;
  transition: 0.2s;
}

.reimu-hit-item-link:hover:before,
.reimu-hit-item-link:focus:before {
  height: 6px;
  border-radius: 50%;
  opacity: 1;
  top: 18px;
}

.reimu-hit-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}

.reimu-hit-item-snippet {
  margin-top: 3px;
  font-size: 13px;
  color: var(--grey-9);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reimu-hit-item-date {
  color: var(--red-1);
  opacity: 0.75;
  font-size: 12px;
  margin-right: 6px;
}

/* ---- 分页 ---- */
.reimu-pagination {
  margin: 8px auto;
  text-align: center;
  color: var(--grey-9);
  overflow: hidden;
}

.reimu-pagination a {
  padding: 10px 16px;
  color: var(--grey-9);
  text-decoration: none;
  transition: 0.2s;
  cursor: pointer;
  cursor: var(--cursor-pointer, pointer);
}

.reimu-pagination a:hover,
.reimu-pagination a:focus {
  background: var(--red-2);
  box-shadow: var(--shadow-red-6-shadow);
  color: #fff;
}

.reimu-pagination .pagination-item {
  display: inline-block;
}

.reimu-pagination .page-number {
  display: inline-block;
  border-radius: 8px;
  margin: 6px;
}

.reimu-pagination .current .page-number {
  color: #fff;
  background: var(--red-1);
  font-weight: bold;
  box-shadow: var(--shadow-red-6-shadow);
}

/* ---- 背景猫脸水印 & 空结果 ---- */
.reimu-bg {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: -1;
  opacity: 0.22;
  width: 150px;
  height: auto;
  pointer-events: none;
}

#reimu-hits-empty {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- 导航栏搜索按钮（SVG 放大镜，替代 iconfont 字形 \e631） ---- */
#nav-search-btn {
  cursor: pointer;
  cursor: var(--cursor-pointer, pointer);
}

#nav-search-btn:before {
  content: "" !important;
  display: inline-block;
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: url("../images/icons/search.svg") center / contain no-repeat;
  mask: url("../images/icons/search.svg") center / contain no-repeat;
  vertical-align: -0.12em;
}
