Files
wx_pbzc/pages/settings/settings.wxss
T
lc ac0db6118d feat(ui): 全项目暗黑模式适配 — 加 theme 变量 + 替换全部硬编码颜色
新增主题变量 (light + dark 两套):
- --success-rgb / --danger / --danger-rgb (utils/theme.js)

全部硬编码 #XXX / rgba 颜色统一改主题变量:
- progress-ring 加 trackColor prop,默认 #EEEEEE
  (canvas 不能直接读 CSS var,需要 caller 传字面颜色)
- ui-modal sheet 背景 #FFFFFF → var(--card-bg), 加底部 padding 避开 Dock TabBar
- ui-modal handle #DDD → var(--bg-soft)
- ui-btn --danger 文字 #E53935 → var(--danger), 边框 rgba(229,57,53,...) → rgba(var(--danger-rgb),...)
- calendar-heatmap 三个 #999/#333 文字色 → var(--text-secondary)/var(--text)
- index picker: preset/custom input 背景 #F5F5F5 → var(--bg-soft), label #666 → var(--text-secondary)
- index done-badge 绿色 → var(--success-rgb), pending-text #CCC → var(--text-secondary)
- records empty/hint #CCC/#E0E0E0 → var(--text-secondary), danger 红 → var(--danger)
- settings plan-editor-sheet 背景 #FFFFFF → var(--card-bg), avatar 背景, handle, editor-input, preview 全部跟进
- leaderboard 金/铜背景 #FFF7E6/#FFF1E6 → rgba 半透明 (dark mode 下不刺眼)

