/* 铸铸保持固定的军绿形象，衬底和对话框随全站配色变化。 */
:root .buddy.zhuzhu {
  --zhuzhu-success: var(--theme-success);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  color: var(--theme-text);
  animation: none;
}

:root .buddy.zhuzhu .buddy-figure {
  position: relative;
  flex: 0 0 auto;
  width: 82px;
  height: 98.4px;
  animation: none;
}
:root .buddy.zhuzhu.compact .buddy-figure { width: 68px; height: 81.6px; }
.zhuzhu-halo { position: absolute; top: 15%; left: 2%; width: 96%; height: 80%; border: 1px solid rgba(var(--theme-primary-rgb), .1); border-radius: 50%; background: linear-gradient(145deg, rgba(var(--theme-surface-rgb), .85), rgba(var(--theme-primary-rgb), .1)); }
.zhuzhu-portrait-stack { position: relative; display: block; width: 100%; height: 100%; }
.zhuzhu-portrait { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(27, 52, 36, .08)); }
.zhuzhu-portrait-mood { position: absolute; inset: 0; }

:root .buddy.zhuzhu .buddy-speech {
  min-width: 0;
  max-width: 300px;
  padding: 11px 15px 12px;
  border: 1px solid var(--theme-line);
  border-radius: 15px;
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: 0 6px 20px rgba(var(--theme-primary-rgb), .07);
}
:root .buddy.zhuzhu .buddy-speech::before {
  content: '';
  position: absolute;
  top: calc(50% - 5px);
  bottom: auto;
  left: -5px;
  width: 8px;
  height: 8px;
  border: 0;
  border-left: 1px solid var(--theme-line);
  border-bottom: 1px solid var(--theme-line);
  background: var(--theme-surface);
  transform: rotate(45deg);
}
:root .buddy.zhuzhu .buddy-speech::after { display: none; }
:root .buddy.zhuzhu .speech-meta { align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 5px; }
:root .buddy.zhuzhu .speech-name { color: var(--theme-primary); font-size: 14px; font-weight: 800; line-height: 18px; letter-spacing: .5px; }
:root .buddy.zhuzhu .speech-tag { padding: 2px 6px; border-radius: 5px; background: var(--theme-soft); color: var(--theme-muted); font-size: 10px; font-weight: 400; line-height: 14px; }
:root .buddy.zhuzhu .speech-line { color: var(--theme-text); font-size: 14px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
:root .buddy.zhuzhu.success .speech-tag { background: rgba(var(--theme-success-rgb), .1); color: var(--zhuzhu-success); }
:root[data-theme="classic"] .buddy.zhuzhu { --zhuzhu-success: #8bd0ae; }

:root .buddy.zhuzhu.floating {
  width: auto;
  max-width: min(380px, calc(100vw - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px))));
  margin: 0;
}
:root .buddy.zhuzhu.floating .buddy-speech { max-width: 292px; }

.conduct-page .zhuzhu-result { gap: 14px; }
.conduct-page .zhuzhu-result .game-result-button { margin-top: 0; }

@media (max-height: 500px), (max-width: 700px) {
  :root .buddy.zhuzhu { gap: 8px; }
  :root .buddy.zhuzhu .buddy-figure { width: 64px; height: 76.8px; }
  :root .buddy.zhuzhu.compact .buddy-figure { width: 54px; height: 64.8px; }
  :root .buddy.zhuzhu .buddy-speech { max-width: 260px; padding: 8px 11px 9px; border-radius: 12px; }
  :root .buddy.zhuzhu .speech-meta { gap: 6px; margin-bottom: 3px; }
  :root .buddy.zhuzhu .speech-name { font-size: 12px; line-height: 16px; }
  :root .buddy.zhuzhu .speech-tag { padding: 1px 5px; font-size: 9px; line-height: 13px; }
  :root .buddy.zhuzhu .speech-line { font-size: 12px; line-height: 1.5; }
  :root .buddy.zhuzhu.floating { max-width: min(330px, calc(100vw - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px)))); }
  .conduct-page .zhuzhu-result { gap: 10px; }
}

@media (max-height: 340px) {
  :root .buddy.zhuzhu.compact .buddy-figure { width: 48px; height: 57.6px; }
  :root .buddy.zhuzhu .buddy-speech { padding: 6px 9px 7px; }
}
