/* 默认颜色变量（浅色模式） */
:root,
.light,
.light-theme {
  --background-color: #ffffff;
  --search-background-color: rgba(250, 250, 250);
  --search-background-hover-color: rgba(110, 86, 207, 0.1);
  --search-title-color: rgba(32, 32, 32);
  --content-border-color: rgba(232, 232, 232);
  --filter-icon: none;
  --message-text: rgba(32, 32, 32);
  --scrollbar-color: rgba(223, 223, 223);
  --dec-text-color: rgba(119, 119, 119);
}

/* 深色模式颜色变量 */
.dark,
.dark-theme {
  --background-color: #000000;
  --search-background-color: rgba(26, 26, 26);
  --search-background-hover-color: rgba(110, 86, 207, 0.1);
  --search-title-color: rgba(230, 230, 230);
  --content-border-color: rgba(255, 255, 255, 0.1);
  --filter-icon: brightness(0) saturate(100%) invert(100%);
  --message-text: rgba(230, 230, 230);
  --scrollbar-color: rgba(51, 51, 51);
  --dec-text-color: rgba(179, 179, 179);
}

/* 外部搜索框 */
.searchbox input {
  background: none;
  padding: 0px;
  box-sizing: content-box;
}

.searchbox-input {
  gap: 10px;
  font-family: var(--sy-f-text);
  background: var(--sy-c-surface);
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  border-radius: 6px;
  align-items: center;
  height: 36px;
  line-height: 36px;
  width: 218px;
  border: 1px solid var(--gray-4);
}

.searchbox-input .text {
  color: #777777;
  display: inline-block;
  font-size: 14px;
  line-height: 22px;
}

.searchbox-input .icon-sousuo {
  margin-left: 8px;
  font-size: 14px;
  color: #777777;
}

.searchbox-right {
  display: flex;
  gap: 4px;
  margin-right: 8px;
}

.searchbox-right .text {
  background-color: var(--sy-c-surface);
  color: var(--sy-c-link);
  font-size: 14px;
  height: 24px;
  display: flex;
  align-items: center;
  padding: 10px;
  box-sizing: border-box;
}

/* 搜索弹窗样式 */

.pagefind-search-container {
  padding-right: 4px;
  background-color: var(--background-color);
  border-radius: 12px;
}

.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gray-a5);
  backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.search-modal-content {
  position: relative;
  background: var(--background-color);
  border-radius: 12px;
  width: 100%;
  height: 46px;
  max-width: 1140px;
  margin-top: 4%;
  box-shadow: 0px 16px 48px 0px rgba(0, 0, 0, 0.16);
}

/* 搜索框搜索按钮 */
.pagefind-ui__form:before {
  background-color: var(--sy-c-link) !important;
  width: 16px !important;
  height: 16px !important;
  top: 15px !important;
  left: 24px !important;
  mask-image: url('../img/search.svg') !important;
}

.pagefind-ui__search-input {
  height: 46px !important;
  font-family: Microsoft YaHei UI !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  padding: 0px 2px 0px 50px !important;
  background-color: var(--background-color) !important;
  border: 1px solid var(--background-color) !important;
  width: calc(100% - 34px) !important;
  color: var(--message-text) !important;
}

.pagefind-ui__search-input:focus {
  outline: none;
}

.pagefind-ui__search-clear {
  font-size: 0px !important;
  right: 20px !important;
  background-image: url(../img/close.svg) !important;
  background-color: var(--background-color) !important;
  background-repeat: no-repeat !important;
  background-size: 24px !important;
  height: 24px !important;
  width: 24px !important;
  top: 12px !important;
}

.pagefind-ui__drawer {
  overflow-y: auto !important;
  height: 613px !important;
  padding: 0px 8px 8px 8px !important;
  background: var(--background-color) !important;
  border-top: 1px solid var(--content-border-color) !important;
  border-radius: 0px 0px 12px 12px !important;
  /* Firefox 兼容性代码 */
  scrollbar-color: rgba(223, 223, 223, 1) var(--background-color);
  scrollbar-width: 8px;
}

/* WebKit 内核的浏览器 */
.pagefind-ui__drawer::-webkit-scrollbar {
  width: 6px;
}

.pagefind-ui__drawer::-webkit-scrollbar-track {
  background: var(--background-color) !important;
  border-radius: 0px 12px 12px 0px !important;
}

.pagefind-ui__drawer::-webkit-scrollbar-thumb {
  background: var(--scrollbar-color);
  border-radius: 999px;
}

.pagefind-ui__drawer::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-color);
}

/* 搜索结果的文字样式 */
.pagefind-ui__results-area {
  margin-top: 0px !important;
}

.pagefind-ui__message {
  font-family: Microsoft YaHei UI !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  padding: 16px 12px 12px 16px !important;
  color: var(--message-text) !important;
}

.pagefind-ui__results {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.pagefind-ui__result {
  border-top: none !important;
  padding: 12px 16px 12px 16px !important;
  border-radius: 8px !important;
  background: var(--search-background-color) !important;
}

.pagefind-ui__result:hover {
  background: var(--search-background-hover-color) !important;
}

.pagefind-ui__result-title,
.pagefind-ui__result-link {
  color: var(--search-title-color) !important;
  font-weight: 700 !important;
}

.pagefind-ui__result-link:hover {
  color: rgba(110, 86, 207) !important;
  text-decoration: none !important;
}

.pagefind-ui__result:last-of-type {
  border-bottom: none !important;
}

.pagefind-ui__result-inner {
  margin-top: 0px !important;
}

/* 父标题样式 */
.pagefind-ui__result-title > a.pagefind-ui__result-link {
  font-size: 16px !important;
}

.pagefind-ui__result-nested {
  padding-left: 40px !important;
}

/* 子标题样式 */
.pagefind-ui__result-nested
  .pagefind-ui__result-title
  > a.pagefind-ui__result-link {
  font-size: 14px !important;
}

.pagefind-ui__result-nested .pagefind-ui__result-link:before {
  content: '' !important;
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url(../img/skip.svg);
  background-repeat: no-repeat;
  background-position: center;
  margin-right: 8px !important;
  filter: var(--filter-icon);
}

/* 描述 */
.pagefind-ui__result-excerpt {
  font-size: 12px !important;
  color: var(--dec-text-color) !important;
}

/* 加载更多样式 */
.pagefind-ui__button {
  margin-top: 8px !important;
  border: none !important;
  color: rgba(110, 86, 207, 1) !important;
  font-family: Microsoft YaHei UI !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 22px !important;
  background: var(--background-color) !important;
}
