visualize.css 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330
  1. :root {
  2. color-scheme: light dark;
  3. background-color: var(
  4. --background,
  5. var(--color-background-primary, light-dark(rgb(255 255 255), rgb(24 24 24)))
  6. ) !important;
  7. /* Agent-facing contract; keep in sync with SKILL.md. */
  8. --background: var(
  9. --color-background-primary,
  10. light-dark(rgb(255 255 255), rgb(24 24 24))
  11. );
  12. --foreground: var(
  13. --color-text-primary,
  14. light-dark(rgb(26 28 31), rgb(255 255 255))
  15. );
  16. --card: var(--gen-ui-card, light-dark(#ffffff, #2b2b2b));
  17. --card-border: var(--gen-ui-card-border, var(--border));
  18. --card-foreground: var(
  19. --color-text-primary,
  20. light-dark(rgb(26 28 31), rgb(255 255 255))
  21. );
  22. --popover: var(
  23. --color-background-secondary,
  24. light-dark(rgb(255 255 255), rgb(45 45 45))
  25. );
  26. --popover-foreground: var(
  27. --color-text-primary,
  28. light-dark(rgb(26 28 31), rgb(255 255 255))
  29. );
  30. --primary: var(
  31. --gen-ui-primary, light-dark(#000000, #ffffff)
  32. );
  33. --content-accent: var(
  34. --color-text-info,
  35. light-dark(rgb(51 156 255), rgb(131 195 255))
  36. );
  37. --primary-foreground: var(
  38. --gen-ui-primary-foreground,
  39. light-dark(rgb(255 255 255), rgb(0 0 0))
  40. );
  41. --secondary: var(
  42. --gen-ui-secondary,
  43. light-dark(rgb(230 230 230), rgb(54 54 54))
  44. );
  45. --secondary-foreground: var(
  46. --color-text-primary,
  47. light-dark(rgb(26 28 31), rgb(255 255 255))
  48. );
  49. --muted: color-mix(in srgb, var(--foreground) 10%, transparent);
  50. --muted-foreground: var(
  51. --color-text-secondary,
  52. light-dark(rgb(26 28 31 / 49.4%), rgb(255 255 255 / 49.8%))
  53. );
  54. --accent: var(
  55. --color-background-info,
  56. light-dark(rgb(229 242 255), rgb(13 39 63))
  57. );
  58. --accent-foreground: var(
  59. --color-text-info,
  60. light-dark(rgb(51 156 255), rgb(131 195 255))
  61. );
  62. --destructive: var(
  63. --color-text-warning,
  64. light-dark(rgb(226 85 7), rgb(255 133 73))
  65. );
  66. --border: var(
  67. --color-border-secondary,
  68. light-dark(rgb(26 28 31 / 8%), rgb(255 255 255 / 8.2%))
  69. );
  70. --input: var(
  71. --color-border-primary,
  72. light-dark(
  73. rgb(26 28 31 / 11.8%),
  74. color-mix(in oklab, rgb(0 0 0) 10%, transparent)
  75. )
  76. );
  77. --ring: var(
  78. --gen-ui-input-border-focused,
  79. light-dark(rgb(51 156 255), rgb(131 195 255 / 76%))
  80. );
  81. --font-size-base: var(--font-text-md-size, 14px);
  82. --blue: light-dark(rgb(51 156 255), rgb(51 156 255));
  83. --orange: light-dark(rgb(226 85 7), rgb(251 106 34));
  84. --green: light-dark(rgb(0 162 64), rgb(64 201 119));
  85. --red: light-dark(rgb(224 46 42), rgb(255 103 100));
  86. --purple: light-dark(rgb(146 79 247), rgb(173 123 249));
  87. --yellow: light-dark(rgb(255 195 0), rgb(255 210 64));
  88. --viz-series-1: var(--content-accent);
  89. --viz-series-2: light-dark(rgb(243 136 59), rgb(245 154 86));
  90. --viz-series-3: light-dark(rgb(93 201 119), rgb(116 213 139));
  91. --viz-series-4: light-dark(rgb(235 119 177), rgb(240 143 192));
  92. --viz-series-5: light-dark(rgb(155 121 236), rgb(170 145 239));
  93. --viz-series-6: light-dark(rgb(58 185 177), rgb(90 203 194));
  94. /* Internal implementation variables; not part of the agent contract. */
  95. --font-sans: -apple-system, system-ui, "Segoe UI", sans-serif;
  96. --font-mono:
  97. ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
  98. monospace;
  99. --font-size-normal: var(--font-size-base);
  100. --font-size-tooltip: calc(var(--font-size-base) - 1px);
  101. --font-size-small: var(--font-text-sm-size, calc(var(--font-size-base) - 2px));
  102. --font-size-h1: var(--font-heading-md-size, calc(var(--font-size-base) + 4px));
  103. --font-size-h2: var(--font-heading-sm-size, calc(var(--font-size-base) + 2px));
  104. --font-size-h3: var(--font-heading-xs-size, var(--font-size-base));
  105. --font-weight-normal: 400;
  106. --font-weight-medium: 500;
  107. --icon-size: 16px;
  108. --line-height-normal: calc(var(--font-size-normal) * 1.5);
  109. --line-height-tooltip: calc(var(--font-size-tooltip) * 1.4285714286);
  110. --line-height-small: calc(var(--font-size-small) + 4px);
  111. --corner-shape: round;
  112. /* 旧比例圆角会产生非标准档位;独立 token 与 App 层级保持一致。 */
  113. --radius-sm: var(--border-radius-sm, 4px);
  114. --radius-md: var(--border-radius-md, 6px);
  115. --radius-lg: var(--border-radius-lg, 8px);
  116. --radius-xl: var(--border-radius-xl, 12px);
  117. --radius-2xl: var(--radius-xl);
  118. --control-radius: var(--radius-lg);
  119. --input-bg: var(--gen-ui-input, light-dark(#ffffff, #2b2b2b));
  120. --input-bg-focused: var(--gen-ui-input-focused, var(--input-bg));
  121. --input-border: var(--gen-ui-input-border, var(--input));
  122. --input-border-hover: var(--gen-ui-input-border-hover, var(--border));
  123. /* 独立导出没有宿主 focused token,仍需保留可辨认的键盘焦点。 */
  124. --input-border-focused: var(--gen-ui-input-border-focused, var(--ring));
  125. --placeholder: var(--gen-ui-foreground-subtlest, var(--muted-foreground));
  126. --hover: var(--gen-ui-hover, var(--muted));
  127. --selected: var(--gen-ui-selected, var(--muted));
  128. --radius-full: 9999px;
  129. --shadow-sm: 0 1px 2px -1px rgb(0 0 0 / 8%);
  130. --checkmark-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 17'%3E%3Cpath d='M12.8961 3.64101C13.1297 3.41418 13.4984 3.37523 13.7779 3.56581C14.0571 3.75635 14.1554 4.11331 14.0299 4.41347L13.9615 4.53847L7.71151 13.7045C7.59411 13.8767 7.4063 13.9877 7.19881 14.0072C6.99136 14.0267 6.78564 13.9533 6.63826 13.806L2.88826 10.056L2.79842 9.9457C2.6192 9.67407 2.64927 9.30496 2.88826 9.06581C3.12738 8.82669 3.49647 8.79676 3.76815 8.97597L3.8785 9.06581L7.03084 12.2182L12.8053 3.74941L12.8961 3.64101Z'/%3E%3C/svg%3E");
  131. /* Legacy aliases; not part of the current agent contract. */
  132. --viz-bg: transparent;
  133. --viz-panel: var(--card);
  134. --viz-border: var(--border);
  135. --viz-text: var(--foreground);
  136. --viz-muted: var(--muted-foreground);
  137. --viz-accent: var(--content-accent);
  138. --viz-accent-text: var(--primary-foreground);
  139. --viz-accent-bg: var(--accent);
  140. --viz-font-size: var(--font-size-base);
  141. --viz-warning: var(--destructive);
  142. }
  143. :root[data-theme="light"] {
  144. color-scheme: light;
  145. }
  146. :root[data-theme="dark"] {
  147. color-scheme: dark;
  148. }
  149. * {
  150. box-sizing: border-box;
  151. }
  152. html > body {
  153. /* Preserve MCP aliases for older inline renderers without creating :root cycles. */
  154. --color-background-primary: var(
  155. --background,
  156. light-dark(rgb(255 255 255), rgb(24 24 24))
  157. );
  158. --color-text-primary: var(
  159. --foreground,
  160. light-dark(rgb(26 28 31), rgb(255 255 255))
  161. );
  162. --color-border-secondary: var(
  163. --border,
  164. light-dark(rgb(26 28 31 / 8%), rgb(255 255 255 / 8.2%))
  165. );
  166. margin: 0;
  167. padding: var(--visualize-paint-gutter, 0px);
  168. color: var(--foreground);
  169. background: transparent !important;
  170. font-family: var(--font-sans) !important;
  171. font-size: var(--font-size-normal);
  172. font-weight: var(--font-weight-normal);
  173. line-height: var(--line-height-normal);
  174. }
  175. .cursor-interaction {
  176. cursor: var(--cursor-interaction, pointer);
  177. }
  178. a {
  179. color: color-mix(in srgb, var(--viz-accent) 80%, var(--viz-text) 20%);
  180. cursor: var(--cursor-interaction, pointer);
  181. font-weight: var(--font-weight-medium, 500);
  182. text-decoration: none;
  183. text-underline-offset: 2px;
  184. }
  185. a:is(:hover, :focus-visible) {
  186. text-decoration-line: underline;
  187. text-decoration-style: dashed;
  188. text-decoration-thickness: 0.5px;
  189. }
  190. h1,
  191. h2,
  192. h3,
  193. h4,
  194. h5,
  195. h6,
  196. p {
  197. margin-block: 0;
  198. }
  199. h1 {
  200. font-size: var(--font-size-h1);
  201. font-weight: var(--font-weight-medium);
  202. line-height: 1.25;
  203. }
  204. h2 {
  205. font-size: var(--font-size-h2);
  206. font-weight: var(--font-weight-medium);
  207. line-height: 1.25;
  208. }
  209. h3,
  210. h4,
  211. h5,
  212. h6 {
  213. font-size: var(--font-size-h3);
  214. font-weight: var(--font-weight-medium);
  215. line-height: 1.3;
  216. }
  217. b,
  218. strong,
  219. th {
  220. font-weight: var(--font-weight-medium);
  221. }
  222. code:not(pre code) {
  223. display: inline;
  224. padding: 1px 6px;
  225. border-radius: var(--radius-sm);
  226. corner-shape: var(--corner-shape);
  227. background: var(--muted);
  228. font-family: var(--font-mono);
  229. font-size: var(--font-size-small);
  230. overflow-wrap: anywhere;
  231. -webkit-box-decoration-break: clone;
  232. box-decoration-break: clone;
  233. word-break: break-word;
  234. }
  235. .table-responsive {
  236. width: 100%;
  237. overflow-x: auto;
  238. scrollbar-width: thin;
  239. }
  240. .table {
  241. width: 100%;
  242. border-collapse: collapse;
  243. color: var(--foreground);
  244. font: inherit;
  245. text-align: start;
  246. }
  247. .table :is(th, td) {
  248. padding-block: 10px;
  249. padding-inline: 0 24px;
  250. overflow-wrap: anywhere;
  251. border-bottom: 1px solid var(--border);
  252. text-align: start;
  253. vertical-align: top;
  254. }
  255. .table-responsive > .table :is(th, td) {
  256. overflow-wrap: break-word;
  257. }
  258. .table :is(th, td):last-child {
  259. padding-inline-end: 0;
  260. }
  261. .table :is(caption, thead th) {
  262. font-weight: 600;
  263. }
  264. .table thead th {
  265. padding-block: 8px;
  266. border-bottom-color: color-mix(in srgb, var(--foreground) 16%, transparent);
  267. }
  268. .table tbody tr:last-child :is(th, td) {
  269. border-bottom: 0;
  270. }
  271. .table.table-sm :is(th, td) {
  272. padding-block: 6px;
  273. }
  274. .table.table-sm :is(th, td):not(:last-child) {
  275. padding-inline-end: 16px;
  276. }
  277. .table :is(.text-end, [align="right"]) {
  278. text-align: end;
  279. font-variant-numeric: tabular-nums;
  280. }
  281. .table :is(.text-center, [align="center"]) {
  282. text-align: center;
  283. }
  284. .table .text-nowrap {
  285. white-space: nowrap;
  286. }
  287. #widget {
  288. display: flex;
  289. flex-direction: column;
  290. gap: 12px;
  291. width: 100%;
  292. padding: 0;
  293. background: transparent !important;
  294. }
  295. .card {
  296. min-width: 0;
  297. padding: 12px;
  298. overflow: hidden;
  299. overflow-wrap: break-word;
  300. border: 1px solid var(--card-border);
  301. border-radius: var(--radius-xl);
  302. corner-shape: var(--corner-shape);
  303. color: var(--card-foreground);
  304. background: var(--card);
  305. }
  306. .widget {
  307. min-width: 0;
  308. overflow: hidden;
  309. border: 0;
  310. border-radius: var(--radius-xl);
  311. corner-shape: var(--corner-shape);
  312. box-shadow: 0 0 0 0.5px var(--border-strong, var(--border));
  313. color: var(--foreground);
  314. background: var(--background);
  315. }
  316. /* 只计算可见圆角容器,任意布局 wrapper 不增加层级。 */
  317. :is(.card, .widget) {
  318. --control-radius: var(--radius-lg);
  319. }
  320. :is(.card, .widget) :is(.card, .widget) {
  321. border-radius: var(--radius-lg);
  322. --control-radius: var(--radius-md);
  323. }
  324. :is(.card, .widget) :is(.card, .widget) :is(.card, .widget) {
  325. border-radius: var(--radius-md);
  326. --control-radius: var(--radius-sm);
  327. }
  328. :is(.card, .widget) :is(.card, .widget) :is(.card, .widget) :is(.card, .widget) {
  329. border-radius: var(--radius-sm);
  330. }
  331. #widget > :not(.card, .widget, .progress) {
  332. width: 100% !important;
  333. max-width: none !important;
  334. margin: 0 !important;
  335. padding: 0 !important;
  336. border: 0 !important;
  337. border-radius: 0 !important;
  338. background: transparent !important;
  339. box-shadow: none !important;
  340. }
  341. .tooltip {
  342. position: fixed;
  343. z-index: 50;
  344. top: 0;
  345. left: 0;
  346. width: max-content;
  347. max-width: min(
  348. 20rem,
  349. var(--tooltip-available-width, calc(100vw - 10px)),
  350. calc(100vw - 10px)
  351. );
  352. max-height: min(
  353. var(--tooltip-available-height, calc(100vh - 10px)),
  354. calc(100vh - 10px)
  355. );
  356. padding: 4px 8px;
  357. border: 1px solid var(--border);
  358. border-radius: var(--radius-lg);
  359. corner-shape: var(--corner-shape);
  360. color: var(--popover-foreground);
  361. background: var(--popover);
  362. box-shadow: none;
  363. font-size: var(--font-size-tooltip);
  364. line-height: var(--line-height-tooltip);
  365. overflow-wrap: break-word;
  366. white-space: normal;
  367. pointer-events: none;
  368. user-select: none;
  369. }
  370. .viz-grid {
  371. display: grid;
  372. grid-template-columns: repeat(auto-fit, minmax(max(180px, 24%), 1fr));
  373. gap: 10px;
  374. }
  375. .viz-stat {
  376. display: flex;
  377. flex-direction: column;
  378. gap: 2px;
  379. }
  380. .viz-stat-value {
  381. font-size: var(--font-size-h2);
  382. font-weight: var(--font-weight-medium);
  383. line-height: 1.25;
  384. }
  385. .viz-row {
  386. display: flex;
  387. flex-wrap: wrap;
  388. align-items: center;
  389. gap: 10px;
  390. }
  391. hr {
  392. width: 100%;
  393. height: 1px;
  394. margin-block: 6px;
  395. border: 0;
  396. background: var(--border);
  397. }
  398. .nav {
  399. display: flex;
  400. min-width: 0;
  401. align-items: center;
  402. gap: 4px;
  403. }
  404. .progress {
  405. display: flex;
  406. height: 8px;
  407. margin-block: calc((var(--line-height-normal, 1.5em) - 8px) / 2);
  408. overflow: hidden;
  409. border: 0;
  410. border-radius: var(--radius-full);
  411. background: var(--muted);
  412. }
  413. .progress-bar:only-child {
  414. border-radius: var(--radius-full);
  415. }
  416. .progress-bar {
  417. height: 100%;
  418. flex-shrink: 0;
  419. border: 0;
  420. background: var(--viz-series-1);
  421. }
  422. .viz-badge {
  423. padding: 3px 8px;
  424. border-radius: var(--radius-full);
  425. color: var(--accent-foreground);
  426. background: var(--accent);
  427. font-weight: var(--font-weight-medium);
  428. }
  429. small,
  430. .text-small,
  431. .viz-badge {
  432. font-size: var(--font-size-small);
  433. line-height: var(--line-height-small);
  434. }
  435. .text-muted {
  436. color: var(--muted-foreground);
  437. }
  438. .tabular-nums {
  439. font-variant-numeric: tabular-nums;
  440. }
  441. .sr-only {
  442. position: absolute;
  443. width: 1px;
  444. height: 1px;
  445. padding: 0;
  446. overflow: hidden;
  447. clip: rect(0, 0, 0, 0);
  448. white-space: nowrap;
  449. border: 0;
  450. }
  451. .viz-controls {
  452. display: flex;
  453. flex-wrap: wrap;
  454. align-items: center;
  455. gap: 8px;
  456. }
  457. .viz-controls > .form-label {
  458. display: grid;
  459. min-width: min(100%, 260px);
  460. flex: 1 1 280px;
  461. grid-template-columns: minmax(0, 1fr) auto;
  462. align-items: baseline;
  463. gap: 2px 12px;
  464. margin-bottom: 0;
  465. }
  466. .viz-controls > .form-label > :is(.form-control, .form-range, .form-select) {
  467. grid-column: 1 / -1;
  468. }
  469. .btn,
  470. .nav-link,
  471. .form-check-input,
  472. .form-control,
  473. .form-range,
  474. .form-select {
  475. font-family: var(--font-sans);
  476. font-size: var(--font-size-normal);
  477. font-weight: var(--font-weight-normal);
  478. line-height: var(--line-height-normal);
  479. }
  480. .btn,
  481. .nav-link {
  482. appearance: button;
  483. display: inline-flex;
  484. inline-size: fit-content;
  485. max-inline-size: 100%;
  486. min-height: 28px;
  487. align-items: center;
  488. justify-content: center;
  489. gap: 4px;
  490. margin: 0;
  491. padding: 0 8px;
  492. -webkit-app-region: no-drag;
  493. border: 1px solid var(--gen-ui-border, var(--input));
  494. border-radius: var(--control-radius);
  495. corner-shape: var(--corner-shape);
  496. color: var(--foreground);
  497. background: transparent;
  498. cursor: var(--cursor-interaction, pointer);
  499. text-align: center;
  500. text-decoration: none;
  501. white-space: nowrap;
  502. user-select: none;
  503. -webkit-font-smoothing: antialiased;
  504. }
  505. .btn:is(.btn-block, .viz-tile) {
  506. inline-size: 100%;
  507. }
  508. .btn.viz-tile {
  509. min-width: 0;
  510. overflow-wrap: anywhere;
  511. white-space: normal;
  512. }
  513. a.btn {
  514. cursor: var(--cursor-interaction, pointer);
  515. text-decoration: none;
  516. }
  517. .btn:not(:disabled):hover,
  518. .nav-link:not(:disabled):not([aria-disabled="true"]):hover {
  519. border-color: var(--gen-ui-border-hover, var(--border));
  520. background: color-mix(in srgb, var(--input-bg) 50%, transparent);
  521. }
  522. .btn-primary {
  523. border-color: transparent;
  524. color: var(--primary-foreground);
  525. background: var(--primary);
  526. background-clip: padding-box;
  527. }
  528. .btn-primary .text-muted {
  529. color: color-mix(in srgb, var(--primary-foreground) 50%, transparent);
  530. }
  531. .btn-primary:not(:disabled):hover {
  532. border-color: transparent;
  533. background: color-mix(in srgb, var(--primary) 80%, transparent);
  534. background-clip: padding-box;
  535. }
  536. .btn-ghost {
  537. border-color: transparent;
  538. color: var(--foreground);
  539. background: transparent;
  540. }
  541. .btn-ghost:not(:disabled):hover {
  542. border-color: transparent;
  543. color: var(--foreground);
  544. background: var(--hover);
  545. }
  546. .nav-pills .nav-link {
  547. min-width: 0;
  548. border-color: transparent;
  549. color: var(--muted-foreground);
  550. background: transparent;
  551. }
  552. .nav-justified .nav-link {
  553. flex: 1 1 0;
  554. overflow-wrap: anywhere;
  555. white-space: normal;
  556. }
  557. .nav-pills .nav-link.active {
  558. color: var(--foreground);
  559. background: var(--muted);
  560. }
  561. .btn-secondary {
  562. border-color: transparent;
  563. background: var(--secondary);
  564. }
  565. .btn-secondary:not(:disabled):hover {
  566. border-color: transparent;
  567. background: color-mix(in srgb, var(--secondary) 80%, transparent);
  568. }
  569. /* 固定高度叠加正文行高会让放大字号溢出;变体仅约束最小高度,保留内容增长。 */
  570. .btn:is(.btn-xs, .btn-sm, .btn-lg) {
  571. line-height: 1;
  572. padding-block: 2px;
  573. }
  574. .btn-xs {
  575. min-height: 20px;
  576. }
  577. .btn-sm {
  578. min-height: 24px;
  579. }
  580. .btn-lg {
  581. min-height: 32px;
  582. padding-inline: 10px;
  583. }
  584. .btn svg.lucide {
  585. --icon-size: 14px;
  586. }
  587. .btn-xs svg.lucide {
  588. --icon-size: 10px;
  589. }
  590. .btn-sm svg.lucide {
  591. --icon-size: 12px;
  592. }
  593. .btn-lg svg.lucide {
  594. --icon-size: 16px;
  595. }
  596. /* Shared preview chrome; product styles stay inside each variant. */
  597. .viz-dotted-background {
  598. background-image: radial-gradient(
  599. circle,
  600. color-mix(in srgb, var(--foreground) 14%, transparent) 0.8px,
  601. transparent 0.8px
  602. );
  603. background-position: center;
  604. background-size: 16px 16px;
  605. }
  606. .viz-carousel {
  607. position: relative;
  608. min-width: 0;
  609. }
  610. .viz-carousel:has(> .viz-carousel-controls) {
  611. min-height: calc(60px + var(--viz-carousel-picker-height, 0px));
  612. padding-bottom: 60px;
  613. }
  614. .viz-carousel > [data-variant][hidden] {
  615. display: none !important;
  616. }
  617. .viz-carousel > [data-variant] {
  618. isolation: isolate;
  619. }
  620. .viz-carousel-controls {
  621. --viz-carousel-hover: light-dark(
  622. color-mix(in srgb, var(--foreground) 5.4%, transparent),
  623. color-mix(in srgb, var(--foreground) 7.8%, transparent)
  624. );
  625. position: absolute;
  626. z-index: 2;
  627. bottom: 8px;
  628. left: 50%;
  629. display: flex;
  630. width: max-content;
  631. /* Leave room for the host's design-controls launcher at the trailing edge. */
  632. max-width: calc(100% - 96px);
  633. align-items: center;
  634. gap: 0;
  635. padding: 0;
  636. border: 1px solid var(--border);
  637. border-radius: 16px;
  638. color: var(--foreground);
  639. background: var(--background);
  640. font-family: var(--font-sans);
  641. /* Match the settings dropdown chrome independently of the content font size. */
  642. font-size: 13px;
  643. font-weight: var(--font-weight-normal);
  644. line-height: 18px;
  645. transform: translateX(-50%);
  646. user-select: none;
  647. }
  648. .viz-carousel-controls button,
  649. .viz-carousel-picker > summary {
  650. display: flex;
  651. min-height: 30px;
  652. align-items: center;
  653. justify-content: center;
  654. gap: 4px;
  655. padding: 0 6px;
  656. -webkit-app-region: no-drag;
  657. border: 0;
  658. border-radius: 14px;
  659. color: inherit;
  660. background: transparent;
  661. font: inherit;
  662. -webkit-tap-highlight-color: transparent;
  663. }
  664. .viz-carousel-controls > button,
  665. .viz-carousel-picker > summary {
  666. position: relative;
  667. isolation: isolate;
  668. }
  669. .viz-carousel-controls > button {
  670. --icon-size: 16px;
  671. width: 30px;
  672. padding: 0;
  673. }
  674. .viz-carousel-picker > summary {
  675. padding-inline: 12px;
  676. }
  677. .viz-carousel-controls .viz-carousel-caret {
  678. width: 14px;
  679. height: 14px;
  680. flex: none;
  681. margin: 0;
  682. color: inherit;
  683. transform: rotate(180deg);
  684. }
  685. .viz-carousel-controls > button > svg,
  686. .viz-carousel-controls .viz-carousel-caret,
  687. .viz-carousel-count {
  688. opacity: 0.5;
  689. }
  690. .viz-carousel-controls > button::before,
  691. .viz-carousel-picker > summary::before {
  692. position: absolute;
  693. z-index: -1;
  694. inset: 3px;
  695. border-radius: 12px;
  696. content: "";
  697. pointer-events: none;
  698. }
  699. .viz-carousel-controls > button:hover::before,
  700. .viz-carousel-picker > summary:hover::before {
  701. background: var(--viz-carousel-hover);
  702. }
  703. .viz-carousel-controls > button,
  704. .viz-carousel-controls [data-lucide],
  705. .viz-carousel-controls .lucide {
  706. flex-shrink: 0;
  707. }
  708. .viz-carousel-picker {
  709. min-width: 0;
  710. }
  711. .viz-carousel-picker > summary {
  712. min-width: 0;
  713. list-style: none;
  714. }
  715. .viz-carousel-picker > summary::-webkit-details-marker {
  716. display: none;
  717. }
  718. .viz-carousel-count {
  719. flex-shrink: 0;
  720. white-space: nowrap;
  721. }
  722. .viz-carousel-name {
  723. min-width: 0;
  724. overflow: hidden;
  725. text-overflow: ellipsis;
  726. white-space: nowrap;
  727. }
  728. .viz-carousel-options {
  729. position: absolute;
  730. right: 0;
  731. bottom: calc(100% + 4px);
  732. left: 0;
  733. display: flex;
  734. max-height: 240px;
  735. flex-direction: column;
  736. gap: 2px;
  737. overflow: auto;
  738. padding: 4px;
  739. border: 1px solid var(--border);
  740. border-radius: var(--radius-lg);
  741. background: var(--background);
  742. box-shadow: 0 4px 12px light-dark(rgb(0 0 0 / 6%), rgb(0 0 0 / 25%));
  743. }
  744. .viz-carousel-options > button {
  745. width: 100%;
  746. min-height: 28px;
  747. justify-content: flex-start;
  748. padding: 4px 8px;
  749. font-size: var(--font-size-small);
  750. text-align: start;
  751. white-space: normal;
  752. overflow-wrap: anywhere;
  753. }
  754. .viz-carousel-options > [aria-current="true"],
  755. .viz-carousel-options > button:hover {
  756. background: var(--viz-carousel-hover);
  757. }
  758. .btn:disabled,
  759. .nav-link:disabled,
  760. .nav-link[aria-disabled="true"] {
  761. cursor: not-allowed;
  762. opacity: 0.5;
  763. }
  764. [data-lucide] {
  765. stroke-width: 1.6;
  766. }
  767. .form-label {
  768. display: block;
  769. margin-bottom: 6px;
  770. color: var(--foreground);
  771. }
  772. .form-control {
  773. display: block;
  774. width: 100%;
  775. min-height: 36px;
  776. padding: 0 8px;
  777. outline: none;
  778. border: 1px solid var(--input-border);
  779. border-radius: var(--control-radius);
  780. corner-shape: var(--corner-shape);
  781. color: var(--foreground);
  782. background: var(--input-bg);
  783. }
  784. .form-control::placeholder {
  785. color: var(--placeholder);
  786. }
  787. .form-control[type="file"] {
  788. padding: 0;
  789. overflow: hidden;
  790. cursor: var(--cursor-interaction, pointer);
  791. }
  792. .form-control[type="file"]::file-selector-button {
  793. min-height: 26px;
  794. margin-right: 8px;
  795. padding: 0 8px;
  796. border: 0;
  797. border-right: 1px solid var(--input);
  798. color: var(--secondary-foreground);
  799. background: var(--input-bg);
  800. cursor: inherit;
  801. font: inherit;
  802. }
  803. .form-control[type="file"]:not(:disabled):hover::file-selector-button {
  804. background: color-mix(in srgb, var(--foreground) 6%, var(--secondary));
  805. }
  806. .form-control-color[type="color"] {
  807. width: 40px;
  808. height: 28px;
  809. padding: 3px;
  810. cursor: var(--cursor-interaction, pointer);
  811. }
  812. .form-control-color[type="color"]::-webkit-color-swatch-wrapper {
  813. padding: 0;
  814. }
  815. .form-control-color[type="color"]::-webkit-color-swatch {
  816. border: 0;
  817. border-radius: calc(var(--radius-lg) - 4px);
  818. corner-shape: var(--corner-shape);
  819. }
  820. textarea.form-control {
  821. height: auto;
  822. min-height: 64px;
  823. padding: 8px;
  824. resize: vertical;
  825. }
  826. .form-control:focus-visible {
  827. border-color: var(--input-border-focused);
  828. background-color: var(--input-bg-focused);
  829. }
  830. .form-control:disabled,
  831. .form-select:disabled {
  832. cursor: not-allowed;
  833. opacity: 0.5;
  834. }
  835. .form-select {
  836. appearance: none;
  837. display: block;
  838. width: 100%;
  839. min-height: 36px;
  840. margin: 0;
  841. padding: 0 32px 0 8px;
  842. outline: none;
  843. border: 1px solid var(--input-border);
  844. border-radius: var(--control-radius);
  845. corner-shape: var(--corner-shape);
  846. color: var(--foreground);
  847. background-color: var(--input-bg);
  848. background-image:
  849. linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%),
  850. linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  851. background-position:
  852. calc(100% - 14px) 50%,
  853. calc(100% - 10px) 50%;
  854. background-repeat: no-repeat;
  855. background-size: 4px 4px;
  856. cursor: var(--cursor-interaction, default);
  857. }
  858. .form-select:not(:disabled):not(:focus-visible):hover {
  859. border-color: var(--input-border-hover);
  860. }
  861. .form-select:focus-visible {
  862. border-color: var(--input-border-focused);
  863. background-color: var(--input-bg-focused);
  864. }
  865. .form-control:not(:disabled):not(:focus-visible):hover {
  866. border-color: var(--input-border-hover);
  867. }
  868. .form-control.form-control-sm, .form-select.form-select-sm {
  869. min-height: 28px;
  870. }
  871. .form-control.form-control-xs, .form-select.form-select-xs {
  872. min-height: 24px;
  873. }
  874. .form-check {
  875. display: flex;
  876. min-height: 20px;
  877. align-items: center;
  878. gap: 6px;
  879. }
  880. .form-check-input {
  881. appearance: none;
  882. width: 16px;
  883. height: 16px;
  884. flex: 0 0 auto;
  885. margin: 0;
  886. border: 1px solid var(--input-border);
  887. color: var(--primary-foreground);
  888. background-color: transparent;
  889. cursor: var(--cursor-interaction, default);
  890. transition:
  891. background-color 150ms,
  892. border-color 150ms,
  893. box-shadow 150ms;
  894. }
  895. .form-check:not(.form-switch) .form-check-input[type="checkbox"] {
  896. border-color: var(--input-border);
  897. border-radius: var(--radius-sm);
  898. corner-shape: var(--corner-shape);
  899. background-color: var(--input-bg);
  900. box-shadow: none;
  901. }
  902. .form-check:not(.form-switch)
  903. .form-check-input:not(:disabled):not(:checked):not(:indeterminate):hover {
  904. /* 半选不是未选中;避免 hover 覆盖 primary 背景导致横线失去对比。 */
  905. background-color: var(--card);
  906. }
  907. .form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked {
  908. border-color: var(--primary);
  909. background-color: var(--primary);
  910. }
  911. .form-check:not(.form-switch)
  912. .form-check-input[type="checkbox"]:checked::before {
  913. display: block;
  914. width: 100%;
  915. height: 100%;
  916. background: var(--primary-foreground);
  917. content: "";
  918. mask: var(--checkmark-image) center / 12px 12px no-repeat;
  919. }
  920. .form-check-input[type="radio"] {
  921. width: 16px;
  922. height: 16px;
  923. border-radius: var(--radius-full);
  924. }
  925. .form-check-input[type="radio"]:checked {
  926. border: 2px solid var(--primary);
  927. background:
  928. radial-gradient(circle, var(--primary-foreground) 0 2.5px, transparent 3px),
  929. var(--primary);
  930. }
  931. .form-check:not(.form-switch) .form-check-input:focus-visible {
  932. outline: 2px solid var(--ring);
  933. outline-offset: 2px;
  934. }
  935. .form-check:not(.form-switch) .form-check-input:disabled {
  936. cursor: not-allowed;
  937. pointer-events: none;
  938. }
  939. .form-check:not(.form-switch) .form-check-input:disabled + .form-check-label {
  940. cursor: not-allowed;
  941. }
  942. .form-switch .form-check-input:disabled,
  943. .form-switch .form-check-input:disabled + .form-check-label {
  944. cursor: not-allowed;
  945. opacity: 0.5;
  946. }
  947. .form-check-label {
  948. color: var(--foreground);
  949. cursor: var(--cursor-interaction, default);
  950. }
  951. .form-switch .form-check-input {
  952. position: relative;
  953. width: 32px;
  954. height: 18px;
  955. border: 0;
  956. border-radius: var(--radius-full);
  957. background: color-mix(in srgb, var(--primary) 30%, transparent);
  958. box-shadow: none;
  959. transition: background-color 200ms cubic-bezier(0, 0, 0.2, 1);
  960. }
  961. .form-switch .form-check-input::before {
  962. position: absolute;
  963. top: 50%;
  964. left: 0;
  965. width: 16px;
  966. height: 16px;
  967. box-sizing: border-box;
  968. border: 1px solid var(--primary-foreground);
  969. border-radius: var(--radius-full);
  970. background: var(--primary-foreground);
  971. box-shadow: none;
  972. content: "";
  973. transform: translate(1px, -50%);
  974. transition: transform 200ms cubic-bezier(0, 0, 0.2, 1);
  975. }
  976. .form-switch .form-check-input:checked {
  977. background: var(--primary);
  978. }
  979. .form-switch .form-check-input:checked::before {
  980. transform: translate(15px, -50%);
  981. }
  982. .form-switch .form-check-input:focus-visible {
  983. box-shadow: 0 0 0 2px var(--ring);
  984. }
  985. .form-check:not(.form-switch) .form-check-input[type="checkbox"]:indeterminate {
  986. border-color: var(--primary);
  987. background: var(--primary);
  988. }
  989. .form-check:not(.form-switch) .form-check-input[type="checkbox"]:indeterminate::before {
  990. display: block;
  991. width: 8px;
  992. height: 2px;
  993. margin: 6px 3px;
  994. background: var(--primary-foreground);
  995. content: "";
  996. }
  997. .form-check-input:disabled {
  998. opacity: 0.5;
  999. }
  1000. .form-range {
  1001. appearance: none;
  1002. display: block;
  1003. width: 100%;
  1004. height: 28px;
  1005. flex: 1;
  1006. margin: 0;
  1007. padding: 0;
  1008. outline: none;
  1009. border: 0;
  1010. accent-color: var(--primary);
  1011. background: linear-gradient(
  1012. color-mix(in srgb, var(--foreground) 7%, transparent),
  1013. color-mix(in srgb, var(--foreground) 7%, transparent)
  1014. )
  1015. center / 100% 2px no-repeat;
  1016. }
  1017. .form-range::-webkit-slider-runnable-track {
  1018. height: 28px;
  1019. background: transparent;
  1020. }
  1021. .form-range::-webkit-slider-thumb {
  1022. appearance: none;
  1023. width: 20px;
  1024. height: 20px;
  1025. margin-top: 4px;
  1026. border: 1px solid var(--border);
  1027. border-radius: var(--radius-full);
  1028. background: var(--primary-foreground);
  1029. }
  1030. .form-range:focus-visible::-webkit-slider-thumb {
  1031. border-color: var(--ring);
  1032. box-shadow: inset 0 0 0 1px var(--ring);
  1033. }
  1034. .form-range::-moz-range-track {
  1035. height: 28px;
  1036. background: transparent;
  1037. }
  1038. .form-range::-moz-range-thumb {
  1039. width: 20px;
  1040. height: 20px;
  1041. border: 1px solid var(--border);
  1042. border-radius: var(--radius-full);
  1043. background: var(--primary-foreground);
  1044. }
  1045. .form-range:focus-visible::-moz-range-thumb {
  1046. border-color: var(--ring);
  1047. box-shadow: inset 0 0 0 1px var(--ring);
  1048. }
  1049. .form-range:disabled {
  1050. cursor: not-allowed;
  1051. opacity: 0.5;
  1052. }
  1053. .btn:not(.btn-primary, .viz-tile):is(
  1054. [aria-pressed="true"],
  1055. [aria-selected="true"],
  1056. .is-selected
  1057. ) {
  1058. border-color: var(--gen-ui-border, var(--border));
  1059. color: var(--foreground);
  1060. background: var(--selected);
  1061. }
  1062. .btn.viz-tile:is([aria-pressed="true"], [aria-selected="true"], .is-selected) {
  1063. border-color: var(--primary);
  1064. box-shadow: inset 0 0 0 1px var(--primary);
  1065. }
  1066. .btn:focus-visible,
  1067. .nav-link:focus-visible,
  1068. .viz-carousel-controls :is(button, summary):focus-visible {
  1069. outline: 2px solid var(--ring);
  1070. outline-offset: 2px;
  1071. }
  1072. @media (pointer: coarse) {
  1073. .viz-carousel:has(> .viz-carousel-controls) {
  1074. min-height: calc(76px + var(--viz-carousel-picker-height, 0px));
  1075. padding-bottom: 76px;
  1076. }
  1077. .btn,
  1078. .nav-link,
  1079. .viz-carousel-controls button,
  1080. .viz-carousel-picker > summary,
  1081. .form-control,
  1082. .form-select,
  1083. .form-control.form-control-sm,
  1084. .form-control.form-control-xs,
  1085. .form-select.form-select-sm,
  1086. .form-select.form-select-xs,
  1087. .btn.btn-xs,
  1088. .btn.btn-sm,
  1089. .btn.btn-lg {
  1090. min-width: 44px;
  1091. min-height: 44px;
  1092. }
  1093. /* Keep small-screen WebKit from zooming when a text field receives focus. */
  1094. .form-control,
  1095. .form-select {
  1096. font-size: max(16px, var(--font-size-normal));
  1097. }
  1098. .form-control[type="file"]::file-selector-button {
  1099. min-width: 44px;
  1100. min-height: 44px;
  1101. }
  1102. .form-control-color[type="color"] {
  1103. width: 44px;
  1104. height: 44px;
  1105. }
  1106. .form-control:is(
  1107. [type="date"],
  1108. [type="datetime-local"],
  1109. [type="month"],
  1110. [type="time"],
  1111. [type="week"]
  1112. ) {
  1113. min-width: 0;
  1114. max-width: 100%;
  1115. padding-block: 8px;
  1116. }
  1117. .form-check {
  1118. min-height: 44px;
  1119. padding-inline: 15px;
  1120. }
  1121. .form-check-input {
  1122. position: relative;
  1123. }
  1124. .form-check-input::after {
  1125. position: absolute;
  1126. top: 50%;
  1127. left: 50%;
  1128. width: 44px;
  1129. height: 44px;
  1130. content: "";
  1131. transform: translate(-50%, -50%);
  1132. }
  1133. .form-check-label {
  1134. display: inline-flex;
  1135. min-width: 44px;
  1136. min-height: 44px;
  1137. align-items: center;
  1138. }
  1139. .form-range {
  1140. height: 44px;
  1141. touch-action: pan-y;
  1142. }
  1143. .form-range::-webkit-slider-runnable-track {
  1144. height: 44px;
  1145. }
  1146. .form-range::-moz-range-track {
  1147. height: 44px;
  1148. }
  1149. .form-range::-webkit-slider-thumb {
  1150. margin-top: 12px;
  1151. }
  1152. }
  1153. svg {
  1154. display: block;
  1155. max-width: 100%;
  1156. height: auto;
  1157. }
  1158. #widget > svg {
  1159. width: 100%;
  1160. }
  1161. /* Model-authored chart rules can otherwise stretch icons after these styles load. */
  1162. svg.lucide {
  1163. display: block;
  1164. width: var(--icon-size) !important;
  1165. height: var(--icon-size) !important;
  1166. flex: none;
  1167. margin: 0 !important;
  1168. stroke-width: 1.6;
  1169. }
  1170. .text-warning,
  1171. .text-destructive {
  1172. color: var(--destructive);
  1173. }