/* 设备卡片组件样式 */ /* 左滑容器:负责裁剪超出部分,并承载卡片圆角/阴影 */ .swipe-wrap { position: relative; overflow: hidden; border-radius: 16rpx; margin-bottom: 20rpx; box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05); background-color: #fff; } /* 底层删除按钮:平时被卡片盖住,左滑后露出 */ .swipe-delete { position: absolute; top: 0; right: 0; bottom: 0; width: 176rpx; display: flex; align-items: center; justify-content: center; background-color: #ff4d4f; color: #fff; border-radius: 0 16rpx 16rpx 0; } .swipe-delete-text { font-size: 30rpx; font-weight: 500; } .swipe-delete:active { background-color: #ff7875; } .device-card { position: relative; z-index: 1; background-color: #fff; border-radius: 16rpx; padding: 24rpx; display: flex; flex-direction: row; align-items: center; transition: transform 0.25s ease; will-change: transform; } .device-card.is-dragging { transition: none; } .device-main { flex: 1; display: flex; flex-direction: column; } .device-header { display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin-bottom: 16rpx; } .device-name { font-size: 32rpx; font-weight: 600; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .status-tag { display: inline-block; padding: 4rpx 16rpx; border-radius: 4rpx; font-size: 22rpx; margin-left: 16rpx; flex-shrink: 0; } .status-tag.online { background-color: #f6ffed; color: #52c41a; border: 1rpx solid #b7eb8f; } .status-tag.offline { background-color: #fff7e6; color: #fa8c16; border: 1rpx solid #ffd591; } .device-info { display: flex; flex-direction: column; } .info-row { display: flex; flex-direction: row; margin-bottom: 8rpx; } .info-label { font-size: 24rpx; color: #999; width: 100rpx; } .info-value { font-size: 24rpx; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .device-actions { display: flex; flex-direction: row; align-items: center; justify-content: center; margin-left: 20rpx; } .device-switch { transform: scale(0.8); }