nex_animation/frontend/src/styles/app.css

818 lines
54 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/* ══════════════════════════════════════════════════════════════════════════
基础层 + Ant Design 接不住的那些细节
-----------------------------------------------------------------------------
这里只放两类东西:
1) 元素级默认值(body / h1~h3 / small / 焦点环 / 减弱动效)——不是控件皮肤;
2) 必须靠 CSS 才能做到的 antd 集成:字段标签列宽、标签度量档位、浮层层级。
任何「按钮 / 输入框 / 下拉长什么样」都去 src/theme/antd.ts 改 token,
写在这里就等于又开了第三个皮肤来源(这正是历史上控件不一致的根因)。
取值只有一个前缀:`--ant-*`。颜色、字号、圆角、控件高度、间距、行高、断点
全部来自 theme/antd.ts 的那一份 ThemeConfig——applyRootVars() 把同一批 token
按同名铺到 `:root`,于是 body、挂在 body 上的浮层、antd 组件读的是同一把尺子。
旧的 --c-* / --fs-* / --ctl-h-* / --radius-* 四十几把私有尺子已经全部删除。
══════════════════════════════════════════════════════════════════════════ */
html { -webkit-text-size-adjust: 100% }
body {
margin: 0;
background: var(--ant-color-bg-layout);
color: var(--ant-color-text);
font-family: var(--ant-font-family);
font-size: var(--ant-font-size);
-webkit-font-smoothing: antialiased;
}
/* 站内最小可读字号:中文在 10px 以下只剩墨点,antd 最小一档就是 fontSizeSM(12)。
父级字号更小时按 0.8 倍缩,不让 small 反过来把小字撑回 12。 */
small { font-size: max(0.8em, var(--ant-font-size-sm)) }
/* 标题三级对应 antd 自己的 heading token(h3=24 / h4=20 / h5=16),
字重与行高也一并取 antd:页面里不再出现 font-weight:700 和 leading-[1.25]。 */
h1 { font-size: var(--ant-font-size-heading-3); line-height: var(--ant-line-height-heading-3); font-weight: var(--ant-font-weight-strong); margin: 0 0 0.5em }
h2 { font-size: var(--ant-font-size-heading-4); line-height: var(--ant-line-height-heading-4); font-weight: var(--ant-font-weight-strong); margin: 0 0 0.5em }
h3 { font-size: var(--ant-font-size-heading-5); line-height: var(--ant-line-height-heading-5); font-weight: var(--ant-font-weight-strong); margin: 0 0 var(--ant-margin) }
::selection { background: var(--ant-color-primary); color: var(--ant-color-text-light-solid) }
/* 键盘焦点必须始终可见(点按钮不出现描边,所以只看 :focus-visible)。
antd 组件自带 outline 的是自己的那一套;这条兜住自绘区域(素材墙、时间线)。 */
:focus-visible { outline: 2px solid var(--ant-color-primary); outline-offset: 2px }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
scroll-behavior: auto !important;
animation-duration: .01ms !important;
animation-iteration-count: 1 !important;
transition-duration: .01ms !important;
}
}
/* ══════════════════════════════════════════════════════════════════════════
结构性变量:等号右边全是 antd token,没有一个新的数
-----------------------------------------------------------------------------
它们存在的唯一理由是「同一档数值要被三处引用,且需要能从容器上覆盖」:
· --tag-* 标签两档度量——容器降档时整片一起降
字段标签列宽 `--label-w` 已经整层删除:标签移到控件上方之后(antd
Form.Item 的 layout="vertical"),「标题与控件对齐」由 antd 的表单栅格负责,
站内不再有第二把量标签的尺子。
顶栏高度 --nex-bar 不在这里:它的唯一出处是 theme/antd.ts 的 HEADER_HEIGHT,
由 applyRootVars() 和 --ant-* 一起写进 `:root`,这里再抄一遍就是两个数。
══════════════════════════════════════════════════════════════════════════ */
:root {
/* 标签两档:md 用 antd 的正文档 + controlHeightSM,sm 整档落到 fontSizeSM。
旧的 main(20/11) 与 sm(18/10) 是两把自造的尺子,现在两档都从 antd 取值。 */
--tag-h: var(--ant-control-height-sm); /* 24 */
--tag-px: var(--ant-padding-xs); /* 8 */
--tag-gap: var(--ant-margin-xxs); /* 4 */
--tag-text: var(--ant-font-size); /* 14 */
--tag-h-sm: calc(var(--ant-control-height-sm) - 4px); /* 20 */
--tag-px-sm: var(--ant-padding-xxs); /* 4 */
--tag-gap-sm: var(--ant-margin-xxs); /* 4 */
--tag-text-sm: var(--ant-font-size-sm); /* 12 */
}
/* ══════════════════════════════════════════════════════════════════════════
表单 glue:结构交给 Ant Design 的 Form.Item,这里只补三件它接不住的事
-----------------------------------------------------------------------------
症状(2026-11 用户第二轮截图的真身):资产库编辑抽屉里「标签在左」的三列字段
和「标签在上」的长字段混排,列边界参差;只放一个字段的行把输入框缩成
一小截;`nex-textarea-tall` 把 rows=2 的文本域撑到 150px。
做法:字段 = antd `Form.Item`(layout="vertical",标签一律在上)、
行 = antd `Row`/`Col`(FormRow)、横条 = antd `Flex`(Ctlbar)。
列边界与降列只有 Row/Col 一个来源(components/ui/grid.tsx),
旧的 --label-w / .nf-ctl / .nf-w-* / 六条 @media 降列整层删除。
CSS 只剩下面这六件 antd 自己接不到的事。
══════════════════════════════════════════════════════════════════════════ */
/* ① 控件撑满列宽。antd 的 Select / InputNumber / DatePicker 默认按内容取宽,
放进 24 等分的 Col 里会各自缩成一截,同一行的三个字段右边界永远不齐。
只管「表单作用域」和「显式给了宽度的字段」:工具条里没写宽度的字段
仍按内容取宽(那里没有列宽可撑,撑满会把一颗下拉顶成整条工具条宽)。 */
.nex-form .nex-field .ant-form-item-control-input-content > :is(.ant-select, .ant-input, .ant-input-affix-wrapper,
.ant-input-number, .ant-picker, .ant-mentions, .ant-cascader, .ant-segmented, .ant-radio-group, .ant-upload-wrapper,
textarea),
.nex-field-fill .ant-form-item-control-input-content > :is(.ant-select, .ant-input, .ant-input-affix-wrapper,
.ant-input-number, .ant-picker, .ant-mentions, .ant-cascader, .ant-segmented, .ant-radio-group, .ant-upload-wrapper,
textarea) { width: 100%; min-width: 0 }
/* ② 工具条 / 动作行里的字段不留竖向边距:Form.Item 的 24px 是给竖排表单的,
横贴一排之后多出来的下边距会把同排的按钮顶歪半格。 */
.nex-ctlbar .ant-form-item, .nex-card-actions .ant-form-item { margin-block-end: 0 }
/* ③ tight 行(一行全是窄字段的批量设置):间距压到半档,其余仍由 Form.Item 自己给 */
.nex-form-row.nf-tight .ant-form-item { margin-block-end: var(--ant-margin-xs) }
/* ④ 字段下的提示(extra)与标题折行。antd 的 extra 是正文档 14,站内说明文字
统一 12(规范 §1);标签默认 nowrap + 省略号,中文长标题会被吃掉尾巴,
宁可让它折到第二行——标题被裁的字段没人知道自己在填什么。 */
.nex-field .ant-form-item-extra {
min-height: 0;
font-size: var(--ant-font-size-sm);
line-height: var(--ant-line-height-sm);
overflow-wrap: anywhere;
}
.nex-field .ant-form-item-label { white-space: normal; overflow: visible }
.nex-field .ant-form-item-label > label { height: auto; white-space: normal }
/* ⑤ 筛选条里的字段(`<Field inline>`):标签在左、控件在右,**同一行**垂直居中。
症状(用户第三轮截图):项目列表的「搜索 / 状态」两个字段占了整两行——
上面一排标签、下面一排控件,右边还空着半条。筛选是一次扫读的动作,
不该用「填表」的排版。
antd 的 horizontal 布局本身就是标签在左,只是它为表单场景把标签**右对齐**
并留了 8px 标签内边距;横扫读的筛选条要左起、且标签不许把控件顶歪,
所以标签列 flex:none + 左对齐,控件列也不参与挤压(工具条里的控件宽度
由字段自己的 width / grow 决定,见 Controls.tsx 的 WIDTHS)。 */
.nex-field-inline { margin-block-end: 0 }
.nex-field-inline .ant-form-item-row { flex-wrap: nowrap; align-items: center }
.nex-field-inline .ant-form-item-label { flex: none; text-align: start; padding: 0; margin-inline-end: var(--ant-margin-xs) }
.nex-field-inline .ant-form-item-label > label { height: auto; white-space: nowrap; color: var(--ant-color-text) }
/* 控件列吃 --nex-ctl-w(inline 的 narrow/wide 由组件写进变量);没写变量的字段照旧按内容定尺。
⚠ 必须是「可收缩 + 上限」而不是 `flex: none; width: N`:控件列不参与挤压时,
标签(nowrap) + 控件的自然宽度大于盒子拿到的宽度就会**捅出盒子**——
visualcheck 576 档 / 的「搜索」字段(盒子 flex-basis 220 实得 227,
控件列 flex:none 撑到 220,标签 49 + 间隙 8 + 220 = 277)溢出 42px。
现在标签列仍然 flex:none(标签永远不被压),控件列最宽 --nex-ctl-w、
盒子变窄时它跟着缩,窄屏是「控件变短」而不是「控件掉出容器」。
栅格里的字段(.nex-ctlbar-grid)要撑满整格,所以那里把上限解掉。 */
.nex-field-inline .ant-form-item-control { flex: 1 1 auto; width: auto; min-width: 0; max-width: var(--nex-ctl-w, none) }
.nex-req { color: var(--ant-color-error); font-weight: var(--ant-font-weight-strong); margin-inline-start: 1px }
/* ⑥ 一行里既有「标签在上」的字段、又有裸复选框时,复选框必须坐进控件那一行。
症状(用户第一轮就在说「字段标题、控件不对齐」):分镜检查器「环境声 / 启用字幕」
这一行,左边标签 30px + 输入框 32px,右边那颗复选框顶在 909——和输入框中心差 35px,
读起来像它属于上一行。原因:FormRow 的列是块级 Col,调用点写的
`self-center` / `self-end` 在块容器里不参与对齐,等于没写。
做法:由这里统一让位——先让出标签块(行高 × 字号 + marginXS = 30),
再在 controlHeight 里垂直居中;整行都是复选框时(:has 不成立)不让位,
因为没有标签行可对齐。调用点从此不再自己写对齐 class。 */
.nex-form-row:has(.ant-form-item-label) > .ant-col > :is(.nex-check, .ant-checkbox-wrapper) {
display: flex;
align-items: center;
height: var(--ant-control-height);
margin-block-start: calc(var(--ant-font-size) * var(--ant-line-height) + var(--ant-margin-xs));
}
/* ── 卡片(Panel = antd Card):标题与副标题是中文短语,默认 ellipsis 会裁掉半句 ── */
.nex-panel .ant-card-head-title { white-space: normal; overflow: visible; text-overflow: clip }
/* 标题条同理:中文短语不许被 ellipsis 裁掉半句,right 那一块也按内容折行。
卡头的 right 只是「一个计数 / 一句下一步」,长起来时不许把标题压成竖排。
症状(430 档 /projects/10 的「流程进度」):right 那句「下一步:时间线合成 + 配音/字幕/混音 — …」
要 400px 以上,而 antd 的 head 是不换行的 flex,标题只剩 30px ⇒ 「流程进度」一个字一行。
做法:head 允许 wrap、right 最宽 100%——宽屏照旧同一行读完,窄屏整句掉到第二行。 */
/* ⚠ 卡头的 flex 容器是 .ant-card-head-wrapper,不是 .ant-card-head(后者只是块级壳),
写在壳上等于没写。extra 默认 flex-shrink:1 会被压成一条竖河,这里让它按内容定尺、
放不下就整块掉到第二行。 */
.nex-panel .ant-card-head-wrapper { flex-wrap: wrap; row-gap: var(--ant-margin-xxs) }
.nex-panel .ant-card-extra { flex-shrink: 0; max-width: 100% }
/* 手机档卡头(Panel 在 <576 挂 nex-head-stack,档位来自 Grid.useBreakpoint):
右端那一块整块占一行,标题拿回整行宽度。上面那条 flex-wrap 救不了它——
折行判定看的是 flex-basis,而 `.ant-card-head-title` 是 `flex:1 1 0`,
浏览器永远认为 extra 放得下,于是 shrink 的是标题,中文标题就断成两行。
做法:把 extra 的假想主轴宽写成整行(flex:1 1 100%),标题的 flex-basis
从 0 放开成 auto(内容宽),两者的假想宽之和必然超过一行 → extra 确定地
掉到第二行,标题在自己的那一行里 grow 满宽。
⚠ 只写 extra 那条不够:标题 basis 是 0 时它能不能把动作挤下去,
取决于 min-width:auto 算出的那一格 min-content(一个汉字 15px)——
`.ant-card-head-title` 在 antd 里是 overflow:hidden(min 归 0),
这条链子中一环扣在别的规则上,版面就会退化成「标题只剩一条竖河」。
该换行的是整块,不是字。 */
.nex-panel.nex-head-stack .ant-card-head-wrapper { row-gap: var(--ant-margin-xs) }
.nex-panel.nex-head-stack .ant-card-head-title { flex: 1 1 auto }
.nex-panel.nex-head-stack .ant-card-extra { flex: 1 1 100%; margin-inline-start: 0 }
/* 卡头里的块级横排(只读标签行 / chip 行 / 控件栏):那 12px 下边距是给
「正文里两块之间」用的,坐进 48px 的卡头就成了压在下面的一段空档。
症状(2026-11 第十四轮 · 用户原话「垂直居中对齐,和其它子页面要一致」+
调度中心工具条截图):那一排 25px 的只读胶囊整体浮在卡头中线**上方 6px**
(= 12 的一半),同屏其它单行卡头偏的是 0.5px——肉眼就是「这排贴顶、下面空一截」。
⚠ 调用点写了 `mb-0` 却压不住:Tailwind 的 utility 在 utilities 层,
而本文件未分层,按 R13 那套层叠规则「未分层永远赢过分层」,
归零只能写在同一层里、按结构命中(这条对全站卡头一次生效)。 */
.nex-panel .ant-card-head :is(.ant-card-head-title, .ant-card-extra) :is(.nex-taggroup, .nex-chipbar, .nex-ctlbar) { margin-block: 0 }
/* 卡头标题槽是 15px/600 的标题档(extra 继承同一档),只读胶囊与分段器坐进来时不许跟着变粗:
R16.3 的只读回显全站只有一档字重(正文里的 Tag 继承 body 的 400)。
症状(同一条工具条):`任务执行:平台内即时执行` 在卡头里是 14px/600,
同样的标签落在卡片正文里是 14px/400——同一枚胶囊在两级里两种字重。 */
.nex-panel .ant-card-head :is(.ant-tag, .nex-chip, .ant-segmented) { font-weight: 400 }
/* Card 的 body 不是 flex 子项,里面的 Row/Col 想收缩必须先从 min-width:auto 解放出来 */
.nex-panel .ant-card-body { min-width: 0 }
.nex-panel .ant-card-body > * { min-width: 0 }
/* ── 内容页页头(PageHead):每一页的门牌是一张**有底纹描边的卡** ──────────
症状(2026-11 第十一轮 · 用户原话「项目中切到每个节点应该是其对应的 Header,
这部分应该放入一个有样式的单独面板中」;第十二轮 · 用户原话「内容页 Header
重写」):页头是一行裸浮在页面底色上的字,和正文第一张卡之间只有 16px 空白,
读起来像「正文上面漏了半句话」;上面还叠着外壳那条同样裸着的面包屑条,
两层无边界的东西贴在一起,分不清哪句说项目、哪句说这一站。
做法:页头坐进自己的 Card,底纹 = 主色 7%(深色 14%)斜向渐变收进卡底色,
描边取主色描边那一族——它是全站唯一带主色描边的卡,一眼就是「这一层的门牌」,
下面的正文卡都是中性描边,主次不再靠字号硬撑。
第十二轮起这条对**所有内容页**成立(七站 + 项目总览 / 平台资产库 / 模型控制台
/ 用户管理 / 账号 / 手册):组件也只剩 PageHead 一个,旧的 NodeHead 并了进来,
「环节页头」和「全局页页头」再也不是两套皮肤。
特异度:antd 5.29 把样式注进 <head> 与 app.css 抢先后,两个类起步,
body 内边距那条堆到三个类才压得住 `.ant-card-small > .ant-card-body`。 */
.nex-panel.nex-pagehead {
border-color: var(--ant-color-primary-border);
background: linear-gradient(115deg,
color-mix(in srgb, var(--ant-color-primary) 7%, var(--ant-color-bg-container)) 0%,
var(--ant-color-bg-container) 58%);
}
html[data-theme='dark'] .nex-panel.nex-pagehead {
background: linear-gradient(115deg,
color-mix(in srgb, var(--ant-color-primary) 14%, var(--ant-color-bg-container)) 0%,
var(--ant-color-bg-container) 58%);
}
.nex-panel.nex-pagehead > .ant-card-body { padding: var(--ant-padding-sm) var(--ant-padding-lg) }
/* 门牌第一行(一级标题 + 右端主操作)定高 = 控件档。
症状(2026-11 第十二轮 · 用户原话「右侧的主功能入口要对齐」):主操作原先挂在
**整块页头**的垂直中线上,七站的职责说明有的两行有的一行,那颗主按钮在每一页的 y
都不一样;概览页没有动作时中线还空着。第一行既然定高,同排右对齐的动作组就必然
七站同高、右缘贴卡内边距——「对齐」由几何保证,不靠页面自己垫 margin。 */
.nex-pagehead-title { min-block-size: var(--ant-control-height) }
/* ── 顶栏流程控制台(PipelineConsole):一颗**打开项目概况抽屉**的按钮 ──────
症状(用户第 2 条):项目身份在站内说了三遍——顶栏这颗胶囊、外壳那条面包屑、
概览页的「流程概览」页头,而「归档 / 删除」这两颗项目级操作又散在
面包屑和概览页页头两处。胶囊本身是个 <a> 跳到流程概览,点下去既不是
「项目详情」也不是「项目操作」,语义含混。
做法:胶囊改成 antd 的 text Button(整站按钮只有一个来源,R15/R8),
点击不再跳页而是打开右侧「项目概况」抽屉——项目身份、指标、流程、
七站跳转、归档与删除全部收进那一处(见 app/layout/ProjectBriefDrawer)。
外观仍是那条 32px 胶囊:底走 bg-elevated(比 Header 底色亮一档,
与同排控件等高),描边跟流程色调由组件自己写 inline。
为什么不是 <a>:跳转语义已经还给抽屉里的七站列表,这颗只管「展开/收起」,
那是 button 的活(aria-haspopup="dialog" + aria-expanded)。 */
.nex-console.ant-btn.ant-btn-text {
display: flex; align-items: center; gap: var(--ant-margin-xs);
flex: 0 1 auto; min-width: 0; max-width: 640px;
height: var(--ant-control-height); line-height: normal;
padding-inline: var(--ant-padding-sm);
border: 1px solid var(--ant-color-primary-border);
background: var(--ant-color-bg-elevated);
color: var(--ant-color-text);
font-weight: 400;
}
/* text 按钮的悬停底色是一整块 fill,压在胶囊上会把里面的彩色轨道糊掉 */
.nex-console.ant-btn.ant-btn-text:hover {
background: var(--ant-color-bg-elevated);
border-color: var(--ant-color-primary-border-hover);
color: var(--ant-color-text);
}
/* ── 项目概况抽屉里的「七站」列表行(ProjectBriefDrawer)──────────────────
一行 = 图标 + 环节名 + 右端状态,整行可点。antd Button 是居中排版,
block 之后要让内容左对齐并撑满,右端状态才有 ms-auto 可推。 */
.nex-brief-row.ant-btn { justify-content: flex-start; text-align: start; height: auto; padding-block: var(--ant-padding-xxs) }
.nex-brief-row.ant-btn > span { min-width: 0 }
/* ── 控件容器 ─────────────────────────────────────────────────────────────
Ctlbar / CardActions / BarRight 现在就是 antd <Flex wrap>(排布由组件给),
CSS 只剩一条:工具条与正文之间留一档呼吸。
Dense 除了给 antd 下发 componentSize="small",还落下 .nex-dense 这个标记:
自绘的那几处(checkable tag 的高度)读不到 ConfigProvider,只能靠它对齐
到同一个 controlHeightSM。 */
.nex-ctlbar { margin-block-end: var(--ant-margin-sm) }
/* 工具条铺成栅格之后,宽度归格子管:控件列吃掉标签以外的全部宽度,
inline 字段上写的 width="narrow|wide"(--nex-ctl-w)在这里让位给列宽,
同一行的控件右边缘因此必然对齐;胶囊选项铺进格子时同理要撑满。 */
.nex-ctlbar-grid > .ant-col { display: flex; align-items: center; gap: var(--ant-margin-xs); min-width: 0 }
.nex-ctlbar-grid > .ant-col > .ant-form-item { flex: 1 1 auto; min-width: 0 }
.nex-ctlbar-grid .nex-field-inline .ant-form-item-control { flex: 1 1 auto; width: auto; min-width: 0; max-width: none }
/* 末尾那格是 BarRight 时它吃掉整行剩下的宽度(见 Controls.tailRight / grid.FILL_AT),
内容再靠右:这一格可能横跨好几列,动作组要贴着**容器**右缘而不是格子的左缘。 */
.nex-ctlbar-grid > .nex-ctlbar-tail { justify-content: flex-end }
/* 整组不可分割(§7):横排时把盒子钉在自然宽度,会折行的父容器于是把整组当一个 item 挪行。
两个类的特异度才压得住同一个元素上 Tailwind 的 min-w-0;窄到一整行都放不下时
这个类不上(useAutoStack 把整组翻成竖排),所以它永远不会捅破容器。 */
.nex-action-group.nex-atom { min-width: max-content }
/* 自动竖排那一档(useAutoStack 判定「一整行放不下」之后上的 .ant-flex-vertical):
横排时用来「把辅助动作钉在最左」的 mr-auto / ml-auto,以及容器上的 items-center,
在竖排里都变成缺陷——那几颗收成内容宽、贴左边或贴中间,和下面几颗参差。
浮层底部(Overlay.DRAWER_ACTIONS 现在就是 ActionGroup)第一条就带 items-center,
所以这两句写在 app.css:不在 @layer 里,特异度压得住 Tailwind utilities 层的
items-center / mr-auto(第 17 轮实测 mb-0 压不住 .nex-taggroup 是同一条反向证据)。 */
.nex-action-group.ant-flex-vertical { align-items: stretch }
.nex-action-group.ant-flex-vertical > * { margin-inline: 0 }
/* ── 流程节点条(Steps):容器自适应网格,不是横向滚动的自然排列 ──────────
症状:12 格 × 96px + 11 × 8px = 1244px 在任何视口都放不下,整条只能横滚,
「把当前节点滚进视野」于是把前面的节点推出视野——项目概览 1440 档
scrollLeft=126(第 1 格被切一半)、1024 档 542(前 5 格看不见)、
总控台那条 526px 宽溢出 718px=12 格里 9 格在视野外。
做法:轨道下限由组件按 compact 档写进 --nex-step-min(完整 140 / 精简 128),
`auto-fill` 按**容器**宽度分列:项目页 1118px → 7 列 2 排、总控台半栏
526px → 3 列、430 手机档 → 2 列。12 个节点一次全部可见,
不滚动、不渐隐、不裁切,中文标题也不再折成「导出完整视 / 频」。
为什么不用 antd Row/Col:Col 的断点读视口,读不到「这条 rail 坐在半栏里」。 */
.nex-steps { display: grid; gap: var(--ant-margin-xs);
grid-template-columns: repeat(auto-fill, minmax(var(--nex-step-min, 140px), 1fr)) }
/* ── 下拉面板:宁可临时压住右边内容,也不让用户盲选 ────────────────────
症状:时间线 / 交付页的字幕模式、配音来源这些选项,文案本身就是说明
(「模型原声直出(口型同步 + 角色声线做参考 · 推荐)」≈ 421px),
面板被钉成触发器宽(186px)后,选项文字只剩 154px,展开也读不全。
做法:宽度 = max(触发器, 内容),上限 460px 与一屏减边距取小;
超过上限的文案折两行(-webkit-line-clamp:2),再长就省略号 + 原生 title。
为什么不无限加宽:面板是临时浮层,压住右边的字段 1 秒;读不全选项是每次都读不全。 */
.nex-select-popup { max-width: min(460px, calc(100vw - 2 * var(--ant-margin-lg))) }
.nex-select-popup .ant-select-item-option-content {
min-width: 0;
white-space: normal;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
/* 多选/标签式选项(tag 里的文字)同样按内容取宽,但保持单行 */
.nex-select-popup .ant-select-item { align-items: center }
/* ── 可点胶囊(Chip = antd Tag.CheckableTag)──────────────────────────────
配色、选中态、hover 全是 antd 自己的(选中=主色实心 + colorTextLightSolid),
CSS 只做一件事:让胶囊和同排的 antd 控件严格等高。
antd 的 Tag 是按行高排的(20px),而工具条里的控件是 24/32——
差的那几 px 就是用户说的「筛选条一排高低不齐」。
档位与 antd 同源:容器是 Dense(componentSize=small)就 24,否则 32。 */
.nex-chipbar { margin-block-end: var(--ant-margin-sm) }
.nex-chip.ant-tag {
display: inline-flex;
align-items: center;
gap: var(--ant-margin-xxs);
height: var(--ant-control-height);
margin-inline-end: 0;
padding-inline: var(--ant-padding-xs);
font-size: var(--ant-font-size-sm);
line-height: 1;
white-space: nowrap;
user-select: none;
}
.nex-dense .nex-chip.ant-tag, .nex-chip-sm.ant-tag { height: var(--ant-control-height-sm) }
/* 禁用:5.29 的 CheckableTag 没有 disabled,语义由 Controls.Chip 贴 inline style,
这里只负责把「点不动」这件事在光标上也说一遍 */
.nex-chip.is-off.ant-tag { cursor: not-allowed }
/* 胶囊铺进 OptionGrid 的等宽格子:宽度交给格子,文字居中。
这条必须排在 .nex-chip.ant-tag 之后——两条特异度相同(类+类),
写在前面会被上面的 display:inline-flex 覆盖回 inline-block,图标与文字的间隙就散了。 */
.nex-opt-cell .ant-tag { margin-inline-end: 0; width: 100%; justify-content: center }
/* 未选中的选项也要有边界(2026-11 第七轮目视)。
症状:antd 的 CheckableTag 未选中态是**完全透明**的,铺进等宽格子后
「出片预设」6 格、「引用已有素材」13 格读起来像两行居中的散文——
看不出这是一组可点的选项,更数不清第几格;ChipBar 的胶囊流没这个毛病,
因为胶囊彼此分开、文案长短本身就在说「这是一颗一颗的」。
做法:只给坐在格子里的选项补次级描边 + 中性底(fill-alter 与站内其它表面同族,
tagcheck 量的「这一层自己有没有加色」≈0,仍是中性);选中态照旧由 antd 的
主色实心表达,不参与这条。border-box 下加边框不改格子宽度,gridcheck 不受影响。
特异度:antd 5.29 把样式注到 <head> 里、和 app.css 抢先后,所以这里堆到 5 个类,
不靠顺序取胜。 */
.nex-opt-cell .nex-chip.ant-tag.ant-tag-checkable:not(.ant-tag-checkable-checked) {
border: 1px solid var(--ant-color-border-secondary);
background: var(--ant-color-fill-alter);
}
.nex-opt-cell .nex-chip.ant-tag.ant-tag-checkable:not(.ant-tag-checkable-checked):hover {
border-color: var(--ant-color-primary-border-hover);
background: var(--ant-color-fill-secondary);
color: var(--ant-color-primary-hover);
}
/* 多选回显 = antd Tag(closable):与 Tag 同度量,色调走 primary 那一族 */
.nex-tag-chip.ant-tag {
display: inline-flex;
align-items: center;
gap: var(--ant-margin-xxs);
max-width: 100%;
min-height: var(--tag-h);
margin-inline-end: 0;
padding-inline: var(--tag-px);
border-color: var(--ant-color-primary-border);
background: var(--ant-color-primary-bg);
color: var(--ant-color-primary);
font-size: var(--tag-text);
line-height: var(--ant-line-height-sm);
}
.nex-tag-chip .ant-tag-close-icon { color: inherit; font-size: var(--ant-font-size-sm) }
/* ── 标签度量(Tag / Status / Badge 共用一套尺子)──────────────────────────
尺寸不写在标签上:容器(TagGroup、密集表格)把 --tag-* 压到 sm 档,
整片标签一起降,于是同一行里三种标签严格等高。
border-radius 显式写 antd Tag 自己的那一档(borderRadiusSM),
不是为了改它,是为了「容器降档时圆角不跟着漂」这件事有个落点。 */
.nex-tag.ant-tag {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--tag-gap);
min-height: var(--tag-h);
padding-inline: var(--tag-px);
margin-inline-end: 0;
font-size: var(--tag-text);
line-height: var(--ant-line-height-sm);
border-radius: var(--ant-border-radius-sm);
white-space: nowrap;
vertical-align: middle;
box-sizing: border-box;
/* 标签最宽只能到它所坐容器的内容盒(第 16 轮:/assets 场景卡把整句「光线」
当标签渲染,nowrap 的长标签直接捅出卡片右缘 204px)。
配合下面 .nex-tag-text 的 ellipsis,收不下时在**标签内部**省略,
而不是把容器顶宽或冲出容器——完整文案由 title 悬停给出。 */
max-width: 100%;
overflow: hidden;
}
/* 标签文字的省略号落点:.nex-tag 是 inline-flex,text-overflow 落在匿名 flex item
上没有选得中,所以由 Status.tsx 给文字套这一层 span(min-width:0 才允许收缩)。 */
.nex-tag-text { min-width: 0; overflow: hidden; text-overflow: ellipsis }
/* 标签的底色只有一档:中性 fill-tertiary(= antd Tag bordered=false 的默认底)。
语义色不再铺底(用户第七轮「浅绿色标签都要处理到新的颜色设计上」)——整屏的
「完成 / 已交付 / 合格」如果各是一块浅绿,绿色就从语义色变成了第二个品牌色,
和新主色(antd 出厂蓝)打架,也把数字压住。语义改由头部那颗 6px 圆点承载。
色值仍然只有 --ant-color-* 一个来源:点用 --nex-tag-tint(由 Status.Tag 按 tone
写成 var(--ant-color-success) 等),明暗两档自动跟主题。 */
.nex-tag.ant-tag { background: var(--ant-color-fill-tertiary); color: var(--ant-color-text) }
.nex-tag-dot {
inline-size: 6px;
block-size: 6px;
flex: none;
border-radius: 9999px;
background: var(--nex-tag-tint, var(--ant-color-text-quaternary));
}
/* 深色档:fill-tertiary 只有 4% 白,标签在容器上分不出来,抬到 8% */
html[data-theme='dark'] .nex-tag.ant-tag { background: color-mix(in srgb, var(--ant-color-text) 8%, transparent) }
/* 密集档:挂在容器上,不挂在单个标签上 */
.nex-tag-dense {
--tag-h: var(--tag-h-sm);
--tag-px: var(--tag-px-sm);
--tag-gap: var(--tag-gap-sm);
--tag-text: var(--tag-text-sm);
}
/* 表格自己就是那个「容器」:站内表格一律 size=sm,是全站最密的地方,
档位令牌在这里压到底,单元格里的 Tag / Status / Badge 整片一起降一档,
页面不必逐个写 size="sm"(规范 §8.1「两档令牌挂在容器上」的表格那一半)。
⚠ 这条在 antd 重写时丢过一次,丢了没人报错:审查页「自动质检清单」的「结论」列
宽 104、扣掉左右内边距只剩 88,而 md 档的「人工不合格」要 98,整格 nowrap
把标签顶出内容盒右缘 10px(tableaudit 新加的「格子内容越界」判据抓到的就是它)。 */
.nex-table {
--tag-h: var(--tag-h-sm);
--tag-px: var(--tag-px-sm);
--tag-gap: var(--tag-gap-sm);
--tag-text: var(--tag-text-sm);
}
/* 单个标签的密集档(容器挂 TAG_DENSE 时不需要它) */
.nex-tag-solo-sm {
--tag-h: var(--tag-h-sm);
--tag-px: var(--tag-px-sm);
--tag-gap: var(--tag-gap-sm);
--tag-text: var(--tag-text-sm);
}
/* 数字气泡:与标签同度量,只收成 pill 并加粗 */
.nex-badge { border-radius: 9999px; font-weight: var(--ant-font-weight-strong) }
.nex-tag-icon { display: inline-flex; align-items: center; line-height: 0; flex: none }
/* 只读标签行:组内一档、组与下方一档半,定死不商量 */
.nex-taggroup { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ant-margin-xs); min-width: 0; margin-block-end: var(--ant-margin-sm) }
.nex-taggroup > span:first-child { flex: none }
/* ── 分页条:page_size 唯一的家 ─────────────────────────────────────────── */
.nex-pager {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--ant-margin-sm);
min-width: 0;
margin-block-start: var(--ant-margin-sm);
}
/* ── 滑杆字段:与 Field 共用标签列,值贴在右端不参与挤压 ─────────────────── */
.nf-slider-ctl { display: flex; align-items: center; gap: var(--ant-margin-sm) }
.nf-slider-ctl .ant-slider { flex: 1 1 auto; min-width: 0; margin: 0 }
.nf-slider-value {
flex: none;
min-width: var(--ant-control-height-lg);
text-align: right;
font-family: var(--ant-font-family-code);
font-size: var(--ant-font-size);
color: var(--ant-color-text-secondary);
font-variant-numeric: tabular-nums;
}
/* ── 复选与文件选择:antd 组件的两个收尾细节 ───────────────────────────── */
.nex-check.ant-checkbox-wrapper { font-size: var(--ant-font-size); color: var(--ant-color-text-secondary) }
.nex-check .ant-checkbox + span { padding-inline-start: var(--ant-margin-xxs); padding-inline-end: 0 }
/* 整块按钮就是热区:input 铺满父按钮,点哪里都开文件对话框 */
.ant-btn:has(> .nex-file-input), .ant-btn:has(.nex-file-input) { position: relative; overflow: hidden }
.nex-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer }
/* ── 分段控件:轨道高度必须正好落在档位上 ────────────────────────────────
症状:窄屏体检量到 37px(档位只有 32/24/40),真值是 36.53;宽屏 31.03
侥幸四舍五入成 31,所以只在窄档犯病,看起来像「窄屏专属 bug」。
根因:antd 把 .ant-segmented-item-label 的 min-height / line-height 写成
「档位 − 2×trackPadding」这个整数,可 kit 的 <Tabs> 在 label 里放了一只
inline-flex(图标 + count)。inline-flex 是行内盒,按基线参与行盒计算,
把行盒顶高 0.5px,于是轨道 = 内容高 + 2×padding 不再是那个整数。
做法:label 改成 flex 容器 + 居中,包装层退出基线计算;文字省略号本来在 label 上,
flex 之后对它无效,改由包装层自己承接(min-width:0 才能被压缩)。
为什么不在 theme/antd.ts 修:这是「内容参与行盒计算」,token 算不出这 0.5px。 */
.nex-segmented .ant-segmented-item-label { display: flex; align-items: center; justify-content: center }
.nex-segmented .ant-segmented-item-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis }
/* 长文本字段:高度由 antd TextArea 的 autoSize 自己长(见 components/ui/Input.tsx)。
旧的 .nex-textarea-tall 给容器挂 min-height: 3×controlHeight,它让 rows=2 的设定
失效——抽屉里每个长字段固定 96px 起、内容少时剩半盒空白,整张抽屉被迫滚动。
补丁删除,「几行文本」回到组件属性上。 */
/* ── 浮层层级:站内自绘浮层(灯箱、下拉、抽屉)与 antd 浮层共用一套 z 轴 ──
antd 默认 dropdown 1050 / drawer 1000 / modal 1000 / message 1010;
我们的灯箱要盖住一切,抽屉里的下拉又要盖住抽屉本体,所以只动这两处。 */
.ant-drawer .ant-select-dropdown,
.ant-drawer .ant-picker-dropdown,
.ant-drawer .ant-cascader-dropdown,
.ant-drawer .ant-dropdown { z-index: 1100 }
/* 自绘吐司(.nex-toast-region)也取 1200:它替掉的正是 antd message 的那一层,
要压得住抽屉与模态,见文件末尾「反馈四级表面」那一节。 */
/* 抽屉 / 弹窗的滚动区统一用细描边滚动条(与 index.css 的 scrollbar-slim 同一条配方) */
.ant-drawer-body, .ant-modal-body { scrollbar-width: thin; scrollbar-color: var(--ant-color-fill) transparent }
.ant-drawer-body::-webkit-scrollbar, .ant-modal-body::-webkit-scrollbar { width: 8px; height: 8px }
.ant-drawer-body::-webkit-scrollbar-thumb, .ant-modal-body::-webkit-scrollbar-thumb { background: var(--ant-color-fill); border-radius: var(--ant-border-radius-sm) }
/* ── 表格:单元格里的标签、按钮排成一排时不要互相挤(antd 的 cell 默认不换行) */
.ant-table-cell .ant-tag + .ant-tag { margin-inline-start: 0 }
.ant-table-wrapper .ant-table-cell { overflow-wrap: anywhere }
.ant-table-wrapper .ant-table-cell-fix-left, .ant-table-wrapper .ant-table-cell-fix-right { background: var(--ant-color-bg-container) }
/* ── 图标:全站唯一的图形出口是 @ant-design/icons ─────────────────────────
.anticon 由 antd 自己管尺寸与对齐;这里只兜住一件事——图标被塞进一排
flex 控件时不要当行内盒参与基线计算(老手写 Icon.tsx 时代就靠这条)。 */
.anticon { display: inline-flex; flex: none }
/* ── 统计卡(Stat = Card + Statistic):纯色卡面 + 配套色块图标 ────────────────
症状(2026-11 第六轮 · 用户第 2 条原话「大的统计标签卡还是不美观,不要底纹,
用配套的色块和图标区分」):上一轮在卡面上压了右上径向渐晕 + 135° 斜纹 +
右下角 84px 水印图形。四张卡并排时那层纹理连成一片灰,斜纹和水印叠在一起
像印刷错位,最该跳出来的数字反而被压住了。
做法:卡面就是 antd Card 自己的 colorBgContainer——没有底纹、没有渐变、没有水印。
识别度全部交给数字左侧那只 32px 圆角色块:底色 = 本卡语义色 12% 混合,
图形 = 同一条语义色(--nex-stat-tint 由 Stat 的 tone 决定,默认主色)。
四张卡并排时先由色块分出四类,数字回到唯一的视觉重心。
为什么深色档单独提一档:12% 的饱和色压在 #141414 上几乎读不出来,提到 18%。
为什么用 color-mix 而不是新色值:站内 `#hex` 只许出现在 theme/antd.ts(§2),
这里按语义色变量比例混合,明暗两档自动跟着主题走,不产生第二套色板。 */
.nex-stat { --nex-stat-tint: var(--ant-color-primary) }
/* 色块族(统计卡 / 概况抽屉的七站行 / 吐司 / 提示条 / 确认框):
一套几何**两档大小**,语义色由宿主写进 `--nex-mark-tint`。
2026-11 第十四轮(用户原话「不要图标」):内容页门牌那一枚从族里退出了——
门牌左侧那块主色方块和左栏高亮项说的是同一句话(R18 每级信息只说一遍),
而一屏里紧接着还有卡头的品牌 N 与统计卡色块,三颗同形状方块互相抢焦点。
`PageHead` 的 icon/反查机制、`.nex-pagehead-title` 的左缘因此一起回到卡内边距。
变量在 2026-11 第十三轮从 `--nex-stat-tint` 改名成 `--nex-mark-tint`:
原来只有统计卡有色调可给,反馈三兄弟自绘之后都要说同一句「这块图形是什么语气」,
出处是 components/ui/tone.tsx 那张唯一的语义表。统计卡那条老变量在本族内兜住,
页面与 Panel 里的 Stat 一个字都不用改。 */
.nex-stat-mark, .nex-brief-mark,
.nex-toast-mark, .nex-notice-mark, .nex-confirm-mark {
display: flex;
align-items: center;
justify-content: center;
flex: none;
background: color-mix(in srgb, var(--nex-mark-tint, var(--ant-color-primary)) 12%, transparent);
color: var(--nex-mark-tint, var(--ant-color-primary));
}
/* 大档:数字左侧、吐司与确认框的问话——凡是「一块卡片级表面」上的色块 */
.nex-stat-mark, .nex-toast-mark, .nex-confirm-mark {
inline-size: 32px;
block-size: 32px;
border-radius: var(--ant-border-radius-lg);
font-size: 17px;
}
/* 小档:色块坐在**一行文字**旁边的地方——概况抽屉的七站行(整行 34px)与提示条。
降一档不是为了好看,是因为 32px 会把行高顶开,一屏四条提示就散了。 */
.nex-brief-mark, .nex-notice-mark {
inline-size: 20px;
block-size: 20px;
border-radius: var(--ant-border-radius-sm);
font-size: var(--ant-font-size-sm);
}
html[data-theme='dark'] .nex-stat-mark,
html[data-theme='dark'] .nex-brief-mark,
html[data-theme='dark'] .nex-toast-mark,
html[data-theme='dark'] .nex-notice-mark,
html[data-theme='dark'] .nex-confirm-mark {
background: color-mix(in srgb, var(--nex-mark-tint, var(--ant-color-primary)) 18%, transparent);
}
/* 统计卡的色调写在卡上(--nex-stat-tint,Panel.tsx 的 Stat 按 tone 给):
本族改读 --nex-mark-tint 之后在这里接一次,卡面自己仍是 antd 的 colorBgContainer。 */
.nex-stat-mark { --nex-mark-tint: var(--nex-stat-tint, var(--ant-color-primary)) }
/* ── 只读回显(Info = antd Descriptions):R16.3 ──────────────────────────────
症状(用户截图:模型卡里「资源地址 / 参考」那只灰盒):回显写成灰底圆角盒 +
label 在上,外面再描一圈边,看着就是一只禁用输入框;而它旁边真有输入框时,
两者分不清哪个能填。
做法:容器换成 antd 为详情回显准备的 Descriptions,皮肤只调三件事——
① label 列降一档字号并用 text-tertiary,值列用正文色:主从一眼分得开;
② label 列给一个最小宽度(可用 --nex-info-label-w 覆盖),
两列/三列并排时列宽不随字数跳动,扫读才有列感;
③ 值列 overflow-wrap:anywhere——长地址、长密钥不许把表格顶宽。
底纹(label 列的 colorFillAlter)、圆角、分隔线全部沿用 antd,明暗两档自动跟主题。
为什么写在 app.css:页面不准 import antd(R8),`.ant-*` 也只准出现在这一层;
组件级皮肤集中在这里,19 个页面共用一把尺子。 */
.nex-info.ant-descriptions { width: 100%; min-width: 0 }
.nex-info .ant-descriptions-item-label,
.nex-info .ant-descriptions-item-content {
padding-block: var(--ant-padding-xxs);
padding-inline: var(--ant-padding-sm);
}
.nex-info .ant-descriptions-item-label {
width: var(--nex-info-label-w, auto);
min-width: 5.5em;
color: var(--ant-color-text-tertiary);
font-size: var(--ant-font-size-sm);
font-weight: 400;
white-space: nowrap;
}
.nex-info .ant-descriptions-item-content {
color: var(--ant-color-text);
overflow-wrap: anywhere;
}
/* 深色档:antd 的 colorFillAlter 只有 4% 白,压不出「这一列是标签」的分界,抬到 7% */
html[data-theme='dark'] .nex-info .ant-descriptions-item-label {
background: color-mix(in srgb, var(--ant-color-text) 7%, transparent);
}
/* 卡内的回显表:卡本身已有描边,表格再描一圈就成了双层框,只留内部网格线 */
.nex-info-in-card.ant-descriptions .ant-descriptions-view { border: 0; border-radius: 0 }
.nex-info-in-card.ant-descriptions .ant-descriptions-item-label,
.nex-info-in-card.ant-descriptions .ant-descriptions-item-content { border-color: var(--ant-color-fill-secondary) }
.nex-info.ant-descriptions .ant-descriptions-header { margin-block-end: var(--ant-margin-xs) }
.nex-info.ant-descriptions .ant-descriptions-title { font-size: var(--ant-font-size); font-weight: 600 }
/* ── 正文纵向节奏(PageStack):块与块之间的距离只由父级 gap 给一把尺子 ──────
症状(2026-11 第五轮 · 用户第 3 条「组件之间的上下、左右边距要合理」):
同一列里页头自带 mb-5(20)、统计卡自带 mb-4(16)、提示条自带 mb-4(16),
外层容器又要么不排间距、要么再排一次。实测量出来同一屏里同时存在
0 / 8 / 16 / 20 / 36 五种值:用户管理的统计卡与下面的表格卡贴成一块
(gap 0),质检页页头与下面的计数工具条之间空出 36px 的大空洞。
做法:正文列一律走 <PageStack>(antd Flex vertical gap=16),这一条把
**直接子块**自带的下边距归零——父级 gap 成为这一列唯一的纵向尺子。
只管直接子级:块内部(表单、卡身、手册正文)的间距仍归各自的栅格与 Form.Item。
为什么用 CSS 而不是从每个页面上删掉 mb-*:同一块内容还要在抽屉、手册正文里复用,
那些地方没有 gap;「间距归容器」这件事由容器自己声明才收得干净。 */
.nex-stack > * { margin-block-end: 0 }
/* 页签条自带 16px 下边距(antd .ant-tabs-nav):它在 PageStack 里就是「和下一块的距离」,
与父级 gap 重复会空出 32px。归零之后页签与正文之间仍是站内那一档 16。 */
.nex-stack > .ant-tabs > .ant-tabs-nav { margin-block-end: 0 }
/* ══════════════════════════════════════════════════════════════════════════
反馈四级表面(R19 · 2026-11 第十三轮)
-----------------------------------------------------------------------------
症状(用户原话「整体修改系统中所有提示窗、完成后的反馈 tips 等。
不要使用默认组件」):反馈原本是三件默认组件拼出来的——
antd `<message>`(顶部正中一颗纯黑药丸:无描边、无色块、悬停不暂停、
重复推送叠成一串一模一样的胶囊、长报错读不完)、
`window.confirm`(操作系统的灰窗口:主题/字号/按钮/语言全不归站内,
问话与后果挤成一行,还同步阻塞把动画冻在原地)、
antd `Alert`(站内唯一一套不带 R16.3 语义底纹的信息块,且没有善后动作位)。
做法:四级表面各有唯一实现,全部自绘,全部只读两把现成的尺子——
① 色块族(上面那一节,两档大小 + `--nex-mark-tint`);
② 语义底纹 `BLOCK_TONE`(R16.3 那把尺子,提示条直接复用)。
色值一律是 antd 语义 token(`--ant-color-*`),这里没有一个新的颜色。
动画时长写成字面量并在这里注明出处:`applyRootVars` 只把
color/borderRadius/boxShadow/font*/lineHeight/controlHeight/margin/padding/screen
抄到 `:root`,motion 那一族不在名单里——吐司与提示条都挂在 `:root` 那棵子树上
(吐司挂在 body 级容器、模态 portal 出 `.ant-app`),读不到 `--ant-motion-*`。
.2s = antd motionDurationMid,.3s = motionDurationSlow。
为什么 .ant-* 只出现在这一层:页面不准 import antd(R8),皮肤也就只有这一个落点。
══════════════════════════════════════════════════════════════════════════ */
/* ── ② 提示条 Notice:卡内的轻量层(替 antd Alert)──────────────────────────
容器(描边 + 底纹 + 圆角 + 内边距)由 Panel.tsx 的 BLOCK_TONE 给,
这里只管色块右边的两行文字——与 antd Alert 的两层结构逐项对齐。 */
.nex-notice { min-width: 0 }
.nex-notice .nex-notice-mark { margin-block-start: 1px }
.nex-notice-title {
color: var(--ant-color-text);
overflow-wrap: anywhere;
}
.nex-notice-desc {
margin-block-start: 2px;
color: var(--ant-color-text-description);
font-size: var(--ant-font-size-sm);
line-height: var(--ant-line-height-relaxed);
overflow-wrap: anywhere;
}
/* 关闭键与右端的善后按钮都要贴着第一行,不能跟着整块垂直居中 */
.nex-notice .nex-notice-close { flex: none; margin-block-start: calc(-1 * var(--ant-padding-xxs)) }
.nex-notice-action { flex: none }
/* ── ③ 吐司 Toast:右下角堆叠卡片(替 antd message)────────────────────────
为什么右下角:顶部正中压住的正是门牌与主操作(上一轮刚要求「右侧的主功能入口要对齐」),
反馈不该把刚点的那颗按钮盖掉。
为什么 `pointer-events:none` + 卡片自己 auto:这一层是贴边的 360px 竖条,
底下往往是正文与滚动区,容器不许吃掉那条带上的任何一次点击。 */
.nex-toast-region {
position: fixed;
inset-inline-end: var(--ant-margin-lg);
inset-block-end: var(--ant-margin-lg);
z-index: 1200;
display: flex;
flex-direction: column-reverse;
gap: var(--ant-margin-xs);
width: min(360px, calc(100vw - 2 * var(--ant-margin-lg)));
pointer-events: none;
}
.nex-toast {
position: relative;
display: flex;
align-items: flex-start;
gap: var(--ant-margin-sm);
padding: var(--ant-padding-sm) var(--ant-padding);
border: 1px solid var(--ant-color-border-secondary);
border-radius: var(--ant-border-radius-lg);
background: var(--ant-color-bg-elevated);
box-shadow: var(--ant-box-shadow-secondary);
/* 底部倒计时条要贴着圆角内侧裁掉 */
overflow: hidden;
pointer-events: auto;
animation: nex-toast-in .2s ease-out both;
}
@keyframes nex-toast-in {
from { opacity: 0; transform: translateY(var(--ant-margin-xs)) }
to { opacity: 1; transform: none }
}
.nex-toast-title {
color: var(--ant-color-text);
font-weight: var(--ant-font-weight-strong);
overflow-wrap: anywhere;
}
.nex-toast-desc {
margin-block-start: 2px;
color: var(--ant-color-text-secondary);
font-size: var(--ant-font-size-sm);
line-height: var(--ant-line-height-relaxed);
overflow-wrap: anywhere;
}
/* 重复次数:同一条文案被推 N 次只显示一颗(去重在 stores/notice.ts),
这颗角标说的就是「其实发生了 N 次」,所以它跟在标题后头,不另起一行。 */
.nex-toast-count {
margin-inline-start: var(--ant-margin-xxs);
color: var(--ant-color-text-tertiary);
font-size: var(--ant-font-size-sm);
font-weight: 400;
font-variant-numeric: tabular-nums;
}
.nex-toast .nex-toast-close { flex: none; margin-block-start: calc(-1 * var(--ant-padding-xxs)) }
/* 倒计时条:JS 与 CSS 同源——时长由组件写进 --nex-toast-ms,
悬停/聚焦时 .is-paused 把动画按停,与此同时 stores 那边的计时器也真的停了。 */
.nex-toast-progress {
position: absolute;
inset-inline: 0;
inset-block-end: 0;
block-size: 2px;
transform-origin: left center;
background: color-mix(in srgb, var(--nex-mark-tint, var(--ant-color-primary)) 55%, transparent);
animation: nex-toast-countdown var(--nex-toast-ms, 3s) linear both;
}
.nex-toast.is-paused .nex-toast-progress { animation-play-state: paused }
@keyframes nex-toast-countdown {
from { transform: scaleX(1) }
to { transform: scaleX(0) }
}
/* ── ④ 确认框 Confirm:破坏性操作的第二道闸(替 window.confirm)────────────
外壳(遮罩 / 圆角 / 内边距 / 阴影 / 底部动作条)都是 kit Modal 与 antd token 的,
这里只补两件事:问话区的两行文字,和危险档那一圈语义描边。 */
.nex-confirm .ant-modal-body { padding-block-start: 0 }
.nex-confirm-body {
display: flex;
align-items: flex-start;
gap: var(--ant-margin-sm);
min-width: 0;
}
.nex-confirm-title {
color: var(--ant-color-text);
font-size: var(--ant-font-size-lg);
line-height: var(--ant-line-height);
font-weight: var(--ant-font-weight-strong);
overflow-wrap: anywhere;
}
.nex-confirm-desc {
margin-block-start: var(--ant-margin-xxs);
color: var(--ant-color-text-tertiary);
line-height: var(--ant-line-height-relaxed);
overflow-wrap: anywhere;
}
/* 危险档给一圈 error 描边:整张框的颜色就是「这一步不好回退」,
不用读文案也能感觉到(原生 confirm 里删除和「继续切换」长得一模一样)。
语气写在问话区(.nex-confirm-body[data-tone]),描边却画在祖先 .ant-modal-content 上,
自定义属性只会向下继承,所以这里用 :has() 把语气提到模态根节点上再落进变量。 */
.nex-confirm { --nex-confirm-edge: var(--ant-color-border-secondary) }
.nex-confirm:has(.nex-confirm-body[data-tone='danger']) { --nex-confirm-edge: var(--ant-color-error-border) }
.nex-confirm:has(.nex-confirm-body[data-tone='warn']) { --nex-confirm-edge: var(--ant-color-warning-border) }
.nex-confirm .ant-modal-content { border: 1px solid var(--nex-confirm-edge) }
/* ── 悬浮提示 Tooltip:站内唯一还在用的默认组件,换肤不换件 ──────────────────
症状:app/layout 的头像、主题开关这些纯图标按钮靠 Tooltip 解释自己是干什么的,
而 antd 出厂是**纯黑药丸**——深色工作台里它比正文还亮,浅色下又是一块死黑,
和站内所有浮层(描边 + 抬升底色 + 阴影)没有共同语言。
做法:底色与文字在 theme/antd.ts 用组件 token 换成 elevated / text(不产生新色值),
这里只补它没有的那两样:一圈描边和一层阴影,让它和抽屉、菜单浮起同一档。 */
.ant-tooltip .ant-tooltip-inner {
border: 1px solid var(--ant-color-border-secondary);
box-shadow: var(--ant-box-shadow-secondary);
font-size: var(--ant-font-size-sm);
}