/* Main-site interior pages only. The homepage keeps its existing layout.
   Local note: React renders <header> inside #root, so direct-child (>)
   selectors from the origin are relaxed to descendant selectors. */
body.interior-page header.interior-header {
  display:grid;
  grid-template-columns:44px auto minmax(0,1fr);
  align-items:center;
  column-gap:12px;
  height:76px;
  min-height:76px;
  padding:0 clamp(16px,3vw,46px);
  box-sizing:border-box;
}
.interior-header > .honglou-brand { grid-column:2; margin:0; }
.interior-header > :is(.header-actions,.language-picker,select) {
  grid-column:3; justify-self:end; margin:0; min-width:0;
}
.interior-header > .header-actions { display:flex; align-items:center; gap:8px; }
.interior-header #header-wallet:not([hidden]) { display:inline-flex; min-height:44px; }
html[dir="rtl"] .interior-header > .header-actions { margin:0; }
.interior-page .interior-header :is(#series-back-link,#legal-back,.page-back) {
  grid-column:1; grid-row:1; position:relative; inset:auto;
  display:inline-flex; align-items:center; justify-content:center;
  inline-size:44px; block-size:44px; width:44px; height:44px;
  min-width:44px; min-height:44px; min-inline-size:44px; min-block-size:44px;
  padding:0; margin:0; gap:0; transform:none; box-sizing:border-box;
  border:1px solid #42534c; border-radius:12px; background:#17231d; color:#dbe2da;
  text-decoration:none; cursor:pointer;
  transition:background-color .15s,border-color .15s;
}
.interior-header .page-back::before {
  content:''; display:block; flex:0 0 20px; inline-size:20px; block-size:20px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 12H5m6-6-6 6 6 6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 12H5m6-6-6 6 6 6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.interior-page .interior-header :is(#series-back-link,#legal-back,.page-back) > .page-back-label {
  position:absolute; inline-size:1px; block-size:1px; padding:0; margin:-1px;
  overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
.interior-header .page-back:hover { background:#21362b; border-color:#68a48c; }
.interior-header .page-back:focus-visible { outline:2px solid #35dda5; outline-offset:3px; }
html[dir="rtl"] .interior-header .page-back::before { transform:rotate(180deg); }
@media(max-width:700px) {
  body.interior-page header.interior-header { height:70px; min-height:70px; padding:0 14px!important; column-gap:8px; }
}
@media(max-width:360px) {
  body.interior-page header.interior-header { padding-inline:10px!important; column-gap:6px; }
  .interior-header > .honglou-brand { gap:4px; }
  .interior-header > .honglou-brand .brand-emblem { display:block; width:22px; height:29px; }
  .interior-header > .honglou-brand .brand-cn { font-size:20px; letter-spacing:1px; }
  .interior-header > .honglou-brand .brand-cn small { letter-spacing:2px; }
  .interior-header > .header-actions { gap:6px; }
  .interior-header #header-wallet { padding-inline:8px; gap:4px; }
  .interior-header .header-login { padding-inline:10px; }
}
@media(prefers-reduced-motion:reduce) { .interior-header .page-back { transition:none; } }

/* Local note: origin uses `body.series-detail-page > .site-header{width:100%}`
   (style.css:138). With <header> inside #root that direct-child selector no longer
   matches, so the header keeps its `margin:0 auto` and shrinks to its content. */
body.series-detail-page header.site-header { width: 100%; }

/* Local note: React mounts <header>/<main>/<footer> inside #root, so #root has to
   take over the flex column that body is on the origin; otherwise main{flex:1}
   cannot grow and the footer sticks to the content instead of the viewport. */
html body.interior-page div#root,
html body.series-detail-page div#root {
  display:flex; flex-direction:column; flex:1 0 auto; min-height:0;
}