/* 小熊元素：图标、水印、装饰点、加载态
   bear.svg 单独文件，这里只放引用与排布 */

/* ---------- 侧边栏顶部 logo 旁的小熊 ---------- */
.sidebar-header {
  position: relative;
}

.sidebar-header::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 30px;
  height: 30px;
  transform: translateY(-50%) rotate(-6deg);
  background: url("/bear.svg") center / contain no-repeat;
  opacity: 0.9;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.sidebar-header:hover::after {
  transform: translateY(-50%) rotate(8deg) scale(1.12);
  opacity: 1;
}

/* ---------- 页面右下角小熊水印 ---------- */
.bear-watermark {
  background: url("/bear.svg") center / contain no-repeat;
}

/* 内页右下角放一个半透明小熊（用 body 的第二个背景层实现，
   不占 DOM，不会遮挡点击） */
body::after {
  content: "";
  position: fixed;
  right: 22px;
  bottom: 18px;
  width: 92px;
  height: 92px;
  background: url("/bear.svg") center / contain no-repeat;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
  transform: rotate(-8deg);
  filter: drop-shadow(0 6px 14px rgba(255, 143, 193, 0.25));
}

html:has(input[type="password"]) body::after {
  width: 110px;
  height: 110px;
  right: 34px;
  bottom: 28px;
  opacity: 0.9;
  transform: rotate(-6deg);
}

/* ---------- 卡片 hover 时右上角冒出小熊 ---------- */
.card::after,
.dark\:bg-dark-800::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 26px;
  height: 26px;
  background: url("/bear.svg") center / contain no-repeat;
  opacity: 0;
  transform: scale(0.6) rotate(-20deg);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.card:hover::after,
.dark\:bg-dark-800:hover::after {
  opacity: 0.55;
  transform: scale(1) rotate(0deg);
}

/* 只给 .card 加定位，小熊角标需要锚点。
   绝对不要写成 .dark\:bg-dark-800 / .dark\:bg-dark-900 ——
   这两个是通用背景类，sub2api 的行操作菜单（.action-menu-content）
   也带 dark:bg-dark-800，一旦被设成 relative，
   它的 position:fixed 就失效，菜单会被推到表格底部超出视口，
   用户看到的现象就是「点更多没反应」。 */
.card {
  position: relative;
}

/* ---------- 主按钮左侧小熊爪印 ---------- */
.btn-primary::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 6px;
  vertical-align: -2px;
  background: url("/bear.svg") center / contain no-repeat;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

/* ---------- 加载动画换成小熊 ---------- */
.animate-spin {
  animation: none !important;
  background: url("/bear.svg") center / contain no-repeat !important;
  width: 1.6em !important;
  height: 1.6em !important;
  border: none !important;
  border-radius: 0 !important;
  animation: bear-bounce 1.05s ease-in-out infinite !important;
}

@keyframes bear-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  45%      { transform: translateY(-18%) scale(1.06); }
  70%      { transform: translateY(0) scale(0.97); }
}

/* ---------- 侧边栏激活项左侧小熊爪 ---------- */
.sidebar-link-active::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  background: url("/bear.svg") center / contain no-repeat;
  opacity: 0.95;
}

/* ---------- 表格行 hover 出现小熊 ---------- */
tbody tr {
  position: relative;
}

tbody tr:hover td:last-child::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: 6px;
  vertical-align: -2px;
  background: url("/bear.svg") center / contain no-repeat;
  opacity: 0.5;
}

/* ---------- 输入框聚焦时小熊探头 ---------- */
input:focus {
  background-image: url("/bear.svg") !important;
  background-repeat: no-repeat !important;
  background-size: 18px !important;
  background-position: right 10px center !important;
  padding-right: 36px !important;
}

/* ---------- 空状态 / 无数据 ---------- */
.empty-state::before,
[class*="empty"]::before {
  content: "";
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  background: url("/bear.svg") center / contain no-repeat;
  opacity: 0.35;
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .animate-spin { animation: none !important; }
  .sidebar-header::after,
  .card::after { transition: none !important; }
}
