# 设计令牌命名规范

## 命名语法

```
{类型}-{分类}-{属性}-{状态?}
```

| 分段 | 说明 | 示例值 |
|:----|:-----|:-------|
| 类型 | 令牌大类 | `color`, `size`, `space`, `font`, `shadow`, `radius`, `opacity`, `z` |
| 分类 | 所属分类 | `brand`, `neutral`, `semantic`, `heading`, `body` |
| 属性 | 具体属性 | `primary`, `background`, `text`, `border`, `hover` |
| 状态（可选） | 交互状态 | `hover`, `active`, `disabled`, `focus`, `error` |

## 类型对照表

### 色彩令牌（color-*）

```
color-brand-primary              // 品牌主色
color-brand-primary-hover        // 品牌主色悬停
color-brand-primary-active       // 品牌主色按下
color-neutral-background         // 页面背景色
color-neutral-text-primary       // 主要文字色
color-neutral-text-secondary     // 次要文字色
color-neutral-border             // 边框色
color-semantic-success           // 成功色
color-semantic-error             // 错误色
color-semantic-warning           // 警告色
color-semantic-info              // 信息色
```

### 间距令牌（space-*）

```
space-padding-xs                 // 极小内边距（4px）
space-padding-sm                 // 小内边距（8px）
space-padding-md                 // 中内边距（16px）
space-padding-lg                 // 大内边距（24px）
space-margin-xs                  // 极小外边距
space-margin-sm                  // 小外边距
space-margin-md                  // 中外边距
space-gap-column                 // 列间距
space-gap-row                    // 行间距
```

### 字体令牌（font-*）

```
font-family-sans                 // 无衬线字体栈
font-family-mono                 // 等宽字体栈
font-size-h1                     // H1 字号
font-size-body                   // 正文字号
font-weight-regular              // 常规字重
font-weight-bold                 // 加粗字重
font-lineHeight-body             // 正文行高
font-letterSpacing                // 字间距
```

### 尺寸令牌（size-*）

```
size-icon-xs                     // 迷你图标（12px）
size-icon-sm                     // 小图标（16px）
size-icon-md                     // 常规图标（24px）
size-icon-lg                     // 大图标（32px）
size-button-min-height           // 按钮最小高度
size-input-height                // 输入框高度
```

### 圆角令牌（radius-*）

```
radius-none                      // 无圆角（0）
radius-sm                        // 小圆角（4px）
radius-md                        // 中圆角（8px）
radius-lg                        // 大圆角（16px）
radius-round                     // 圆形（50%）
```

### 阴影令牌（shadow-*）

```
shadow-none                      // 无阴影
shadow-sm                        // 小阴影（卡片）
shadow-md                        // 中阴影（下拉菜单）
shadow-lg                        // 大阴影（模态框）
shadow-xl                        // 特大阴影（通知）
```

## 平台映射

```json
{
  "color-brand-primary": {
    "css": "var(--color-brand-primary)",
    "scss": "$color-brand-primary",
    "figma": "Color / Brand / Primary",
    "ios": "UIColor.brandPrimary",
    "android": "@color/brand_primary"
  }
}
```

## 禁止行为
- 禁止在代码中硬编码色值/尺寸（必须使用 Token）
- 禁止 Token 命名出现具体像素值
- 禁止混用不同语义的同类型 Token
