Files
nj/docs/opendesign/css/components.css
iven b320641d9c
Some checks failed
Main Merge / backend (push) Has been cancelled
Main Merge / frontend (push) Has been cancelled
fix(app): 全链路验证修复 — 编译错误/CORS/迁移/启动脚本
前端修复:
- calendar_page: 移除不存在的 JournalEntry.content getter
- responsive_scaffold: 移除不存在的 notchThickness 参数
- splash_page: SingleTickerProvider → TickerProvider (多 AnimationController)
- profile_page: UserRoleType.name → .code (修复运行时崩溃)
- 导入缺失的 user.dart

后端修复:
- class_service: generate_class_code 取 UUID 后6位(随机部分)避免碰撞
- diary_role_seed: 移除不存在的 id 列,使用复合主键 ON CONFLICT

基础设施:
- config/default.toml: CORS 改为通配符(开发模式)
- scripts/dev.sh: 统一启动脚本(自动清理端口)
- docs/opendesign/: Open Design 设计规格 HTML 原型稿

验证结果: flutter analyze 0 error, cargo test 77/77 通过, 17个页面全部渲染正常
2026-06-02 01:03:58 +08:00

297 lines
7.7 KiB
CSS

/* ─────────────────────────────────────────────────────────
* 暖记 — 共享组件样式
* ───────────────────────────────────────────────────────── */
/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
font-family: var(--font-body);
font-size: var(--text-base);
line-height: var(--leading-body);
color: var(--fg);
background: var(--bg);
overflow-x: hidden;
}
/* Phone frame wrapper */
.phone-frame {
width: 390px;
height: 844px;
position: relative;
overflow: hidden;
background: var(--bg);
border-radius: 44px;
box-shadow: var(--elev-float);
}
/* Status bar */
.status-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 28px 0;
height: var(--safe-top);
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
position: relative;
z-index: 100;
}
.status-bar .time { font-variant-numeric: tabular-nums; }
.status-bar .icons { display: flex; gap: 6px; align-items: center; }
.status-bar .icons svg { width: 18px; height: 18px; }
/* Dynamic Island */
.dynamic-island {
position: absolute;
top: 12px;
left: 50%;
transform: translateX(-50%);
width: 126px;
height: 36px;
background: #000;
border-radius: 20px;
z-index: 200;
}
/* Top nav bar */
.top-nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-4) var(--space-5);
position: relative;
z-index: 10;
}
.top-nav .title {
font-family: var(--font-display);
font-size: var(--text-xl);
font-weight: 700;
color: var(--fg);
}
.top-nav .action {
width: var(--touch-min);
height: var(--touch-min);
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--radius-pill);
background: var(--surface);
border: none;
cursor: pointer;
transition: background var(--motion-fast) var(--ease-standard);
}
.top-nav .action:hover { background: var(--border-soft); }
.top-nav .action:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.top-nav .action svg { width: 22px; height: 22px; color: var(--fg); }
/* Bottom tab bar */
.tab-bar {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: calc(var(--tab-height) + var(--safe-bottom));
padding-bottom: var(--safe-bottom);
display: flex;
align-items: flex-start;
justify-content: space-around;
background: var(--surface);
border-top: 1px solid var(--border-soft);
z-index: 100;
}
.tab-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
padding-top: 10px;
background: none;
border: none;
cursor: pointer;
color: var(--muted);
font-size: var(--text-xs);
font-weight: 500;
transition: color var(--motion-fast) var(--ease-standard);
}
.tab-item.active { color: var(--accent); }
.tab-item svg { width: 24px; height: 24px; }
.tab-item span { margin-top: 2px; }
/* Buttons */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
padding: 14px 28px;
border-radius: var(--radius-pill);
border: none;
font-family: var(--font-display);
font-size: var(--text-md);
font-weight: 600;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-standard);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
background: var(--accent);
color: var(--accent-on);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.btn-secondary {
background: var(--surface);
color: var(--fg);
border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-secondary:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.btn-ghost {
background: transparent;
color: var(--muted);
}
.btn-ghost:hover { color: var(--accent); }
/* Cards */
.card {
background: var(--surface);
border-radius: var(--radius-md);
padding: var(--space-5);
box-shadow: var(--elev-soft);
border: 1px solid var(--border-soft);
}
/* Tags / chips */
.chip {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: 6px 14px;
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 500;
background: var(--surface);
color: var(--fg-2);
border: 1px solid var(--border);
transition: all var(--motion-fast) var(--ease-standard);
}
.chip:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.chip.active {
background: var(--accent);
color: var(--accent-on);
border-color: var(--accent);
}
/* Section heading */
.section-heading {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-4);
}
.section-heading h3 {
font-family: var(--font-display);
font-size: var(--text-lg);
font-weight: 700;
}
.section-heading .more {
font-size: var(--text-sm);
color: var(--accent);
cursor: pointer;
background: none;
border: none;
font-weight: 500;
min-height: var(--touch-min);
display: inline-flex;
align-items: center;
}
.section-heading .more:focus-visible { box-shadow: var(--focus-ring); outline: none; border-radius: 4px; }
/* Mood emoji faces */
.mood-row {
display: flex;
gap: var(--space-3);
justify-content: center;
}
.mood-btn {
width: 48px;
height: 48px;
border-radius: 50%;
border: 2px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
background: var(--surface);
cursor: pointer;
transition: all var(--motion-fast) var(--ease-bounce);
}
.mood-btn:hover { transform: scale(1.1); }
.mood-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.mood-btn.selected {
border-color: var(--accent);
background: var(--surface-warm);
transform: scale(1.08);
}
/* Scroll content area */
.scroll-content {
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
}
.scroll-content::-webkit-scrollbar { display: none; }
/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-secondary { color: var(--secondary); }
.font-display { font-family: var(--font-display); }
.font-hand { font-family: var(--font-handwritten); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.w-full { width: 100%; }
.rounded-full { border-radius: var(--radius-pill); }
/* Decorative doodles */
.doodle { opacity: 0.15; pointer-events: none; }
/* Home indicator */
.home-indicator {
width: 134px;
height: 5px;
background: var(--fg);
opacity: 0.2;
border-radius: 3px;
margin: 8px auto;
}
/* Page transitions */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(40px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
from { opacity: 0; transform: scale(0.9); }
to { opacity: 1; transform: scale(1); }
}
.anim-fade { animation: fadeIn 0.5s var(--ease-standard) both; }
.anim-slide { animation: slideUp 0.6s var(--ease-bounce) both; }
.anim-scale { animation: scaleIn 0.4s var(--ease-bounce) both; }