style.css 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. @tailwind base;
  2. @tailwind components;
  3. @tailwind utilities;
  4. /* 全局基础样式 */
  5. @layer base {
  6. body {
  7. @apply bg-base-300 overflow-hidden;
  8. }
  9. /* 自定义滚动条 */
  10. ::-webkit-scrollbar {
  11. @apply w-1.5 h-1.5;
  12. }
  13. ::-webkit-scrollbar-track {
  14. @apply bg-transparent;
  15. }
  16. ::-webkit-scrollbar-thumb {
  17. @apply bg-base-content/20 rounded;
  18. }
  19. ::-webkit-scrollbar-thumb:hover {
  20. @apply bg-base-content/30;
  21. }
  22. }
  23. /* D3相关样式 */
  24. @layer components {
  25. /* 树节点 */
  26. .tree-node {
  27. cursor: pointer;
  28. }
  29. .tree-node circle,
  30. .tree-node rect {
  31. stroke-width: 2;
  32. transition: all 0.2s;
  33. }
  34. .tree-node:hover circle,
  35. .tree-node:hover rect {
  36. filter: brightness(1.2);
  37. }
  38. .tree-node.selected circle,
  39. .tree-node.selected rect {
  40. stroke: #fff;
  41. stroke-width: 3;
  42. }
  43. .tree-node.highlighted circle,
  44. .tree-node.highlighted rect {
  45. stroke: #2ecc71;
  46. stroke-width: 2;
  47. }
  48. /* ========== 统一的置灰样式 ========== */
  49. /* 所有节点置灰 */
  50. .tree-node.dimmed,
  51. .match-node.dimmed,
  52. .graph-node.dimmed,
  53. .walked-node.dimmed {
  54. opacity: 0.15;
  55. pointer-events: none;
  56. }
  57. /* 所有边置灰 */
  58. .tree-link.dimmed,
  59. .match-link.dimmed,
  60. .graph-link.dimmed,
  61. .walked-link.dimmed {
  62. stroke-opacity: 0.08 !important;
  63. }
  64. /* 分数标签置灰 */
  65. .match-score.dimmed,
  66. .walked-score.dimmed {
  67. opacity: 0.15;
  68. }
  69. /* ========== 统一的高亮样式 ========== */
  70. .tree-link.highlighted,
  71. .match-link.highlighted,
  72. .graph-link.highlighted,
  73. .walked-link.highlighted {
  74. stroke-opacity: 0.8 !important;
  75. stroke-width: 2 !important;
  76. }
  77. /* ========== 游走层节点样式 ========== */
  78. .walked-node {
  79. cursor: pointer;
  80. }
  81. .walked-node circle,
  82. .walked-node rect {
  83. transition: all 0.2s;
  84. }
  85. .walked-node:hover circle,
  86. .walked-node:hover rect {
  87. filter: brightness(1.2);
  88. }
  89. .walked-node text {
  90. @apply text-xs;
  91. fill: oklch(var(--bc));
  92. pointer-events: none;
  93. }
  94. .tree-node text {
  95. @apply text-xs;
  96. fill: oklch(var(--bc));
  97. pointer-events: none;
  98. }
  99. /* 树边 */
  100. .tree-link {
  101. fill: none;
  102. stroke: #9b59b6;
  103. stroke-opacity: 0.3;
  104. stroke-width: 1;
  105. transition: stroke-opacity 0.2s;
  106. }
  107. .tree-link.highlighted {
  108. stroke-opacity: 0.8;
  109. stroke-width: 2;
  110. }
  111. /* 图节点 */
  112. .graph-node {
  113. cursor: pointer;
  114. }
  115. .graph-node circle,
  116. .graph-node rect {
  117. stroke: #333;
  118. stroke-width: 2;
  119. transition: all 0.2s;
  120. }
  121. .graph-node.center circle,
  122. .graph-node.center rect {
  123. stroke: #fff;
  124. stroke-width: 3;
  125. }
  126. .graph-node:hover circle,
  127. .graph-node:hover rect {
  128. filter: brightness(1.2);
  129. }
  130. .graph-node text {
  131. @apply text-xs;
  132. fill: oklch(var(--bc));
  133. pointer-events: none;
  134. }
  135. /* 图边 */
  136. .graph-link {
  137. stroke-opacity: 0.6;
  138. transition: stroke-opacity 0.2s;
  139. }
  140. .graph-link:hover {
  141. stroke-opacity: 1;
  142. }
  143. .graph-link-label {
  144. @apply text-xs;
  145. fill: oklch(var(--bc) / 0.5);
  146. }
  147. }