/* ============================================================
   UNICONN 站内搜索模块（悬浮放大镜 + 左侧抽屉）
   独立于模板样式，不依赖 jQuery / Bootstrap JS
   主色沿用站点 --primary: #FD5D14
   ============================================================ */

.ucs-toggle {
  position: fixed;
  left: 18px;
  top: 50%;
  z-index: 1035;
  width: 56px;
  height: 56px;
  margin-top: -28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #FD5D14;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(253, 93, 20, .34), 0 2px 8px rgba(0, 0, 0, .18);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.ucs-toggle:hover,
.ucs-toggle:focus-visible {
  background: #e8520f;
  box-shadow: 0 12px 30px rgba(253, 93, 20, .45);
}

.ucs-toggle:hover {
  transform: scale(1.07);
}

.ucs-toggle:focus-visible {
  outline: 3px solid rgba(253, 93, 20, .45);
  outline-offset: 3px;
}

.ucs-toggle svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* 抽屉打开时把按钮藏起来，避免与遮罩重叠 */
.ucs-toggle[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
}

/* ---------- 遮罩 ---------- */
.ucs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(24, 20, 17, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}

.ucs-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ---------- 左侧抽屉 ---------- */
.ucs-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1045;
  width: min(430px, 92vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #241d18;
  box-shadow: 8px 0 44px rgba(0, 0, 0, .26);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform .32s cubic-bezier(.22, .61, .36, 1), visibility .32s;
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

.ucs-panel.is-open {
  transform: none;
  visibility: visible;
}

.ucs-panel *,
.ucs-panel *::before,
.ucs-panel *::after {
  box-sizing: border-box;
}

/* ---------- 头部 ---------- */
.ucs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 18px;
  background: radial-gradient(circle at 18% -10%, #33291f 0%, #17130f 68%);
  color: #fff;
}

.ucs-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fff;
}

.ucs-title::before {
  content: "";
  display: block;
  width: 4px;
  height: 16px;
  background: #FD5D14;
}

.ucs-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}

.ucs-close:hover,
.ucs-close:focus-visible {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .4);
  outline: none;
}

.ucs-close svg {
  width: 15px;
  height: 15px;
}

/* ---------- 输入区 ---------- */
.ucs-search {
  padding: 18px 22px;
  background: #fbf8f6;
  border-bottom: 1px solid #efe9e4;
}

.ucs-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: #fff;
  border: 1.5px solid #e6ddd6;
  border-radius: 10px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.ucs-field:focus-within {
  border-color: #FD5D14;
  box-shadow: 0 0 0 3px rgba(253, 93, 20, .14);
}

.ucs-field > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #a99c92;
}

.ucs-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #241d18;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.ucs-input::placeholder {
  color: #b3a79e;
}

.ucs-input::-webkit-search-cancel-button,
.ucs-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.ucs-clear {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: #a99c92;
  font-size: 13px;
  cursor: pointer;
  visibility: hidden;
}

.ucs-clear.is-visible {
  visibility: visible;
}

.ucs-clear:hover {
  color: #FD5D14;
}

/* ---------- 热门标签 ---------- */
.ucs-hot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 22px 16px;
  border-bottom: 1px solid #f1ebe6;
}

.ucs-hot-label {
  width: 100%;
  margin-bottom: 2px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #a99c92;
}

.ucs-chip {
  padding: 6px 12px;
  border: 1px solid #ece2db;
  border-radius: 999px;
  background: #fff;
  color: #5c4f45;
  font-size: 12.5px;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

.ucs-chip:hover,
.ucs-chip:focus-visible {
  border-color: #FD5D14;
  background: #fff6f1;
  color: #d94a10;
  outline: none;
}

/* ---------- 结果区 ---------- */
.ucs-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 10px 18px;
  -webkit-overflow-scrolling: touch;
}

.ucs-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 8px;
  font-size: 12px;
  color: #a99c92;
}

.ucs-group-label {
  padding: 12px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #b3a79e;
}

.ucs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease;
}

.ucs-item:hover,
.ucs-item.is-active {
  background: #fff3ec;
  color: inherit;
  text-decoration: none;
}

.ucs-item:focus-visible {
  outline: 2px solid rgba(253, 93, 20, .5);
  outline-offset: -2px;
}

.ucs-badge {
  flex: 0 0 auto;
  width: 42px;
  padding: 4px 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .04em;
}

.ucs-badge--series {
  background: #fdeee6;
  color: #d94a10;
}

.ucs-badge--part {
  background: #eef1f5;
  color: #41536b;
}

.ucs-badge--page {
  background: #eef7ee;
  color: #2f6b3a;
}

.ucs-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.ucs-item-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: #241d18;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ucs-item-sub {
  margin-left: 7px;
  font-weight: 400;
  color: #8c7f75;
}

.ucs-item-meta {
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  color: #8c7f75;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ucs-arrow {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: #c9bdb3;
}

.ucs-panel mark {
  padding: 0 1px;
  border-radius: 2px;
  background: rgba(253, 93, 20, .2);
  color: inherit;
}

/* ---------- 空状态 ---------- */
.ucs-empty {
  padding: 34px 24px 26px;
  text-align: center;
  color: #8c7f75;
  font-size: 13px;
  line-height: 1.7;
}

.ucs-empty strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  color: #241d18;
}

.ucs-empty a {
  color: #FD5D14;
  text-decoration: none;
}

.ucs-empty a:hover {
  text-decoration: underline;
}

/* ---------- 底部 ---------- */
.ucs-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 12px 22px;
  border-top: 1px solid #efe9e4;
  background: #fbf8f6;
  font-size: 12px;
  color: #a99c92;
}

.ucs-foot a {
  color: #FD5D14;
  text-decoration: none;
}

.ucs-foot a:hover {
  text-decoration: underline;
}

.ucs-keys {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ucs-keys kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  border: 1px solid #e2d8d0;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  color: #8c7f75;
  font-family: inherit;
  font-size: 10.5px;
  text-align: center;
}

/* 打开抽屉时锁定页面滚动 */
body.ucs-lock {
  overflow: hidden;
}

/* ---------- 小屏 ---------- */
@media (max-width: 575.98px) {
  .ucs-toggle {
    left: 12px;
    width: 48px;
    height: 48px;
    margin-top: -24px;
  }

  .ucs-toggle svg {
    width: 21px;
    height: 21px;
  }

  .ucs-panel {
    width: 100%;
  }

  .ucs-head {
    padding: 16px 18px 14px;
  }

  .ucs-search,
  .ucs-hot {
    padding-left: 18px;
    padding-right: 18px;
  }

  .ucs-foot {
    padding: 10px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ucs-toggle,
  .ucs-overlay,
  .ucs-panel,
  .ucs-item {
    transition: none;
  }
}
