Files
sundynix-pets/pets-fe/app.wxss
T
Blizzard b99099759f refactor(fe): 结构去重 + 修 FAB 遮挡内容(视觉等价,不含设计调整)
app.wxss 是从 preview.html 迁移来的,带来一批小程序里根本不生效的
标签选择器(wxml 没有 h2/p/b/span):.page-title h2、.task-text b、
.stat b、.article-card p、.record-row span、.poster h3。各页当初都
自建了替身 class,于是 .pt-h2 在 5 个文件里逐字重复、.ac-b 3 处、
.tt-b 2 处、page{height:100vh} 更是 9 个文件一模一样抄了 9 遍。

- 删掉 6 组死规则,替身 class 收进 app.wxss
- 页面骨架 page{} / .page-scroll / .page-body 统一到 app.wxss
- learn.wxss 清空后删除(该页已无私有样式)
- 左右留白统一 40rpx(home/article 原本是 36rpx)

顺带修一个真 bug:FAB 固定在 bottom:190rpx、高 116rpx,上沿距底
306rpx,但 7 个挂 FAB 的页面只留了 210rpx(learn/profile 更只有
60rpx)底部留白,最后一张卡片一直被它压住。改为 --pad-b-fab 330rpx。

本次不含任何色值/字号/圆角改动,设计调整在下一步。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 10:28:48 +08:00

