.site-header:has(li:nth-last-child(n + 4)) { --layout-2: true; } 有了这个,当导航项有4个或更多时,我们设置变量--layout /* This will only works if the --layout-2 CSS variable is set */ @container style(--layout-2: true) {