Tab bar inactive 图标重新根据 dark mode 切换颜色 (#999999 light / #98989F dark)

leaderboard.json 删除 backgroundColor: #F5F5F5 覆盖,让 theme.json 接管

故意保留:
- 各 .wxss 中渐变按钮上的 #FFFFFF 文字色
- 排行榜金/铜文字色 #FA8C16/#D46B08 (视觉符号约定)
- 各页 data 中 orange theme 默认值 (onShow 后被 themeMod 覆盖)
2026-07-08 15:22:09 +08:00

581 lines
10 KiB
Plaintext

.section-header {
display: flex;
align-items: center;
margin-bottom: 20rpx;
}
.section-icon {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
.section-header .section-title {
margin-bottom: 0;
}
/* ---- theme picker ---- */
.theme-list { margin-top: 0; }
.theme-item {
display: flex;
align-items: center;
padding: 22rpx 0;
border-bottom: 1rpx solid var(--border);
transition: background 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
}
.theme-item:last-child { border-bottom: none; }
.theme-item.active {
background: rgba(var(--primary-rgb), 0.12);
margin: 0 -32rpx;
padding-left: 32rpx;
padding-right: 32rpx;
border-radius: 16rpx;
border-bottom: none;
}
.theme-item.active + .theme-item {
border-top: 1rpx solid transparent;
}
.theme-color-dot {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
margin-right: 20rpx;
flex-shrink: 0;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.15);
transition: transform 0.2s ease;
}
.theme-item:active .theme-color-dot {
transform: scale(1.15);
}
.theme-name {
flex: 1;
font-size: 28rpx;
color: var(--text);
}
.theme-check-img {
width: 32rpx;
height: 32rpx;
}
/* ---- plan list ---- */
.plan-list { margin-top: 0; }
.plan-item {
display: flex;
align-items: center;
padding: 24rpx 0;
border-bottom: 1rpx solid var(--border);
transition: background-color 0.3s ease, border-color 0.3s ease;
}
.plan-item:last-child { border-bottom: none; }
.plan-item.active {
background: rgba(var(--primary-rgb), 0.12);
margin: 0 -32rpx;
padding-left: 32rpx;
padding-right: 32rpx;
border-radius: 16rpx;
border-bottom: none;
}
.plan-radio {
width: 40rpx;
height: 40rpx;
border: 3rpx solid var(--border);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
flex-shrink: 0;
transition: border-color 0.2s;
}
.plan-item.active .plan-radio {
border-color: var(--primary);
}
.radio-dot {
width: 22rpx;
height: 22rpx;
background: var(--primary);
border-radius: 50%;
animation: popIn 0.3s ease;
}
.plan-content {
flex: 1;
display: flex;
flex-direction: column;
}
.plan-item-name {
font-size: 28rpx;
font-weight: 600;
color: var(--text);
}
.plan-item-desc {
font-size: 22rpx;
color: var(--text-secondary);
margin-top: 4rpx;
}
.plan-check-img {
width: 32rpx;
height: 32rpx;
}
.plan-actions {
display: flex;
align-items: center;
gap: 8rpx;
flex-shrink: 0;
}
.plan-edit-btn {
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: transparent;
transition: background 0.15s ease;
}
.plan-edit-btn:active {
background: rgba(var(--primary-rgb), 0.12);
}
.plan-edit-img {
width: 36rpx;
height: 36rpx;
opacity: 0.55;
}
.plan-item.active .plan-edit-img {
opacity: 0.85;
}
/* ---- setting rows ---- */
.setting-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
border-bottom: 1rpx solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-left {
display: flex;
align-items: center;
}
.setting-icon {
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
.setting-label {
font-size: 28rpx;
color: var(--text);
}
.setting-value {
font-size: 28rpx;
color: var(--primary);
}
/* ---- about ---- */
.about-list { margin-top: 12rpx; }
.about-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 18rpx 0;
border-bottom: 1rpx solid var(--border);
}
.about-row:last-child { border-bottom: none; }
.about-label {
font-size: 26rpx;
color: var(--text-secondary);
}
.about-value {
font-size: 26rpx;
color: var(--text);
}
.about-link {
color: var(--primary);
font-weight: 500;
}
/* ---- profile ---- */
.profile-row {
display: flex;
align-items: center;
padding: 16rpx 0 24rpx;
}
.avatar-btn {
position: relative;
width: 120rpx;
height: 120rpx;
padding: 0;
margin: 0;
background: var(--bg-soft);
border-radius: 50%;
border: none;
line-height: 1;
overflow: hidden;
flex-shrink: 0;
}
.avatar-btn::after {
border: none;
}
.avatar-img {
width: 100%;
height: 100%;
border-radius: 50%;
/* peopleFill svg is mostly transparent; give it a soft tint */
background: var(--bg-soft);
padding: 24rpx;
box-sizing: border-box;
}
.avatar-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 36rpx;
background: rgba(0, 0, 0, 0.55);
color: #FFFFFF;
font-size: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.profile-info {
flex: 1;
margin-left: 24rpx;
display: flex;
flex-direction: column;
min-width: 0;
}
.profile-name {
font-size: 32rpx;
font-weight: 600;
color: var(--text);
line-height: 1.2;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.profile-sub {
font-size: 22rpx;
color: var(--text-secondary);
margin-top: 8rpx;
line-height: 1;
}
.nickname-input {
flex: 1;
text-align: right;
font-size: 28rpx;
color: var(--text);
padding: 0;
background: transparent;
}
.about-footer {
margin-top: 24rpx;
padding-top: 20rpx;
border-top: 1rpx solid var(--border);
text-align: center;
}
.about-copy {
font-size: 22rpx;
color: var(--text-secondary);
}
/* ---- plan editor modal ---- */
/* 普通 view 实现的底部 sheet,不用 ui-modal 是因为 WeChat 自定义组件根元素
上 position: fixed 会被运行时吞掉,导致 body 落到容器末尾(非浮层)。 */
.plan-editor-mask {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
z-index: 1000;
display: flex;
align-items: flex-end;
justify-content: center;
}
.plan-editor-mask__bg {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0, 0, 0, 0.45);
animation: planEditorFade 0.25s ease;
}
.plan-editor-sheet {
position: relative;
width: 100%;
max-height: 88vh;
overflow-y: auto;
box-sizing: border-box;
background: var(--card-bg);
border-radius: 32rpx 32rpx 0 0;
padding: 12rpx 32rpx 40rpx;
/* Sheet is z-index 1000 above the tab bar (z-index 999), but the tab bar
still visually covers the bottom of the sheet. Add the tab bar's
height (110rpx + safe area) to padding-bottom so "保存/取消" sit
clearly above the tab bar. */
padding-bottom: calc(150rpx + env(safe-area-inset-bottom));
animation: planEditorSlideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.plan-editor-handle {
width: 64rpx;
height: 8rpx;
background: var(--bg-soft);
border-radius: 4rpx;
margin: 0 auto 16rpx;
}
@keyframes planEditorFade {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes planEditorSlideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.editor-title {
display: block;
text-align: center;
font-size: 32rpx;
font-weight: 700;
color: var(--text);
margin-bottom: 20rpx;
}
.editor-field {
display: flex;
flex-direction: column;
margin-bottom: 14rpx;
}
.editor-row {
display: flex;
gap: 12rpx;
}
.editor-row .editor-field-half {
flex: 1;
}
.editor-label {
font-size: 22rpx;
color: var(--text-secondary);
margin-bottom: 6rpx;
line-height: 1;
}
.editor-input {
height: 68rpx;
background: var(--bg-soft);
border-radius: 10rpx;
padding: 0 16rpx;
font-size: 26rpx;
color: var(--text);
box-sizing: border-box;
width: 100%;
}
.editor-preview {
margin-top: 6rpx;
background: var(--bg);
border-radius: 14rpx;
padding: 12rpx 16rpx;
}
.editor-preview-head {
display: flex;
justify-content: space-between;
align-items: baseline;
margin-bottom: 8rpx;
}
.editor-preview-title {
font-size: 22rpx;
font-weight: 600;
color: var(--text);
}
.editor-preview-meta {
font-size: 20rpx;
color: var(--text-secondary);
}
.editor-preview-list {
/* No fixed max-height: the modal body scrolls, preview expands inline. */
min-height: 60rpx;
}
.editor-preview-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8rpx 0;
border-bottom: 1rpx solid var(--border);
font-size: 24rpx;
}
.editor-preview-row:last-child {
border-bottom: none;
}
.editor-preview-day {
color: var(--text);
}
.editor-preview-target {
color: var(--primary);
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.editor-preview-empty {
text-align: center;
color: var(--text-secondary);
font-size: 22rpx;
padding: 16rpx 0;
}
.editor-actions {
display: flex;
gap: 12rpx;
margin-top: 20rpx;
}
.editor-action-reset,
.editor-action-save {
flex: 1;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 40rpx;
font-size: 28rpx;
font-weight: 600;
transition: opacity 0.15s ease, background 0.15s ease;
}
.editor-action-reset {
background: var(--card-bg);
color: var(--text-secondary);
border: 2rpx solid var(--border);
}
.editor-action-reset:active {
background: var(--bg-soft);
}
.editor-action-save {
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: #FFFFFF;
box-shadow: 0 4rpx 12rpx rgba(var(--primary-rgb), 0.25);
}
.editor-action-save:active {
opacity: 0.9;
}
.editor-cancel {
display: block;
text-align: center;
font-size: 26rpx;
color: var(--text-secondary);
padding: 12rpx 0 0;
}
/* ---- 清除数据确认弹窗 ---- */
.confirm-dialog {
padding: 48rpx 40rpx 32rpx;
text-align: center;
}
.confirm-title {
display: block;
font-size: 34rpx;
font-weight: 600;
color: var(--text);
margin-bottom: 16rpx;
}
.confirm-desc {
display: block;
font-size: 26rpx;
color: var(--text-secondary);
line-height: 1.6;
margin-bottom: 40rpx;
}
.confirm-actions {
display: flex;
gap: 20rpx;
}
.confirm-btn {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
height: 88rpx;
border-radius: 16rpx;
font-size: 30rpx;
font-weight: 500;
transition: opacity 0.15s;
}
.confirm-btn:active {
opacity: 0.8;
}
.confirm-btn--cancel {
background: var(--bg);
color: var(--text-secondary);
}
.confirm-btn--danger {
background: var(--danger);
color: #FFFFFF;
}