.chat-body {
  background:
    radial-gradient(ellipse at 70% 8%, rgba(200, 143, 122, 0.22) 0%, transparent 48%),
    #1a1412;
}

.chat-page {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 85% 50% at 88% 0%, rgba(216, 160, 140, 0.28), transparent 52%),
    radial-gradient(ellipse 70% 42% at 8% 35%, rgba(197, 171, 133, 0.12), transparent 50%),
    linear-gradient(180deg, #2a221f 0%, #342824 42%, #3a2c28 100%);
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-page::-webkit-scrollbar {
  display: none;
}

.chat-top {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 48px 16px 14px;
  color: #f7efe8;
  z-index: 5;
  border-bottom: 1px solid rgba(216, 160, 140, 0.18);
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: rgba(247, 239, 232, 0.9);
  font-size: 0;
  line-height: 0;
  background: rgba(216, 160, 140, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.back-btn::before {
  content: "";
  width: 8px;
  height: 8px;
  border-left: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
  margin-left: 2px;
}

.chat-top-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hermit-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #fff8f3;
  background: linear-gradient(145deg, #d19a86, #c88f7a);
  box-shadow: 0 4px 14px rgba(200, 143, 122, 0.4);
}

.chat-eyebrow {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #e0b5a3;
  margin-bottom: 2px;
}

.chat-title {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.2em;
}

.top-spacer {
  width: 36px;
}

.chat-stream {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-stream::-webkit-scrollbar {
  display: none;
}

.msg {
  max-width: 86%;
  animation: msgIn 0.45s ease both;
}

.msg.hermit {
  align-self: flex-start;
}

.msg.user {
  align-self: flex-end;
}

.msg-bubble {
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.75;
  letter-spacing: 0.03em;
}

.msg.hermit .msg-bubble {
  background: rgba(247, 236, 228, 0.14);
  color: rgba(255, 246, 240, 0.94);
  border: 1px solid rgba(216, 160, 140, 0.28);
  border-radius: 4px 18px 18px 18px;
  backdrop-filter: blur(8px);
}

.msg.hermit.is-intro .msg-bubble {
  background: rgba(216, 160, 140, 0.28);
  border-color: rgba(232, 180, 160, 0.42);
}

.msg.user .msg-bubble {
  background: linear-gradient(180deg, #e8c4b4, #d8a08c);
  color: #3a2f2b;
  border-radius: 18px 18px 4px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.msg-soft {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255, 246, 240, 0.58);
}

.typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(216, 160, 140, 0.14);
  border: 1px solid rgba(216, 160, 140, 0.22);
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(232, 180, 160, 0.85);
  animation: typingDot 1.1s ease-in-out infinite;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

.quick-replies {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 10px;
}

.quick-replies[hidden] {
  display: none !important;
}

.quick-replies button {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #f7efe8;
  background: rgba(216, 160, 140, 0.22);
  border: 1px solid rgba(232, 180, 160, 0.38);
  transition: transform 0.2s ease, background 0.2s ease;
}

.quick-replies button:active {
  transform: scale(0.97);
  background: rgba(216, 160, 140, 0.36);
}

.chat-composer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 16px 22px;
  background: linear-gradient(180deg, transparent, rgba(42, 30, 28, 0.94) 28%);
  border-top: 1px solid rgba(216, 160, 140, 0.16);
}

.chat-composer input {
  height: 46px;
  border: 1px solid rgba(216, 160, 140, 0.3);
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(247, 236, 228, 0.12);
  color: #f7efe8;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.chat-composer input::placeholder {
  color: rgba(247, 239, 232, 0.38);
}

.chat-composer input:focus {
  border-color: rgba(232, 180, 160, 0.62);
  background: rgba(247, 236, 228, 0.18);
}

.chat-composer .send-btn {
  min-width: 72px;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d19a86, #c88f7a);
  color: #fff8f3;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.chat-composer .send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.chat-page .toast {
  bottom: 88px;
}

.flow-list {
  margin: 0 0 16px;
  padding-left: 18px;
  color: rgba(236, 230, 217, 0.72);
  font-size: 13px;
  line-height: 1.9;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes typingDot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.chat-page[hidden],
.page[hidden],
.tabbar[hidden] {
  display: none !important;
}

.chat-page.is-open {
  display: flex !important;
  position: relative;
  z-index: 40;
  flex: 1;
  min-height: 0;
}

.phone:has(#chatPage:not([hidden])) .toast,
.phone:has(.chat-page.is-open) .toast {
  bottom: 88px;
}
