/* ============================================================
   Yinfu 主题 · 鼠标悬浮特效 (2026-08-28 rev.c)
   特效保留：边框、浮起、变色、鼠标追踪
   已删除：内部光晕（跟随光标的粉色柔光 fill）
   ============================================================ */

/* ---------- 1. 卡片：聚光边框 + 微浮起（保留鼠标追踪） ----------
   注意：描边放在 ::before，避免覆盖 .media:after 的高度撑开户（置顶大卡片的
   高度依赖 .media:after / .media-diy:after 的 padding-top，若被 ::after 覆盖
   高度会塌陷为 0，导致卡片消失）。 */

.fx-card {
  position: relative;
  isolation: isolate;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1),
              box-shadow .35s ease;
  will-change: transform;
}

/* 聚光边框：光标位置的高亮描边（跟随鼠标） */
.fx-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
  background: radial-gradient(320px circle at var(--fx-x, 50%) var(--fx-y, 50%),
              rgba(244, 114, 182, .85), rgba(244, 114, 182, .2) 40%, transparent 68%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.fx-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -12px rgba(244, 114, 182, .40),
              0 6px 16px -6px rgba(31, 15, 23, .10);
}

.fx-card:hover::before { opacity: 1; }

.dark .fx-card:hover {
  box-shadow: 0 16px 32px -14px rgba(244, 114, 182, .45),
              0 6px 16px -6px rgba(0, 0, 0, .5);
}

/* ---------- 2. 文章正文大容器：仅边框，不位移 ---------- */

.fx-panel {
  position: relative;
  isolation: isolate;
  transition: box-shadow .35s ease;
}

.fx-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
  background: radial-gradient(360px circle at var(--fx-x, 50%) var(--fx-y, 50%),
              rgba(244, 114, 182, .85), rgba(244, 114, 182, .15) 40%, transparent 66%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.fx-panel:hover {
  box-shadow: 0 12px 28px -14px rgba(244, 114, 182, .32),
              0 4px 14px -8px rgba(31, 15, 23, .08);
}
.fx-panel:hover::after { opacity: 1; }

.dark .fx-panel:hover {
  box-shadow: 0 14px 30px -16px rgba(244, 114, 182, .38),
              0 6px 16px -8px rgba(0, 0, 0, .45);
}

/* ---------- 3. 上一篇/下一篇：浮起 + 变色（无伪元素，避免遮罩冲突） ---------- */

.fx-prev {
  transition: transform .3s cubic-bezier(.22, 1, .36, 1),
              box-shadow .3s ease;
}
.fx-prev:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -12px rgba(244, 114, 182, .55),
              0 5px 14px -5px rgba(0, 0, 0, .30);
}

/* ---------- 4. 按钮：流光扫过 ---------- */

.fx-btn {
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.fx-btn::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -80%;
  width: 42%;
  height: 160%;
  z-index: 1;
  pointer-events: none;
  transform: skewX(-22deg);
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  opacity: 0;
  transition: opacity .2s ease;
}
.fx-btn:hover::before {
  opacity: 1;
  animation: fx-shine .7s ease;
}
.dark .fx-btn::before {
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .30), transparent);
}
@keyframes fx-shine {
  0%   { left: -80%; }
  100% { left: 165%; }
}

/* 分页页码是 inline 元素，需转成 inline-block 才能承载流光 */
.fx-inline {
  display: inline-block;
}

/* ---------- 5. 导航链接：底部渐变滑线 ---------- */

nav a:not(.font-extrabold):not(.p-2) {
  position: relative;
}
nav a:not(.font-extrabold):not(.p-2)::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 60%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(244, 114, 182, 0),
              rgba(244, 114, 182, .9), rgba(244, 114, 182, 0));
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform .35s ease;
}
nav a:not(.font-extrabold):not(.p-2):hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* ---------- 5. 搜索框（导航栏长条形输入框 + 搜索结果页搜索框） ---------- */

.yf-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  border-radius: .5rem;
  background: var(--btn-plain-bg-hover);
  color: #374151;
}

.yf-search-icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--btn-content);
}

.yf-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  font-size: .875rem;
  color: inherit;
}

.yf-search input::placeholder { color: rgba(128, 128, 128, .55); }

/* 导航栏搜索框：手机较窄，桌面加宽 */
.yf-search-nav {
  width: 7rem;
  padding: .35rem .7rem;
}
@media (min-width: 640px) { .yf-search-nav { width: 9rem; } }
@media (min-width: 1024px) { .yf-search-nav { width: 13rem; } }

/* 搜索结果页搜索框：与标题框同高同宽，输入框带下划线 */
.yf-search-bar {
  width: 100%;
  padding: .5rem .875rem;
  border: 1px solid var(--btn-plain-bg-hover);
}

.yf-search-bar input {
  border-bottom: 2px solid rgba(244, 114, 182, .45);
  padding: .2rem 0;
  line-height: 1.5;
  transition: border-color .3s ease;
}
.yf-search-bar input:focus {
  border-bottom-color: rgba(244, 114, 182, .95);
}
.yf-search-bar input::placeholder { color: rgba(128, 128, 128, .5); }

.yf-search-btn {
  flex: none;
  border: 0;
  cursor: pointer;
  border-radius: .375rem;
  background: var(--primary);
  color: #fff;
  font-size: .8125rem;
  font-weight: 500;
  padding: .375rem .875rem;
  line-height: 1.5;
  transition: opacity .3s ease;
}
.yf-search-btn:hover { opacity: .85; }

.dark .yf-search { color: #e5e7eb; }
.dark .yf-search-btn { color: #1f2937; }