index.css 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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; /* 简化padding,因为图标不再绝对定位 */
  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: flex; /* 改为flex布局 */
  80. align-items: center; /* 垂直居中 */
  81. justify-content: flex-start; /* 改为左对齐,让图标和文字左对齐 */
  82. height: 28px; /* 固定高度,不变化 */
  83. line-height: 28px;
  84. width: 100%; /* 使用100%宽度,让内容在容器中居中 */
  85. border-radius: 6px;
  86. margin: 2px 0; /* 固定边距,不变化 */
  87. border-bottom: 1px solid rgba(67, 97, 238, 0.05);
  88. position: relative;
  89. flex-shrink: 0; /* 防止被压缩 */
  90. box-sizing: border-box; /* 确保padding不影响总宽度 */
  91. }
  92. ul.fe-function-list li:last-child {
  93. border-bottom: none;
  94. }
  95. ul.fe-function-list li.x-hovered,
  96. ul.fe-function-list li:hover {
  97. color: #000;
  98. background: rgba(67, 97, 238, 0.08);
  99. box-shadow: 0 2px 6px rgba(67, 97, 238, 0.08);
  100. /* 保持字体粗细不变,避免文字宽度变化导致布局抖动 */
  101. font-weight: 500;
  102. }
  103. ul.fe-function-list li > span.tool-name {
  104. display: inline-block;
  105. flex: 1; /* 让文字区域占据剩余空间 */
  106. white-space: nowrap;
  107. overflow: hidden;
  108. text-overflow: ellipsis;
  109. line-height: 28px;
  110. flex-shrink: 1; /* 允许文字被压缩以显示省略号 */
  111. min-width: 0; /* 允许flex项目缩小到内容宽度以下 */
  112. }
  113. ul.fe-function-list li > b {
  114. width: 20px;
  115. height: 20px;
  116. /* 只对transform进行过渡,避免其他属性变化影响布局 */
  117. transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  118. display: inline-flex;
  119. align-items: center;
  120. justify-content: center;
  121. background: rgba(0,0,0,0.1);
  122. padding: 0px;
  123. border-radius: 50%;
  124. margin-right: 12px; /* 增加图标和文字之间的间距 */
  125. color: currentColor;
  126. filter: drop-shadow(0 2px 4px rgba(67, 97, 238, 0.1));
  127. /* 移除绝对定位,让图标作为flex项目 */
  128. flex-shrink: 0; /* 防止图标被压缩 */
  129. flex-basis: 20px; /* 设置固定基础宽度,确保所有图标对齐 */
  130. }
  131. /* 暗黑模式适配 */
  132. .dark-mode .fe-function-list li > b {
  133. background: rgba(255,255,255,0.1);
  134. }
  135. ul.fe-function-list li:hover > b {
  136. transform: rotate(360deg);
  137. -webkit-transform: rotate(360deg);
  138. }
  139. ul.fe-function-list li i {
  140. color: #aaa;
  141. font-weight: 700;
  142. font-style: normal;
  143. }
  144. .fe-feedback {
  145. font-size: 13px;
  146. border-top: 1px solid rgba(67, 97, 238, 0.08);
  147. padding: 8px 16px;
  148. background: linear-gradient(to right, rgba(67, 97, 238, 0.05), rgba(67, 97, 238, 0.05));
  149. color: var(--text-color);
  150. opacity: 0.9;
  151. flex-shrink: 0; /* 防止被压缩 */
  152. position: relative; /* 改为相对定位 */
  153. width: 100%;
  154. box-sizing: border-box;
  155. margin-top: auto; /* 确保在容器底部 */
  156. }
  157. .fe-feedback a {
  158. color: #666;
  159. text-decoration: none;
  160. text-align: left;
  161. }
  162. .fe-feedback a:hover {
  163. color: #c00;
  164. }
  165. svg:not(:root) {
  166. overflow: hidden;
  167. }
  168. .fe-feedback svg {
  169. vertical-align: middle;
  170. display: inline-block;
  171. fill: currentColor;
  172. margin-right: 3px;
  173. }
  174. .fe-feedback img {
  175. opacity: 0.6;
  176. position: relative;
  177. top: 1px;
  178. }
  179. .fe-feedback a:hover img {
  180. opacity: 1.0;
  181. }
  182. .fe-feedback .x-settings {
  183. float: right;
  184. cursor: pointer;
  185. margin-left: 5px;
  186. display: inline-flex;
  187. align-items: center;
  188. color: #666;
  189. }
  190. .fe-feedback .x-settings:hover {
  191. color: #c00;
  192. }
  193. .fe-feedback .x-fb,
  194. .fe-feedback .x-settings
  195. {
  196. float: right;
  197. }
  198. /* 加载状态样式 */
  199. .fe-loading {
  200. display: flex;
  201. flex-direction: column;
  202. align-items: center;
  203. justify-content: center;
  204. padding: 20px;
  205. min-height: 60px;
  206. flex: 1;
  207. }
  208. .loading-spinner {
  209. width: 20px;
  210. height: 20px;
  211. border: 2px solid rgba(67, 97, 238, 0.1);
  212. border-left: 2px solid #4361ee;
  213. border-radius: 50%;
  214. animation: spin 1s linear infinite;
  215. margin-bottom: 8px;
  216. }
  217. .loading-text {
  218. color: #666;
  219. font-size: 12px;
  220. text-align: center;
  221. }
  222. @keyframes spin {
  223. 0% { transform: rotate(0deg); }
  224. 100% { transform: rotate(360deg); }
  225. }
  226. /* 无工具状态样式 */
  227. .fe-no-tools {
  228. padding: 20px;
  229. text-align: center;
  230. flex: 1;
  231. display: flex;
  232. align-items: center;
  233. justify-content: center;
  234. }
  235. .no-tools-message p {
  236. color: #666;
  237. font-size: 12px;
  238. margin: 0 0 12px 0;
  239. }
  240. .install-tools-btn {
  241. background: #4361ee;
  242. color: white;
  243. border: none;
  244. border-radius: 4px;
  245. padding: 6px 12px;
  246. font-size: 11px;
  247. cursor: pointer;
  248. transition: all 0.2s ease;
  249. }
  250. .install-tools-btn:hover {
  251. background: #3651d4;
  252. transform: translateY(-1px);
  253. }
  254. /* 暗色模式适配 */
  255. html[dark-mode="on"] .loading-text,
  256. html[dark-mode="on"] .no-tools-message p {
  257. color: #ccc;
  258. }
  259. html[dark-mode="on"] .loading-spinner {
  260. border-color: rgba(255, 255, 255, 0.1);
  261. border-left-color: #4361ee;
  262. }
  263. /* 工具列表为空时的基本样式 */
  264. .fe-function-list:empty {
  265. min-height: 20px;
  266. }
  267. /* 1个工具时的优化 */
  268. .fe-function-list li:only-child {
  269. margin: 4px 0;
  270. height: 32px;
  271. width: 100%; /* 使用100%宽度 */
  272. }
  273. .fe-function-list li:only-child > span.tool-name {
  274. line-height: 32px;
  275. }
  276. /* 当只有极少工具时的特殊优化 */
  277. .very-few-tools .fe-function-list {
  278. padding: 6px 0;
  279. }
  280. .very-few-tools .fe-function-list li {
  281. height: 34px;
  282. margin: 4px 0;
  283. width: 100%; /* 使用100%宽度 */
  284. }
  285. .very-few-tools .fe-function-list li > span.tool-name {
  286. line-height: 34px;
  287. }
  288. /* 当没有工具时,优化无工具提示的显示 */
  289. .fe-no-tools .no-tools-message {
  290. text-align: center;
  291. }
  292. /* 优化加载状态的显示 */
  293. .fe-loading {
  294. justify-content: center;
  295. align-items: center;
  296. display: flex;
  297. height: 120px;
  298. }