Devices.css 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. /* Devices 页面样式:极简风格,响应式设计 */
  2. /* 主容器 */
  3. .Devices-container {
  4. width: 100%;
  5. height: 100%;
  6. box-sizing: border-box;
  7. display: flex;
  8. flex-direction: column;
  9. background: #f8f9fa;
  10. padding: clamp(0.75rem, 2vw, 1.5rem);
  11. }
  12. /* 头部区域 */
  13. .devices-header {
  14. width: 100%;
  15. box-sizing: border-box;
  16. display: flex;
  17. justify-content: space-between;
  18. align-items: center;
  19. gap: clamp(0.5rem, 1.5vw, 1rem);
  20. margin-bottom: clamp(0.75rem, 2vw, 1.5rem);
  21. padding: clamp(0.5rem, 1.5vw, 1rem);
  22. border: 1px solid #e5e7eb;
  23. border-radius: clamp(6px, 1vw, 8px);
  24. background: #ffffff;
  25. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  26. min-height: clamp(40px, 6vw, 48px);
  27. }
  28. /* 标题 */
  29. .devices-title {
  30. font-size: clamp(1rem, 2.5vw, 1.8rem);
  31. font-weight: 600;
  32. padding: 0;
  33. color: #1a1a1a;
  34. letter-spacing: -0.5px;
  35. line-height: 1.2;
  36. display: flex;
  37. align-items: center;
  38. }
  39. /* 刷新按钮 */
  40. .refresh-btn {
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. gap: clamp(0.25rem, 1vw, 0.5rem);
  45. padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.75rem, 2vw, 1.25rem);
  46. background: #1a1a1a;
  47. color: white;
  48. border: none;
  49. border-radius: clamp(6px, 1vw, 8px);
  50. cursor: pointer;
  51. font-size: clamp(0.75rem, 1.5vw, 1rem);
  52. font-weight: 500;
  53. transition: all 0.2s ease;
  54. line-height: 1.2;
  55. user-select: none;
  56. white-space: nowrap;
  57. }
  58. .refresh-btn:hover:not(.disabled) {
  59. background: #333;
  60. transform: translateY(-1px);
  61. }
  62. .refresh-btn:active:not(.disabled) {
  63. transform: translateY(0);
  64. }
  65. .refresh-btn.disabled {
  66. opacity: 0.4;
  67. cursor: not-allowed;
  68. background: #ccc;
  69. }
  70. .refresh-btn.disabled:hover {
  71. transform: none;
  72. }
  73. /* 刷新图标 */
  74. .refresh-icon {
  75. font-size: 1em;
  76. transition: transform 0.3s ease;
  77. display: inline-block;
  78. }
  79. /* 悬停时图标旋转 */
  80. .refresh-btn:hover .refresh-icon:not(.spinning) {
  81. transform: rotate(180deg);
  82. }
  83. /* 扫描中图标持续旋转 */
  84. .refresh-icon.spinning {
  85. animation: spin 1s linear infinite;
  86. }
  87. /* 旋转动画 */
  88. @keyframes spin {
  89. from {
  90. transform: rotate(0deg);
  91. }
  92. to {
  93. transform: rotate(360deg);
  94. }
  95. }
  96. /* 滚动区域 */
  97. .devices-scroll-area {
  98. flex: 1;
  99. overflow-y: auto;
  100. overflow-x: hidden;
  101. padding: 0;
  102. }
  103. /* 自定义滚动条 */
  104. .devices-scroll-area::-webkit-scrollbar {
  105. width: 6px;
  106. }
  107. .devices-scroll-area::-webkit-scrollbar-track {
  108. background: transparent;
  109. }
  110. .devices-scroll-area::-webkit-scrollbar-thumb {
  111. background: #d1d5db;
  112. border-radius: 3px;
  113. }
  114. .devices-scroll-area::-webkit-scrollbar-thumb:hover {
  115. background: #9ca3af;
  116. }
  117. /* 设备项 */
  118. .device-item {
  119. display: flex;
  120. justify-content: space-between;
  121. align-items: center;
  122. padding: clamp(0.75rem, 1.5vw, 1rem) clamp(0.875rem, 2vw, 1.25rem);
  123. margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem);
  124. background: white;
  125. border-radius: clamp(6px, 1vw, 8px);
  126. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  127. transition: all 0.2s ease;
  128. border: 1px solid #e5e7eb;
  129. }
  130. .device-item:hover {
  131. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  132. border-color: #d1d5db;
  133. transform: translateY(-1px);
  134. }
  135. /* 设备信息容器 */
  136. .device-info {
  137. flex: 1;
  138. min-width: 0;
  139. }
  140. /* 设备 ID(IP:端口) */
  141. .device-id {
  142. font-size: clamp(0.8rem, 1.8vw, 1.1rem);
  143. font-weight: 500;
  144. color: #1a1a1a;
  145. font-family: 'Courier New', 'Consolas', monospace;
  146. word-break: break-all;
  147. letter-spacing: 0.2px;
  148. line-height: 1.5;
  149. }
  150. /* 连接按钮 */
  151. .connect-btn {
  152. padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.75rem, 2vw, 1.5rem);
  153. background: #1a1a1a;
  154. color: white;
  155. border: none;
  156. border-radius: clamp(6px, 1vw, 8px);
  157. cursor: pointer;
  158. font-size: clamp(0.75rem, 1.5vw, 1rem);
  159. font-weight: 500;
  160. transition: all 0.2s ease;
  161. white-space: nowrap;
  162. margin-left: clamp(0.5rem, 1.5vw, 1rem);
  163. user-select: none;
  164. }
  165. .connect-btn:hover:not(.disabled) {
  166. background: #333;
  167. transform: translateY(-1px);
  168. }
  169. .connect-btn:active:not(.disabled) {
  170. transform: translateY(0);
  171. }
  172. .connect-btn.disabled {
  173. opacity: 0.4;
  174. cursor: not-allowed;
  175. background: #ccc;
  176. }
  177. .connect-btn.disabled:hover {
  178. transform: none;
  179. }
  180. /* 断开按钮 */
  181. .disconnect-btn {
  182. padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.75rem, 2vw, 1.5rem);
  183. background: #dc2626;
  184. color: white;
  185. border: none;
  186. border-radius: clamp(6px, 1vw, 8px);
  187. cursor: pointer;
  188. font-size: clamp(0.75rem, 1.5vw, 1rem);
  189. font-weight: 500;
  190. transition: all 0.2s ease;
  191. white-space: nowrap;
  192. user-select: none;
  193. }
  194. .disconnect-btn:hover:not(.disabled) {
  195. background: #b91c1c;
  196. transform: translateY(-1px);
  197. }
  198. .disconnect-btn:active:not(.disabled) {
  199. transform: translateY(0);
  200. }
  201. .disconnect-btn.disabled {
  202. opacity: 0.4;
  203. cursor: not-allowed;
  204. background: #ccc;
  205. }
  206. .disconnect-btn.disabled:hover {
  207. transform: none;
  208. }
  209. /* 平板适配 */
  210. @media (min-width: 768px) and (max-width: 1023px) {
  211. .devices-header {
  212. padding: clamp(0.75rem, 1.5vw, 1rem);
  213. }
  214. }
  215. /* 移动端适配 */
  216. @media (max-width: 767px) {
  217. .Devices-container {
  218. padding: clamp(0.5rem, 2vw, 1rem);
  219. }
  220. .devices-header {
  221. flex-direction: column;
  222. align-items: flex-start;
  223. gap: clamp(0.5rem, 1.5vw, 0.75rem);
  224. padding: clamp(0.75rem, 2vw, 1rem);
  225. }
  226. .refresh-btn {
  227. width: 100%;
  228. justify-content: center;
  229. }
  230. .device-item {
  231. flex-direction: column;
  232. align-items: flex-start;
  233. gap: clamp(0.5rem, 1.5vw, 0.75rem);
  234. }
  235. .connect-btn {
  236. width: 100%;
  237. margin-left: 0;
  238. }
  239. }