html {
      background: #444;
      font-family: sans-serif;
    }

    body, html {
      overscroll-behavior: none;
    }

    #canvas, #overlayDiv {
      position: absolute;
      top: 0px;
      left: 0px;

      width: 100%;
      height: 100%;

      border: 0 none;
    }

    #canvas {
      background: #000;
    }

    .visible {
      visibility: visible;
      opacity: 1.0;
      transition: opacity .1s linear;
    }

    .hidden {
      visibility: hidden;
      opacity: 0;
      transition: visibility 0s .25s, opacity .25s linear;
    }

    #statusDiv, #inputDiv {
      background: rgba(0, 0, 0, 0.75);
      width: 50%;
      margin: auto;
      min-width: 340px;
      padding: 10px;

      position: absolute;
      top: 0;
      left: 0;
      right: 0;

      border-radius: 0 0 5px 5px;
    }

    #statusTextDiv {
      overflow: auto;
      max-height: 40vh;
      color: #ccc;
      font-size: 14px;
    }

    #statusProgress {
      display: none;
      width: 100%;
    }

    #inputDiv {
      width: 65%;
      padding-left: 10px;
      padding-right: 20px;
    }

    #inputPrompt {
      color: #eee;
      font-size: 150%;
      margin-bottom: 1em;
      margin-top: 1em;

    }

    #inputText {
      width: 100%;
      font-size: 175%;
      padding: 5px;
      background: inherit;
      color: #eee;
    }

    #inputText:focus {
      color: #ffffff;
    }

    #ContextContainer {
      position: absolute;
      left: 0px;
      top: 0px;
      color: white;
    }

    #ContextContainer.shown {
      background: rgba(0, 0, 0, 0.5);
      border-radius: 0px 0px 5px 0px;
    }

    #ContextButton {
      text-decoration: none;
      color: lightgrey;
      font-size: xx-large;
      cursor: pointer;
      user-select: none;
      -moz-user-select: none;
      padding: 10px 10px;
      opacity: .75;
    }

    #ContextButton:focus {
      outline: none;
      color: #ffffff;
      opacity: 1.0;
    }

    #ContextMenu a {
      text-decoration: none;
      color: lightgrey;
      background: #444;
      height: 48px;
      width: 250px;
      border-radius: 5px;
      border: 1px solid lightgrey;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 5px 5px;
      opacity: 1.0;
    }

    #ContextMenu a:hover {
      text-decoration: none;
      background: #666666;
      color: #ffffff
    }

    #presplash {
        position: absolute;
        top: 0;
        left: 0;
        display: block;
        margin: auto;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

/* ===== 分块：head 样式 / 移动端加载界面样式 ===== */
html, body {
      height: 100%;
      height: 100dvh;
      margin: 0; padding: 0;
      overflow: hidden;
      overscroll-behavior: none;
      background: #000;
      touch-action: none;
      -webkit-user-select: none;
      user-select: none;
      -webkit-touch-callout: none;
      -webkit-tap-highlight-color: transparent;
      -webkit-text-size-adjust: 100%;
    }
    #statusTextDiv { max-height: 22vh !important; }
    #statusDiv { max-width: 92vw !important; }
    #canvas, #overlayDiv {
      width: 100vw !important;
      height: 100vh !important;
      height: 100dvh !important;
      touch-action: none;
    }
    /* 触摸设备上把自带的小菜单按钮放大一点 */
    @media (pointer: coarse) {
      #ContextButton { width: 44px !important; height: 44px !important; line-height: 44px !important; }
    }

/* ===== 分块：head 样式 / 移动端加载界面样式 ===== */
#gf-loading {
      position: fixed; inset: 0; z-index: 99998;
      display: flex; align-items: center; justify-content: center;
      background: radial-gradient(circle at 50% 35%, #1d2a4a 0%, #0b1020 70%);
      color: #e8eefc; font: 15px/1.7 -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
      text-align: center; padding: 24px;
      transition: opacity .45s ease;
    }
    #gf-loading.gf-out { opacity: 0; pointer-events: none; }
    .gf-box { width: 100%; max-width: 340px; }
    .gf-logo { font-size: 17px; font-weight: 600; letter-spacing: .5px; margin-bottom: 18px; color: #cfe0ff; }
    .gf-stage { font-size: 13px; color: #9fb2d4; margin-bottom: 10px; min-height: 22px; }
    .gf-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
    .gf-bar i {
      display: block; height: 100%; width: 0%;
      border-radius: 99px;
      background: linear-gradient(90deg, #6ea8fe, #a78bfa);
      transition: width .25s ease;
    }
    .gf-pct { font-size: 12px; color: #7f92b3; margin-top: 8px; font-variant-numeric: tabular-nums; }
    .gf-tip { font-size: 11.5px; color: #64748b; margin-top: 20px; line-height: 1.6; }

    #gf-rotate {
      position: fixed; inset: 0; z-index: 99999;
      background: rgba(6,10,20,.94); color: #dbe6ff;
      display: flex; align-items: center; justify-content: center; text-align: center;
      font: 15px/1.7 -apple-system, "PingFang SC", system-ui, sans-serif;
    }
    #gf-rotate[hidden] { display: none; }
    .gf-rot-icon { font-size: 46px; margin-bottom: 6px; animation: gfspin 2.4s ease-in-out infinite; }
    @keyframes gfspin { 0%,100%{transform:rotate(0)} 50%{transform:rotate(90deg)} }
    #gf-rotate button {
      margin-top: 18px; padding: 9px 22px; border-radius: 99px;
      border: 1px solid rgba(255,255,255,.25); background: transparent;
      color: #9fb2d4; font-size: 13px;
    }

    #gf-fs {
      position: fixed; top: calc(8px + env(safe-area-inset-top)); right: calc(8px + env(safe-area-inset-right));
      z-index: 99997; width: 34px; height: 34px; border-radius: 9px;
      align-items: center; justify-content: center; padding: 0;
      border: 1px solid rgba(255,255,255,.14); background: rgba(10,14,26,.45);
      color: #cbd5e1; font-size: 15px; line-height: 1; opacity: .22;
      -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
      display: none;
    }
    #gf-fs:active { opacity: .8; }
    @media (pointer: coarse) { #gf-fs { display: flex; } }

    #gf-toast {
      position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
      transform: translateX(-50%);
      max-width: 86vw; padding: 8px 16px; border-radius: 99px;
      background: rgba(12,16,28,.86); border: 1px solid rgba(255,255,255,.14);
      color: #cbd5e1; font: 12.5px/1.5 -apple-system, "PingFang SC", system-ui, sans-serif;
      z-index: 99996; text-align: center;
      -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    }
    #gf-toast[hidden] { display: none; }

    #gf-err {
      position: fixed; inset: 0; z-index: 100000; display: none;
      background: #140d12; color: #f8d4d4; padding: 26px 20px; overflow: auto;
      font: 13.5px/1.85 -apple-system, "PingFang SC", system-ui, sans-serif;
      -webkit-user-select: text; user-select: text;
    }
    #gf-err h3 { margin: 0 0 12px; font-size: 15px; color: #ff9c9c; }
    #gf-err pre {
      white-space: pre-wrap; word-break: break-all; font-size: 12px;
      background: rgba(255,255,255,.05); padding: 10px; border-radius: 8px; margin: 0 0 16px;
    }
    #gf-err ul { padding-left: 18px; margin: 0; }
    #gf-err li { margin-bottom: 8px; }
