/* Let each chapter breathe with the window height, without clipping content. */
@media (min-width: 1024px) {
  header, main > section[data-screen-label], footer { max-width:1440px !important; }
  main > section[data-screen-label] {
    min-height:calc(100svh - 64px);
    display:flex;
    flex-direction:column;
    justify-content:center;
    padding-top:clamp(56px,8vh,112px) !important;
    padding-bottom:clamp(56px,8vh,112px) !important;
  }
  main > #us {
    min-height:calc(100svh - 140px);
    justify-content:flex-start;
    padding-top:clamp(32px,3vh,48px) !important;
    padding-bottom:clamp(40px,6vh,80px) !important;
  }
  #us > div:nth-child(2) { flex-wrap:nowrap !important; }
  #us > div:nth-child(2) > div { flex-basis:0 !important; }
  #us nav[aria-label="本期目录"] { flex-basis:0 !important; }
}

@media (min-width:1024px) {
  #us > div:nth-child(2) { margin-top:auto !important; margin-bottom:auto; padding-top:36px; padding-bottom:24px; }
  #voice > div:nth-child(2) { display:grid !important; grid-template-columns:minmax(280px,.8fr) minmax(0,1.55fr); gap:clamp(40px,5vw,80px) !important; }
}

/* Layout is available before the first render, at every window width. */
html { scrollbar-gutter: stable; }
main > section[data-screen-label] > div { min-width:0; }
@media (min-width:1024px) {
  :is(#works,#journeys,#everyday,#next) > div:nth-child(2) {
    display:grid !important;
    grid-template-columns:minmax(260px,1fr) minmax(0,1.55fr);
    gap:clamp(32px,4vw,64px) !important;
  }
  :is(#journeys,#next) > div:nth-child(2) { grid-template-columns:minmax(0,1.55fr) minmax(260px,1fr); }
  :is(#journeys,#next) > div:nth-child(2) > div:first-child { grid-column:2;grid-row:1; }
  :is(#journeys,#next) > div:nth-child(2) > div:last-child { grid-column:1;grid-row:1; }
}
@media (max-width:1023px) {
  main > section[data-screen-label] { width:100%; padding-top:48px !important; padding-bottom:56px !important; }
  #us { padding-top:24px !important; }
  :is(#us,#works,#journeys,#everyday,#voice,#next) > div:nth-child(2) {
    display:grid !important; grid-template-columns:minmax(0,1fr); gap:36px !important;
  }
  :is(#us,#works,#journeys,#everyday,#voice,#next) > div:nth-child(2) > * { width:100%;min-width:0;max-width:100% !important; }
  #us nav[aria-label="本期目录"] { max-width:600px !important; }
  #caption-frame { height:560px !important; }
}
@media (max-width:480px) {
  header { padding-inline:20px !important; }
  #us h1 + figure + figure + p { margin-top:64px !important; }
  main > section[data-screen-label] > div:first-child { gap:12px;flex-wrap:wrap;line-height:1.6 !important; }
}

/* Title + portraits scale together with the column width (phone → small desktop → fullscreen). */
#us > div:nth-child(2) > div:first-child{container-type:inline-size}
#us .cover-art{position:relative;width:100%;height:45.8cqw}
#us .cover-art [data-cover-title]{font-size:47.5cqw!important;padding-top:.2em!important}
#us .cover-art [data-polaroid]:nth-of-type(1){width:26.8cqw!important;top:-1cqw!important;right:9cqw!important;left:auto!important}
#us .cover-art [data-polaroid]:nth-of-type(2){width:24.9cqw!important;top:17.8cqw!important;right:-1.3cqw!important;left:auto!important}
#us .cover-art [data-polaroid] figcaption{font-size:max(13px,2.75cqw)!important}
@media(min-width:1024px){
 #us > div:nth-child(2){display:grid!important;grid-template-columns:minmax(0,1fr) minmax(280px,420px);gap:clamp(40px,6vw,88px)!important;width:100%}
}

/* 桌面端底部有固定导航栏，音乐按钮（螃蟹随它站）提到导航栏上方 */
@media(min-width:1024px){#music-global{bottom:72px!important}}
