/* ============ 小Windy mascot 客服 widget (2026-09-08) ============ */
#mascot-wrap {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 9000;
  width: 74px;
  height: 104px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
#mascot-stage {
  position: absolute;
  inset: 0;
  will-change: transform;
}
#mascot-img {
  width: auto;
  height: 104px;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  animation: mascot-idle 2.6s ease-in-out infinite;
  transform-origin: 50% 100%;
  pointer-events: none;
}
#mascot-wrap.walking #mascot-img {
  animation: mascot-walk 0.42s linear infinite;
}
#mascot-wrap:hover #mascot-img {
  animation-name: mascot-hop;
  animation-duration: 0.5s;
}
#mascot-wrap.open #mascot-img {
  animation: mascot-idle 2.6s ease-in-out infinite;
}

@keyframes mascot-idle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.01); }
}
@keyframes mascot-walk {
  0%, 100% { transform: translateY(0) rotate(-0.8deg); }
  25% { transform: translateY(-2px) rotate(0.8deg); }
  50% { transform: translateY(0) rotate(-0.6deg); }
  75% { transform: translateY(-2px) rotate(0.8deg); }
}
@keyframes mascot-hop {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-14px) scale(1.05, 0.95); }
  60% { transform: translateY(0) scale(0.96, 1.04); }
}

/* 氣泡提示 */
#mascot-bubble {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-42%) scale(0.9);
  transform-origin: 50% 100%;
  background: rgba(13, 22, 48, 0.92);
  border: 1px solid rgba(124, 199, 255, 0.35);
  color: #eaf4ff;
  font-size: 13px;
  line-height: 1.45;
  padding: 9px 12px;
  border-radius: 14px 14px 14px 3px;
  width: 178px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#mascot-bubble.show {
  opacity: 1;
  transform: translateX(-42%) scale(1);
  pointer-events: auto;
}

/* ============ 對話窗 ============ */
#mascot-chat {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9001;
  width: min(356px, calc(100vw - 32px));
  height: min(520px, calc(100dvh - 70px));
  min-height: 320px;
  display: none;
  flex-direction: column;
  background: rgba(10, 17, 40, 0.92);
  border: 1px solid rgba(124, 199, 255, 0.28);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  color: #eaf4ff;
}
#mascot-chat.open { display: flex; }

#mascot-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(64, 110, 224, 0.55), rgba(84, 46, 160, 0.5));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}
#mascot-chat-head img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px;
}
#mascot-chat-head .mc-title {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  color: #ffffff;
}
#mascot-chat-head .mc-sub {
  font-size: 11.5px;
  color: rgba(234, 244, 255, 0.72);
  margin-top: 1px;
}
#mascot-chat-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: #dbe9ff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
  flex: 0 0 auto;
}
#mascot-chat-close:hover { background: rgba(255, 255, 255, 0.22); }

#mascot-chat-msgs {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.mc-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  animation: mc-in 0.22s ease both;
}
@keyframes mc-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.mc-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 4px;
  color: #eef6ff;
}
.mc-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #3a6fe0, #5f9bff);
  border-bottom-right-radius: 4px;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(58, 111, 224, 0.35);
}
.mc-msg.err {
  align-self: flex-start;
  background: rgba(120, 60, 60, 0.35);
  border: 1px solid rgba(255, 130, 130, 0.25);
  color: #ffd9d9;
}
.mc-msg.typing {
  display: inline-flex;
  gap: 5px;
  padding: 14px 16px;
  align-items: center;
}
.mc-msg.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9fc4ff;
  display: inline-block;
  animation: mc-blink 1s infinite ease-in-out;
}
.mc-msg.typing i:nth-child(2) { animation-delay: 0.16s; }
.mc-msg.typing i:nth-child(3) { animation-delay: 0.32s; }
@keyframes mc-blink {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

#mascot-chat-form {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  align-items: flex-end;
}
#mascot-chat-input {
  flex: 1 1 auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #eef6ff;
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  outline: none;
  resize: none;
  max-height: 96px;
  min-height: 38px;
  line-height: 1.4;
}
#mascot-chat-input:focus { border-color: rgba(124, 199, 255, 0.6); }
#mascot-chat-input::placeholder { color: rgba(234, 244, 255, 0.4); }
#mascot-chat-send {
  flex: 0 0 auto;
  border: none;
  border-radius: 12px;
  padding: 9px 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #3a6fe0, #5f9bff);
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
  height: 38px;
}
#mascot-chat-send:hover { filter: brightness(1.12); }
#mascot-chat-send:active { transform: scale(0.96); }
#mascot-chat-send:disabled { opacity: 0.55; cursor: default; filter: none; }

@media (max-width: 560px) {
  #mascot-wrap { width: 58px; height: 84px; left: 6px; bottom: 8px; }
  #mascot-img { width: auto; height: 84px; margin: 0 auto; }
  #mascot-bubble { bottom: 86px; width: 160px; font-size: 12.5px; }
  #mascot-chat { right: 8px; bottom: 8px; width: calc(100vw - 16px); }
}

/* ============ 快速回覆 chips（新歌宣傳入口，2026-09-26） ============ */
.mc-chips {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 92%;
  animation: mc-in 0.22s ease both;
}
.mc-chip {
  border: 1px solid rgba(124, 199, 255, 0.45);
  background: rgba(124, 199, 255, 0.12);
  color: #dbe9ff;
  font: inherit;
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.mc-chip:hover { background: rgba(124, 199, 255, 0.26); color: #ffffff; }
.mc-chip:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
  #mascot-img { animation: none !important; }
}
