index.css 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. html, body {
  2. margin: 0;
  3. padding: 0;
  4. }
  5. .fe-whole-page {
  6. width: 152px;
  7. min-height: 140px;
  8. font-size: 14px;
  9. user-select: none;
  10. padding: 0;
  11. margin: 0;
  12. position: relative;
  13. display: flex;
  14. flex-direction: column;
  15. overflow: hidden;
  16. transition: min-height 0.2s ease-out;
  17. }
  18. .fe-hide {
  19. display: none;
  20. }
  21. .fe-function-title {
  22. padding: 8px 12px;
  23. color: #2b2d42;
  24. font-weight: 600;
  25. cursor: default;
  26. border-bottom: 1px solid rgba(67, 97, 238, 0.1);
  27. background: linear-gradient(to right, #f8f9ff, #f0f2ff);
  28. font-size: 12px;
  29. letter-spacing: 0.5px;
  30. flex-shrink: 0; /* 防止被压缩 */
  31. }
  32. .fe-function-title span {
  33. font-weight: normal;
  34. color: #999;
  35. font-size: 10px;
  36. }
  37. ul.fe-function-list {
  38. padding: 0;
  39. list-style: none;
  40. width: 100%;
  41. margin: 0;
  42. flex: 1;
  43. min-height: 40px;
  44. overflow-y: auto; /* 允许垂直滚动 */
  45. overflow-x: hidden; /* 隐藏水平滚动 */
  46. max-height: 500px; /* 不再限制最大高度 */
  47. display: inline-table;
  48. scrollbar-width: thin; /* Firefox 下的滚动条样式 */
  49. scrollbar-color: rgba(67, 97, 238, 0.3) transparent;
  50. }
  51. /* 自定义滚动条样式 - Webkit内核浏览器 */
  52. ul.fe-function-list::-webkit-scrollbar {
  53. width: 6px;
  54. }
  55. ul.fe-function-list::-webkit-scrollbar-track {
  56. background: transparent;
  57. }
  58. ul.fe-function-list::-webkit-scrollbar-thumb {
  59. background: rgba(67, 97, 238, 0.3);
  60. border-radius: 3px;
  61. transition: background 0.2s ease;
  62. }
  63. ul.fe-function-list::-webkit-scrollbar-thumb:hover {
  64. background: rgba(67, 97, 238, 0.5);
  65. }
  66. /* 暗黑模式下的滚动条 */
  67. html[dark-mode="on"] ul.fe-function-list::-webkit-scrollbar-thumb {
  68. background: rgba(255, 255, 255, 0.3);
  69. }
  70. html[dark-mode="on"] ul.fe-function-list::-webkit-scrollbar-thumb:hover {
  71. background: rgba(255, 255, 255, 0.5);
  72. }
  73. ul.fe-function-list li {
  74. padding: 2px 10px 2px 38px;
  75. cursor: pointer;
  76. color: #4a4c6d;
  77. /* 只对安全的属性进行过渡,避免布局变化 */
  78. transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  79. display: block;
  80. align-items: center;
  81. height: 28px; /* 固定高度,不变化 */
  82. border-radius: 6px;
  83. margin: 2px 0; /* 固定边距,不变化 */
  84. border-bottom: 1px solid rgba(67, 97, 238, 0.05);
  85. text-align: justify;
  86. position: relative;
  87. line-height: 28px; /* 固定行高,不变化 */
  88. flex-shrink: 0; /* 防止被压缩 */
  89. box-sizing: border-box; /* 确保padding不影响总宽度 */
  90. }
  91. ul.fe-function-list li:last-child {
  92. border-bottom: none;
  93. }
  94. ul.fe-function-list li.x-hovered,
  95. ul.fe-function-list li:hover {
  96. color: #000;
  97. background: rgba(67, 97, 238, 0.08);
  98. box-shadow: 0 2px 6px rgba(67, 97, 238, 0.08);
  99. /* 保持字体粗细不变,避免文字宽度变化导致布局抖动 */
  100. font-weight: 500;
  101. }
  102. ul.fe-function-list li > span {
  103. padding-left: 24px;
  104. }
  105. ul.fe-function-list li:after {
  106. content: ' ';
  107. display: inline-block;
  108. width: 100%;
  109. overflow: hidden;
  110. height: 0;
  111. }
  112. ul.fe-function-list li > b {
  113. width: 20px;
  114. height: 20px;
  115. /* 只对transform进行过渡,避免其他属性变化影响布局 */
  116. transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  117. display: inline-flex;
  118. align-items: center;
  119. justify-content: center;
  120. background: rgba(0,0,0,0.1);
  121. padding: 0px;
  122. border-radius: 50%;
  123. margin-right: 2px;
  124. color: currentColor;
  125. filter: drop-shadow(0 2px 4px rgba(67, 97, 238, 0.1));
  126. position: absolute;
  127. left: 10px;
  128. top: 6px;
  129. /* 确保图标的变换不影响文档流 */
  130. transform-origin: center center;
  131. }
  132. /* 暗黑模式适配 */
  133. .dark-mode .fe-function-list li > b {
  134. background: rgba(255,255,255,0.1);
  135. }
  136. ul.fe-function-list li:hover > b {
  137. transform: rotate(360deg);
  138. -webkit-transform: rotate(360deg);
  139. }
  140. ul.fe-function-list li i {
  141. color: #aaa;
  142. font-weight: 700;
  143. font-style: normal;
  144. }
  145. .fe-feedback {
  146. font-size: 13px;
  147. border-top: 1px solid rgba(67, 97, 238, 0.08);
  148. padding: 8px 16px;
  149. background: linear-gradient(to right, rgba(67, 97, 238, 0.05), rgba(67, 97, 238, 0.05));
  150. color: var(--text-color);
  151. opacity: 0.9;
  152. flex-shrink: 0; /* 防止被压缩 */
  153. position: relative; /* 改为相对定位 */
  154. width: 100%;
  155. box-sizing: border-box;
  156. margin-top: auto; /* 确保在容器底部 */
  157. }
  158. .fe-feedback a {
  159. color: #666;
  160. text-decoration: none;
  161. text-align: left;
  162. }
  163. .fe-feedback a:hover {
  164. color: #c00;
  165. }
  166. svg:not(:root) {
  167. overflow: hidden;
  168. }
  169. .fe-feedback svg {
  170. vertical-align: middle;
  171. display: inline-block;
  172. fill: currentColor;
  173. margin-right: 3px;
  174. }
  175. .fe-feedback img {
  176. opacity: 0.6;
  177. position: relative;
  178. top: 1px;
  179. }
  180. .fe-feedback a:hover img {
  181. opacity: 1.0;
  182. }
  183. .fe-feedback .x-settings {
  184. float: right;
  185. cursor: pointer;
  186. margin-left: 5px;
  187. display: inline-flex;
  188. align-items: center;
  189. color: #666;
  190. }
  191. .fe-feedback .x-settings:hover {
  192. color: #c00;
  193. }
  194. .fe-feedback .x-fb,
  195. .fe-feedback .x-settings
  196. {
  197. float: right;
  198. }
  199. /* 加载状态样式 */
  200. .fe-loading {
  201. display: flex;
  202. flex-direction: column;
  203. align-items: center;
  204. justify-content: center;
  205. padding: 20px;
  206. min-height: 60px;
  207. flex: 1;
  208. }
  209. .loading-spinner {
  210. width: 20px;
  211. height: 20px;
  212. border: 2px solid rgba(67, 97, 238, 0.1);
  213. border-left: 2px solid #4361ee;
  214. border-radius: 50%;
  215. animation: spin 1s linear infinite;
  216. margin-bottom: 8px;
  217. }
  218. .loading-text {
  219. color: #666;
  220. font-size: 12px;
  221. text-align: center;
  222. }
  223. @keyframes spin {
  224. 0% { transform: rotate(0deg); }
  225. 100% { transform: rotate(360deg); }
  226. }
  227. /* 无工具状态样式 */
  228. .fe-no-tools {
  229. padding: 20px;
  230. text-align: center;
  231. flex: 1;
  232. display: flex;
  233. align-items: center;
  234. justify-content: center;
  235. }
  236. .no-tools-message p {
  237. color: #666;
  238. font-size: 12px;
  239. margin: 0 0 12px 0;
  240. }
  241. .install-tools-btn {
  242. background: #4361ee;
  243. color: white;
  244. border: none;
  245. border-radius: 4px;
  246. padding: 6px 12px;
  247. font-size: 11px;
  248. cursor: pointer;
  249. transition: all 0.2s ease;
  250. }
  251. .install-tools-btn:hover {
  252. background: #3651d4;
  253. transform: translateY(-1px);
  254. }
  255. /* 暗色模式适配 */
  256. html[dark-mode="on"] .loading-text,
  257. html[dark-mode="on"] .no-tools-message p {
  258. color: #ccc;
  259. }
  260. html[dark-mode="on"] .loading-spinner {
  261. border-color: rgba(255, 255, 255, 0.1);
  262. border-left-color: #4361ee;
  263. }
  264. /* 工具列表为空时的基本样式 */
  265. .fe-function-list:empty {
  266. min-height: 20px;
  267. }
  268. /* 1个工具时的优化 */
  269. .fe-function-list li:only-child {
  270. margin: 4px 0;
  271. height: 32px;
  272. line-height: 32px;
  273. }
  274. .fe-function-list li:only-child > b {
  275. top: 6px;
  276. }
  277. /* 当只有极少工具时的特殊优化 */
  278. .very-few-tools .fe-function-list {
  279. padding: 6px 0;
  280. }
  281. .very-few-tools .fe-function-list li {
  282. height: 34px;
  283. line-height: 34px;
  284. margin: 4px 0;
  285. }
  286. /* 当没有工具时,优化无工具提示的显示 */
  287. .fe-no-tools .no-tools-message {
  288. text-align: center;
  289. }
  290. /* 优化加载状态的显示 */
  291. .fe-loading {
  292. justify-content: center;
  293. align-items: center;
  294. display: flex;
  295. height: 120px;
  296. }