/* 640px 起使用侧栏；按可用宽度排版，不区分设备型号。手机沿用原页面。 */
.jg-wide-nav { display: none; }
@media (min-width: 640px) {
  :root { --jg-rail: 76px; --jg-gutter: 20px; --jg-page-max: 960px; font-size: 40px !important; }
  :root[data-jg-layout="hall"], :root[data-jg-layout="room"] { --jg-page-max: 1280px; }
  :root[data-jg-layout="auth"] { --jg-page-max: 1040px; }
  /* transform 让原页面的 fixed 头尾以内容区为基准，弹窗仍由原组件负责。 */
  #app { position: relative; width: min(calc(100% - var(--jg-rail) - var(--jg-gutter) * 2), var(--jg-page-max)) !important; height: 100%; height: var(--visual-viewport-height,100dvh); margin-left: calc(var(--jg-rail) + (100% - var(--jg-rail) - min(100% - var(--jg-rail) - var(--jg-gutter) * 2, var(--jg-page-max))) / 2); transform: translateZ(0); }
  #realapp, #realapp > *, .index-container > * { max-width: 100%; }
  #realapp { min-width: 0; height: 100% !important; }
  .jn-nav, .jg-wallet-nav, .bottom-taps { display: none !important; }
  .jg-wide-nav { position: fixed; inset: 0 auto 0 0; z-index: 10030; display: flex; flex-direction: column; width: var(--jg-rail); padding: max(16px,env(safe-area-inset-top)) 10px max(16px,env(safe-area-inset-bottom)); background: var(--jb-card); border-right: 1px solid var(--jb-line); color: var(--jb-ink); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; overscroll-behavior: contain; font-size: 14px; }
  .jg-wide-nav .jg-wide-brand { --jg-logo-inset: 8px; flex: none; display: flex; align-items: center; justify-content: center; position: relative; width: 48px; height: 44px; min-height: 44px; padding: 8px; margin: 0 auto 24px; background: transparent; border-radius: 14px; box-shadow: none; overflow: hidden; }
  .jg-wide-brand img { width: 142px; max-width: none; height: 32px; object-fit: contain; object-position: left; flex: none; margin-left: 106px; }
  .jg-wide-nav nav { display: grid; gap: 6px; }
  .jg-wide-nav :is(a:not(.jg-wide-brand),button) { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; width: 100%; border: 0; border-radius: 12px; padding: 10px; text-decoration: none; background: transparent; color: var(--jb-vice); font: inherit; cursor: pointer; }
  .jg-wide-nav svg { width: 23px; height: 23px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
  .jg-wide-nav :is(a,button) span, .jg-wide-nav__section > p { display: none; }
  .jg-wide-nav :is(a,button):hover { background: var(--jb-soft); color: var(--jb-brand); }
  .jg-wide-nav [aria-current="page"] { background: var(--jb-soft) !important; color: var(--jb-brand) !important; font-weight: 700 !important; box-shadow: inset 3px 0 var(--jb-brand); }
  .jg-wide-nav :is(a,button):focus-visible { outline: 2px solid var(--jb-brand); outline-offset: 2px; }
  .jg-wide-nav__section { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--jb-line); }
  .jg-wide-nav__foot { margin-top: auto; padding-top: 24px; }
  :root[data-jg-mode="dark"] .jg-wide-nav :is(a:not(.jg-wide-brand),button) { color: #c1d0e6 !important; }
  :root[data-jg-mode="dark"] .jg-wide-nav a[aria-current="page"] { color: #85baff !important; background: #203754 !important; }
  .hallPage .maincontent { padding-bottom: 24px !important; }
  .hallPage .toppart { padding-inline: 0; }
  .hallPage.jg-hero-hall { --jg-hero-header: 68px; }
  .hallPage.jg-hero-hall > .head_area { width: 100%; max-width: none; padding-inline: 20px !important; }
  .hallPage.jg-hero-hall .jg-hero-brand { visibility: hidden; }
  :root .jg-hero-hall .jg-brand-hero { width: calc(100% - 24px); max-width: none; height: 250px; margin: 0 auto 16px; border-radius: 24px; }
  .jg-brand-hero__copy { padding: 28px 0 0 32px; width: 55%; }
  .jg-brand-hero__copy h2 { font-size: 38px; }
  .jg-brand-hero__copy p { font-size: 15px; margin-top: 18px; }
  .jg-brand-hero__person { right: 0; top: 0; height: 300px; }
  .hallPage .centerArea, .hallPage .noticecontent { width: calc(100% - 24px) !important; max-width: none; margin-inline: auto; }
  .jg-play-grid, .jg-extras { width: calc(100% - 24px); max-width: 620px; }
  .jg-play-grid { gap: 14px !important; }
  .jg-extras { margin-inline: auto; }
  .jg-sheet { left: var(--jg-rail); max-height: var(--visual-viewport-height,100dvh); }
  .jg-sheet__head { flex: none; min-height: 64px; padding-inline: 24px; }
  .jg-sheet__body { width: 100%; max-width: 1280px; align-self: center; padding: 24px; min-height: 0; }
  :root .jg-lobby__grid, .jg-art-grid, .jg-partner-games .jg-art-grid { grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap: 18px; }
  .jg-art-search { min-height: 44px; max-width: 520px; }
  .jg-art-filters button, .jg-art-more { min-height: 44px; }
  .jg-partner-list { grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); }
  .jg-lobby__seg { max-width: 720px; margin-inline: auto; }
  /* 固定视口宽度的旧页面改为所在内容区宽度。 */
  :is(.security-v3__panel,.invite-v3__footer,.down-line-list,.actual-transfer,.transfer-done,.people-bill-v3 .filter,.support-copy-menu-mask,.copy-menu-mask) { width: 100% !important; max-width: 100%; }
  .recent-games-v3 .accounts-list .accounts-swipe-cell { width: 100%; }
  .persondetail.person-detail-v3 .personhead { width: 100%; }
  .van-dialog { width: min(460px,calc(100% - 32px)) !important; max-height: calc(var(--visual-viewport-height,100dvh) - 32px); overflow-y: auto; }
  .van-popup--bottom:not(.pc28-standard-sheet--credit) { max-height: 90%; }
  body > .van-popup--bottom { left: var(--jg-rail); right: 0; width: calc(100% - var(--jg-rail)); }
  body > .Login-window.van-popup { left: var(--jg-rail) !important; width: calc(100% - var(--jg-rail)) !important; position: fixed !important; max-height: var(--visual-viewport-height,100dvh) !important; height: var(--visual-viewport-height,100dvh); }
  body > .van-popup--center, body > .van-dialog { left: calc(50% + var(--jg-rail) / 2); }
  .van-popup--center { max-width: calc(100% - 32px); max-height: calc(var(--visual-viewport-height,100dvh) - 32px); overflow-y: auto; }
  .jg-payments .rcinner, .jg-payments .withdrawMain { max-width: 720px; margin-inline: auto; }
  .jg-payments .newContent { padding-bottom: 28px !important; }
  .activity .activecont .activeinner { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 16px; padding: 20px; }
  .activity .activecont .activebox { width: 100%; height: auto; aspect-ratio: 2.3; margin: 0 !important; }
  .activity .activecont .activebox .itemBg { width: 100%; height: 100%; object-fit: cover; }
  .activity .contentsdsinner { max-width: 720px; margin-inline: auto; }
  .jg-crash-frame { left: var(--jg-rail) !important; width: calc(100% - var(--jg-rail)) !important; height: var(--visual-viewport-height,100dvh) !important; }
  /* 信用盘继续使用原 Vue 面板，只调整宽度及可点击面积。 */
  :root.jg-bet-room .pc28-standard-sheet--credit .pc28-credit-content { width: 100% !important; max-width: none !important; }
  :root.jg-bet-room .pc28-standard-sheet--credit .pc28-credit-center { margin: 0 12px !important; }
  :root.jg-bet-room .credit-option { min-height: 54px; }
  :root.jg-bet-room .credit-groups button { min-height: 44px; }
  :root.jg-bet-room .jg-bet-tabs button { min-height: 44px; }
  :root.jg-bet-room .jg-draw__balls { justify-content: center; gap: 20px; }
  :root.jg-bet-room .pc28-standard-sheet--credit .botconentent { flex: 0 0 auto !important; height: auto !important; }
  :root.jg-bet-room .botconentent .pc28-credit-amounts__bar { min-height: 44px; }
  :root.jg-bet-room .botconentent :is(.pc28-credit-amounts,.pc28-credit-amounts__bar,.bottom1-select) { height: 44px !important; }
  :root.jg-bet-room .botconentent :is(.bottom1-del,.moneyselectItem,.quick-entry,.setmoney) { min-height: 44px !important; }
  :root.jg-bet-room .zhuotou-source-chrome .header .back { position: absolute; left: 12px; width: 44px; }
  :root.jg-bet-room .zhuotou-source-chrome .header .right-set { position: absolute; right: 112px; width: 44px; }
  .liuhe-gameplay { max-width: 100% !important; }
  .jg-auth-page:not(#_) .loginInner { padding-inline: max(24px,calc(50% - 280px)); }
  :root .jg-auth-page { overflow-y: auto; }
}
@media (min-width: 640px) and (max-width: 1099px) {
  .jg-wide-nav .jg-wide-brand::after { display: none; }
}
@media (min-width: 1100px) {
  :root { --jg-rail: 216px; --jg-gutter: 28px; }
  .jg-wide-nav { padding-inline: 18px; }
  .jg-wide-nav .jg-wide-brand { width: 172px; height: 48px; margin-bottom: 28px; border-radius: 999px; }
  .jg-wide-brand img { margin-left: 0; width: 148px; height: auto; }
  .jg-wide-nav :is(a:not(.jg-wide-brand),button) { justify-content: flex-start; padding-inline: 16px; }
  .jg-wide-nav :is(a,button) span { display: inline; }
  .jg-wide-nav__section > p { display: block; margin: 0 16px 12px; color: var(--jb-assist); font-size: 12px; }
  .hallPage .toppart { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 20px; align-items: start; }
  .hallPage .toppart > .jg-brand-hero, .hallPage .toppart > .centerArea, .hallPage .toppart > .noticecontent { grid-column: 1 / -1; }
  :root .jg-hero-hall .jg-brand-hero { height: 240px; margin-bottom: 0; }
  .jg-brand-hero__copy { padding: 20px 0 0 44px; }
  .jg-brand-hero__copy h2 { font-size: 44px; }
  .jg-brand-hero__person { right: 10%; height: 310px; }
  .hallPage .centerArea { margin-block: 0 !important; }
  .jg-play-grid, .jg-extras { width: 100%; max-width: none; margin: 0 !important; }
  .jg-play-grid { padding-left: 12px; }
  .jg-extras { padding-right: 12px; }
  .jg-footer__panel { margin-top: 20px; }
  .jg-footer__contact { padding-block: 24px; }
  .jg-footer__contact h3 { font-size: 20px; }
  .jg-auth-page:not(#_) .loginInner { display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,460px); grid-template-rows: auto 1fr; gap: 0 28px; align-content: start; align-items: center; min-height: 100%; padding: 28px 28px 40px; background-size: 100% 100%; }
  .jg-auth-page .jg-auth-header { grid-column: 1 / -1; margin: 0 0 24px; }
  .jg-auth-page .jg-auth-banner { height: 400px; margin: 0; align-self: center; }
  .jg-auth-banner__default { padding: 24px 8px 0; }
  .jg-auth-banner__default img { max-width: 100%; height: 82%; right: -24px; }
  .jg-auth-banner__default strong { font-size: 32px; }
  .jg-auth-banner--configured { height: auto !important; width: 100%; aspect-ratio: 2.64; }
  .jg-auth-page:not(#_) .loginPage { align-self: center; padding: 28px; }
  :root.jg-bet-room .pc28-standard-sheet--credit .botconentent { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,35%); align-items: center; gap: 20px; }
  :root.jg-bet-room .botconentent :is(.pc28-credit-amounts,.pc28-credit-amounts__bar,.btoclassline) { width: 100% !important; max-width: none !important; margin: 0 !important; }
  :root.jg-bet-room .botconentent .bottom1-select { flex: 1; min-width: 0; }
  :root.jg-bet-room .botconentent .setmoney { width: 90px !important; }
}
@media (min-width: 640px) and (max-height: 600px) {
  .jg-wide-nav { padding-block: 8px; }
  .jg-wide-nav .jg-wide-brand { margin-bottom: 8px; }
  .jg-wide-nav nav { gap: 2px; }
  .jg-wide-nav__section { margin-top: 8px; padding-top: 8px; }
  .jg-wide-nav__foot { padding-top: 12px; }
  :root .jg-hero-hall .jg-brand-hero { height: 210px; }
  .jg-brand-hero__person { height: 260px; }
  :root.jg-bet-room .jg-draw { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: 4px 12px; padding-block: 8px; }
  :root.jg-bet-room .jg-draw__head { grid-column: 1; grid-row: 1; }
  :root.jg-bet-room .jg-draw__head h2 { font-size: 12px; }
  :root.jg-bet-room .jg-draw__balls { grid-column: 1; grid-row: 2; margin: 0; padding: 0; gap: 12px; min-height: 40px; }
  :root.jg-bet-room .jg-ball { width: 34px; height: 34px; font-size: 18px; }
  :root.jg-bet-room .jg-draw__next { grid-column: 2; grid-row: 1 / 3; display: grid; gap: 4px; margin: 0; padding: 6px 10px; }
  :root.jg-bet-room .jg-draw__ring { display: none; }
  :root.jg-bet-room .jg-draw__wallet { align-items: center; flex-direction: row; justify-content: space-between; }
}
