* { box-sizing: border-box; }
      html, body { margin: 0; min-height: 100%; width: 100%; }
      html { overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: none; }
      body {
        --page-width: min(100vw, 820px, calc((100vh - 24px - env(safe-area-inset-bottom, 0px)) * .6));
        --page-width: min(100vw, 820px, calc((100dvh - 24px - env(safe-area-inset-bottom, 0px)) * .6));
        --download-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        --download-height: calc(var(--page-width) * .86875 * 265 / 1112);
        background: #091008; color: #fff; font-family: Arial, sans-serif;
      }
      button, a { -webkit-tap-highlight-color: transparent; }
      button { font: inherit; }
      button:focus-visible, a:focus-visible, iframe:focus-visible {
        outline: 3px solid #fff1a0; outline-offset: 4px;
      }
      .bodyC {
        min-height: 100vh;
        min-height: 100dvh;
        background: #091008;
      }
      /* 1. 将容器改为 Grid 布局，让所有层在同一网格重叠 */
      .content {
        position: relative;
        width: var(--page-width);
        margin: 0 auto;
        min-height: 100dvh;
        
        /* 关键：使用 grid 布局，子元素重叠排列，容器高度由最长的内容自动撑开 */
        display: grid;
        grid-template-areas: "overlay";
        
        /* 背景图按照 100% 宽度自适应，高度自动（按原图比例延伸，不再硬拉伸） */
        background: url("../img/bg1.png") center top / 100% auto no-repeat;
        isolation: isolate;
        box-shadow: 0 0 80px #0009;

        /* 底部仅保留下载按钮所需的实际高度，不多留空白 */
        padding-bottom: calc(var(--download-bottom) + var(--download-height) + 16px);
      }

      /* 让所有原本 absolute 的核心子元素映射到同一网格区域 */
      .content > * {
        grid-area: overlay;
      }

      /* 2. 保持 center-banner 位置不变，同时让它参与撑开容器 */
      .center-banner {
        position: relative; /* 参与容器高度计算 */
        width: 100%;
        height: auto;
        margin-top: 151.5%; /* 保持原本 151.5% 的相对位置不偏离 */
        display: block;
        z-index: 0;
        pointer-events: none;
      }

      /* 3. 确保游戏 Frame 和左右侧栏依然相对于容器顶部定位 */
      .game-iframe-wrapper {
        position: absolute; left: 21%; top: 0; margin-top: 34.5876%; width: 58%;
        aspect-ratio: 9 / 16; z-index: 1;
        background: #100e0b; overflow: hidden;
      }

      .game-rail {
        position: absolute; top: 0; margin-top: 29.8315%; padding: 0; border: 0;
        background: none; cursor: pointer; z-index: 3;
        transition: filter .2s;
      }  
      .game-iframe-wrapper iframe {
        display: block; width: 100%; height: 100%; border: 0;
        pointer-events: auto;
        /* 触摸事件交由 Unity 画布处理，避免外层 iframe 改写移动端手势。 */
        touch-action: auto;
      }
    
      .game-rail:hover { filter: brightness(1.12); }
      .game-rail img { display: block; width: 100%; height: auto; }
      .game-rail-left { left: 1.65%; width: 18.671875%; }
      .game-rail-right { right: 1.35%; width: 18.828125%; }
      .download {
        position: fixed; bottom: var(--download-bottom); left: 50%;
        transform: translateX(-50%); width: calc(var(--page-width) * .86875);
        padding: 0; border: 0; background: none; cursor: pointer; z-index: 4;
        transition: filter .2s;
      }
      .download:hover { filter: brightness(1.12); }
      .download img { width: 100%; height: auto; display: block; }
      @keyframes download-pulse {
        0%, 100% { transform: scale(.95); filter: brightness(1); }
        50% { transform: scale(1.03); filter: brightness(1.22); }
      }
      .download img, .superwild-install img {
        transform-origin: center;
        animation: download-pulse 1.4s ease-in-out infinite;
      }
      #superwild-popup {
        width: min(calc(var(--page-width) * .84), calc((100vh - 48px) * 630 / 790));
        width: min(calc(var(--page-width) * .84), calc((100dvh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 630 / 790));
        max-width: none; max-height: none; padding: 0; border: 0;
        margin: auto; transform: translateY(-4vh) scale(1);
        transform-origin: center center;
        color: #fff; background: transparent; overflow: visible;
      }
      @keyframes superwild-popup-in {
        0% { opacity: 0; transform: translateY(calc(-4vh + 44px)) scale(.72); }
        58% { opacity: 1; transform: translateY(calc(-4vh - 6px)) scale(1.035); }
        80% { opacity: 1; transform: translateY(calc(-4vh + 2px)) scale(.992); }
        100% { opacity: 1; transform: translateY(-4vh) scale(1); }
      }
      @keyframes superwild-popup-out {
        from { opacity: 1; transform: translateY(-4vh) scale(1); }
        to { opacity: 0; transform: translateY(calc(-4vh + 12px)) scale(.94); }
      }
      @keyframes superwild-detail-in {
        from { opacity: 0; transform: translateY(16px) scale(.9); }
        to { opacity: 1; transform: translateY(0) scale(1); }
      }
      @keyframes superwild-backdrop-in {
        from { opacity: 0; }
        to { opacity: 1; }
      }
      @keyframes superwild-backdrop-out {
        from { opacity: 1; }
        to { opacity: 0; }
      }
      #superwild-popup[open] {
        animation: superwild-popup-in .72s cubic-bezier(.22, 1, .36, 1) both;
      }
      #superwild-popup[open]::backdrop {
        background: #0009;
        animation: superwild-backdrop-in .38s ease-out both;
      }
      #superwild-popup.is-closing {
        animation: superwild-popup-out .22s ease-in both;
      }
      #superwild-popup.is-closing::backdrop {
        animation: superwild-backdrop-out .22s ease-in both;
      }
      html.superwild-scroll-locked { overflow: hidden; }
      body.superwild-scroll-locked { overflow: hidden; }
      .superwild-art {
        display: block; width: 100%; height: auto;
        filter: drop-shadow(0 18px 28px #0005);
      }
      .superwild-logo {
        /* 原图 630 × 790：Logo 位于 (182, 208)，显示为 260 × 164。 */
        position: absolute; left: 28.888889%; top: 26.329114%; width: 41.269841%; height: auto;
        display: block; pointer-events: none;
      }
      .superwild-title {
        position: absolute; left: 5.71%; top: 51.3%; width: 88.58%; height: auto;
        display: block; pointer-events: none;
      }
      #superwild-popup[open] .superwild-title {
        animation: superwild-detail-in .48s cubic-bezier(.16, 1, .3, 1) .18s both;
      }
      #superwild-popup[open] .superwild-install {
        animation: superwild-detail-in .42s cubic-bezier(.16, 1, .3, 1) .3s both;
      }
      .superwild-close, .superwild-install {
        position: absolute; padding: 0; border: 0; background: none; cursor: pointer;
      }
      .superwild-close { right: 0; top: 25.5%; width: 7.62%; min-width: 32px; }
      .superwild-close:focus { outline: none; box-shadow: none; }
      .superwild-install { left: 5.71%; top: 84.5%; width: 88.58%; }
      .superwild-close img, .superwild-install img { display: block; width: 100%; height: auto; }
      .superwild-install:hover { filter: brightness(1.12); }
      .visually-hidden {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
      }
      .slider {
        /* 各端都在页面右边缘以内，底部与固定下载按钮留出间距。 */
        --item-width: 44px;
        --item-height: 44px;
        --panel-width: 60px;
        position: fixed;
        right: max(
          env(safe-area-inset-right, 0px),
          calc((100vw - var(--page-width)) / 2 - 7px)
        );
        bottom: calc(var(--download-bottom) + var(--download-height) + 16px); z-index: 10;
        display: flex; flex-direction: column; gap: 8px;
        width: var(--panel-width); padding: 8px;
        border-radius: 14px 0 0 14px;
        background: linear-gradient(155deg, #1d321cf2, #08110ef2 76%);
        box-shadow: -4px 8px 24px #0006, inset 1px 0 #d6b25d70, inset 0 1px #fff2;
        backdrop-filter: blur(10px);
        transition: gap .3s ease;
      }
      .slider-toggle {
        flex-shrink: 0; width: var(--item-width); height: var(--item-height); padding: 5px;
        border: 1px solid #d6b25d30; border-radius: 11px;
        background: #07100db3 url("../img/sidebar-expand.svg") center / contain no-repeat;
        background-origin: content-box;
        cursor: pointer;
        transition: background-color .2s, border-color .2s, transform .2s, box-shadow .2s;
      }
      .slider-toggle:hover { transform: translateY(-2px); border-color: #f7d77c; background-color: #182a18; box-shadow: 0 5px 12px #0006; }
      .slider-toggle:active { transform: scale(.94); }
      .slider[data-collapsed="true"] .slider-toggle {
        background-image: url("../img/sidebar-collapse.svg");
      }
      .slider-links { display: flex; flex-direction: column; gap: 8px; overflow: hidden; width: 100%; max-height: 240px; opacity: 1; visibility: visible; transition: max-height .3s ease, opacity .2s ease, visibility 0s; }
      .slider a { flex-shrink: 0; width: var(--item-width); height: var(--item-height); display: block; padding: 5px; border: 1px solid #d6b25d30; border-radius: 11px; background: #07100db3; transition: transform .2s, border-color .2s, background .2s, box-shadow .2s; }
      .slider a:hover { transform: translateY(-2px); border-color: #f7d77c; background: #182a18; box-shadow: 0 5px 12px #0006; }
      .slider img { width: 100%; height: 100%; display: block; }
      .slider[data-collapsed="true"] { gap: 0; }
      .slider[data-collapsed="true"] .slider-links { max-height: 0; opacity: 0; visibility: hidden; pointer-events: none; transition: max-height .3s ease, opacity .2s ease, visibility 0s .3s; }
      @media (max-width: 1100px) {
        /* 小屏按可用宽度展示内容，不再随屏幕高度缩小页面。 */
        body { --page-width: min(100vw, 820px); }
        /* 保持与 PC 相同的页内定位，仅缩小入口尺寸。 */
        .slider {
          --item-width: 55px;
          --item-height: 55px;
          --panel-width: 71px;
          border-radius: 12px 0 0 12px;
        }
      }
      @media (prefers-reduced-motion: reduce) {
        .game-rail, .download, .download img, .superwild-install img,
        .slider, .slider-toggle, .slider-links, .slider a,
        #superwild-popup[open], #superwild-popup[open]::backdrop,
        #superwild-popup[open] .superwild-title, #superwild-popup[open] .superwild-install,
        #superwild-popup.is-closing, #superwild-popup.is-closing::backdrop {
          animation: none;
          transition: none;
        }
      }
