/* 与已有玻璃描边共用 ::after，光线只落在一像素边缘，不覆盖正文。 */
:root {
  --interaction-light-rgb: 166 226 255;
  --interaction-edge-rest: linear-gradient(140deg, rgb(199 229 255 / .2), rgb(126 166 231 / .045) 48%, rgb(169 201 254 / .14));
  --dog-glass-image: url("assets/icons/dog-glass.svg?v=20260926-relief");
  --dog-glass-refraction: blur(.65px) saturate(125%) brightness(1.12);
}
:root[data-theme="light"] {
  --interaction-light-rgb: 69 138 218;
  --interaction-edge-rest: linear-gradient(140deg, rgb(88 139 194 / .2), rgb(144 181 223 / .045) 48%, rgb(109 131 191 / .15));
  --dog-glass-image: url("assets/icons/dog-glass-day.svg?v=20260926-relief");
  --dog-glass-refraction: blur(.5px) saturate(112%) brightness(1.025);
}
.light-reactive {
  position: relative;
  --light-hover-alpha: 0;
  --light-pulse-alpha: 0;
  --light-pointer-x: 50%;
  --light-pointer-y: 0px;
  --light-edge-angle: 0deg;
  transition-property: color, background-color, border-color, box-shadow;
}
/* 列表维持原来的底部分隔线，仅交互时显出局部亮边，不常驻整圈方框。 */
.latest-link.light-reactive,
.light-topic.light-reactive,
.light-note.light-reactive,
.article-item.light-reactive,
.search-result.light-reactive,
.bm-link.light-reactive,
.bookmark-link.light-reactive {
  --interaction-edge-rest: linear-gradient(transparent, transparent);
}
/* 卡片保持原位，反馈来自光线，不再上下或横向跳动。 */
.light-reactive:hover,
.light-reactive:active {
  transform: none;
  translate: none;
}
.light-entry.light-reactive:hover {
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.light-reactive::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  background:
    conic-gradient(from var(--light-edge-angle), transparent 0deg, rgb(var(--interaction-light-rgb) / var(--light-pulse-alpha)) 16deg, transparent 65deg),
    radial-gradient(145px circle at var(--light-pointer-x) var(--light-pointer-y), rgb(var(--interaction-light-rgb) / var(--light-hover-alpha)), transparent 78%),
    var(--interaction-edge-rest);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
/* 首页原有静态玻璃边缘继续保留，交互层只在其上局部增亮。 */
.light-entry.light-reactive::after {
  background:
    conic-gradient(from var(--light-edge-angle), transparent 0deg, rgb(var(--interaction-light-rgb) / var(--light-pulse-alpha)) 16deg, transparent 65deg),
    radial-gradient(145px circle at var(--light-pointer-x) var(--light-pointer-y), rgb(var(--interaction-light-rgb) / var(--light-hover-alpha)), transparent 78%),
    var(--glass-rim);
}
.light-reactive.is-light-hover { --light-hover-alpha: .9; }
.light-reactive:active { border-color: var(--focus); }
.light-reactive:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
/* 搜索结果位于滚动容器，内收焦点线避免左右轮廓被裁掉。 */
.search-result.light-reactive:focus-visible { outline-offset: -2px; }
.light-reactive:has(:focus-visible)::after {
  background: var(--focus);
}
/* 不支持挖空蒙版时仅保留普通边框，防止光层遮住正文。 */
@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .light-reactive::after { display: none; }
  .light-reactive:is(:hover, :focus-within, :active) { border-color: var(--focus); }
}

/* 照片轮廓与透明表面分开处理，高光清楚而身体仍透出后方光场。 */
.footer-dog-mark,
.dog-glass-mark {
  width: 68px;
  height: 76px;
  display: block;
  position: relative;
  flex: 0 0 auto;
  pointer-events: none;
  /* 祖先不设置 filter，让内部玻璃可采样到页面本身的背景。 */
  filter: none;
}
.footer-dog-mark::before,
.dog-glass-mark::before,
.dog-empty::before {
  content: "";
  display: block;
  background: var(--dog-glass-image) center / contain no-repeat;
  -webkit-backdrop-filter: var(--dog-glass-refraction);
  backdrop-filter: var(--dog-glass-refraction);
  /* 轮廓蒙版限制折射范围，耳朵周围不会出现矩形的模糊底板。 */
  -webkit-mask: url("assets/icons/dog-glass-mask.svg?v=20260926-relief") center / contain no-repeat;
  mask: url("assets/icons/dog-glass-mask.svg?v=20260926-relief") center / contain no-repeat;
  pointer-events: none;
}
.footer-dog-mark::before,
.dog-glass-mark::before { position: absolute; inset: 0; }
.site-footer:has(.footer-dog-mark) { align-items: center; }
.dog-empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding-block: 26px;
}
.dog-empty::before {
  width: 72px;
  height: 80px;
  filter: none;
}
@media (max-width: 600px) {
  .footer-dog-mark { width: 60px; height: 68px; }
  .site-footer:has(.footer-dog-mark) { column-gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .light-reactive,
  .light-reactive::after { transition: none; animation: none; }
  .light-reactive.is-light-hover { --light-hover-alpha: 0; }
  /* 键盘已有清楚的外轮廓，减少动态时不再叠画第二圈焦点边。 */
  .light-reactive:active::after { background: var(--focus); }
}
@media (forced-colors: active) {
  .light-reactive::after { display: none; }
  .light-reactive:focus-visible { outline-color: Highlight; }
  .footer-dog-mark::before, .dog-glass-mark::before, .dog-empty::before {
    /* 高对比模式仍保留可识别的实体狗狗，不退回纯色矩形。 */
    background: var(--dog-glass-image) center / contain no-repeat;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    forced-color-adjust: none;
  }
}