269 lines
10 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* ===== 全局设计令牌 + 通用样式(由 preview.html 迁移,px→rpx ×2 ===== */
page{
--bg:#F8F6F2;
--bg2:#FBF8F3;
--card:#FFFFFF;
--text:#2D2925;
--muted:#8D8277;
--muted2:#B5A99D;
--line:#EEE6DC;
--primary:#F5A947;
--primary2:#FFBF68;
--primary-dark:#DD8420;
--green:#73BE9D;
--green-soft:#EAF7F1;
--red:#EE7D73;
--red-soft:#FFF0EE;
--blue:#78A6E8;
--blue-soft:#EEF5FF;
--purple:#A993E8;
--purple-soft:#F4F0FF;
--yellow-soft:#FFF6E4;
--shadow:0 24rpx 60rpx rgba(70,48,25,.08);
--shadow2:0 36rpx 88rpx rgba(70,48,25,.13);
--radius:44rpx;
/* 页面留白。FAB 固定在 bottom:190rpx、高 116rpx,上沿距底 306rpx
内容必须让开这段距离,否则最后一张卡会被它压住(7 个挂 FAB 的页面都中过这个招)。 */
--pad-x:40rpx;
--pad-b-fab:calc(330rpx + env(safe-area-inset-bottom));
--pad-b-plain:calc(60rpx + env(safe-area-inset-bottom));
color:var(--text);
font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",sans-serif;
background:
radial-gradient(circle at 10% 8%, rgba(245,169,71,.26), transparent 30%),
radial-gradient(circle at 88% 10%, rgba(115,190,157,.20), transparent 26%),
radial-gradient(circle at 72% 88%, rgba(120,166,232,.14), transparent 28%),
linear-gradient(135deg,#FBF5EA,#EEF6F1 55%,#F8F1E7);
/* 页面自身不滚,滚动交给 .page-scroll,这样 nav-bar 和 tabBar 才能固定住。
这 4 行原本在 9 个页面的 wxss 里逐字重复。 */
height:100vh;
overflow:hidden;
display:flex;
flex-direction:column;
}
view,text{box-sizing:border-box}
/* 页面骨架:nav-bar → .page-scroll(承载滚动) → .page-body(内容留白) */
.page-scroll{flex:1;min-height:0}
.page-body{padding:8rpx var(--pad-x) var(--pad-b-fab)}
/* 没挂 FAB 的页面(目前只有文章详情)不需要给它让位 */
.page-body.no-fab{padding-bottom:var(--pad-b-plain)}
/* 全局隐藏滚动条(页面级 + 组件级),保留正常滚动 */
::-webkit-scrollbar{
width:0 !important;
height:0 !important;
display:none;
-webkit-appearance:none;
background:transparent;
color:transparent;
}
page{scrollbar-width:none;-ms-overflow-style:none}
/* 文本 */
.muted{color:var(--muted)}
.tiny{font-size:24rpx;color:var(--muted)}
/* 区块标题 */
.section-head{
display:flex;align-items:center;justify-content:space-between;margin:8rpx 0 24rpx;
}
.section-head .sh-title{font-size:36rpx;letter-spacing:-.4rpx;font-weight:700}
.link{
color:var(--primary-dark);font-weight:900;font-size:26rpx;
}
.head-links{display:flex;align-items:center;gap:26rpx}
/* 页面标题。
注意:小程序没有 h2/p/b/span 标签,从 preview.html 迁移过来的标签选择器全是死规则,
各页当初都自建了替身 class(.pt-h2 在 5 个文件里逐字重复)。这里统一收编。 */
.page-title{margin:4rpx 0 28rpx}
.pt-h2{font-size:46rpx;letter-spacing:-.6rpx;font-weight:800}
.pt-p{color:var(--muted);font-size:26rpx;margin-top:10rpx}
/* 按钮 */
.btn{
border:0;height:96rpx;border-radius:34rpx;padding:0 32rpx;
display:inline-flex;align-items:center;justify-content:center;gap:16rpx;
font-weight:900;font-size:30rpx;line-height:96rpx;transition:.16s ease;
}
.btn::after{border:none}
.btn:active{transform:scale(.98)}
.btn-primary{
color:#fff;background:linear-gradient(135deg,var(--primary),var(--primary2));
box-shadow:0 24rpx 48rpx rgba(245,169,71,.28);
}
.btn-ghost{color:var(--text);background:#fff;border:1rpx solid var(--line)}
.btn-soft{color:#9E6200;background:var(--yellow-soft)}
.btn-green{color:#fff;background:linear-gradient(135deg,#69B991,#86CEB0)}
.btn-block{width:100%;display:flex}
.btn-small{height:68rpx;border-radius:24rpx;padding:0 22rpx;font-size:24rpx;line-height:68rpx}
/* 卡片 */
.card{
background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);
padding:32rpx;margin-bottom:28rpx;position:relative;overflow:hidden;
}
.card.no-shadow{box-shadow:none;border:1rpx solid var(--line)}
/* 标签 */
.tag{
display:inline-flex;align-items:center;height:48rpx;border-radius:999rpx;padding:0 18rpx;
font-size:24rpx;font-weight:900;background:var(--green-soft);color:#377A61;white-space:nowrap;
}
.tag.warn{background:#FFF0D7;color:#A96500}
.tag.red{background:var(--red-soft);color:#C95348}
.tag.blue{background:var(--blue-soft);color:#3C6EBA}
.tag.purple{background:var(--purple-soft);color:#765AC5}
/* 表单 */
.field{margin-bottom:28rpx}
.field:last-child{margin-bottom:0}
.field label{display:block;font-size:26rpx;color:var(--muted);font-weight:800;margin-bottom:16rpx}
.input,input,textarea,.picker-box{
width:100%;border:1rpx solid var(--line);background:#FBFAF8;height:88rpx;border-radius:30rpx;
padding:0 26rpx;color:var(--text);font-size:30rpx;outline:none;box-sizing:border-box;
display:flex;align-items:center;
}
.textarea{
width:100%;border:1rpx solid var(--line);background:#FBFAF8;height:184rpx;border-radius:30rpx;
padding:24rpx 26rpx;color:var(--text);font-size:30rpx;box-sizing:border-box;
}
.placeholder{color:var(--muted2)}
/* 分段选择 */
.seg{display:flex;gap:16rpx}
.seg .seg-btn{
flex:1;height:80rpx;line-height:80rpx;text-align:center;border-radius:26rpx;
border:1rpx solid var(--line);background:#fff;color:var(--muted);font-weight:800;font-size:28rpx;
}
.seg .seg-btn.selected{color:var(--primary-dark);background:#FFF2DC;border-color:#FFD39A}
/* 多选 check */
.check-list{display:flex;flex-direction:column;gap:20rpx;margin:32rpx 0}
.check{
display:flex;align-items:center;gap:20rpx;background:#fff;box-shadow:var(--shadow);
border-radius:32rpx;padding:26rpx;border:1rpx solid transparent;font-size:28rpx;font-weight:700;
}
.box{
width:44rpx;height:44rpx;border-radius:16rpx;border:4rpx solid #DDCEC1;
display:flex;align-items:center;justify-content:center;color:#fff;flex:none;
font-size:26rpx;font-weight:900;
}
.check.selected{background:#FFF8EC;border-color:#FFD29A}
.check.selected .box{background:var(--primary);border-color:var(--primary)}
/* 圆形/条形选项 */
.mini-options{display:flex;flex-wrap:wrap;gap:16rpx;margin:20rpx 0 28rpx}
.option{
border:1rpx solid var(--line);background:#fff;border-radius:999rpx;height:68rpx;line-height:68rpx;
padding:0 24rpx;color:#5F554D;font-weight:800;font-size:24rpx;
}
.option.selected{background:#FFF2DC;color:var(--primary-dark);border-color:#FFD39A}
/* 进度条 */
.progress-row{
display:flex;align-items:center;justify-content:space-between;margin-bottom:16rpx;
font-size:26rpx;color:#6A5D52;font-weight:900;
}
.bar{height:20rpx;border-radius:999rpx;background:#F0E7DD;overflow:hidden}
.bar .bar-fill{
height:100%;border-radius:999rpx;
background:linear-gradient(90deg,var(--primary),#FFD57F);display:block;transition:.25s ease;
}
/* 头像 */
.avatar{
width:120rpx;height:120rpx;border-radius:44rpx;
background:linear-gradient(135deg,#FFE5B7,#FFC06B);
display:flex;align-items:center;justify-content:center;font-size:64rpx;
box-shadow:0 24rpx 52rpx rgba(245,169,71,.18);flex:none;
}
/* 多宠切换 */
.pet-switch{display:flex;gap:20rpx;overflow-x:auto;padding:0 0 24rpx;white-space:nowrap}
.pet-switch::-webkit-scrollbar{display:none}
.pet-chip{
flex:none;display:inline-flex;border:1rpx solid var(--line);background:#fff;border-radius:40rpx;
padding:18rpx 24rpx;align-items:center;gap:16rpx;color:var(--muted);font-weight:900;font-size:28rpx;
box-shadow:0 12rpx 36rpx rgba(70,48,25,.05);
}
.pet-chip.active{color:var(--primary-dark);background:#FFF4E4;border-color:#FFD6A1}
.pet-chip .mini-avatar{
width:56rpx;height:56rpx;border-radius:20rpx;display:flex;align-items:center;
justify-content:center;background:#FFE4B7;font-size:30rpx;
}
/* 任务列表 */
.task-list{display:flex;flex-direction:column;gap:20rpx}
.task{display:flex;gap:20rpx;align-items:flex-start;background:#FBFAF8;border-radius:32rpx;padding:24rpx;transition:.15s ease}
.circle{
width:46rpx;height:46rpx;border-radius:50%;border:4rpx solid #DED1C4;display:flex;
align-items:center;justify-content:center;color:#fff;font-size:24rpx;flex:none;margin-top:2rpx;font-weight:900;
}
.task.done{opacity:.55}
.task.done .circle{background:var(--green);border-color:var(--green)}
.task-text{flex:1}
.tt-b{font-size:28rpx;font-weight:700}
.tt-p{font-size:24rpx;color:var(--muted);margin-top:8rpx;line-height:1.45}
.priority{
font-size:22rpx;color:#A96500;background:#FFF0D7;border-radius:999rpx;padding:8rpx 14rpx;font-weight:900;flex:none;
}
/* 记录行 */
.record-row{
display:flex;justify-content:space-between;align-items:center;padding:24rpx 0;
border-bottom:1rpx solid var(--line);font-size:26rpx;
}
.record-row:last-child{border-bottom:0}
/* 统计格 */
.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16rpx;margin:28rpx 0}
.stat{background:#fff;border:1rpx solid var(--line);border-radius:32rpx;padding:24rpx 14rpx;text-align:center}
/* 文章卡 */
.article-card{
display:flex;gap:24rpx;background:#fff;border-radius:40rpx;padding:26rpx;box-shadow:var(--shadow);margin-bottom:24rpx;
}
.article-icon{
width:116rpx;height:116rpx;border-radius:36rpx;flex:none;display:flex;align-items:center;
justify-content:center;background:#FFF1D8;font-size:56rpx;
}
.ac-b{font-size:30rpx;font-weight:700}
.ac-p{color:var(--muted);font-size:24rpx;line-height:1.45;margin-top:10rpx}
/* 海报 */
.poster{
background:
radial-gradient(circle at 100% 0%, rgba(245,169,71,.24), transparent 35%),
linear-gradient(160deg,#FFF7E8,#FFFFFF);
border:1rpx solid #F2DFC3;border-radius:52rpx;padding:36rpx;text-align:center;overflow:hidden;position:relative;
}
.poster-avatar{
width:152rpx;height:152rpx;margin:16rpx auto 20rpx;border-radius:54rpx;
background:linear-gradient(135deg,#FFE5B7,#FFC06B);display:flex;align-items:center;justify-content:center;
font-size:80rpx;box-shadow:0 24rpx 52rpx rgba(245,169,71,.20);
}
.poster-list{
background:rgba(255,255,255,.78);border-radius:32rpx;padding:24rpx;margin:28rpx 0;text-align:left;line-height:1.8;font-size:26rpx;
}
/* 风险盒 */
.risk-box{
background:#FFF0D8;color:#A96500;padding:24rpx;border-radius:32rpx;font-weight:900;
display:flex;gap:18rpx;margin-bottom:24rpx;align-items:center;
}
/* 弹层内动作行 */
.sheet-actions{display:flex;gap:20rpx;margin-top:24rpx}
.sheet-actions .btn{flex:1}
/* 聊天气泡 */
.plan-chat{display:flex;flex-direction:column;gap:20rpx;margin-bottom:24rpx}
.msg{max-width:88%;border-radius:36rpx;padding:22rpx 26rpx;font-size:26rpx;line-height:1.55}
.msg.ai{background:#F3F8F5;align-self:flex-start}
.msg.user{background:#FFF1D8;align-self:flex-end}