"I did not sleep all night, thinking about you."
Translation:Я не спал всю ночь, думая о тебе.
Technically it's not an object, it's just a way to show the duration. Accusative can have several meanings, and it's not always indicating an object.
It's not an object because a verb can have a real direct object alongside with an Accusative to indicate time:
- Я чита́ла кни́гу всю ночь. 'I was reading [a/the] book all night.' (direct object is кни́гу)
- Я учи́л ру́сский всю ночь. 'I was learning Russian all night.' (direct object is ру́сский)
All imperfective verbs can be used with such accusatives. It can also be used with some perfective verbs (most notably verbs with the prefix про-, indicating finishing doing something for a period of time):
- Я прожила́ в Гонконге три го́да. 'I lived in Hong Kong for 3 years.' (roughly equal to Я жила́ в Гонко́нге три го́да.)
- Я пробыла́ в Улан-Ба́торе две неде́ли. 'I stayed in Ulaanbaatar for 2 weeks.' (roughly equal to Я была́ в Улан-Ба́торе две неде́ли.)
Ok, here we have an intransitive verb (спать) and "всю ночь" cannot considered a real object, but the accusative is always used with a verb and expresses the direct object. It's the ambiguity :-\
Same with "сто́ить" (to cost): "Дом сто́ит миллион."
Can we consider "всю ночь" and "миллион" direct objects when used with intransitive verbs? For ease of study, I suppose, yes.
"Я прожила́ в Гонконге три го́да." is another example. "прожила́" is a transitive verb: "прожила́ - кого/что? - три го́да" (целых три года прожила́). "Я прошёл десять километров."
It's just a matter of definitions, I think.
A question about order: in another question in another skill, we were given Я всю ночь хотела пить. It doesn't seem as though there would be difference in emphasis needed - is there a stylistic or other reason to change the order? Just personal preference? See https://forum.duolingo.com/comment/22415237