feat(admin): 增加背景管理

- settings 新增 background.light / background.dark,留空使用内置图
- 后台首页管理新增「背景管理」,两栏 URL 输入与实时预览,可一键恢复内置图
- 前台按设置覆盖明暗背景图,仍保留 65vh 与交叉淡入
- 保存/撤销沿用现有设置乐观锁流程
This commit is contained in:
2026-11-03 20:23:57 +08:00
parent b9005dd514
commit 5439ebf3be
6 changed files with 166 additions and 5 deletions
+43
View File
@@ -1379,3 +1379,46 @@ html.theme-transition .site-background {
transition: none !important;
}
}
/* 后台:背景管理预览 */
.background-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: var(--su-space-5);
}
.background-section {
display: flex;
flex-direction: column;
gap: var(--su-space-3);
min-width: 0;
}
.background-preview {
position: relative;
height: 180px;
border: 1px solid var(--su-border);
border-radius: var(--su-radius-md);
background-color: var(--su-bg-subtle);
background-position: center top;
background-repeat: no-repeat;
background-size: cover;
overflow: hidden;
}
.background-preview span {
position: absolute;
bottom: var(--su-space-3);
left: var(--su-space-3);
padding: 2px var(--su-space-2);
border-radius: var(--su-radius-pill);
background-color: rgb(0 0 0 / 55%);
color: #fff;
font-size: var(--su-font-size-xs);
}
@media (width <= 900px) {
.background-grid {
grid-template-columns: minmax(0, 1fr);
}
}