refactor(miniprogram): 全面接入 Design Token — 68 SCSS 文件 px→var(--tk-*)
Some checks failed
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled

- 重写 tokens.scss:校准 10 级字号 + 4 结构 token 匹配实际设计值
- 更新 mixins.scss:4 个 mixin 引用 token 替代硬编码
- 68 SCSS 文件全面迁移:font-size px → var(--tk-font-*),辅助文字色 → var(--tk-text-secondary)
- 清理 12 个页面的本地 mixin 重复定义
- elder-mode.scss 从 530 行缩减至 ~120 行:删除所有字号/颜色覆写,仅保留结构布局
- Token 覆盖率:634 引用 / 仅 3 个特殊硬编码值(72px/80px/21px)

关怀模式通过 CSS 变量级联自动生效,消除"打地鼠"问题。
This commit is contained in:
iven
2026-05-09 23:53:07 +08:00
parent 257ca94a25
commit 890c132890
74 changed files with 1127 additions and 1688 deletions

View File

@@ -4,70 +4,86 @@
.messages-page {
min-height: 100vh;
background: $bg;
padding-bottom: calc(120px + env(safe-area-inset-bottom));
padding: 20px 24px 100px;
padding-bottom: calc(100px + env(safe-area-inset-bottom));
}
/* ─── 页头 ─── */
.messages-header {
padding: 24px 32px 8px;
margin-bottom: 20px;
}
.messages-title {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 36px;
font-weight: bold;
@include serif-number;
font-size: var(--tk-font-h1);
font-weight: 700;
color: $tx;
}
/* ─── Tab 切换 ─── */
.msg-tabs {
/* ─── 分段控件 Tab ─── */
.msg-segment {
display: flex;
padding: 16px 24px 0;
gap: 0;
background: $surface-alt;
border-radius: $r-sm;
padding: 3px;
margin-bottom: 12px;
}
.msg-tab {
.msg-segment-tab {
flex: 1;
height: $tab-h;
height: 40px;
border-radius: $r-xs;
@include flex-center;
position: relative;
&:active {
opacity: 0.85;
}
}
.msg-tab-text {
font-size: 28px;
font-weight: 600;
color: $tx2;
}
.msg-segment-active {
background: $card;
box-shadow: $shadow-sm;
.msg-tab-active .msg-tab-text {
color: $pri;
}
.msg-tab-indicator {
padding: 0 24px;
height: 3px;
background: $bd-l;
margin-bottom: 16px;
}
.msg-tab-bar {
width: 50%;
height: 3px;
background: $pri;
border-radius: 2px;
transition: transform 0.2s;
&.msg-tab-bar-right {
transform: translateX(100%);
.msg-segment-text {
color: $tx;
}
}
.msg-segment-text {
font-size: var(--tk-font-cap);
font-weight: 600;
color: $tx3;
}
.msg-segment-badge {
position: absolute;
top: 4px;
right: 12px;
min-width: 16px;
height: 16px;
border-radius: 8px;
background: $dan;
@include flex-center;
padding: 0 4px;
}
.msg-segment-badge-text {
font-size: var(--tk-font-micro);
color: #fff;
font-weight: 600;
}
/* ─── 内容区 ─── */
.msg-content {
padding: 0 24px;
// wrapper
}
.msg-list {
display: flex;
flex-direction: column;
gap: 8px;
}
.msg-empty {
@@ -79,18 +95,18 @@
}
.msg-empty-text {
font-size: 26px;
font-size: var(--tk-font-cap);
color: $tx2;
}
/* ─── 咨询卡片 ─── */
.consult-card {
display: flex;
gap: 12px;
align-items: center;
background: $card;
border-radius: $r;
padding: 24px;
margin-bottom: 12px;
padding: 16px;
box-shadow: $shadow-sm;
&:active {
@@ -98,53 +114,84 @@
}
}
.consult-info {
.consult-card-muted {
opacity: 0.65;
}
.consult-avatar {
width: 44px;
height: 44px;
border-radius: 22px;
background: $surface-alt;
@include flex-center;
flex-shrink: 0;
}
.consult-avatar-active {
background: $pri-l;
}
.consult-avatar-char {
@include serif-number;
font-size: var(--tk-font-body-sm);
font-weight: 700;
color: $tx3;
}
.consult-avatar-active .consult-avatar-char {
color: $pri;
}
.consult-body {
flex: 1;
min-width: 0;
}
.consult-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 4px;
&:last-child {
margin-bottom: 0;
}
}
.consult-doctor {
font-size: 28px;
font-size: var(--tk-font-cap);
font-weight: 600;
color: $tx;
display: block;
margin-bottom: 6px;
}
.consult-preview {
font-size: 24px;
color: $tx2;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.consult-meta {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 8px;
flex-shrink: 0;
margin-left: 16px;
}
.consult-time {
font-size: 22px;
font-size: var(--tk-font-micro);
color: var(--tk-text-secondary);
flex-shrink: 0;
}
.consult-preview {
font-size: var(--tk-font-cap);
color: $tx2;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
margin-right: 8px;
}
.consult-badge {
min-width: 24px;
height: 24px;
border-radius: 12px;
min-width: 18px;
height: 18px;
border-radius: 9px;
background: $dan;
@include flex-center;
padding: 0 6px;
padding: 0 4px;
flex-shrink: 0;
}
.consult-badge-text {
font-size: 18px;
font-size: var(--tk-font-micro);
color: #fff;
font-weight: 600;
}
@@ -152,43 +199,72 @@
/* ─── 通知卡片 ─── */
.notify-card {
display: flex;
align-items: center;
gap: 12px;
align-items: flex-start;
background: $card;
border-radius: $r;
padding: 24px;
margin-bottom: 12px;
padding: 16px;
box-shadow: $shadow-sm;
&:active {
opacity: 0.85;
}
}
.notify-info {
.notify-card-muted {
opacity: 0.65;
}
.notify-icon {
width: 36px;
height: 36px;
border-radius: $r-sm;
@include flex-center;
flex-shrink: 0;
}
.notify-icon-char {
@include serif-number;
font-size: var(--tk-font-body-sm);
font-weight: 700;
}
.notify-body {
flex: 1;
min-width: 0;
}
.notify-title {
font-size: 28px;
font-weight: 600;
color: $tx;
display: block;
margin-bottom: 6px;
.notify-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 4px;
}
.notify-desc {
font-size: 24px;
color: $tx2;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.notify-title {
font-size: var(--tk-font-cap);
font-weight: 400;
color: $tx;
}
.notify-title-bold {
font-weight: 600;
}
.notify-time {
font-size: 22px;
color: $tx2;
font-size: var(--tk-font-micro);
color: var(--tk-text-secondary);
flex-shrink: 0;
margin-left: 16px;
margin-left: 8px;
}
.notify-desc {
font-size: var(--tk-font-cap);
color: $tx2;
line-height: 1.5;
}
.notify-dot {
width: 8px;
height: 8px;
border-radius: 4px;
background: $pri;
flex-shrink: 0;
margin-top: 6px;
}