/* 山上归来 · 智能问答助手样式 */
:root { --qa-gold: #c39a45; --qa-gold-d: #a87f2e; }

/* 悬浮按钮 */
.qa-fab {
  position: fixed; right: calc(24px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 10000;
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  background: linear-gradient(135deg, #d8b36a, #b8892f);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(168,127,46,.45);
  transition: transform .3s ease, box-shadow .3s ease, opacity .3s ease;
  animation: qaPulse 2.6s ease-in-out infinite;
}
.qa-fab:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 16px 34px rgba(168,127,46,.55); }
.qa-fab::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(195,154,69,.5); animation: qaRing 2.6s ease-out infinite;
}
.qa-fab-hide { opacity: 0; transform: scale(.5); pointer-events: none; animation: none; }
@keyframes qaPulse { 0%,100% { box-shadow: 0 10px 26px rgba(168,127,46,.45); } 50% { box-shadow: 0 10px 32px rgba(195,154,69,.7); } }
@keyframes qaRing { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.55); opacity: 0; } }

/* 聊天弹窗 */
.qa-panel {
  position: fixed; right: calc(24px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 10001;
  width: 372px; height: 600px; max-height: calc(100vh - 44px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 18px;
  box-shadow: 0 24px 60px rgba(30,25,15,.28);
  opacity: 0; transform: translateY(24px) scale(.96); transform-origin: bottom right;
  pointer-events: none; transition: opacity .32s ease, transform .32s ease;
}
.qa-panel.qa-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* 头部 */
.qa-head {
  flex: 0 0 auto; padding: 16px 16px; display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #2c2620, #40342a); color: #fff;
}
.qa-hl { display: flex; align-items: center; gap: 12px; }
.qa-hlogo {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg,#d8b36a,#b8892f); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; font-family: "Noto Serif SC", serif;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.qa-ht { font-size: 15.5px; font-weight: 600; letter-spacing: .5px; }
.qa-hs { font-size: 12px; color: #cdbfa6; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.qa-dot { width: 7px; height: 7px; border-radius: 50%; background: #5fd08a; box-shadow: 0 0 0 3px rgba(95,208,138,.22); }
.qa-close { background: none; border: none; color: #cdbfa6; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; transition: color .2s; }
.qa-close:hover { color: #fff; }

/* 消息区 */
.qa-body { flex: 1 1 auto; overflow-y: auto; padding: 18px 16px; background: #faf8f4; scroll-behavior: smooth; }
.qa-msg { max-width: 88%; margin-bottom: 12px; font-size: 14px; line-height: 1.65; word-break: break-word; }
.qa-bot { align-self: flex-start; }
.qa-bot, .qa-user {
  padding: 10px 14px; border-radius: 14px;
}
.qa-bot { background: #f0ede6; color: #3c372f; border-bottom-left-radius: 4px; display: inline-block; }
.qa-user { background: linear-gradient(135deg,#d8b36a,#bd8f37); color: #fff; border-bottom-right-radius: 4px; margin-left: auto; display: block; }

/* 答案卡片 */
.qa-card { background: #fff; border: 1px solid #ece6d8; border-radius: 10px; padding: 10px 12px; margin: 9px 0; box-shadow: 0 2px 8px rgba(40,35,25,.04); }
.qa-cq { font-size: 13.5px; font-weight: 600; color: #2b2620; margin-bottom: 4px; }
.qa-ca { font-size: 13px; color: #6f675b; line-height: 1.6; }
.qa-more { font-size: 12.5px; color: #9a9183; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.qa-more a, .qa-copywx { color: var(--qa-gold-d); cursor: pointer; text-decoration: none; }
.qa-more a:hover, .qa-copywx:hover { text-decoration: underline; }

/* 无匹配联系方式 */
.qa-contact { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.qa-tel, .qa-wxbtn {
  font-size: 13px; padding: 8px 14px; border-radius: 20px; text-decoration: none; cursor: pointer;
}
.qa-tel { background: var(--qa-gold); color: #fff; }
.qa-wxbtn { background: #fff; color: var(--qa-gold-d); border: 1px solid #e2d3ac; }

/* 快捷问题 */
.qa-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.qa-chip {
  background: #fff; border: 1px solid #e4d7b8; color: var(--qa-gold-d);
  font-size: 12.5px; padding: 6px 13px; border-radius: 20px; cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.qa-chip:hover { background: var(--qa-gold); color: #fff; transform: translateY(-1px); }

/* 输入栏 */
.qa-inputbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid #efe9dc; }
.qa-input { flex: 1; border: none; outline: none; font-size: 14px; padding: 9px 12px; background: #f6f3ec; border-radius: 20px; color: #333; }
.qa-input:focus { background: #fff; box-shadow: 0 0 0 2px rgba(195,154,69,.3); }
.qa-send { width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; flex: 0 0 auto; background: linear-gradient(135deg,#d8b36a,#b8892f); color: #fff; display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.qa-send:hover { transform: scale(1.08); }

/* 移动端 */
@media (max-width: 575px) {
  .qa-fab { right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); width: 60px; height: 60px; }
  .qa-panel { right: calc(10px + env(safe-area-inset-right)); left: calc(10px + env(safe-area-inset-left)); width: auto; bottom: calc(10px + env(safe-area-inset-bottom)); height: min(74vh, 640px); max-height: calc(100vh - 20px); }
}
