/* Devices 页面样式:极简风格,响应式设计 */ /* 主容器 */ .Devices-container { width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; background: #f8f9fa; padding: clamp(0.75rem, 2vw, 1.5rem); } /* 头部区域 */ .devices-header { width: 100%; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; gap: clamp(0.5rem, 1.5vw, 1rem); margin-bottom: clamp(0.75rem, 2vw, 1.5rem); padding: clamp(0.5rem, 1.5vw, 1rem); border: 1px solid #e5e7eb; border-radius: clamp(6px, 1vw, 8px); background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); min-height: clamp(40px, 6vw, 48px); } /* 标题 */ .devices-title { font-size: clamp(1rem, 2.5vw, 1.8rem); font-weight: 600; padding: 0; color: #1a1a1a; letter-spacing: -0.5px; line-height: 1.2; display: flex; align-items: center; } /* 刷新按钮 */ .refresh-btn { display: flex; align-items: center; justify-content: center; gap: clamp(0.25rem, 1vw, 0.5rem); padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.75rem, 2vw, 1.25rem); background: #1a1a1a; color: white; border: none; border-radius: clamp(6px, 1vw, 8px); cursor: pointer; font-size: clamp(0.75rem, 1.5vw, 1rem); font-weight: 500; transition: all 0.2s ease; line-height: 1.2; user-select: none; white-space: nowrap; } .refresh-btn:hover:not(.disabled) { background: #333; transform: translateY(-1px); } .refresh-btn:active:not(.disabled) { transform: translateY(0); } .refresh-btn.disabled { opacity: 0.4; cursor: not-allowed; background: #ccc; } .refresh-btn.disabled:hover { transform: none; } /* 刷新图标 */ .refresh-icon { font-size: 1em; transition: transform 0.3s ease; display: inline-block; } /* 悬停时图标旋转 */ .refresh-btn:hover .refresh-icon:not(.spinning) { transform: rotate(180deg); } /* 扫描中图标持续旋转 */ .refresh-icon.spinning { animation: spin 1s linear infinite; } /* 旋转动画 */ @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } /* 滚动区域 */ .devices-scroll-area { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0; } /* 自定义滚动条 */ .devices-scroll-area::-webkit-scrollbar { width: 6px; } .devices-scroll-area::-webkit-scrollbar-track { background: transparent; } .devices-scroll-area::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; } .devices-scroll-area::-webkit-scrollbar-thumb:hover { background: #9ca3af; } /* 设备项 */ .device-item { display: flex; justify-content: space-between; align-items: center; padding: clamp(0.75rem, 1.5vw, 1rem) clamp(0.875rem, 2vw, 1.25rem); margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem); background: white; border-radius: clamp(6px, 1vw, 8px); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); transition: all 0.2s ease; border: 1px solid #e5e7eb; } .device-item:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); border-color: #d1d5db; transform: translateY(-1px); } /* 设备信息容器 */ .device-info { flex: 1; min-width: 0; } /* 设备 ID(IP:端口) */ .device-id { font-size: clamp(0.8rem, 1.8vw, 1.1rem); font-weight: 500; color: #1a1a1a; font-family: 'Courier New', 'Consolas', monospace; word-break: break-all; letter-spacing: 0.2px; line-height: 1.5; } /* 连接按钮 */ .connect-btn { padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.75rem, 2vw, 1.5rem); background: #1a1a1a; color: white; border: none; border-radius: clamp(6px, 1vw, 8px); cursor: pointer; font-size: clamp(0.75rem, 1.5vw, 1rem); font-weight: 500; transition: all 0.2s ease; white-space: nowrap; margin-left: clamp(0.5rem, 1.5vw, 1rem); user-select: none; } .connect-btn:hover:not(.disabled) { background: #333; transform: translateY(-1px); } .connect-btn:active:not(.disabled) { transform: translateY(0); } .connect-btn.disabled { opacity: 0.4; cursor: not-allowed; background: #ccc; } .connect-btn.disabled:hover { transform: none; } /* 断开按钮 */ .disconnect-btn { padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.75rem, 2vw, 1.5rem); background: #dc2626; color: white; border: none; border-radius: clamp(6px, 1vw, 8px); cursor: pointer; font-size: clamp(0.75rem, 1.5vw, 1rem); font-weight: 500; transition: all 0.2s ease; white-space: nowrap; user-select: none; } .disconnect-btn:hover:not(.disabled) { background: #b91c1c; transform: translateY(-1px); } .disconnect-btn:active:not(.disabled) { transform: translateY(0); } .disconnect-btn.disabled { opacity: 0.4; cursor: not-allowed; background: #ccc; } .disconnect-btn.disabled:hover { transform: none; } /* 平板适配 */ @media (min-width: 768px) and (max-width: 1023px) { .devices-header { padding: clamp(0.75rem, 1.5vw, 1rem); } } /* 移动端适配 */ @media (max-width: 767px) { .Devices-container { padding: clamp(0.5rem, 2vw, 1rem); } .devices-header { flex-direction: column; align-items: flex-start; gap: clamp(0.5rem, 1.5vw, 0.75rem); padding: clamp(0.75rem, 2vw, 1rem); } .refresh-btn { width: 100%; justify-content: center; } .device-item { flex-direction: column; align-items: flex-start; gap: clamp(0.5rem, 1.5vw, 0.75rem); } .connect-btn { width: 100%; margin-left: 0; } }