# 后台样式统一优化计划 ## 问题总结 经过全面审查,发现以下风格不一致和突兀的地方: | # | 问题 | 严重度 | 涉及文件 | |---|------|--------|----------| | 1 | CSS 中大量使用硬编码十六进制颜色,未引用 Tailwind 语义 token | 高 | `index.css` | | 2 | `stat-card` 悬浮效果(上移+大阴影)与 `section-card`(仅阴影)风格差异大 | 中 | `index.css` | | 3 | 主按钮悬浮时 `translateY(-1px)` 在管理后台中显得突兀 | 中 | `index.css` | | 4 | `blue-600` 应为 `brand` 的渐变色在布局和头像中混用 | 中 | `layout/index.tsx`, `ProfileSummary.tsx` | | 5 | 登录页使用 `#f7f8fa` 而非 `canvas` token | 低 | `Login/index.tsx`, `LoginPanel.tsx` | | 6 | Role/Personnel 页面缺少 `page-stack` 包裹 | 中 | `Role/index.tsx`, `Personnel/index.tsx` | | 7 | Modal 宽度不一致(640/720/默认520) | 中 | `Channel`, `DramaList`, `DramaDetail`, `Role`, `Personnel` | | 8 | 分页配置不一致(部分有 sizeCanChange/showTotal,部分没有) | 中 | 多个页面 | | 9 | 状态标签颜色不一致(禁用:红色 vs 灰色) | 低 | `User`, `Personnel` vs `Channel`, `Drama` | | 10 | DramaList 的"新增短剧"按钮用绿色,其他页面用蓝色 | 低 | `DramaList.tsx` | | 11 | InputNumber 宽度不一致(固定180px vs 100%) | 低 | `Channel` vs `Drama` | ## 实施方案 ### 步骤 1:统一 CSS 中的颜色引用 (`index.css`) 将所有硬编码颜色替换为 Tailwind 语义化写法: ```css /* 之前 */ background-color: #f2f3f5 !important; /* canvas */ color: #165dff !important; /* brand */ background-color: #e8f3ff !important; /* brand-light */ color: #4e5969 !important; /* 无对应token,新增 secondary */ background-color: #fafbfc !important; /* 无对应token,新增 header-bg */ color: #1d2129 !important; /* ink */ color: #86909c !important; /* muted */ border-color: #c9cdd4 !important; /* 无对应token,新增 border-hover */ background-color: #f7f8fa !important; /* 无对应token,新增 row-hover */ color: #fff !important; /* white */ ``` 新增 tailwind.config.js token: - `secondary: '#4e5969'` — 表头、表单标签等次级文字 - `header-bg: '#fafbfc'` — 表头、描述标签背景 - `row-hover: '#f7f8fa'` — 表格行悬浮背景 - `border-hover: '#c9cdd4'` — 输入框悬浮边框 CSS 改用 `theme()` 函数引用: ```css background-color: theme('colors.canvas') !important; color: theme('colors.brand') !important; ``` ### 步骤 2:统一悬浮效果 (`index.css`) - 移除 `stat-card` 的 `hover:-translate-y-0.5`,改为与 `section-card` 一致的仅阴影变化 - 移除 `.arco-btn-primary:hover` 的 `transform: translateY(-1px)` - 统一所有悬浮阴影为同一级别 ### 步骤 3:修复渐变色 (`layout/index.tsx`, `ProfileSummary.tsx`) 将 `to-blue-600` 改为 `to-brand`: - `layout/index.tsx` 行 61:Logo 渐变 - `layout/index.tsx` 行 103:Avatar 渐变 - `ProfileSummary.tsx` 行 7:Avatar 渐变 ### 步骤 4:修复登录页背景色 (`Login/index.tsx`, `LoginPanel.tsx`) 将 `bg-[#f7f8fa]` 改为 `bg-canvas` ### 步骤 5:统一页面结构 (`Role/index.tsx`, `Personnel/index.tsx`) 为 Role 和 Personnel 页面添加 `page-stack` 包裹: ```tsx return (