/* XY H5：竖屏一套 / 横屏一套，都是手机画幅，互不复用 */
html.h5-land.mobile-app body,
html.h5-land.mobile-app #app,
html.h5-land.mobile-app .screen-page.active {
  max-width: none;
  width: 100%;
}

html.h5-land.mobile-app .stellar-bg,
html.h5-land.mobile-app .stellar-tap-fx,
html.h5-land.mobile-app #lock {
  max-width: none;
  width: 100%;
}

html.h5-land.mobile-app .toast-receipt {
  max-width: min(560px, calc(100% - 24px));
}

/* 电脑：竖窗口走 9:16 手机框；横窗口走 16:9 手机框 */
@media (hover: hover) and (pointer: fine) and (min-width: 720px) {
  html.h5-land.mobile-app body,
  html.h5-land.mobile-app #app {
    width: min(100vw, calc(100vh * 16 / 9));
    height: min(100vh, calc(100vw * 9 / 16));
    max-width: 960px;
    max-height: 100dvh;
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 64px rgba(0, 0, 0, 0.45);
  }
  html.h5-land.mobile-app .stellar-bg,
  html.h5-land.mobile-app #lock {
    width: min(100vw, calc(100vh * 16 / 9));
    max-width: 960px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* —— 登录：竖屏保持上下叠；横屏左品牌右表单 —— */
html.h5-land #screen-auth-phone.active .page-inner--flat,
html.h5-land #screen-auth-invite.active .page-inner--flat,
html.h5-land #screen-profile-setup.active .page-inner--flat {
  display: grid;
  grid-template-columns: minmax(200px, 0.85fr) minmax(280px, 1.15fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "brand tabs"
    "brand card"
    "brand foot";
  height: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  padding: 8px 14px;
  gap: 6px 16px;
  align-items: stretch;
  box-sizing: border-box;
}

html.h5-land #screen-auth-phone .hero-brand,
html.h5-land #screen-auth-invite .hero-brand,
html.h5-land #screen-profile-setup .hero-brand {
  grid-area: brand;
  margin: 0;
  align-self: center;
  justify-self: center;
}

html.h5-land #screen-auth-phone .hero-brand--mini .brand-fluid-img,
html.h5-land #screen-auth-invite .hero-brand--mini .brand-fluid-img {
  max-height: min(32vh, 150px);
  width: auto;
}

html.h5-land #screen-auth-phone .auth-tabs,
html.h5-land #screen-auth-invite .auth-tabs {
  grid-area: tabs;
  margin: 0;
}

html.h5-land #screen-auth-phone .auth-card,
html.h5-land #screen-auth-invite .auth-card,
html.h5-land #screen-profile-setup .profile-setup-card {
  grid-area: card;
  margin: 0;
  max-height: 100%;
  overflow: auto;
  padding: 8px 12px 10px;
}

html.h5-land #screen-auth-phone .auth-hint,
html.h5-land #screen-auth-invite .auth-hint {
  margin: 0 0 6px;
  font-size: 12px;
}

html.h5-land #screen-auth-phone label,
html.h5-land #screen-auth-invite label {
  margin: 4px 0 2px;
}

html.h5-land #screen-auth-phone input,
html.h5-land #screen-auth-invite input {
  padding: 8px 10px;
}

html.h5-land #screen-auth-phone .btn-main,
html.h5-land #screen-auth-invite .btn-main {
  margin-top: 8px;
  padding: 10px 12px;
}

html.h5-land #screen-auth-phone .page-foot,
html.h5-land #screen-auth-invite .page-foot,
html.h5-land #screen-profile-setup .page-foot {
  grid-area: foot;
  margin: 0;
  padding: 0;
}

html.h5-land #screen-auth-phone .page-foot,
html.h5-land #screen-auth-invite .page-foot,
html.h5-land #screen-profile-setup .page-foot {
  grid-area: foot;
  margin: 0;
}

html.h5-land #screen-profile-setup .profile-setup-card {
  grid-area: 1 / 2 / -1 / 3;
}

/* —— 首页：竖屏上下菜单；横屏左 Logo 右双列入口 —— */
html.h5-land #screen-home.active .page-inner--flat {
  display: grid;
  grid-template-columns: minmax(180px, 32%) 1fr;
  grid-template-rows: auto auto 1fr;
  height: 100dvh;
  max-height: 100dvh;
  padding: 8px 14px 10px;
  gap: 8px 16px;
  box-sizing: border-box;
}

html.h5-land #screen-home .hero-brand {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  margin: 0;
}

html.h5-land #screen-home .hero-brand--compact .brand-fluid-img--home {
  max-height: min(46vh, 240px);
  width: auto;
}

html.h5-land #screen-home #offBanner,
html.h5-land #screen-home #announceBanner {
  grid-column: 2;
}

html.h5-land #screen-home .home-menu {
  grid-column: 2;
  grid-row: 2 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow: auto;
  min-height: 0;
}

html.h5-land #screen-home .home-entry-cluster {
  grid-column: 1 / -1;
}

html.h5-land #screen-home .menu-row {
  min-height: 0;
  margin: 0;
}

/* 内页横屏：铺满 16:9 手机框，不再锁 430 竖条 */
html.h5-land .screen-page.active {
  padding-left: 12px;
  padding-right: 12px;
}

html.h5-land .screen-page.active .sub-bar {
  max-width: none;
}
