.brandbar {
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  min-width: 0;
}

.brand-wordmark {
  color: #080808;
  font-size: 22px;
  line-height: 24px;
}

.assistant-identity > img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: none;
}

/* 欢迎区只保留一个机器人，完整展示在问候语上方。 */
.welcome-mascot {
  position: relative;
  width: 112px;
  height: 80px;
  margin-bottom: 12px;
  z-index: 2;
  pointer-events: none;
}

.mascot-button {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 16px;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.mascot-button picture {
  display: block;
  height: 100%;
  transform-origin: 50% 100%;
  transition: transform 220ms ease;
}

.mascot-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.mascot-button:hover picture,
.mascot-button:focus-visible picture {
  transform: translateY(-6px) rotate(-4deg);
}

.mascot-button.is-greeting picture {
  animation: mascot-greet 650ms ease-in-out;
}

.mascot-greeting {
  position: absolute;
  left: calc(100% - 4px);
  bottom: 12px;
  width: max-content;
  max-width: min(230px, calc(100vw - 144px));
  padding: 9px 13px;
  border: 1px solid #d9e9e1;
  border-radius: 14px 14px 14px 3px;
  background: #fff;
  color: #3a6552;
  font-size: 12px;
  line-height: 1.6;
  box-shadow: 0 4px 16px #163b2510;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  visibility: hidden;
}

.welcome-mascot.show-greeting .mascot-greeting {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
}

@keyframes mascot-greet {
  0%,
  100% {
    transform: none;
  }
  35% {
    transform: translateY(-10px) rotate(-7deg);
  }
  70% {
    transform: translateY(-4px) rotate(4deg);
  }
}

@media (max-width: 760px) {
  .brand-wordmark {
    font-size: 18px;
  }
}

@media (max-width: 720px) {
  .welcome-mascot {
    width: 98px;
    height: 70px;
  }

  .mascot-greeting {
    bottom: 10px;
    max-width: min(210px, calc(100vw - 128px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-button picture,
  .mascot-greeting {
    animation: none !important;
    transition: none;
    transform: none !important;
  }
}

/* 手机首页仅调整欢迎区、输入区位置和模型入口。 */
.mobile-home-greeting {
  display: none;
}

@media (max-width: 760px) {
  #main.home-start {
    display: flex;
    flex-direction: column;
  }

  .home-start > .topbar {
    flex-shrink: 0;
  }

  .home-start #home {
    display: flex;
    flex: 1;
    flex-direction: column;
    max-width: none;
    margin: 0;
    padding: 0 16px calc(32px + env(safe-area-inset-bottom));
  }

  .home-start #welcome {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    margin: 0;
    padding: 24px 0;
  }

  .home-start .mobile-home-greeting {
    display: block;
    text-align: center;
  }

  .home-start #composerMascot,
  .home-start #greeting,
  .home-start #welcome > h2,
  .home-start #modelButton {
    display: none;
  }

  .home-start #promptForm {
    flex-shrink: 0;
    margin: 0;
  }
}
