/* 加载画面：送信奶包跑步。
   狗 = 用户用视频大模型照定版 logo 生成的跑步视频，取两个步子（39 帧，第 55–93 帧）首尾相接，抠透明底、去掉「AI 生成」水印、
   按色块调回定版 logo 的颜色，存成 run.webp（处理脚本 docs/art/new-style/候选/2026-11-16-拍照水印/loading_video.py）。
   index.html 直接引用这个文件：JS 还没下完的首屏（.nb-boot）和 React 里的 <NaibaoLoader> 共用。 */

.nb-load {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  --nb-w: min(250px, 48vw);
  --nb-t: 0.4095s; /* 4 拍 = run.webp 一圈（39 帧 × 42ms），字和水波跟狗同一个循环 */
}
.nb-run {
  position: relative;
  width: var(--nb-w);
  aspect-ratio: 460 / 290;
}
.nb-run img {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.nb-shadow {
  position: absolute;
  left: 22%;
  width: 60%;
  bottom: 0;
  height: 7%;
  border-radius: 50%;
  background: #6b4a30;
  opacity: 0.1;
}
/* logo 下面那条雾蓝水波，往后流，像奶包在往前跑 */
.nb-wave {
  width: calc(var(--nb-w) * 1.15);
  height: 12px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}
.nb-wave svg {
  display: block;
  width: 200%;
  height: 100%;
  animation: nb-wave calc(var(--nb-t) * 2) linear infinite;
}
@keyframes nb-wave {
  to {
    transform: translateX(-12.5%);
  }
}
/* 只管加载画面里的 LOADING 字（11-18：以前写成全局 .nb-text，把奶包包对话框的台词也变成了 flex，打字时字竖着挤、对话泡一跳一跳） */
.nb-load .nb-text {
  margin: 4px 0 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}
/* 字母：照定版 logo 的英文画法（单线、圆头、轻微手抖）画的矢量线条，生成脚本 split_running.py 旁边的 loading_letters.py */
.nb-ch {
  height: 26px;
  background: no-repeat center / 100% 100%;
}
.nb-ch-L {
  aspect-ratio: 61 / 104;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -2 61 104'%3E%3Cpath d='M12.6 5 Q14.9 50 12.6 95 Q31 94 50.6 95' fill='none' stroke='%23473022' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.nb-ch-O {
  aspect-ratio: 75 / 104;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -2 75 104'%3E%3Cpath d='M35.6 5 C56.3 5 64.4 28 64.4 51 C64.4 78 51.7 95 34.5 95 C16.1 95 6.9 77 6.9 50 C6.9 25 17.2 5 35.6 5 Z' fill='none' stroke='%23473022' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.nb-ch-A {
  aspect-ratio: 90 / 104;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -2 90 104'%3E%3Cpath d='M9.1 95 Q24.7 52 41.6 5 Q59.8 50 76.7 95 M20.8 66 Q42.9 64.5 65 66' fill='none' stroke='%23473022' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.nb-ch-D {
  aspect-ratio: 76 / 104;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -2 76 104'%3E%3Cpath d='M12 5 Q13.2 50 12 95 M12 6 C46.8 4 64.8 25 64.8 51 C64.8 80 44.4 96 12 94' fill='none' stroke='%23473022' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.nb-ch-I {
  aspect-ratio: 26 / 104;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -2 26 104'%3E%3Cpath d='M11 5 Q12.5 50 11 95' fill='none' stroke='%23473022' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.nb-ch-N {
  aspect-ratio: 90 / 104;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -2 90 104'%3E%3Cpath d='M13 95 Q10.4 50 13 5 Q41.6 50 72.8 95 Q75.4 50 72.8 5' fill='none' stroke='%23473022' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.nb-ch-G {
  aspect-ratio: 76 / 104;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -2 76 104'%3E%3Cpath d='M62.1 22 C55.4 10 46.3 5 36.2 5 C16.9 5 6.8 27 6.8 50 C6.8 78 18.1 95 36.2 95 C53.1 95 63.3 82 64.4 62 L64.4 55 M42.9 56 Q54.2 55.5 64.4 55' fill='none' stroke='%23473022' stroke-width='7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.nb-ch-dot {
  aspect-ratio: 20 / 104;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -2 20 104'%3E%3Cpath d='M8 92 L8 92.1' fill='none' stroke='%23473022' stroke-width='11.200000000000001' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* LOADING...：字母一个接一个轻轻跳一下，三个点依次亮 */
.nb-load .nb-text span {
  display: inline-block;
  animation: nb-letter calc(var(--nb-t) * 4) ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.08s);
}
.nb-load .nb-text .nb-dot {
  animation-name: nb-dot;
}
@keyframes nb-letter {
  0%,
  45%,
  100% {
    transform: translateY(0) rotate(0);
  }
  18% {
    transform: translateY(-5px) rotate(-6deg);
  }
  32% {
    transform: translateY(1px) rotate(3deg);
  }
}
@keyframes nb-dot {
  0%,
  10% {
    opacity: 0.15;
    transform: translateY(0);
  }
  25% {
    opacity: 1;
    transform: translateY(-4px);
  }
  40%,
  85% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0.15;
  }
}

/* 首屏：JS 还没到，整页铺底色 */
.nb-boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #f6f0e3;
}

/* 进小屋的加载遮罩（ui/loadGate.ts）：盖在所有东西上面；从别的页面点进来淡入，画面能看了淡出（GATE_FADE_MS 同一个数） */
.nb-gate {
  z-index: 100000;
  transition: opacity 0.45s ease-out;
}
.nb-gate.fade-in {
  animation: nb-gate-in 0.2s ease-out;
}
.nb-gate.is-leaving {
  opacity: 0;
  pointer-events: none;
}
@keyframes nb-gate-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nb-load {
    --nb-t: 1.2s;
  }
}
