/* 小星图回应悬浮：依次点亮、描线、淡去；不自动循环。 */
:root{--hover-star:#dfc58f;--hover-star-soft:#c2ad83}
.primary-nav a::after{opacity:0;pointer-events:none}
.primary-nav a:not([aria-current])::after,.primary-nav a::before{display:none}
.primary-nav a[aria-current]::after{opacity:1;transform:none;animation:none}

.star-constellation{
  position:absolute;
  max-width:none;
  overflow:visible;
  color:var(--hover-star);
  pointer-events:none;
  --star-peak:.95;
  --thread-peak:.50;
  --emerge-y:4px;
}
.constellation--nav{
  left:50%;
  bottom:-24px;
  width:86px;
  height:36px;
  transform:translateX(-50%);
}
.primary-nav a[data-constellation-variant="up"] .constellation--nav{bottom:auto;top:-21px}
.constellation--card{
  right:20px;
  width:120px;
  height:50px;
  --star-peak:.85;
  --thread-peak:.40;
}
.constellation--down{--emerge-y:-4px}
.constellation--orbit{--emerge-y:0px}
.constellation-motion{transform-box:view-box;transform-origin:60px 25px}
.constellation-node{
  fill:currentColor;
  opacity:0;
  transform-box:fill-box;
  transform-origin:center;
  filter:drop-shadow(0 0 3px #d8b97070);
}
.constellation-thread{
  fill:none;
  stroke:var(--hover-star-soft);
  stroke-width:.75;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-dasharray:1;
  stroke-dashoffset:1;
  opacity:0;
}

/* 图案只用卡片边缘的留白；标题、分类和箭头保持清楚。 */
.article-row,.note-card{position:relative}
.article-row::after,.note-card::after{display:none}
.article-row .constellation--card{right:5px;width:104px;height:43px;top:-7px}
.article-row[data-constellation-variant="down"] .constellation--card{top:auto;bottom:-12px}
.article-row[data-constellation-variant="orbit"] .constellation--card{top:-11px;right:4px}
.note-card .constellation--card{top:-24px;right:18px}
.note-card[data-constellation-variant="down"] .constellation--card{top:auto;bottom:-21px}
.note-card[data-constellation-variant="orbit"] .constellation--card{top:-22px;right:16px}

/* 按钮继续保留一颗轻亮的小星。 */
.button{position:relative}
.button::after{
  content:"";
  position:absolute;
  top:-9px;
  right:9px;
  width:11px;
  height:15px;
  background:var(--hover-star);
  clip-path:polygon(50% 0,61% 37%,100% 50%,61% 63%,50% 100%,39% 63%,0 50%,39% 37%);
  opacity:0;
  filter:drop-shadow(0 0 3px #d8b97060);
  transform:translateY(4px) scale(.5) rotate(-15deg);
  transition:opacity 260ms ease,transform 420ms ease;
  pointer-events:none;
}
.button:focus-visible::after{opacity:.9;transform:none}

@media(hover:hover) and (pointer:fine){
  .primary-nav a:hover{color:#ead3a3;text-shadow:0 0 18px #d7ba7640}
  :is(.primary-nav a,.article-row,.note-card):hover .constellation-node{
    animation:constellation-node 1600ms ease-out both;
    animation-delay:calc(var(--star-index,0) * 140ms);
  }
  :is(.primary-nav a,.article-row,.note-card):hover .constellation-thread{
    animation:constellation-thread 2020ms ease-out both;
  }
  :is(.primary-nav a,.article-row,.note-card):hover .constellation--orbit .constellation-motion{
    animation:constellation-orbit 2050ms ease-out both;
  }
  .button:hover::after{animation:star-awaken 1100ms ease-out both}
}
@keyframes constellation-node{
  0%{opacity:0;transform:translateY(var(--emerge-y)) scale(.5)}
  19%{opacity:var(--star-peak);transform:translateY(0) scale(1.28)}
  34%{opacity:calc(var(--star-peak) * .90);transform:translateY(0) scale(1.15)}
  69%{opacity:calc(var(--star-peak) * .80);transform:translateY(0) scale(1.15)}
  100%{opacity:0;transform:translateY(0) scale(.94)}
}
@keyframes constellation-thread{
  0%,12%{opacity:0;stroke-dashoffset:1}
  24%{opacity:calc(var(--thread-peak) * .7)}
  49%{opacity:var(--thread-peak);stroke-dashoffset:0}
  75%{opacity:calc(var(--thread-peak) * .8);stroke-dashoffset:0}
  100%{opacity:0;stroke-dashoffset:0}
}
@keyframes constellation-orbit{
  0%{transform:translateY(2px) rotate(-8deg)}
  55%{transform:translateY(-1px) rotate(3deg)}
  100%{transform:translateY(0) rotate(10deg)}
}
@keyframes star-awaken{
  0%{opacity:0;transform:translateY(4px) scale(.35) rotate(-18deg)}
  45%{opacity:1;transform:translateY(-2px) scale(1.2) rotate(7deg)}
  100%{opacity:.9;transform:none}
}

/* 焦点使用静态形态，保留原有 outline。 */
.primary-nav a:focus-visible .constellation-node,
:is(.article-row,.note-card):has(a:focus-visible) .constellation-node{opacity:var(--star-peak);transform:none;animation:none}
.primary-nav a:focus-visible .constellation-thread,
:is(.article-row,.note-card):has(a:focus-visible) .constellation-thread{opacity:var(--thread-peak);stroke-dashoffset:0;animation:none}
.primary-nav a:focus-visible .constellation-motion,
:is(.article-row,.note-card):has(a:focus-visible) .constellation-motion{transform:none;animation:none!important}

@media(max-width:800px){
  .constellation--nav{width:68px;height:29px;bottom:-19px}
  .primary-nav a[data-constellation-variant="up"] .constellation--nav{top:-17px}
}
@media(max-width:600px){
  .constellation--card{width:98px;height:42px}
  .article-row .constellation--card{width:84px;height:35px;right:1px;top:-5px}
  .article-row[data-constellation-variant="down"] .constellation--card{top:auto;bottom:-10px}
  .note-card .constellation--card{right:14px;top:-20px}
  .note-card[data-constellation-variant="down"] .constellation--card{top:auto;bottom:-18px}
}
@media(prefers-reduced-motion:reduce){
  .constellation-node,.constellation-thread,.constellation-motion,.button::after{
    animation:none!important;
    transition:none!important;
    transform:none!important;
  }
}
@media(prefers-reduced-motion:reduce) and (hover:hover) and (pointer:fine){
  :is(.primary-nav a,.article-row,.note-card):hover .constellation-node{opacity:var(--star-peak)}
  :is(.primary-nav a,.article-row,.note-card):hover .constellation-thread{opacity:var(--thread-peak);stroke-dashoffset:0}
  .button:hover::after{opacity:.9}
}
@media print{.star-constellation,.button::after{display:none}}
