+```
+
+---
+
+## 5. 圆角与阴影
+
+### 5.1 圆角体系
+
+| Token | 值 | 使用元素 |
+| -------------- | ------ | ---------------------- |
+| `rounded-sm` | 2px | Checkbox、小标签 |
+| `rounded-md` | 6px | 按钮、输入框、Select |
+| `rounded-lg` | 8px | 搜索框、小卡片 |
+| `rounded-xl` | 12px | 大卡片、面板、图标容器 |
+| `rounded-full` | 9999px | 标签、Avatar |
+
+### 5.2 阴影体系
+
+| 级别 | 类名 | 用途 |
+| ---- | --------------------- | ---------------------- |
+| 无 | — | 静态元素 |
+| 低 | `shadow-sm` | 卡片、输入框、按钮 |
+| 中 | `shadow-lg` | 下拉菜单、浮层、Dialog |
+| 动态 | 自定义 `shadow-[...]` | 卡片悬停时的彩色阴影 |
+
+### 5.3 彩色阴影规范(工具卡片专用)
+
+```tsx
+// 工具卡片悬停阴影 — 必须使用 rgba 格式配合 CSS 变量
+className="hover:shadow-[0_8px_24px_-8px_rgba(var(--tool-color),0.14)]
+ dark:hover:shadow-[0_8px_30px_-10px_rgba(var(--tool-color),0.25)]"
+```
+
+---
+
+## 6. 组件规范
+
+### 6.1 Button
+
+来源:`src/components/ui/button.tsx`
+
+#### 变体
+
+| 变体 | 类名 | 场景 |
+| ------------- | -------------------------------------------- | ------------------ |
+| `default` | `bg-primary text-primary-foreground` | 主操作 |
+| `destructive` | `bg-destructive text-destructive-foreground` | 删除、危险操作 |
+| `outline` | `border border-input bg-background` | 次级操作、取消 |
+| `secondary` | `bg-secondary text-secondary-foreground` | 次要操作 |
+| `ghost` | 仅悬停背景 | 图标按钮、低优先级 |
+| `link` | 下划线文字 | 跳转链接 |
+
+#### 尺寸
+
+| 尺寸 | 高度 | 内边距 | 场景 |
+| --------- | ------- | ----------- | -------- |
+| `default` | 40px | `px-4 py-2` | 标准按钮 |
+| `sm` | 36px | `px-3` | 紧凑按钮 |
+| `lg` | 44px | `px-8` | 突出按钮 |
+| `icon` | 40×40px | — | 图标按钮 |
+
+#### 使用示例
+
+```tsx
+// 主操作
+
+
+// 图标按钮
+
+
+// 危险操作
+
+```
+
+### 6.2 Input
+
+来源:`src/components/ui/input.tsx`
+
+```tsx
+// 标准输入框
+
+
+// 错误状态
+
+```
+
+**规范要点**:
+
+- 高度统一为 `h-10`(40px)
+- 等宽字体用于数据输入
+- 占位符使用 `text-muted-foreground/60`
+- 错误时边框变红并调整焦点环
+
+### 6.3 SwitchButtonGroup
+
+来源:`src/components/ui/switch.tsx`
+
+```tsx
+// 分段控制器
+
+```
+
+**规范要点**:
+
+- 容器:`rounded-lg bg-muted p-1`
+- 选中项:`bg-background text-foreground shadow-sm font-semibold`
+- 未选中项:`hover:bg-background/50 hover:text-foreground/80`
+- 尺寸:`small`(32px)用于工具页,`medium`(36px)标准
+
+### 6.4 Card(工具卡片)
+
+来源:`src/pages/Dashboard/ToolCard.tsx`
+
+```tsx
+// 标准工具卡片结构
+
+ {/* 上半部分:图标 + 标题 + 箭头 */}
+
+
+ {/* 图标容器 */}
+
+
+
+ {/* 文字 */}
+
+
+
+
+ {/* 下半部分:预览区(可选) */}
+
{snapshot}
+
+```
+
+### 6.5 TextInputArea
+
+来源:`src/components/TextInputArea.tsx`
+
+```tsx
+// 多行文本输入区
+
+```
+
+**规范要点**:
+
+- 外容器:`rounded-md border border-input bg-background shadow-sm`
+- 焦点状态:`focus-within:ring-1 focus-within:ring-ring`
+- 错误状态:`border-destructive focus-within:ring-destructive`
+- 底部工具栏:`h-10 bg-muted/30 border-t border-border/50`
+- 字体:`font-mono text-sm`
+
+### 6.6 Dialog
+
+来源:`src/components/ui/dialog.tsx`
+
+```tsx
+// 对话框内容
+
+
+ 标题
+ 描述文字
+
+ {/* 内容 */}
+
+
+
+
+
+```
+
+### 6.7 Select
+
+来源:`src/components/ui/select.tsx`
+
+```tsx
+
+```
+
+### 6.8 Checkbox
+
+来源:`src/components/ui/checkbox.tsx`
+
+```tsx
+// 标准复选框
+
+
+// 小型复选框(工具栏内)
+
+```
+
+### 6.9 Badge
+
+来源:`src/components/ui/badge.tsx`
+
+| 变体 | 场景 |
+| ------------- | ------------------ |
+| `default` | 状态标签、分类 |
+| `secondary` | 次要标签 |
+| `destructive` | 错误标签 |
+| `outline` | 可点击标签、筛选器 |
+
+### 6.10 CopyButton
+
+来源:`src/components/CopyButton.tsx`
+
+```tsx
+// 标准复制按钮
+
+
+// 小型复制按钮
+
+```
+
+**规范要点**:
+
+- 默认 `variant="ghost" size="icon"`
+- 复制成功后变为绿色背景 + 对勾图标
+- 使用 `sonner` toast 提示复制结果
+
+---
+
+## 7. 交互与动效
+
+### 7.1 过渡规范
+
+| 属性 | 值 | 场景 |
+| ------------------- | ---------- | ----------------------------- |
+| `transition-colors` | 150ms ease | 色彩变化(悬停、焦点) |
+| `transition-all` | 150ms ease | 综合变化(SwitchButtonGroup) |
+| `duration-200` | 200ms | 复制按钮状态切换 |
+
+### 7.2 焦点状态
+
+所有可交互元素必须有可见的焦点指示器:
+
+```tsx
+// 标准焦点环
+focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
+
+// 紧凑焦点环(图标按钮)
+focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring
+
+// 输入框焦点
+focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
+```
+
+### 7.3 悬停状态
+
+```tsx
+// 按钮悬停
+hover:bg-accent hover:text-accent-foreground
+
+// 卡片悬停
+hover:bg-muted/30 hover:border-[rgba(var(--tool-color),0.45)]
+
+// 链接/文字悬停
+hover:text-foreground hover:underline
+```
+
+### 7.4 动画规范
+
+使用 `tailwindcss-animate` 提供的动画:
+
+```tsx
+// 淡入
+animate-in fade-in duration-150
+
+// 淡入 + 缩放(SwitchButtonGroup 选中项)
+animate-in fade-in-50 zoom-in-95 duration-150
+
+// 从顶部滑入(下拉菜单)
+animate-in fade-in slide-in-from-top-2 duration-150
+
+// 错误提示出现
+animate-in fade-in slide-in-from-top-1 duration-150
+
+// 骨架屏脉冲
+animate-pulse
+```
+
+### 7.5 禁用状态
+
+```tsx
+// 统一禁用样式
+disabled:pointer-events-none disabled:opacity-50
+```
+
+---
+
+## 8. 暗色模式
+
+### 8.1 实现方式
+
+通过 `darkMode: 'class'`(Tailwind 配置)+ `.dark` 类切换:
+
+```tsx
+// ThemeModeProvider 自动处理
+document.documentElement.classList.toggle('dark', resolvedMode === 'dark');
+```
+
+### 8.2 暗色模式下的特殊处理
+
+```tsx
+// 彩色阴影增强(暗色模式下阴影需要更高透明度)
+shadow-[0_8px_24px_-8px_rgba(var(--tool-color),0.14)]
+dark:shadow-[0_8px_30px_-10px_rgba(var(--tool-color),0.25)]
+
+// 图标容器背景增强
+bg-[rgba(var(--tool-color),0.08)]
+dark:bg-[rgba(var(--tool-color),0.12)]
+
+// 成功状态文字调整
+text-emerald-600 dark:text-emerald-400
+```
+
+### 8.3 暗色模式色彩映射原则
+
+| 亮色 | 暗色 | 说明 |
+| ---------------- | ---------------- | ------------------------------- |
+| 纯白背景 | 深蓝黑背景 | 避免纯黑 `#000`,使用 `#020617` |
+| 浅灰背景 | 深灰背景 | 保持层次关系 |
+| 深文字 | 浅文字 | 反转对比度 |
+| 彩色阴影低透明度 | 彩色阴影高透明度 | 暗色需要更强视觉反馈 |
+
+---
+
+## 9. 工具色彩标识
+
+### 9.1 色板定义
+
+每个工具分配一个主题色,定义于 `src/config/features.tsx`:
+
+```ts
+const PALETTE_COLORS: Record
= {
+ primary: '13, 148, 136', // teal (#0d9488)
+ success: '22, 163, 74', // green (#16a34a)
+ warning: '217, 119, 6', // amber (#d97706)
+ error: '220, 38, 38', // red (#dc2626)
+ secondary: '147, 51, 232', // purple (#9333e8)
+ info: '37, 99, 235', // blue (#2563eb)
+};
+```
+
+### 9.2 工具色彩分配
+
+| 工具 | 色彩键 | 色值 |
+| ----------- | ----------- | ------ |
+| 时间戳转换 | `primary` | Teal |
+| 存储清理 | `warning` | Amber |
+| 二维码工具 | `success` | Green |
+| 文本统计 | `secondary` | Purple |
+| JWT 解析 | `info` | Blue |
+| JSON 对比 | `primary` | Teal |
+| Base64 转换 | `info` | Blue |
+| 右键还原 | `success` | Green |
+
+### 9.3 工具色彩使用规范
+
+```tsx
+// 1. 通过 style 注入 CSS 变量
+
+
+// 2. 图标容器背景(低透明度)
+bg-[rgba(var(--tool-color),0.08)]
+dark:bg-[rgba(var(--tool-color),0.12)]
+
+// 3. 图标颜色
+ text-[rgb(var(--tool-color))]
+
+// 4. 悬停边框
+hover:border-[rgba(var(--tool-color),0.45)]
+
+// 5. 悬停阴影
+hover:shadow-[0_8px_24px_-8px_rgba(var(--tool-color),0.14)]
+
+// 6. 箭头悬停色
+group-hover:text-[rgb(var(--tool-color))]
+```
+
+**注意**:工具色彩仅用于**标识和装饰**,不得用于功能性色彩(如成功/错误状态)。
+
+---
+
+## 10. 代码规范
+
+### 10.1 Tailwind 类名组织顺序
+
+使用 `cn()` 工具函数(`clsx` + `tailwind-merge`)组合类名,按以下顺序排列:
+
+```tsx
+className={cn(
+ // 1. 布局(display, position, flex, grid)
+ 'flex items-center justify-between',
+ // 2. 尺寸(width, height, padding, margin)
+ 'w-full h-10 px-4',
+ // 3. 外观(background, border, shadow, rounded)
+ 'rounded-md border border-input bg-background shadow-sm',
+ // 4. 文字(color, font, text-align)
+ 'text-sm font-medium text-foreground',
+ // 5. 交互(hover, focus, disabled, cursor)
+ 'hover:bg-accent focus-visible:ring-2 disabled:opacity-50',
+ // 6. 动画(transition, animate)
+ 'transition-colors duration-150',
+ // 7. 条件类
+ isActive && 'bg-primary text-primary-foreground',
+ // 8. 外部传入
+ className,
+)}
+```
+
+### 10.2 颜色使用检查清单
+
+- [ ] 所有颜色使用 CSS 变量(`bg-background` 而非 `bg-white`)
+- [ ] 边框使用 `border-border` 及其透明度变体
+- [ ] 文字层级使用 `foreground` → `muted-foreground` → `muted-foreground/60`
+- [ ] 错误状态使用 `destructive` 系列
+- [ ] 工具色彩仅用于装饰性元素
+
+### 10.3 组件文件组织
+
+```
+src/
+├── components/ui/ # shadcn 基础组件(只读,不修改)
+├── components/ # 业务组件
+│ ├── CopyButton.tsx
+│ ├── SwitchButtonGroup.tsx
+│ ├── TextInputArea.tsx
+│ └── ...
+├── pages/ # 页面组件
+│ ├──
/
+│ │ ├── index.tsx # 页面入口
+│ │ ├── use.ts # 业务逻辑 Hook
+│ │ └── components/ # 页面私有组件
+│ └── ...
+└── providers/ # Context Providers
+```
+
+### 10.4 新增页面模板
+
+```tsx
+// src/pages/NewTool/index.tsx
+import SwitchButtonGroup from '@/components/SwitchButtonGroup';
+import { useI18n } from '@/utils/chromeI18n';
+import { cn } from '@/lib/utils';
+
+export default function Index() {
+ const { t } = useI18n('newTool');
+
+ return (
+
+ {/* 页面内容 */}
+
+
{t('newTool:title')}
+
+
+ );
+}
+```
+
+---
+
+## 11. 反模式清单
+
+以下模式**禁止**在项目中使用:
+
+### 11.1 色彩反模式
+
+```tsx
+// ❌ 硬编码颜色
+
+
+
+
+// ❌ 使用非语义化 Tailwind 颜色
+
+
+
+// ✅ 使用 CSS 变量
+
+
+```
+
+### 11.2 布局反模式
+
+```tsx
+// ❌ 固定高度导致内容截断
+
+
+// ✅ 使用 min-height 或自适应
+
+
+
+// ❌ 使用 margin 做组件间距
+
+
+// ✅ 使用 gap
+
+```
+
+### 11.3 组件反模式
+
+```tsx
+// ❌ 修改 shadcn/ui 基础组件样式
+// 如需修改,通过 className 覆盖或创建包装组件
+
+// ❌ 内联样式用于颜色(工具色彩除外)
+
+
+// ❌ 混合使用不同圆角体系
+