::before / ::after 或四个独立子元素分别代表上下左右四条边width: 0 → 100% 过渡,垂直边通过 height: 0 → 100% 过渡transition-delay 让四条边按顺序依次出现,形成连贯的绘制路径stroke-dasharray + stroke-dashoffset 也是实现描边动画的经典方案两种描边动画方案。方案一用 SVG stroke-dashoffset,pathLength="1" 把周长归一化,hover 时偏移归零,描边像被"画"出来。方案二用 CSS 伪元素 ::before/::after 各负责两条边,通过 width/height 过渡 + transition-delay 串联,依次画出上右、下左,绕成一圈。