.connected-panel,
.device-card,
.empty-state {
  border: 1rpx solid #e6ebf2;
  border-radius: 18rpx;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  box-sizing: border-box;
}

.connected-panel {
  margin-top: 24rpx;
  padding-bottom: 24rpx;
}

.connected-panel:first-child {
  margin-top: 0;
}

.connected-summary {
  min-height: 56rpx;
  padding: 8rpx 24rpx 0;
}

.connected-name {
  min-width: 0;
  color: #111827;
  font-size: 34rpx;
  line-height: 1.35;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-badges {
  justify-content: flex-end;
  gap: 14rpx;
  padding: 8rpx 24rpx 0;
}

.traffic-badge {
  flex: none;
  min-width: 156rpx;
  text-align: right;
  color: #64748b;
  font-size: 22rpx;
  line-height: 1.35;
  white-space: nowrap;
}

.meta-grid {
  display: flex;
  flex-direction: column;
  margin: 18rpx 24rpx 0;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  gap: 20rpx;
  padding: 16rpx 0;
  border-top: 1rpx solid #edf2f7;
}

.meta-item:first-child {
  border-top: 0;
}

.meta-label {
  flex: none;
  color: #64748b;
  font-size: 24rpx;
}

.meta-value {
  min-width: 0;
  color: #111827;
  font-size: 24rpx;
  text-align: right;
  word-break: break-all;
}

.device-section {
  margin-top: 30rpx;
  padding-bottom: 10rpx;
}

.device-section .panel-title {
  flex: 1;
  white-space: nowrap;
  word-break: keep-all;
}

.device-filter {
  flex: none;
  display: flex;
  align-items: center;
  padding: 4rpx;
  border: 1rpx solid #d8e2ea;
  border-radius: 12rpx;
  background: #eef4f7;
  box-sizing: border-box;
}

.device-filter-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72rpx;
  height: 42rpx;
  border-radius: 8rpx;
  color: #64748b;
  font-size: 21rpx;
  line-height: 1.2;
  font-weight: 800;
}

.device-filter-item.is-active {
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 4rpx 10rpx rgba(15, 23, 42, 0.08);
}

.device-scroll {
  height: 520rpx;
  box-sizing: border-box;
}

.empty-state {
  padding: 42rpx 28rpx;
  text-align: center;
}

.empty-title {
  color: #111827;
  font-size: 30rpx;
  line-height: 1.4;
  font-weight: 800;
}

.empty-text {
  margin-top: 10rpx;
  color: #6b7280;
  font-size: 25rpx;
  line-height: 1.45;
}

.device-card {
  margin-bottom: 18rpx;
  padding: 18rpx 20rpx;
}

.device-card--connected {
  border-color: #93d5cf;
  background: #f0fdfa;
}

.device-info {
  min-width: 0;
}

.device-main-row,
.device-meta-row {
  display: flex;
  align-items: center;
  gap: 14rpx;
}

.device-name {
  min-width: 0;
  flex: 1;
  color: #111827;
  font-size: 30rpx;
  line-height: 1.35;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-badges {
  flex: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18rpx;
}

.device-badges--stacked {
  justify-content: flex-start;
  gap: 14rpx;
  margin-top: 10rpx;
}

.device-id,
.device-service,
.device-target {
  margin-top: 8rpx;
  color: #64748b;
  font-size: 22rpx;
  line-height: 1.4;
  word-break: break-all;
}

.device-target {
  flex: none;
  color: var(--accent-dark);
  font-weight: 800;
}

.rssi {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 128rpx;
  height: 46rpx;
  padding: 0 10rpx;
  border-radius: 999rpx;
  background: #f1f5f9;
  color: #475569;
  font-size: 22rpx;
  line-height: 1.35;
  box-sizing: border-box;
  white-space: nowrap;
}

.connect-state {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112rpx;
  height: 46rpx;
  padding: 0;
  border-radius: 999rpx;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 22rpx;
  line-height: 1.35;
  white-space: nowrap;
}

.connect-state.connected {
  background: #dcfce7;
  color: #166534;
}

@media (max-width: 360px) {
  .device-card {
    padding: 16rpx;
  }

  .device-main-row {
    align-items: flex-start;
  }
}
