/* 保持现有皮肤；气泡从鸭嘴喷出，粒子跟随气泡展开和消散。 */
.gagapi-wordmark {
  display: inline-flex;
  align-items: center;
  font-family: Geist, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1;
}

.dark img[src$="/brand/gagapi-duck-v1.png"] {
  filter: brightness(1.5) drop-shadow(0 0 1px rgb(255 247 228 / 70%));
}

.gagapi-closing-mascot {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: min(100%, 440px);
  min-width: 0;
  text-align: start;
}
.gagapi-closing-mark,
.gagapi-home-glider {
  width: 120px;
  height: 120px;
  flex: 0 0 120px;
}
.gagapi-closing-mark,
.gagapi-closing-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gagapi-closing-lockup,
.gagapi-duck-voice {
  position: relative;
}
.gagapi-duck-voice {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 75%;
}
.gagapi-closing-mark > *,
.gagapi-closing-mark img,
.gagapi-closing-lockup {
  width: 100%;
  height: 100%;
}
.gagapi-duck-voice > img {
  object-fit: contain;
}
.gagapi-closing-lockup > .gagapi-duck-voice {
  animation: gagapi-greeting 5.2s ease-in-out infinite;
}
.gagapi-beak-speech {
  position: absolute;
  left: 80%;
  top: 34%;
  width: 0;
  height: 0;
  pointer-events: none;
  user-select: none;
  opacity: var(--gagapi-speaking, 1);
  color: var(--ink-head, #55534e);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-align: start;
}
.gagapi-speech-emission {
  position: absolute;
  inset: 0 auto auto 0;
}
.gagapi-speech-bubble {
  position: absolute;
  top: -25px;
  left: 14px;
  display: block;
  box-sizing: border-box;
  width: 200px;
  max-width: calc(100vw - 155px);
  padding: 12px 14px;
  border: 1px solid var(--line, #ece6da);
  border-radius: 18px;
  background: var(--card, #fff);
  box-shadow: 0 5px 18px rgb(41 39 36 / 6%);
  line-height: 1.5;
  overflow-wrap: anywhere;
  opacity: 0;
  transform-origin: -14px 25px;
  animation: gagapi-bubble-burst 12s ease-out both infinite;
  animation-play-state: var(--gagapi-speech-play, running);
}
.gagapi-speech-bubble::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -7px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-left: 1px solid var(--line, #ece6da);
  border-bottom: 1px solid var(--line, #ece6da);
  transform: rotate(45deg);
}
.gagapi-speech-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #5882ce;
  opacity: 0;
  animation: gagapi-bubble-sparks 12s ease-out both infinite;
  animation-play-state: var(--gagapi-speech-play, running);
}
.gagapi-speech-spark:nth-child(odd) { background: #e7b05c; }
@keyframes gagapi-greeting {
  0%, 70%, 100% { transform: rotate(0); }
  78% { transform: rotate(-3deg); }
  86% { transform: rotate(3deg); }
  94% { transform: rotate(-1deg); }
}
@keyframes gagapi-bubble-burst {
  0% { opacity: 0; transform: scale(.04); filter: blur(3px); }
  4% { opacity: 1; transform: scale(1.05); filter: blur(0); }
  7%, 23% { opacity: 1; transform: scale(1); filter: blur(0); }
  27% { opacity: .65; transform: translate(10px, -7px) scale(.98); filter: blur(1px); }
  31%, 100% { opacity: 0; transform: translate(20px, -15px) scale(.85); filter: blur(4px); }
}
@keyframes gagapi-bubble-sparks {
  0% { opacity: 0; transform: translate(0, 0) scale(.2); }
  2% { opacity: .8; transform: translate(0, 0) scale(1); }
  8% { opacity: 0; transform: translate(var(--spark-x), var(--spark-y)) scale(.3); }
  23% { opacity: 0; transform: translate(var(--spark-x), var(--spark-y)) scale(.3); }
  25% { opacity: .75; transform: translate(var(--spark-x), var(--spark-y)) scale(1); }
  32%, 100% { opacity: 0; transform: translate(var(--scatter-x), var(--scatter-y)) scale(.1); }
}
@media (min-width: 640px) {
  .gagapi-closing-mark,
  .gagapi-home-glider {
    width: 160px;
    height: 160px;
    flex-basis: 160px;
  }
  .gagapi-beak-speech { font-size: 16px; }
  .gagapi-speech-bubble { width: 230px; }
}
@media (max-height: 700px) {
  .gagapi-closing-mascot { margin-block: -8px; }
}
@media (prefers-reduced-motion: reduce) {
  .gagapi-duck-voice,
  .gagapi-speech-bubble,
  .gagapi-speech-spark {
    transform: none !important;
    animation: none !important;
  }
  .gagapi-speech-bubble[data-phrase="0"] {
    opacity: 1;
    filter: none;
  }
}
