/* ---------------------------------------------------------------------------
 * history-drawer.css —— 前台「浏览历史」抽屉（2026-11-24）。
 *
 * 尺寸/动画/移动端全屏与 help.css 的 `.ps-help-drawer` 同一套契约，
 * 但类名独立（`ps-hist-*`）—— 两者内容与生命周期不同，别互相影响。
 * --------------------------------------------------------------------------- */

.ps-hist-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: rgba(16, 22, 40, .45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.ps-hist-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.ps-hist-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1061;
  display: flex;
  flex-direction: column;
  width: min(460px, 100vw);
  background: #fff;
  box-shadow: -8px 0 30px rgba(16, 22, 40, .18);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility .28s;
}
.ps-hist-drawer.is-open {
  transform: none;
  visibility: visible;
}

body.ps-hist-lock {
  overflow: hidden;
}

.ps-hist-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .95rem 1.1rem;
  border-bottom: 1px solid var(--border, #e5e7f0);
  background: #fff;
}
.ps-hist-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: .75rem;
  background: rgba(20, 32, 74, .07);
  color: var(--navy, #14204a);
  font-size: 1.15rem;
}
.ps-hist-head-txt {
  flex: 1 1 auto;
  min-width: 0;
}
.ps-hist-kicker {
  display: block;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
}
.ps-hist-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--navy, #14204a);
}
.ps-hist-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: .6rem;
  background: transparent;
  color: var(--muted, #6b7280);
  font-size: 1rem;
  cursor: pointer;
}
.ps-hist-close:hover {
  background: rgba(16, 22, 40, .06);
  color: var(--navy, #14204a);
}

.ps-hist-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.1rem 1.2rem;
}
.ps-hist-body .row {
  --bs-gutter-x: .75rem;
  --bs-gutter-y: .75rem;
}
/* _fav_items 的图高写死 180px（收藏页口径），抽屉里要更小更密 */
.ps-hist-body .card-img-top {
  height: 128px !important;
}
.ps-hist-body .blog-thumb {
  height: 128px;
}
.ps-hist-body .card-body {
  padding: .6rem .65rem;
}
.ps-hist-body .card-title {
  font-size: .82rem;
  line-height: 1.25;
}
.ps-hist-body .card-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ps-hist-body .small.text-muted {
  font-size: .72rem;
}

.ps-hist-loading,
.ps-hist-loadmore {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .9rem 0;
  color: var(--muted, #6b7280);
  font-size: .82rem;
}

.ps-hist-empty {
  padding: 2.4rem 1rem;
  text-align: center;
  color: var(--muted, #6b7280);
}
.ps-hist-empty > i {
  display: block;
  margin-bottom: .5rem;
  font-size: 2rem;
  opacity: .6;
}
.ps-hist-empty p {
  margin: 0;
}

.ps-hist-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1.1rem;
  border-top: 1px solid var(--border, #e5e7f0);
  background: #fff;
}
.ps-hist-foot a {
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy, #14204a);
}
.ps-hist-foot a i {
  vertical-align: -2px;
}

@media (max-width: 767.98px) {
  .ps-hist-drawer {
    width: 100vw;
  }
  .ps-hist-head {
    padding-top: calc(.95rem + env(safe-area-inset-top, 0px));
  }
  .ps-hist-foot {
    padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  }
  .ps-hist-body .card-img-top {
    height: 140px !important;
  }
  .ps-hist-body .blog-thumb {
    height: 140px;
  }
}
