/* ============ 复元草堂 · 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: #FDF8EC;
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.65;
  color: #26221C;
  max-width: 250px;
  box-shadow: 0 10px 26px rgba(54, 42, 24, .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: #FDF8EC;
  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(20, 48, 42, .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), #7d5c32);
  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: #FDF8EC;
  border: 1px solid rgba(20, 48, 42, .15);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(20, 48, 42, .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(--ink) 0%, var(--ink-2) 100%);
  color: #F7F2E7;
  flex-shrink: 0;
}
.ai-avatar {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover; object-position: 50% 8%;
  background: #F7F2E7;
  box-shadow: 0 0 0 2px rgba(247, 242, 231, .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: #F7F2E7;
  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(176, 138, 82, .5);
  color: #26221C;
  border-top-left-radius: 4px;
}
.ai-msg-user .ai-bubble {
  background: var(--cinnabar);
  color: #FDF8EC;
  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 var(--line);
  flex-shrink: 0;
}
.ai-quick button {
  border: 1px solid rgba(20, 48, 42, .25);
  background: #F0E8D4; color: var(--ink);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px; cursor: pointer;
}
.ai-quick button:hover { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar); }
.ai-input {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.ai-input button.ai-mic {
  width: 34px; height: 34px; flex-shrink: 0;
  border: 1.5px solid rgba(20, 48, 42, .3);
  border-radius: 50%;
  background: #F0E8D4; color: var(--ink);
  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(--cinnabar); color: #fff; }
.ai-input button.ai-mic.listening {
  background: #A6402F; border-color: #A6402F; color: #fff;
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(166, 64, 47, .45); }
  50% { box-shadow: 0 0 0 7px rgba(166, 64, 47, 0); }
}
.ai-input button.ai-mic-off { opacity: .45; }
.ai-input input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13.5px;
  outline: none;
  background: #fff;
}
.ai-input input:focus { border-color: var(--ink); }
.ai-input button {
  border: none; border-radius: 999px;
  background: linear-gradient(135deg, var(--cinnabar), #7a2e22);
  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 {
  position: relative; width: 100%; max-width: 400px; cursor: pointer;
  background: rgba(253, 248, 236, .85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(20, 48, 42, .15);
  border-radius: 12px; padding: 8px;
  box-shadow: 0 16px 40px rgba(20, 48, 42, .20);
  transition: transform .3s, box-shadow .3s;
}
.hero.video-col.show,
.hero-video-col.show { display: block; }
.hero.with-video .hero-video-col {
  display: flex; justify-content: center; align-self: center;
}
.hero-video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 54px rgba(20, 48, 42, .26);
}
.hero-video-screen {
  position: relative; aspect-ratio: 16 / 9; border-radius: 8px;
  overflow: hidden; background: #0d1a16;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.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, 20, 16, .08), rgba(10, 20, 16, .42));
}
.play-ring {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--ink);
  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: #FDF8EC; 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: #FDF8EC; 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: #FDF8EC; 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: 6px; border-radius: 10px; }
  .play-ring { width: 42px; height: 42px; }
  .video-modal { padding: 12px; }
}
