const assert = require("node:assert/strict"); const fs = require("node:fs"); const path = require("node:path"); const root = path.resolve(__dirname, ".."); const read = (file) => fs.readFileSync(path.join(root, file), "utf8"); const globals = read("src/app/globals.css"); const navigation = read("src/components/xingbang/navigation.css"); const workspace = read("src/app/data-access/workspace.css"); const assistant = read("src/components/xingbang/business-assistant.css"); const assistantComponent = read("src/components/xingbang/BusinessAssistant.tsx"); const operations = read("src/app/operations-center/operations.css"); assert.match(globals, /font-size:\s*16px/, "全局正文应提供清晰的基础字号"); assert.match(globals, /:focus-visible/, "键盘操作应有明显焦点提示"); assert.match(navigation, /\.xb-agent-nav a\{min-height:42px[^}]*font-size:14px/, "主导航应扩大文字和点击区域"); assert.match(navigation, /\.xb-role-switch\{min-height:42px/, "身份选择器应保留足够大的点击区域"); assert.match(workspace, /\.ra-button\{min-height:42px[^}]*font-size:14px[^}]*font-weight:700/, "工作台按钮应清晰且易点击"); assert.match(workspace, /\.ra-button\.primary\{background:#17634c/, "主操作按钮应采用稳定的主色强调"); assert.match(workspace, /\.xb-review-final>\.ra-button:not\(\.primary\)\{border-color:#d7837b/, "退回操作应与批准操作清楚区分"); assert.match(workspace, /\.xb-panel>p,.xb-panel p,.xb-panel details\{font-size:14px/, "业务面板正文不应继续使用过小字号"); assert.match(assistant, /\.ba-messages article p\{font-size:15px/, "助手对话正文应易于阅读"); assert.match(assistant, /\.ba-messages article\.user\{width:100%;max-width:100%;margin-left:0\}/, "用户消息应占据整行以便贴右显示"); assert.match(assistant, /\.ba-messages article\.user>div\{width:100%;justify-content:flex-end/, "用户气泡内容应靠右对齐"); assert.match(assistant, /@media\(max-width:820px\)\{\.ba-messages article\.user p\{max-width:88%\}\}/, "移动端用户气泡应保留可读宽度"); assert.match(assistantComponent, /className="ba-user-icon" aria-label="本人">