/* ============ 四季芳华 · AI 管家样式（墨绿金） ============ */

/* ---------- 迎宾卡通形象 ---------- */
.welcome-doll {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  animation: dollIn 1.5s cubic-bezier(.3, .7, .35, 1) both;
}
.welcome-doll.bye {
  transition: transform .6s ease, opacity .6s ease;
  transform: translate(-50%, -170%);
  opacity: 0;
}
@keyframes dollIn {
  from { transform: translate(0, 34vh); opacity: 0; }
  25% { opacity: 1; }
  to { transform: translate(0, 0); opacity: 1; }
}
.welcome-avatar {
  width: 120px;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .18));
  animation: dollBounce 2.4s ease-in-out infinite;
}
.welcome-avatar img { display: block; width: 100%; height: auto; }
@keyframes dollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.welcome-doll.talking .welcome-avatar img { animation: butlerTalk .45s ease-in-out infinite alternate; }
@keyframes butlerTalk {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-2px) scale(1.025); }
}
.welcome-bubble {
  position: relative;
  background: #fffdf6;
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.65;
  color: #22332a;
  max-width: 250px;
  box-shadow: 0 10px 26px rgba(34, 51, 42, .18);
  opacity: 0;
  transform: translateY(10px) scale(.7);
  transform-origin: bottom left;
  transition: opacity .4s ease, transform .4s cubic-bezier(.22, 1.2, .36, 1);
}
.welcome-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.welcome-bubble::after {
  content: "";
  position: absolute;
  left: -8px;
  bottom: 14px;
  width: 13px;
  height: 13px;
  background: #fffdf6;
  border-left: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
}
@media (max-width: 760px) {
  .welcome-doll { flex-direction: row; gap: 6px; }
  .welcome-avatar { width: 72px; }
  .welcome-bubble { max-width: 200px; font-size: 13px; padding: 10px 12px; }
  .welcome-bubble::after {
    left: auto; right: -8px;
    border-left: none; border-bottom: none;
    border-right: 2px solid var(--gold); border-top: 2px solid var(--gold);
  }
}
/* 迎宾结束后缩小停靠右下角 */
.welcome-doll.docked {
  left: auto !important; top: auto !important;
  right: 20px; bottom: 20px;
  flex-direction: column;
  pointer-events: auto;
  animation: none;
  cursor: pointer;
  z-index: 80;
}
.welcome-doll.docked .welcome-avatar {
  width: 92px;
  animation: dollBounce 2.4s ease-in-out infinite;
  filter: drop-shadow(0 6px 14px rgba(31, 61, 43, .28));
  position: relative;
}
.welcome-doll.docked .welcome-avatar::after {
  content: "AI";
  position: absolute;
  right: -2px; top: -2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #8b6528);
  color: #fff;
  font-size: 11px; font-weight: 700; line-height: 22px; text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.welcome-doll.docked .welcome-bubble { display: none; }
.welcome-doll.docked:hover .welcome-avatar { transform: translateY(-3px); }
@media (max-width: 760px) {
  .welcome-doll.docked { right: 12px; bottom: 14px; }
  .welcome-doll.docked .welcome-avatar { width: 74px; }
  .welcome-doll.docked .welcome-avatar::after { width: 18px; height: 18px; line-height: 18px; font-size: 9px; }
}

/* ---------- AI 客服聊天窗（小瑞） ---------- */
.ai-chat {
  position: fixed;
  right: 20px; bottom: 124px;
  width: 340px;
  max-width: calc(100vw - 24px);
  max-height: min(560px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: #fffdf6;
  border: 1px solid rgba(31, 61, 43, .18);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(31, 61, 43, .22);
  z-index: 90;
  overflow: hidden;
  animation: aiPop .28s cubic-bezier(.22, 1.2, .36, 1) both;
}
.ai-chat[hidden] { display: none; }
@keyframes aiPop {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--green) 0%, #14281c 100%);
  color: #fff;
  flex-shrink: 0;
}
.ai-avatar {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover; object-position: 50% 8%;
  background: #f4f7f4;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35), 0 0 0 3.5px var(--gold);
}
.ai-head-t { flex: 1; min-width: 0; }
.ai-head-t b { display: block; font-size: 14.5px; letter-spacing: 1px; }
.ai-head-t i { display: block; font-style: normal; font-size: 11.5px; opacity: .8; margin-top: 1px; }
.ai-close {
  width: 28px; height: 28px; flex-shrink: 0;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.ai-close:hover { background: rgba(255, 255, 255, .3); }
.ai-msgs {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-msg { display: flex; }
.ai-msg-user { justify-content: flex-end; }
.ai-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px; line-height: 1.7;
  word-break: break-word;
}
.ai-msg-bot .ai-bubble {
  background: #fff;
  border: 1.5px solid rgba(185, 138, 62, .5);
  color: #22332a;
  border-top-left-radius: 4px;
}
.ai-msg-user .ai-bubble {
  background: var(--green);
  color: #fff;
  border-top-right-radius: 4px;
}
.ai-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.ai-typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  animation: aiDot 1s ease-in-out infinite;
}
.ai-typing i:nth-child(2) { animation-delay: .15s; }
.ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50% { transform: translateY(-4px); opacity: 1; }
}
.ai-quick {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px;
  border-top: 1px dashed #ddd3bc;
  flex-shrink: 0;
}
.ai-quick button {
  border: 1px solid rgba(31, 61, 43, .35);
  background: #f4f7f4; color: var(--green);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px; cursor: pointer;
}
.ai-quick button:hover { background: var(--green); color: #fff; border-color: var(--green); }
.ai-input {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px 12px;
  border-top: 1px solid #ddd3bc;
  flex-shrink: 0;
}
.ai-input button.ai-mic {
  width: 34px; height: 34px; flex-shrink: 0;
  border: 1.5px solid rgba(31, 61, 43, .4);
  border-radius: 50%;
  background: #f4f7f4; color: var(--green);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
  padding: 0;
}
.ai-mic svg { width: 17px; height: 17px; }
.ai-input button.ai-mic:hover { background: var(--green); color: #fff; }
.ai-input button.ai-mic.listening {
  background: #b03a2e; border-color: #b03a2e; color: #fff;
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(176, 58, 46, .45); }
  50% { box-shadow: 0 0 0 7px rgba(176, 58, 46, 0); }
}
.ai-input button.ai-mic-off { opacity: .45; }
.ai-input input {
  flex: 1; min-width: 0;
  border: 1px solid #ddd3bc;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13.5px;
  outline: none;
  background: #fff;
}
.ai-input input:focus { border-color: var(--green); }
.ai-input button {
  border: none; border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #8b6528);
  color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 8px 16px; cursor: pointer;
  letter-spacing: 1px;
}
.ai-input button:disabled { opacity: .55; cursor: default; }
@media (max-width: 760px) {
  .ai-chat { right: 10px; bottom: 96px; }
}

/* ---------- 首屏视频卡片 ---------- */
.hero-video-col { display: none; }
.hero-video-card {
  display: none;  /* 默认隐藏，有视频时显示 */
  position: relative; width: 100%; max-width: 400px; cursor: pointer;
  background: rgba(255, 253, 246, .72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 16px; padding: 10px;
  box-shadow: 0 16px 40px rgba(31, 61, 43, .22);
  transition: transform .3s, box-shadow .3s;
}
.hero-video-col.show,
.hero-video-card.show { display: block; }
.hero-video-col.show {
  display: flex; justify-content: flex-end; align-self: center;
  padding-right: clamp(0px, 2vw, 24px);
}
.hero-video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 54px rgba(31, 61, 43, .28);
}
.hero-video-screen {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px;
  overflow: hidden; background: #1a2e22;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10);
}
.hero-video-screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-video-mask {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, rgba(10, 25, 18, .08), rgba(10, 25, 18, .40));
}
.play-ring {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  transition: transform .25s;
}
.play-ring svg { width: 22px; height: 22px; margin-left: 2px; }
.hero-video-card:hover .play-ring { transform: scale(1.08); }
.hero-video-label {
  font-size: 12px; letter-spacing: 2px; color: #fff; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
}
.video-modal {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(10, 20, 14, .93);
}
.video-modal.show { display: flex; }
.video-modal-box { width: min(1080px, 96vw); }
.video-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.video-modal-title { color: #fff; font-size: 16px; letter-spacing: 2px; font-weight: 600; }
.video-close {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 16px;
}
.video-close:hover { background: rgba(255, 255, 255, .28); }
.video-modal-box video {
  width: 100%; aspect-ratio: 16 / 9; display: block; background: #000;
  border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
@media (max-width: 900px) {
  .hero-video-card { max-width: 100%; padding: 8px; border-radius: 12px; }
  .play-ring { width: 42px; height: 42px; }
  .video-modal { padding: 12px; }
}
