
  .tut-bar {
    position: absolute; left: 12px; right: 12px;
    top: calc(148px + env(safe-area-inset-top));
    display: none; align-items: center; gap: 8px;
    padding: 18px 24px;
    border: 26px solid transparent;
    /* 提示条实际恒为 only-skip（正文为空），这层框不会画出来；素材仍统一到新框，
     * 避免仓库里残留旧框引用 */
    border-image: url("./assets/game/ui/dialog-box-v2.webp") 80 fill / 26px round;
    background: none;
    color: #4A2A18;
    font-family: var(--font-dialog);
    font-size: 13px; font-weight: var(--weight-dialog); line-height: 1.5;
    z-index: 201;                     /* 星域飞船放大后 z-index 200，跳过入口要压在船身之上 */
    pointer-events: none;            /* 整条不拦点击，只有"跳过"可点 */
  }
  .tut-bar.show { display: flex; }
  .tut-bar #tut-text { flex: 1; }
  .tut-bar .link-btn { color: #B6532A; pointer-events: auto; }
  .tut-bar.only-skip {
    justify-content: flex-end;
    top: calc(148px + env(safe-area-inset-top));
    border: 0; padding: 0;
    background: none;
  }
  .tut-bar.only-skip #tut-text { display: none; }
  .tut-bar.only-skip .link-btn {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(255, 249, 236, .55);
    color: #7A2E12;
    font-size: 13px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
  .tut-focus {
    box-shadow: 0 0 0 2px rgba(51,36,31,.85), 0 0 0 6px rgba(255,255,255,.75);
    border-radius: 10px;
    animation: tutPulse 1.4s ease-in-out infinite;
  }
  .surface.tut-focus {
    border-radius: 0;
    animation: tutPulseInset 1.4s ease-in-out infinite;
  }
  @keyframes tutPulseInset {
    0%, 100% { box-shadow: inset 0 0 0 2px rgba(51,36,31,.7), inset 0 0 0 7px rgba(255,255,255,.42); }
    50% { box-shadow: inset 0 0 0 2px rgba(51,36,31,.25), inset 0 0 0 7px rgba(255,255,255,.12); }
  }
  .sheep.tut-focus { box-shadow: none; animation: none; }
  .sheep.tut-focus::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 106px; height: 106px; margin: -53px 0 0 -53px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(51,36,31,.85), 0 0 0 6px rgba(255,255,255,.75);
    animation: tutPulse 1.4s ease-in-out infinite;
    pointer-events: none;
  }
  .sheep.lit .art { transform: translateY(-3px) scaleX(var(--flip, 1)); }
  .sheep.lit img {
    filter:
      brightness(1.14)
      drop-shadow(0 0 16px rgba(150,222,255,.95))
      drop-shadow(0 0 34px rgba(96,180,255,.55));
  }

  .tut-tip {
    position: absolute; left: 50%; top: 18%;
    transform: translateX(-50%);
    max-width: 76%; padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 249, 236, .92);
    color: #7A2E12;
    font-size: 14px; line-height: 1.4; font-weight: 600;
    box-shadow: 0 4px 14px rgba(74, 42, 24, .18);
    z-index: 26; pointer-events: none; opacity: 0;
    transition: opacity .18s ease;
  }
  .tut-tip.show { opacity: 1; }

  @keyframes tutPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(51,36,31,.85), 0 0 0 6px rgba(255,255,255,.75); }
    50% { box-shadow: 0 0 0 2px rgba(51,36,31,.3), 0 0 0 6px rgba(255,255,255,.25); }
  }

  .tut-gesture {
    position: fixed; left: 0; top: 0;
    width: 0; height: 0;
    z-index: 46;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
  }
  .tut-gesture.show { opacity: 1; }
  .gh-move {
    position: absolute; left: 0; top: 0;
    width: 0; height: 0;
    transform-origin: 0 0;
  }
  .gh-img {
    position: absolute; left: 0; top: 0; display: block;
    width: var(--hand-w, 46px); height: auto;
    transform-origin: var(--tip-x, 32.81%) var(--tip-y, 90.13%);
    transform:
      translate(calc(-1 * var(--tip-x, 32.81%)), calc(-1 * var(--tip-y, 90.13%)))
      rotate(var(--hand-rot, 0deg))
      scaleX(var(--hand-flip, 1));
    filter:
      drop-shadow(0 0 1.5px rgba(42,30,22,.5))
      drop-shadow(0 2px 4px rgba(42,30,22,.32));
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
  }
  .tut-gesture .tg-ripple {
    position: absolute; left: 0; top: 0;
    width: 54px; height: 54px; margin: -27px 0 0 -27px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.95);
    box-shadow: 0 0 0 2px rgba(51,36,31,.35) inset;
    opacity: 0;
  }
  .tut-gesture.type-tap .gh-move { animation: tgTap .9s ease-in-out infinite; }
  .tut-gesture.type-tap .tg-ripple { animation: tgRipple .9s ease-out infinite; }
  .tut-gesture.type-hold .gh-move { transform: translateY(4px) scale(.95); }
  .tut-gesture.type-hold .tg-ripple { animation: tgRipple 1.2s ease-out infinite; }
  .tut-gesture.type-drag .gh-move { animation: tgDrag 1.7s ease-in-out infinite; }
  .tut-gesture.type-drag .tg-ripple { animation: tgDragRipple 1.7s ease-out infinite; }
  @keyframes tgTap {
    0%, 100% { transform: translateY(0); }
    38% { transform: translateY(6px) scale(.94); }
    62% { transform: translateY(0); }
  }
  @keyframes tgRipple {
    0% { transform: scale(.45); opacity: .95; }
    70%, 100% { transform: scale(1.25); opacity: 0; }
  }
  .tut-release {
    position: fixed; left: 0; top: 0;
    width: 0; height: 0;
    z-index: 46;
    pointer-events: none;
    opacity: 0;
    transition: opacity .16s ease;
  }
  .tut-release.show { opacity: 1; }
  .tut-release .gh-move { animation: tgRelease 1.25s ease-in-out infinite; }
  .tut-release .tg-ripple {
    position: absolute; left: 0; top: 0;
    width: 54px; height: 54px; margin: -27px 0 0 -27px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.95);
    box-shadow: 0 0 0 2px rgba(51,36,31,.35) inset;
    opacity: 0;
    animation: tgReleaseRipple 1.25s ease-out infinite;
  }
  @keyframes tgRelease {
    0% { transform: translateY(6px) scale(.92); opacity: .95; }
    20% { transform: translateY(2px) scale(.97); opacity: 1; }
    58% { transform: translateY(-16px) scale(1); opacity: .7; }
    82%, 100% { transform: translateY(-30px) scale(1); opacity: 0; }
  }
  @keyframes tgReleaseRipple {
    0% { transform: scale(.5); opacity: .9; }
    48%, 100% { transform: scale(1.15); opacity: 0; }
  }
  @keyframes tgDrag {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    8% { transform: translate(0, 5px) scale(.9); opacity: 1; }     /* 先点一下物品 */
    18% { transform: translate(0, 0) scale(1); opacity: 1; }
    55%, 72% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1); opacity: 1; }
    84%, 100% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1); opacity: 0; }
  }
  @keyframes tgDragRipple {
    0% { transform: scale(.35); opacity: .9; }
    14% { transform: scale(1.15); opacity: 0; }
    100% { transform: scale(1.15); opacity: 0; }
  }
  .game-dialog {
    position: absolute; left: 0; right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    z-index: 58;                       /* 高于场景 UI 与羊圈卡片，低于收羊展示（60） */
    padding: 0 4%;
    display: flex; flex-direction: column;
    pointer-events: none;              /* 空白处不拦点击 */
  }
  .game-dialog[hidden] { display: none; }
  .game-dialog.at-top {
    top: calc(196px + env(safe-area-inset-top));
    bottom: auto;
  }
  .game-dialog.on-home {
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
  /* 教程第 3 步：目标景物在星球上沿，320×568 上原尺寸对话框会把它盖住，
   * 手指与台词同时出现时玩家点不到；这一步只把对话框整体上移一档留出空间。 */
  .game-dialog.tut-spot {
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
  /* 圆盘外长按的进度环：250ms 走满即长按生效（正式玩法通用反馈） */
  .hold-ring {
    position: absolute;
    width: 56px; height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 236, 176, .95);
    box-shadow: 0 0 12px rgba(255, 214, 120, .55), inset 0 0 10px rgba(255, 236, 176, .45);
    pointer-events: none;
    opacity: 0;
    z-index: 22;
  }
  .hold-ring.run { animation: holdRing .25s linear forwards; }
  @keyframes holdRing {
    0%   { opacity: .9; transform: scale(.5); }
    70%  { opacity: 1; transform: scale(1.06); }
    100% { opacity: .95; transform: scale(1.12); }
  }
  @media (prefers-reduced-motion: reduce) {
    .hold-ring.run { animation: none; opacity: .95; }
  }

  /* 教程第 5 步：羊要先走到盘面上、台词框上方站住再说话。
   * 尺寸不在这里改（全站与剧情框统一，见 .gd-box 的高度公式），只把对话框整体下移：
   * 320×568 上默认位置框顶 321 会压住盘面顶（341），下移后框顶让到盘面上沿之下，
   * 羊脚底仍能钉在盘面上且不压框。 */
  .game-dialog.tut-stage {
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .game-dialog .gd-box {
    position: relative; width: 100%;
    /* 外框视觉与剧情页共用 .dialog-frame（styles.css）；这里只定位置与高度。
     * 高度公式与剧情页 .dialog-box 完全一致（同下限、同 25dvh、同 ÷0.6），
     * 正文安全区占框高 60%，所以剧情框与引导框在任何一档都是同一个尺寸，
     * 台词长短也不影响框高。超过 3 行由 fitDialogText() 逐级缩字号兜底 */
    height: max(clamp(168px, 25dvh, 226px),
               calc((var(--dialog-line-height) * 3 * var(--dialog-font-size) + 12px) / 0.6));
    pointer-events: auto;
    cursor: pointer;
    animation: gdIn .2s ease-out;
  }
  /* 瞬时提示（第一只羊判定）：外观不变，但完全不接输入——
   * 长按中的 pointerup / pointercancel 必须穿透，松手照常结束光柱并判定 */
  .game-dialog.transient .gd-box { pointer-events: none; cursor: default; }
  .game-dialog .dialog-body { gap: 0; }
  .game-dialog .gd-text {
    flex: 1;
    min-height: 0;
  }
  .game-dialog .gd-foot {
    margin-top: 6px;
    text-align: center;
    font-family: var(--font-dialog);
    font-size: 14px; font-weight: var(--weight-dialog);
    color: rgba(255,243,216,.75);
  }
  @keyframes gdIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .tut-gesture .gh-move,
    .tut-gesture .tg-ripple { animation: none !important; }
    .tut-gesture.type-hold .tg-ripple { opacity: .7; }
    .tut-release .gh-move,
    .tut-release .tg-ripple { animation: none !important; }
    .tut-release .gh-move { transform: translateY(-8px); opacity: 1; }
    .game-dialog .gd-box { animation: none; }
  }
