Files
SupplierSystem/DESIGN_SYSTEM.md
T
Ubuntu deb3e72750
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s
chore: 以 AI 生鲜配送系统 当前版本作为 SupplierSystem 起点
来源仓库:jxc/ai-fresh-delivery
来源提交:f0b1a180e2deb7e4673b9d1c8542619f7bc0f73d
快照树:  09f679334ff38f0ff25e907961c94a8223bcaedd(与来源 HEAD 工作树逐字节一致,3801 个文件)

按约定本仓库不带任何历史提交:来源仓库的历史中含真实凭据
(生产 SSH 私钥 deploy/id_rsa_tencent、server/.env、.env.tencent/.env.production/.env.gitea、
deploy/小程序AppSecret.txt,其中 MP_APPSECRET / S3 AccessKey 经哈希比对与线上同值),
整包推送会把这些凭据永久带入本仓库,故只取「当前版本」的单提交快照。
供应商系统后续开发自本提交开始。
2026-10-08 17:35:43 +08:00

10 KiB
Raw Blame History

AI生鲜供应链管理系统 - 设计系统规范

1. 设计原则

核心目标

  • 极简: 减少视觉噪音,每个元素都有明确目的
  • 高效: 信息层级清晰,重要操作一目了然
  • 专业: 体现供应链管理的严谨性和科技感
  • 清晰: 功能状态明确,用户无需猜测

设计哲学

基于Linear风格的精确性和Vercel风格的简洁性,适配生鲜供应链场景:

  • 浅色主界面,确保在各种光线环境下可读
  • 精确的字距和行高,提升阅读效率
  • 明确的状态反馈,每个交互都有视觉响应
  • 数据密集型布局优化,高密度信息清晰呈现

2. 颜色系统

主色调

Primary:      #0f172a    /* 深蓝黑 - 主按钮、关键操作 */
Primary Hover:#1e293b    /* 悬停状态 */
Accent:       #6366f1    /* 靛紫 - 强调、激活状态 */
Accent Hover: #818cf8    /* 强调色悬停 */

背景色

Bg Primary:   #ffffff    /* 主背景 */
Bg Secondary: #f8fafc    /* 次级背景、卡片 */
Bg Tertiary:  #f1f5f9    /* 第三层背景、hover */
Bg Dark:      #0f172a    /* 深色背景、反色 */

文字色

Text Primary:   #0f172a    /* 主文字、标题 */
Text Secondary: #475569    /* 次级文字、正文 */
Text Muted:     #94a3b8    /* 辅助文字、placeholder */
Text Inverse:   #ffffff    /* 深色背景上的文字 */

边框色

Border Light:   #e2e8f0    /* 浅色边框 */
Border Default: #cbd5e1    /* 默认边框 */
Border Dark:    #64748b    /* 深色边框 */

状态色

Success:        #10b981    /* 成功、完成 */
Success Light:  #d1fae5    /* 成功背景 */
Warning:        #f59e0b    /* 警告、注意 */
Warning Light:  #fef3c7    /* 警告背景 */
Danger:         #ef4444    /* 危险、错误 */
Danger Light:   #fee2e2    /* 危险背景 */
Info:           #3b82f6    /* 信息提示 */
Info Light:     #dbeafe    /* 信息背景 */

状态标签配色

待处理:   bg-slate-100 text-slate-700 border-slate-200
进行中:   bg-indigo-50 text-indigo-700 border-indigo-200
已完成:   bg-emerald-50 text-emerald-700 border-emerald-200
警告:     bg-amber-50 text-amber-700 border-amber-200
错误:     bg-rose-50 text-rose-700 border-rose-200

3. 字体系统

字体栈

Primary:   Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif
Mono:      'JetBrains Mono', 'Fira Code', monospace

字号规范

Display:     32px / font-weight: 600 / line-height: 1.2 / letter-spacing: -0.02em
H1:          24px / font-weight: 600 / line-height: 1.3 / letter-spacing: -0.01em
H2:          20px / font-weight: 600 / line-height: 1.4
H3:          16px / font-weight: 600 / line-height: 1.5
Body Large:  16px / font-weight: 400 / line-height: 1.6
Body:        14px / font-weight: 400 / line-height: 1.6
Small:       13px / font-weight: 400 / line-height: 1.5
Caption:     12px / font-weight: 500 / line-height: 1.4

