Files
nj/docs/opendesign/css/editor-common.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

503 lines
11 KiB
CSS

/* ─────────────────────────────────────────────────────────
* 暖记 — 编辑器共享样式
* 三端通用 (mobile / tablet / desktop)
* ───────────────────────────────────────────────────────── */
/* Top toolbar */
.editor-topbar {
display: flex;
align-items: center;
justify-content: space-between;
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
}
.topbar-left, .topbar-right {
display: flex;
align-items: center;
gap: var(--space-3);
}
.topbar-btn {
border-radius: var(--radius-pill);
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--fg);
transition: background var(--motion-fast);
}
.topbar-btn:hover { background: var(--surface-warm); }
.topbar-center {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 600;
color: var(--fg-2);
}
/* Save button */
.save-btn {
background: var(--accent);
color: var(--accent-on);
border: none;
border-radius: var(--radius-pill);
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 600;
cursor: pointer;
transition: all var(--motion-fast);
}
.save-btn:hover { background: var(--accent-hover); }
/* Canvas area common */
.canvas-grid {
position: absolute;
inset: 0;
background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
background-size: 28px 28px;
opacity: 0.4;
pointer-events: none;
border-radius: var(--radius-md);
}
.washi-tape {
position: absolute;
background: repeating-linear-gradient(
45deg,
rgba(242, 204, 143, 0.7),
rgba(242, 204, 143, 0.7) 4px,
rgba(255, 243, 230, 0.7) 4px,
rgba(255, 243, 230, 0.7) 8px
);
transform: rotate(-8deg);
border-radius: 2px;
opacity: 0.8;
}
.placed-sticker {
position: absolute;
cursor: move;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}
.journal-content { position: relative; z-index: 1; }
.journal-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-4);
border: none;
outline: none;
width: 100%;
background: transparent;
}
.journal-body {
font-size: var(--text-base);
line-height: 1.9;
color: var(--fg-2);
border: none;
outline: none;
width: 100%;
background: transparent;
resize: none;
min-height: 240px;
}
/* Format bar */
.format-bar {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-2) 0;
margin-bottom: var(--space-4);
border-bottom: 1px solid var(--border-soft);
}
.format-btn {
border-radius: 6px;
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--muted);
font-size: var(--text-sm);
font-weight: 600;
transition: all var(--motion-fast);
}
.format-btn:hover { background: var(--surface-warm); color: var(--fg); }
.format-btn.active { background: var(--accent); color: #FFF8F0; }
.format-divider {
width: 1px;
height: 22px;
background: var(--border);
}
/* Color dots */
.color-dot {
border-radius: 50%;
border: 2px solid transparent;
cursor: pointer;
transition: all var(--motion-fast);
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.active { border-color: var(--fg); }
/* Placed photo in journal */
.placed-photo {
width: 100%;
border-radius: var(--radius-sm);
background: linear-gradient(135deg, #D4E8DC, #E8F4ED);
display: flex;
align-items: center;
justify-content: center;
}
/* Panel tabs */
.panel-tab {
padding: 8px 16px;
border-radius: var(--radius-pill);
font-size: var(--text-sm);
font-weight: 500;
background: var(--surface-warm);
color: var(--fg-2);
border: none;
cursor: pointer;
white-space: nowrap;
transition: all var(--motion-fast);
}
.panel-tab.active { background: var(--accent); color: #FFF8F0; }
.panel-content {
padding: var(--space-5);
}
/* Sticker grid */
.sticker-grid {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: var(--space-3);
}
.sticker-item {
aspect-ratio: 1;
border-radius: var(--radius-sm);
background: var(--surface-warm);
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-bounce);
border: 1px solid transparent;
}
.sticker-item:hover { transform: scale(1.1); border-color: var(--accent); }
/* Date strip */
.date-strip {
display: flex;
align-items: center;
justify-content: space-between;
background: var(--surface);
}
.date-info {
display: flex;
align-items: center;
gap: var(--space-2);
font-size: var(--text-sm);
color: var(--muted);
}
.date-info strong { color: var(--fg); font-weight: 600; }
.mood-quick { display: flex; gap: 6px; }
.mood-mini {
border-radius: 50%;
border: 1.5px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
background: var(--surface);
cursor: pointer;
transition: all var(--motion-fast);
}
.mood-mini.selected { border-color: var(--accent); background: var(--surface-warm); }
/* Undo/Redo */
.topbar-undo-redo {
display: flex;
align-items: center;
gap: 2px;
}
.undo-btn, .redo-btn {
border-radius: var(--radius-pill);
border: none;
background: none;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--muted);
transition: all var(--motion-fast);
}
.undo-btn:hover:not(:disabled), .redo-btn:hover:not(:disabled) { background: var(--surface-warm); color: var(--fg); }
.undo-btn:disabled, .redo-btn:disabled { opacity: 0.35; cursor: default; }
.undo-btn svg, .redo-btn svg { width: 18px; height: 18px; }
/* Auto-save indicator */
.autosave-status {
display: flex;
align-items: center;
gap: 5px;
font-size: 11px;
color: var(--success);
font-weight: 500;
}
.autosave-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--success);
}
/* Brush slider (size + opacity) */
.brush-slider {
flex: 1;
-webkit-appearance: none;
appearance: none;
height: 4px;
border-radius: 2px;
background: var(--border);
outline: none;
}
.brush-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--accent);
cursor: pointer;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.brush-size-row {
display: flex;
align-items: center;
gap: var(--space-3);
}
.brush-size-value {
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
min-width: 36px;
text-align: right;
}
/* Brush color dots */
.brush-color-dot {
border-radius: 50%;
border: 3px solid transparent;
cursor: pointer;
transition: all var(--motion-fast);
}
.brush-color-dot:hover { transform: scale(1.1); }
.brush-color-dot.active { border-color: var(--fg); box-shadow: 0 0 0 2px var(--surface); }
/* Brush opacity */
.brush-opacity-row {
display: flex;
align-items: center;
gap: var(--space-3);
transition: opacity var(--motion-fast);
}
.brush-opacity-row.disabled { opacity: 0.35; pointer-events: none; }
.brush-opacity-label {
font-size: var(--text-xs);
color: var(--muted);
font-weight: 500;
min-width: 40px;
}
.brush-opacity-value {
font-size: var(--text-sm);
font-weight: 600;
color: var(--fg);
min-width: 36px;
text-align: right;
}
/* Tag pill */
.tag-selected-area {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
min-height: 36px;
}
.tag-pill {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 12px;
border-radius: 9999px;
background: var(--surface-warm);
color: var(--accent);
font-size: 13px;
font-weight: 500;
transition: all var(--motion-fast);
}
.tag-pill .remove {
width: 16px;
height: 16px;
border-radius: 50%;
background: var(--accent);
color: var(--surface);
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
cursor: pointer;
border: none;
line-height: 1;
transition: background var(--motion-fast);
}
.tag-pill .remove:hover { background: var(--accent-hover); }
/* Tag input */
.tag-input-row {
display: flex;
}
.tag-input {
flex: 1;
height: 44px;
border: 1.5px solid var(--border);
border-radius: var(--radius-pill);
padding: 0 var(--space-4);
font-size: var(--text-sm);
color: var(--fg);
background: var(--bg);
outline: none;
transition: border-color var(--motion-fast);
font-family: var(--font-body);
}
.tag-input::placeholder { color: var(--meta); }
.tag-input:focus { border-color: var(--accent); box-shadow: var(--shadow-input-focus); }
/* Tag suggest items */
.tag-suggest-item {
display: inline-flex;
align-items: center;
padding: 6px 14px;
border-radius: 9999px;
background: var(--surface-warm);
color: var(--fg-2);
font-size: var(--text-sm);
font-weight: 500;
border: 1px solid transparent;
cursor: pointer;
white-space: nowrap;
min-height: 44px;
transition: all var(--motion-fast);
}
.tag-suggest-item:hover { border-color: var(--accent); color: var(--accent); }
/* Brush section title (tablet/desktop) */
.brush-section-title {
font-size: var(--text-xs);
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: var(--space-3);
}
/* Brush color grid (tablet/desktop) */
.brush-colors-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-3);
}
/* Tags section */
.tags-section {
margin-bottom: var(--space-5);
}
/* Tool panel side (tablet/desktop) */
.tool-panel-side {
background: var(--surface);
border-left: 1px solid var(--border-soft);
overflow-y: auto;
scrollbar-width: thin;
flex-shrink: 0;
}
.tool-panel-side::-webkit-scrollbar { width: 4px; }
.tool-panel-side::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.panel-header {
padding: var(--space-5);
border-bottom: 1px solid var(--border-soft);
display: flex;
align-items: center;
gap: var(--space-3);
}
/* Canvas wrapper scrollbar (tablet/desktop) */
.canvas-wrapper {
flex: 1;
padding: var(--space-6);
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
}
.canvas-wrapper::-webkit-scrollbar { width: 4px; }
.canvas-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
/* Canvas paper (tablet/desktop) */
.canvas-paper {
background: var(--surface);
border-radius: var(--radius-md);
box-shadow: var(--elev-medium);
border: 1px solid var(--border-soft);
position: relative;
}
/* Editor body flex layout (tablet/desktop) */
.editor-body {
flex: 1;
display: flex;
overflow: hidden;
}