You got it.
I think you could even do .internal-link[data-href="#^Top]" as the selector, so you don’t need the span tag at all. I also switched the background colour to use a variable so that it should look better in different themes or in light mode:
.internal-link[data-href="#^Top"] {
width: 80px;
height: 40px;
border-radius: 10px 10px 0px 0px;
background-color: var(--background-primary-alt);
box-shadow: 0px 5px 10px #darkgrey;
text-align: center;
padding-top: 4%;
line-height: 100%;
font-weight: bold;
font-size: 14px;
color: white;
position: fixed;
bottom: 0;
right: 5%;
margin: 0;
}
With the above, you can just write [[#^Top|TOP]] anywhere in the document and the CSS will pick it up.