* {
  --c-black: #222;
  --c-white: #fff;
  --c-main: #49a984;
  --c-grey: #f4f6f8;
  --c-body: #e7f4f4;
  --p-inline: 20px;
  box-sizing: border-box;
}

.chat-outter-container.fz-max #chat-header .win-title {
  font-size: 2rem;
}
.chat-outter-container.fz-max .msg .bubble {
  font-size: 1.8rem;
}
.chat-outter-container.fz-max .msg .meta {
  font-size: 1.4rem;
}
.chat-outter-container.fz-max #chat-footer-menu .menu-btn {
  font-size: 1.6rem;
}
.chat-outter-container.fz-max #chat-input {
  font-size: 1.7rem;
}
.chat-outter-container.fz-max .ai-list li {
  font-size: 1.7rem;
}

body {
  margin: 0;
  background: var(--c-grey);
  font-family: "Segoe UI", Arial, "微軟正黑體", sans-serif;
}

#chat-float-btn {
  position: fixed;
  right: 25px;
  bottom: 14px;
  z-index: 999999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--c-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: rgba(0, 0, 0, 15%) 0 4px 12px 0;
  overflow: hidden;
}
#chat-float-btn img {
  display: block;
  width: 100%;
}
#chat-float-btn:hover {
  box-shadow: 0 10px 36px #89d1b740;
}
#chat-main-container {
  border-radius: 5px;
  position: fixed;
  right: 20px;
  bottom: 80px;
  max-width: 410px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  height: 640px;
  z-index: 999999;
  animation: slideIn 0.36s;
  overflow: hidden;
}
@keyframes slideIn {
  from {
    transform: translateY(70px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
#chat-main-container.open {
  display: flex;
}
#chat-header {
  background: var(--c-black);
  padding: 13px var(--p-inline);
  align-items: center;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 4px 7px rgb(0, 0, 0, 0.2);
  z-index: 1;
}
/* #chat-header .main-sec {
  align-items: center;
  display: flex;
  gap: 10px;
}
#chat-header .icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c-white);
  display: grid;
  place-items: center;
}
#chat-header .icon img {
  display: block;
  width: 75%;
} */
#chat-header .win-title {
  color: var(--c-white);
  font-weight: bold;
  font-size: 1.8rem;
}
#chat-header .active-sec {
  display: flex;
  align-items: center;
}
#chat-header button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
#chat-header button + button {
  margin-left: 15px;
}
#chat-header button img {
  display: block;
  width: 18px;
}
#chat-body {
  background: var(--c-body);
  flex: 1;
  overflow-y: auto;
  padding: 25px var(--p-inline);
}
.msg {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.msg + .msg {
  margin-top: 10px;
}
.msg.ai {
  padding-left: 40px;
  position: relative;
}
.msg.ai:before {
  content: "";
  background: var(--ai-avatar, url("../images/ic-profile-bear.svg")) no-repeat;
  background-size: contain;
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
}
.msg .bubble {
  border-radius: 10px;
  font-size: 1.5rem;
  line-height: 1.4;
  box-shadow: 0 1.5px 6px #e0e9ee;
  position: relative;
}
.msg.ai .bubble {
  background: var(--c-white);
  color: var(--c-black);
  max-width: 90%;
  padding: 15px 20px;
}
.msg.ai .bubble:before {
  position: absolute;
  top: 13px;
  left: 0;
  content: "";
  border-style: solid;
  border-width: 5px 5px 5px 0;
  border-color: transparent var(--c-white) transparent transparent;
  transform: translateX(-100%);
}
.msg .bubble p {
  margin: 0;
}
.msg .bubble p + p {
  margin-top: 10px;
}
.msg.user {
  align-items: flex-end;
}
.msg.user .bubble {
  background: var(--c-main);
  color: var(--c-white);
  max-width: 80%;
  padding: 10px 20px;
  position: relative;
}
.msg.user .bubble:before {
  position: absolute;
  top: 20px;
  right: 0;
  content: "";
  border-style: solid;
  border-width: 5px 0 5px 5px;
  border-color: transparent transparent transparent var(--c-main);
  transform: translateX(100%);
}
.msg .meta {
  color: #aaa;
  font-size: 1.2rem;
  margin-top: 3px;
}
#chat-footer-menu {
  display: flex;
  flex-wrap: wrap;
  background: var(--c-white);
  gap: 8px;
  padding: 13px var(--p-inline);
  z-index: 1;
}
#chat-footer-menu .menu-btn {
  background: #e5e5e5;
  border-radius: 30px;
  border: none;
  padding: 4px 12px;
  font-size: 1.4rem;
  color: var(--c-black);
  cursor: pointer;
}
#chat-footer-menu .menu-btn:hover {
  font-weight: bold;
}
#chat-footer {
  background: var(--c-black);
  padding: 15px var(--p-inline);
  position: relative;
}
#chat-input {
  border-radius: 5px;
  border: none;
  color: var(--c-black);
  font-size: 1.5rem;
  background: var(--c-white);
  outline: none;
  padding: 15px 20px;
  padding-right: 35px;
  width: 100%;
}
#send-btn {
  position: absolute;
  top: 50%;
  right: 30px;
  transform: translateY(-43%);
  cursor: pointer;
  padding: 0;
  border: none;
  background: none;
}
#send-btn svg {
  fill: #c0c0c0;
  width: 20px;
}
#send-btn:hover svg,
#send-btn:active svg {
  fill: var(--c-black);
}
#chat-body::-webkit-scrollbar {
  width: 8px;
  background: #dadada;
}
#chat-body::-webkit-scrollbar-thumb {
  background: var(--c-main);
  border-radius: 8px;
}
.ai-list {
  margin-block: 15px;
  list-style: none;
  padding: 0;
}
.ai-list img {
  display: inline-block;
  width: 17px;
  vertical-align: bottom;
  margin-right: 5px;
}
.ai-list li {
  margin-bottom: 8px;
  font-size: 1.5rem;
}
.ai-list a {
  color: var(--c-main);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: bold;
}
.ai-highlight {
  color: #ff5432;
}
@media (max-width: 600px) {
  * {
    --p-inline: 15px;
  }
  #chat-main-container {
    right: 0 !important;
    left: 0 !important;
    bottom: 70px;
    top: auto;
    min-width: unset;
    max-width: unset;
    width: 100vw;
    height: calc(100dvh - 70px);
  }
  #chat-body {
    padding-block: 20px;
  }
  #chat-input {
    padding-block: 12px;
  }
  #chat-float-btn {
    width: 44px;
    height: 44px;
    right: 10px;
    bottom: 10px;
  }
  .msg .bubble {
    max-width: 100% !important;
  }
}
