globals.css 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. @import "tailwindcss";
  2. @import "tw-animate-css";
  3. @import "shadcn/tailwind.css";
  4. @import "./tokens.css";
  5. .ops-card-link { display:inline-flex;align-items:center;gap:5px;margin-left:auto;padding:5px 8px;border-radius:5px;color:var(--primary);font-size:var(--type-support);font-weight:700;text-decoration:none;white-space:nowrap; }
  6. .ops-card-link:hover { background:var(--primary-soft); }
  7. .ops-card-link:focus-visible { outline:2px solid var(--primary);outline-offset:2px; }
  8. .ops-card-link svg { flex:none; }
  9. @custom-variant dark (&:is(.dark *));
  10. @theme inline {
  11. --color-background: var(--background);
  12. --color-foreground: var(--foreground);
  13. --color-card: var(--card);
  14. --color-card-foreground: var(--card-foreground);
  15. --color-popover: var(--popover);
  16. --color-popover-foreground: var(--popover-foreground);
  17. --color-primary: var(--primary);
  18. --color-primary-foreground: var(--primary-foreground);
  19. --color-secondary: var(--secondary);
  20. --color-secondary-foreground: var(--secondary-foreground);
  21. --color-muted: var(--muted);
  22. --color-muted-foreground: var(--muted-foreground);
  23. --color-accent: var(--accent);
  24. --color-accent-foreground: var(--accent-foreground);
  25. --color-destructive: var(--destructive);
  26. --color-border: var(--border);
  27. --color-input: var(--input);
  28. --color-ring: var(--ring);
  29. --color-primary-hover: var(--primary-hover);
  30. --color-primary-soft: var(--primary-soft);
  31. --color-primary-soft-foreground: var(--primary-soft-foreground);
  32. --color-primary-border: var(--primary-border);
  33. --color-surface-subtle: var(--surface-subtle);
  34. --color-text-secondary: var(--text-secondary);
  35. --color-border-subtle: var(--border-subtle);
  36. --color-border-hover: var(--border-hover);
  37. --color-icon: var(--icon);
  38. --color-success: var(--success);
  39. --color-success-soft: var(--success-soft);
  40. --color-success-border: var(--success-border);
  41. --color-warning: var(--warning);
  42. --color-warning-soft: var(--warning-soft);
  43. --color-warning-border: var(--warning-border);
  44. --color-info: var(--info);
  45. --color-info-soft: var(--info-soft);
  46. --color-info-border: var(--info-border);
  47. --color-destructive-hover: var(--destructive-hover);
  48. --color-destructive-foreground: var(--destructive-foreground);
  49. --color-destructive-soft: var(--destructive-soft);
  50. --color-destructive-border: var(--destructive-border);
  51. --color-notice: var(--notice);
  52. --color-notice-foreground: var(--notice-foreground);
  53. --color-overlay: var(--overlay);
  54. --radius-sm: calc(var(--radius) * 0.6);
  55. --radius-md: calc(var(--radius) * 0.8);
  56. --radius-lg: var(--radius);
  57. --radius-xl: calc(var(--radius) * 1.4);
  58. --radius-2xl: calc(var(--radius) * 1.8);
  59. --radius-3xl: calc(var(--radius) * 2.2);
  60. --radius-4xl: calc(var(--radius) * 2.6);
  61. --color-sidebar: var(--sidebar);
  62. --color-sidebar-foreground: var(--sidebar-foreground);
  63. --color-sidebar-primary: var(--sidebar-primary);
  64. --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  65. --color-sidebar-accent: var(--sidebar-accent);
  66. --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  67. --color-sidebar-border: var(--sidebar-border);
  68. --color-sidebar-ring: var(--sidebar-ring);
  69. --font-sans: "IBM Plex Sans", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  70. --font-serif: "Iowan Old Style", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  71. --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  72. }
  73. * {
  74. box-sizing: border-box;
  75. scrollbar-width: thin;
  76. scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  77. }
  78. *::-webkit-scrollbar {
  79. width: 9px;
  80. height: 9px;
  81. }
  82. *::-webkit-scrollbar-track {
  83. background: var(--scrollbar-track);
  84. }
  85. *::-webkit-scrollbar-thumb {
  86. border: 2px solid transparent;
  87. border-radius: 999px;
  88. background: var(--scrollbar-thumb);
  89. background-clip: padding-box;
  90. }
  91. *::-webkit-scrollbar-thumb:hover {
  92. background-color: var(--scrollbar-thumb-hover);
  93. }
  94. *::-webkit-scrollbar-corner {
  95. background: transparent;
  96. }
  97. /*
  98. * 「表格没横向超出 ⇒ 收起横向滚动条」只适用于**量过**的容器。
  99. * ⚠️ ⛔ 把这条判据挂在裸 `:not(.has-horizontal-overflow)` 上当默认值:没接
  100. * `useHorizontalOverflow()` 的容器永远拿不到那个类,会被误判成"不超出"而
  101. * `overflow-x:hidden`,把末列夹成看不见也点不到(2026-11-14 实测:客户门户
  102. * 工单进度表 960px 视口下「操作」列不可达,`.work-order-table-wrap` 自带的
  103. * `overflow-x:auto` 被本条以更高优先级覆盖)。
  104. * ⇒ 判据改绑 hook 在测量后落地的 `data-overflow-measured`:未测量的容器保持原生 `auto`。
  105. */
  106. :root .measured-table-scroll[data-overflow-measured="true"]:not(.has-horizontal-overflow) {
  107. overflow-x: hidden;
  108. }
  109. /*
  110. * 台账列表:高度对齐「运营商管理」——占满主内容区可见高度,表体区内滚,底部分页固定。
  111. * 页根加 .page-fill;列表卡片加 .list-shell-fill;表滚动区保持 .measured-table-scroll。
  112. *
  113. * 缺陷 P-38(2026-11-14 Chrome 960×640 实测:工单台账 18 行 `<tr>` 明明在 DOM 里,
  114. * 列表区却只剩约 2px 可见、既看不见也点不到):这里原本写的是**固定** height,
  115. * 只预留了顶栏 4rem 与主区上下内边距 2.5rem(见 `AppShell.tsx` 的 `h-16`、`py-4 sm:py-5`),
  116. * ⛔ 没算页内要素换行长出来的高度——窄视口下 `.work-order-ledger-alerts` 由 4 列换成 2 行、
  117. * 筛选行随之换行,把这些 `flex: none` 的兄弟推到多高,下面的 `.list-shell-fill`
  118. * (`flex:1 + min-height:0 + overflow:hidden`)就被挤到贴着底边,表体超出底边的部分整段裁掉。
  119. * 现在把「视口高度」当**下限**而不是上限:容器至少铺满一屏,页内要素要得更多时整体长高,
  120. * 纵向滚动交给文档级滚动(AppShell 内容列是 `min-h-svh`、`<main>` 无 overflow,
  121. * 顶栏 `sticky top-0 h-16` 始终可见;⛔ 给这两层加 overflow:hidden,那样又变成裁切);
  122. * 表体自身的下限兜底见本文件下方 `.list-shell-fill > .measured-table-scroll`。
  123. * ⛔ 在 `.page-fill` 本身上回退成固定 height(需要锁高的列表页另用 `.page-fill-window`,
  124. * 那条变体自带表体 240px 下限,见下);也⛔ 按 640/900 这类具体视口高度写白名单分支。
  125. * ⛔ 用 `overflow:clip` + 无高度子容器:那会让 flex 轨道失去确定高度,
  126. * 表体撑到自然高度、分页器被顶出屏幕(2026-11-13 实测分页栏不可见)。
  127. */
  128. .page-fill {
  129. display: flex;
  130. flex-direction: column;
  131. min-height: calc(100dvh - 4rem - 2.5rem);
  132. }
  133. /*
  134. * 「整页锁高」变体(各台账列表页,与「运营商管理」同形):`.page-fill` 的 min-height
  135. * 只保证页根至少一屏,flex 子项仍按内容高度排布——行数一多,表体就把页根撑高、整页
  136. * 滚动,而不是表体内滚、分页器固定在底部。要与「运营商管理」一致,页根须有**确定**高度:
  137. * 加 `.page-fill-window` 后按视口锁高(同 `organization.css` 的 `.org-operator-page`)。
  138. *
  139. * 视口高度只是**目标**高度,不是硬上限——矮视口下固定要素(标题/统计卡/4 张待办卡换行/
  140. * 筛选行)本身就吃掉一屏时,表体会被压到看不见(P-38)。故给列表卡片本身一个下限:
  141. * 表体 `flex-basis: 240px`(=`.list-shell-fill > .measured-table-scroll` 的 min-height)
  142. * 让卡片的 `fit-content` 等于「卡片内固定部分 + 240」,卡片再按此下限长高、由文档级滚动接住,
  143. * 卡片不破、分页器不被裁。⛔ 只写 `height` 不留下限:那会重现 P-38。
  144. * ⛔ 把这条并进 `.page-fill`:非台账页没有「表体让位」的结构,锁高只会裁切。
  145. */
  146. .page-fill.page-fill-window {
  147. height: calc(100dvh - 4rem - 2.5rem);
  148. min-height: 0;
  149. }
  150. /*
  151. * 锁高页的高度改由「`<main>` 的剩余空间」给出,⛔ 再裸算视口:
  152. * 上面那条 `calc(100dvh - 4rem - 2.5rem)` 只扣了顶栏与 `<main>` 的上下内边距,
  153. * 一旦 `<main>` 里还有别的兄弟节点(区域运营身份的提示条 `p[role=note]`),那段高度不被扣,
  154. * 页面就比视口高出一整个提示条——列表明明已锁高,整页却还要多滚五六十像素(2026-11-16 实测 753×954:溢出 58px)。
  155. * 这里让含锁高页的 `<main>` 变成确定高度的纵向 flex:提示条按内容、页根吃掉剩余高度。
  156. * ⚠️ 内容真的超出一屏时(矮视口 4 张卡换行)页根靠下方 `.list-shell-fill { min-height: fit-content }`
  157. * 长高、由文档级滚动接住,⛔ 给 main 加 overflow:hidden 把它裁掉。
  158. */
  159. main:has(> .page-fill.page-fill-window) {
  160. display: flex;
  161. flex-direction: column;
  162. height: calc(100dvh - 4rem);
  163. }
  164. main:has(> .page-fill.page-fill-window) > :not(.page-fill.page-fill-window) {
  165. flex: none;
  166. }
  167. main:has(> .page-fill.page-fill-window) > .page-fill.page-fill-window {
  168. flex: 1 1 auto;
  169. height: auto;
  170. min-height: 0;
  171. }
  172. .page-fill.page-fill-window > .list-shell-fill {
  173. min-height: fit-content;
  174. }
  175. .page-fill.page-fill-window > .list-shell-fill > :is(.measured-table-scroll, .ops-table-wrap, .workspace-table-wrap, .list-scroll-fill) {
  176. flex-basis: 240px;
  177. }
  178. /* 页内其余要素(标题、统计卡、告警条、第二张台账面板…)一律按内容高度,⛔ 被压扁。 */
  179. .page-fill.page-fill-window > :not(.list-shell-fill) {
  180. flex: none;
  181. }
  182. /*
  183. * 同页还有第二张台账面板时(如成本管理「② 成本金额定义」的矩阵表 + 录入面板),
  184. * 两张表无法共用一个视口:退回页面级滚动与内容高度,⛔ 让下面那张被压到 min-height
  185. * 之下、内容既看不见也滚不到(`cost-ledger-scroll` 是 `overflow-y:hidden`)。
  186. */
  187. .page-fill.page-fill-window:has(> .ops-list-shell:not(.list-shell-fill)) {
  188. height: auto;
  189. min-height: calc(100dvh - 4rem - 2.5rem);
  190. }
  191. .page-fill.page-fill-window:has(> .ops-list-shell:not(.list-shell-fill)) > .list-shell-fill {
  192. flex: none;
  193. min-height: 0;
  194. }
  195. .page-fill.page-fill-window:has(> .ops-list-shell:not(.list-shell-fill)) > .list-shell-fill > :is(.measured-table-scroll, .ops-table-wrap) {
  196. flex-basis: auto;
  197. }
  198. @media (max-width: 640px) {
  199. /* 订阅页 ≤640 走卡片列表(`.order-mobile-list`),不是表体:锁高会把整叠卡片
  200. 裁在 `.list-shell-fill` 的 overflow:hidden 里,改为恢复页面级滚动。 */
  201. .page-fill.page-fill-window.order-page {
  202. height: auto;
  203. min-height: calc(100dvh - 4rem - 2.5rem);
  204. }
  205. }
  206. .page-fill > .list-shell-fill,
  207. .page-fill > .org-ledger,
  208. .page-fill > .org-maintenance-ledger-shell,
  209. .page-fill > .order-list-shell,
  210. .page-fill > .work-order-list-shell,
  211. .page-fill > .ops-list-shell,
  212. .page-fill > .workspace-panel.list-shell-fill {
  213. flex: 1;
  214. min-height: 0;
  215. display: flex;
  216. flex-direction: column;
  217. overflow: hidden;
  218. }
  219. .page-fill > .ops-heading,
  220. .page-fill > .ops-back-link,
  221. .page-fill > .customer-sub-overview,
  222. .page-fill > .order-heading,
  223. .page-fill > .work-order-heading,
  224. .page-fill > .work-order-ledger-alerts,
  225. .page-fill > .workspace-heading,
  226. .page-fill > .workspace-metrics,
  227. .page-fill > .workspace-alert,
  228. .page-fill > .workspace-panel:not(.list-shell-fill),
  229. .page-fill > .work-order-inbox,
  230. .page-fill > .work-order-guidance,
  231. .page-fill > .work-order-reminder,
  232. .page-fill > .ops-import-note,
  233. .page-fill > .scheduled-jobs-overview {
  234. flex: none;
  235. }
  236. .list-shell-fill {
  237. display: flex;
  238. flex-direction: column;
  239. min-height: 0;
  240. overflow: hidden;
  241. }
  242. .list-shell-fill > .ops-list-heading,
  243. .list-shell-fill > .ops-toolbar,
  244. .list-shell-fill > .ops-tabs,
  245. .list-shell-fill > .org-filterbar,
  246. .list-shell-fill > .ops-list-footer,
  247. .list-shell-fill > .org-maintenance-ledger-note,
  248. .list-shell-fill > .order-list-heading,
  249. .list-shell-fill > .order-tabs,
  250. .list-shell-fill > .order-filters,
  251. .list-shell-fill > .order-list-footer,
  252. .list-shell-fill > .order-rule-strip,
  253. .list-shell-fill > .order-mobile-list,
  254. .list-shell-fill > .order-empty,
  255. .list-shell-fill > .work-order-list-heading,
  256. .list-shell-fill > .work-order-tabs,
  257. .list-shell-fill > .work-order-filters,
  258. .list-shell-fill > .work-order-ledger-filters,
  259. .list-shell-fill > .workspace-toolbar,
  260. .list-shell-fill > .workspace-note,
  261. .list-shell-fill > .ops-import-note,
  262. .list-shell-fill > .list-pager,
  263. .list-shell-fill > .org-list-pager,
  264. .list-shell-fill > .work-order-ledger-pager {
  265. flex: none;
  266. }
  267. .list-shell-fill > header {
  268. flex: none;
  269. }
  270. .list-shell-fill > .measured-table-scroll,
  271. .list-shell-fill > .ops-table-wrap,
  272. .list-shell-fill > .workspace-table-wrap,
  273. .list-shell-fill > .list-scroll-fill {
  274. position: relative;
  275. flex: 1;
  276. /* 缺陷 P-38(2026-11-14 Chrome 960×640 实测:工单台账 18 行 `<tr>` 在 DOM 里,
  277. * 表体却只剩约 2px 可见、点不到):这里原本是 `min-height: 0`,等于明确告诉浏览器
  278. * "本表体可以被压到 0";而同级的标题/筛选/分页/汇总条全是 `flex: none`,
  279. * 窄视口下筛选行与告警卡一换行,剩下的空间就够不上海拔最低的本表体 ⇒ 夹成 0。
  280. * 这就是"测量/布局结果过小"时的**下限兜底**:⛔ 退回 0,也⛔ 按 640/900 这类
  281. * 具体视口高度写白名单分支。240px ≈ 4 行行高 + 吸顶表头,保证列表始终可见且能纵向滚动;
  282. * 页根 `.page-fill` 已改成下限高度,多出来的空间由文档级滚动接住(见上方 `.page-fill` 注释),
  283. * ⛔ 用"取消表体内滚、整页堆叠"来绕开(那会连带废掉表头吸顶与分页器)。 */
  284. min-height: 240px;
  285. overflow: auto;
  286. scrollbar-gutter: stable;
  287. }
  288. .list-shell-fill thead th {
  289. position: sticky;
  290. top: 0;
  291. z-index: 1;
  292. }
  293. /* 底部分页栏:与运营商管理 .org-list-pager 同形。 */
  294. .list-pager,
  295. .org-list-pager {
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. flex-wrap: wrap;
  300. gap: 10px;
  301. padding: 14px 24px;
  302. border-top: 1px solid var(--border-subtle, var(--border));
  303. color: var(--muted-foreground);
  304. font-size: var(--type-support);
  305. }
  306. .list-pager > div,
  307. .org-list-pager > div {
  308. display: flex;
  309. align-items: center;
  310. gap: 9px;
  311. }
  312. .list-pager strong,
  313. .org-list-pager strong {
  314. color: var(--foreground);
  315. font-variant-numeric: tabular-nums;
  316. }
  317. .list-pager button,
  318. .org-list-pager button {
  319. min-height: 30px;
  320. padding: 4px 10px;
  321. border: 1px solid var(--border);
  322. border-radius: 6px;
  323. background: var(--card);
  324. color: var(--foreground);
  325. font: inherit;
  326. font-size: var(--type-support);
  327. cursor: pointer;
  328. }
  329. .list-pager button:hover:not(:disabled),
  330. .list-pager button:focus-visible:not(:disabled),
  331. .org-list-pager button:hover:not(:disabled),
  332. .org-list-pager button:focus-visible:not(:disabled) {
  333. border-color: var(--primary);
  334. color: var(--primary);
  335. }
  336. .list-pager button:disabled,
  337. .org-list-pager button:disabled {
  338. opacity: 0.45;
  339. cursor: not-allowed;
  340. }
  341. html {
  342. min-width: 320px;
  343. min-height: 100%;
  344. }
  345. /* 浏览器窗口的滚动条不参与普通 z-index 层叠;模态层出现时隐藏背景滚动条。 */
  346. html:has(dialog[open], [aria-modal="true"]) {
  347. overflow: hidden;
  348. }
  349. body {
  350. min-width: 320px;
  351. min-height: 100svh;
  352. margin: 0;
  353. background: var(--background);
  354. color: var(--foreground);
  355. font-family: "IBM Plex Sans", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  356. -webkit-font-smoothing: antialiased;
  357. text-rendering: optimizeLegibility;
  358. }
  359. /* 原生单选菜单:沿用「更多」菜单的表面、层次和选中反馈。 */
  360. @supports (appearance: base-select) {
  361. select:not([multiple]) {
  362. appearance: base-select !important;
  363. display: flex !important;
  364. align-items: center !important;
  365. background-image: var(--select-chevron) !important;
  366. background-repeat: no-repeat !important;
  367. background-position: right 10px center !important;
  368. background-size: 16px 16px !important;
  369. padding-right: 34px !important;
  370. cursor: pointer;
  371. }
  372. select:not([multiple])::picker-icon {
  373. display: none;
  374. }
  375. select:not([multiple]):open {
  376. color: var(--primary);
  377. }
  378. select:not([multiple]):disabled {
  379. cursor: not-allowed;
  380. }
  381. select:not([multiple])::picker(select) {
  382. appearance: base-select;
  383. min-inline-size: anchor-size(width);
  384. max-inline-size: min(360px, calc(100vw - 24px));
  385. max-block-size: min(320px, 46vh);
  386. margin-block: 5px;
  387. padding: 6px;
  388. overflow-y: auto;
  389. border: 1px solid var(--border);
  390. border-radius: 8px;
  391. background: var(--card);
  392. color: var(--foreground);
  393. box-shadow: var(--shadow-dialog);
  394. scrollbar-width: thin;
  395. }
  396. select:not([multiple]) option {
  397. display: flex;
  398. align-items: center;
  399. gap: 8px;
  400. min-block-size: 34px;
  401. margin-block: 1px;
  402. padding: 7px 10px;
  403. border: 0;
  404. border-radius: 6px;
  405. background: transparent;
  406. color: var(--text-secondary);
  407. font-size: var(--type-body);
  408. font-weight: 550;
  409. line-height: 1.45;
  410. white-space: normal;
  411. overflow-wrap: anywhere;
  412. cursor: pointer;
  413. transition: background-color .16s, color .16s;
  414. }
  415. select:not([multiple]) option:is(:hover, :focus-visible, :checked) {
  416. background: var(--primary-soft);
  417. color: var(--primary);
  418. }
  419. select:not([multiple]) option:checked {
  420. font-weight: 650;
  421. }
  422. select:not([multiple]) option::checkmark {
  423. order: 1;
  424. margin-left: auto;
  425. color: var(--primary);
  426. }
  427. select:not([multiple]) option:disabled {
  428. color: var(--muted-foreground);
  429. opacity: .55;
  430. cursor: not-allowed;
  431. }
  432. }
  433. @media (prefers-reduced-motion: reduce) {
  434. select:not([multiple]) option { transition: none; }
  435. }
  436. /* 三态渲染(册2 §2.5):取数失败≠无值,失败态用醒目色并挂原文,⛔ 回落成"—"或 0 */
  437. .oss-tri-fail {
  438. color: var(--destructive);
  439. font-weight: 700;
  440. }
  441. .oss-tri-missing {
  442. color: var(--muted-foreground);
  443. }
  444. @layer base {
  445. * {
  446. @apply border-border outline-ring/50;
  447. }
  448. body {
  449. @apply bg-background text-foreground;
  450. }
  451. }