字重规范

Regular:  400
Medium:   500
Semibold: 600
Bold:     700

4. 间距系统

基础单位: 4px

space-1:   4px
space-2:   8px
space-3:   12px
space-4:   16px
space-5:   20px
space-6:   24px
space-8:   32px
space-10:  40px
space-12:  48px

组件间距

Card Padding:     20px - 24px
Section Gap:      24px
Element Gap:      12px - 16px
Form Field Gap:   16px

5. 圆角系统

Rounded None:   0px
Rounded Small:  4px    /* 按钮、标签、输入框 */
Rounded Medium: 6px    /* 卡片、小容器 */
Rounded Large:  8px    /* 大卡片、模态框 */
Rounded XL:     12px   /* 特殊容器 */
Rounded Full:   9999px /* 圆形、胶囊 */

6. 阴影系统

Shadow SM:    0 1px 2px rgba(0,0,0,0.05)
Shadow:       0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06)
Shadow MD:    0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05)
Shadow LG:    0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)
Shadow XL:    0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04)

7. 组件规范

按钮

主按钮 (Primary)

Background:     #0f172a
Text:           #ffffff
Border Radius:  6px
Padding:        8px 16px
Font Size:      13px
Font Weight:    500
Hover:          bg #1e293b, translateY(-1px)
Active:         bg #0f172a, scale(0.98)
Disabled:       bg #cbd5e1, text #94a3b8, cursor not-allowed

次级按钮 (Secondary)

Background:     #ffffff
Border:         1px solid #e2e8f0
Text:           #475569
Hover:          bg #f8fafc, border #cbd5e1
Active:         bg #f1f5f9

幽灵按钮 (Ghost)

Background:     transparent
Text:           #475569
Hover:          bg #f1f5f9
Active:         bg #e2e8f0

危险按钮 (Danger)

Background:     #ef4444
Text:           #ffffff
Hover:          bg #dc2626

输入框

文本输入

Background:     #ffffff
Border:         1px solid #e2e8f0
Border Radius:  6px
Padding:        10px 14px
Font Size:      14px
Placeholder:    #94a3b8
Focus:          border #6366f1, ring 2px #6366f1/20
Error:          border #ef4444, ring 2px #ef4444/20
Disabled:       bg #f1f5f9, text #94a3b8

选择框

同文本输入
Height:         40px

卡片

默认卡片

Background:     #ffffff
Border:         1px solid #e2e8f0
Border Radius:  8px
Padding:        20px
Shadow:         0 1px 3px rgba(0,0,0,0.1)
Hover:          shadow 0 4px 6px rgba(0,0,0,0.07), border #cbd5e1

统计卡片

Background:     #ffffff
Border:         1px solid #e2e8f0
Border Radius:  8px
Padding:        20px
Header:         图标 + 标题
Value:          24px, font-weight 600, text-primary
Label:          13px, text-muted

表格

数据表格

Header Background: #f8fafc
Header Text:       #475569, 12px, font-weight 500, uppercase
Row Border:        1px solid #e2e8f0
Row Hover:         bg #f8fafc
Cell Padding:      12px 16px
Striped:           bg #f8fafc (even rows)

标签/徽章

状态标签

Padding:        4px 10px
Border Radius:  9999px (pill)
Font Size:      12px
Font Weight:    500
Border:         1px solid (varies by status)

导航

侧边栏导航

Width:          240px
Background:     #ffffff
Border Right:   1px solid #e2e8f0
Item Padding:   10px 16px
Item Radius:    6px
Active:         bg #f1f5f9, text #0f172a, font-weight 500
Hover:          bg #f8fafc
Inactive:       text #64748b

顶部导航

Height:         64px
Background:     #ffffff
Border Bottom:  1px solid #e2e8f0

模态框

标准模态框

Overlay:        bg rgba(0,0,0,0.5)
Background:     #ffffff
Border Radius:  8px
Padding:        24px
Max Width:      560px (small), 720px (medium), 960px (large)
Shadow:         0 20px 25px rgba(0,0,0,0.1)

8. 布局规范

页面结构

Container:      max-width 1440px, centered
Sidebar:        240px fixed
Main Content:   flex-1, padding 24px
Header Height:  64px

