/* ============================================================
   Henny AI Chat Widget — 设计助手浮标
   Brunello Cucinelli · Miiine · gjhj 设计开发
   ============================================================ */

#henny-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Float Button */
#henny-chat-float {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5f463e 0%, #3d201e 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(95,70,62,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
#henny-chat-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(95,70,62,0.55);
}
#henny-chat-float svg {
  width: 28px;
  height: 28px;
  fill: #e0d5cc;
}

/* Badge */
#henny-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #956155;
  border: 2px solid #fff;
  border-radius: 50%;
  display: none;
}
#henny-chat-badge.online { background: #6b8f71; display: block; }

/* Chat Panel */
#henny-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e8e3df;
}
#henny-chat-panel.open { display: flex; }

/* Header */
#henny-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #5f463e 0%, #3d201e 100%);
  color: #e0d5cc;
  display: flex;
  align-items: center;
  gap: 12px;
}
#henny-chat-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e0d5cc;
  color: #5f463e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
#henny-chat-header .info { flex: 1; }
#henny-chat-header .name { font-weight: 600; font-size: 14px; }
#henny-chat-header .status { font-size: 11px; opacity: 0.75; }
#henny-chat-close {
  background: none;
  border: none;
  color: #e0d5cc;
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
}
#henny-chat-close:hover { opacity: 1; }

/* Messages */
#henny-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #faf8f6;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.henny-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  animation: henny-fadein 0.25s ease;
}
@keyframes henny-fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.henny-msg.user {
  align-self: flex-end;
  background: #5f463e;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.henny-msg.assistant {
  align-self: flex-start;
  background: #fff;
  color: #3d201e;
  border: 1px solid #e8e3df;
  border-bottom-left-radius: 4px;
}
.henny-msg.assistant p { margin: 4px 0; }
.henny-msg.assistant p:first-child { margin-top: 0; }
.henny-msg.assistant p:last-child { margin-bottom: 0; }
.henny-msg.assistant code {
  background: #f0ece8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.henny-msg .typing { display: flex; gap: 4px; padding: 4px 0; }
.henny-msg .typing span {
  width: 6px; height: 6px;
  background: #b8a69a;
  border-radius: 50%;
  animation: henny-dot 1.4s infinite ease-in-out;
}
.henny-msg .typing span:nth-child(2) { animation-delay: 0.2s; }
.henny-msg .typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes henny-dot { 0%,80%,100% { opacity: 0.2; } 40% { opacity: 1; } }

/* Quick Actions */
#henny-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
}
.henny-quick-btn {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid #d4cbc4;
  background: #fff;
  color: #5f463e;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.henny-quick-btn:hover {
  background: #5f463e;
  color: #fff;
  border-color: #5f463e;
}

/* Input */
#henny-chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid #e8e3df;
  display: flex;
  gap: 8px;
  background: #fff;
}
#henny-chat-input {
  flex: 1;
  border: 1px solid #d4cbc4;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 13px;
  outline: none;
  resize: none;
  font-family: inherit;
  max-height: 80px;
  background: #faf8f6;
  color: #3d201e;
}
#henny-chat-input:focus { border-color: #5f463e; }
#henny-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #5f463e;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
#henny-chat-send:hover { transform: scale(1.1); }
#henny-chat-send svg { width: 18px; height: 18px; fill: #e0d5cc; }
#henny-chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Mobile */
@media (max-width: 480px) {
  #henny-chat-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 88px;
    height: 480px;
  }
  #henny-chat-float { right: 16px; }
}
