fix(website): center back-to-top button using left/margin instead of right

Previously used right: max(1.5rem, calc(50vw - 700px + 0.5rem)) which
caused the button to overlap content at certain viewport widths. Switch
to left: 50% with margin-left: -2rem to keep it centered relative to
the viewport without interfering with sidebar or content layout.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-03-22 02:19:40 +08:00
parent 7aeb8fbb65
commit 49eae1aba3

View File

@@ -531,7 +531,8 @@ th[data-sort].sort-asc::after {
.back-to-top {
position: fixed;
bottom: 2rem;
right: max(1.5rem, calc(50vw - 700px + 0.5rem));
left: 50%;
margin-left: -2rem;
background: var(--bg);
border: 1px solid var(--border-strong);
border-radius: 4px;
@@ -569,7 +570,7 @@ th[data-sort].sort-asc::after {
}
@media (max-width: 640px) {
.back-to-top { right: 1.25rem; bottom: 1.25rem; }
.back-to-top { bottom: 1.25rem; }
}
/* === Noscript === */