网格系统

Grid:           12-column
Gap:            16px (default), 24px (large)
Breakpoints:
  - sm: 640px
  - md: 768px
  - lg: 1024px
  - xl: 1280px
  - 2xl: 1536px

响应式断点

Mobile:         < 768px
Tablet:         768px - 1024px
Desktop:        > 1024px

9. 交互反馈

悬停状态

  • 按钮: 背景色变化 + 轻微上移 (translateY(-1px))
  • 卡片: 阴影增强 + 边框加深
  • 链接: 颜色变化
  • 表格行: 背景色变化

焦点状态

  • 输入框: 边框变为 accent 色 + 2px 浅色 ring
  • 按钮: 2px 浅色 ring
  • 所有可交互元素必须有可见的焦点指示

激活状态

  • 按钮: scale(0.98) + 背景色加深
  • 标签: 背景色变化

禁用状态

  • 透明度: 0.5
  • 光标: not-allowed
  • 无悬停效果

加载状态

  • 按钮: spinner 图标 + 禁用状态
  • 页面: skeleton 骨架屏
  • 数据: 旋转 loading 图标

10. 动效规范

过渡时间

Fast:     100ms (hover, focus)
Normal:   150ms (state changes)
Slow:     200ms (modals, panels)

缓动函数

Default:    cubic-bezier(0.4, 0, 0.2, 1)
Enter:      cubic-bezier(0, 0, 0.2, 1)
Exit:       cubic-bezier(0.4, 0, 1, 1)

常用动效

Fade In:        opacity 0 → 1
Slide Up:       translateY(8px) → translateY(0)
Scale In:       scale(0.95) → scale(1)

11. 图标规范

图标库

  • Lucide React (主要)
  • 自定义 SVG (特殊需求)

图标尺寸

Small:    14px
Default:  16px
Medium:   20px
Large:    24px

图标使用

  • 按钮内图标: 16px, 与文字间距 8px
  • 导航图标: 20px
  • 状态图标: 16px
  • 标题图标: 20px

12. 数据可视化

图表配色

Primary:    #6366f1
Secondary:  #10b981
Tertiary:   #f59e0b
Quaternary: #ef4444
Neutral:    #64748b

统计数字展示

Large:      32px, font-weight 600, text-primary
Medium:     24px, font-weight 600
Small:      18px, font-weight 500
Label:      13px, text-muted

13. 特殊组件

状态时间线

Line:         2px solid #e2e8f0
Active Dot:   10px, bg accent, border 2px white
Inactive Dot: 10px, bg #cbd5e1
Label:        13px, text-secondary
Time:         12px, text-muted

进度条

Height:       8px
Background:   #e2e8f0
Fill:         accent color
Radius:       9999px

搜索框

Height:       40px
Icon:         16px, text-muted, left 12px
Padding:      10px 14px 10px 40px
Placeholder:  "搜索..."

14. 页面模板

列表页

Header:       标题 + 操作按钮
Stats:        统计卡片行 (4-5个)
Filters:      搜索 + 筛选条件
Table:        数据表格
Pagination:   底部分页

详情页

Header:       返回 + 标题 + 状态 + 操作
Info Cards:   关键信息卡片
Tabs:         多标签内容
Content:      详细数据

表单页

Header:       标题 + 保存/取消
Form:         分组表单字段
Actions:      底部操作栏

15. 可访问性

对比度

  • 文字与背景对比度至少 4.5:1
  • 大文字 (18px+) 对比度至少 3:1

焦点可见

  • 所有可交互元素必须有焦点指示
  • 焦点指示必须清晰可见

触摸目标

  • 最小触摸目标: 44px × 44px
  • 按钮最小高度: 36px

16. Tailwind 配置速查

// tailwind.config.js 扩展
colors: {
  primary: {
    DEFAULT: '#0f172a',
    hover: '#1e293b',
  },
  accent: {
    DEFAULT: '#6366f1',
    hover: '#818cf8',
    light: '#e0e7ff',
  },
  success: {
    DEFAULT: '#10b981',
    light: '#d1fae5',
  },
  warning: {
    DEFAULT: '#f59e0b',
    light: '#fef3c7',
  },
  danger: {
    DEFAULT: '#ef4444',
    light: '#fee2e2',
  },
}