/* ============================================================
   九鼎 · 玩家端客服聊天
   叠加在 zaka-skin.v7.css 之上，只改外观和动效，不动功能。
   删掉 index.html 里引用本文件和 zaka-kfchat.v1.js 的两行即可回到原样。
   ============================================================ */
@keyframes zkPopL{0%{opacity:0;transform:translateY(8px) scale(.82)}60%{opacity:1;transform:translateY(0) scale(1.03)}100%{transform:none}}
@keyframes zkPopR{0%{opacity:0;transform:translateY(8px) scale(.82)}60%{opacity:1;transform:translateY(0) scale(1.03)}100%{transform:none}}
@keyframes zkSendOn{0%{transform:scale(.7)}60%{transform:scale(1.12)}100%{transform:scale(1)}}

/* 背景：淡紫渐变 + 两团柔光 */
html body.zk-page-chat .zk-chat-shell{
  background:
    radial-gradient(120% 55% at 0% 0%, rgba(196,170,255,.38) 0%, rgba(196,170,255,0) 60%),
    radial-gradient(100% 50% at 100% 100%, rgba(170,190,255,.34) 0%, rgba(170,190,255,0) 62%),
    linear-gradient(180deg,#f7f3ff 0%,#eff0ff 100%) !important;
}
html body.zk-page-chat .pc-bg-wallpaper{background:linear-gradient(180deg,#f7f3ff 0%,#eff0ff 100%) !important}

/* 标题栏和输入栏共用实色底与分隔线。 */
html body .fh-chat-titlebar,
html body.zk-page-chat .zk-chat-shell > .fh-chat-titlebar,
html body .fh-chat-titlebar ~ input[type="file"] + div {
  --support-chat-surface: #f8f9fc;
  --support-chat-divider: #dfe2ed;
  background: var(--support-chat-surface) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-sizing: border-box;
  margin: 0 !important;
  flex-shrink: 0;
}
html body .fh-chat-titlebar,
html body.zk-page-chat .zk-chat-shell > .fh-chat-titlebar {
  border-bottom: 1px solid var(--support-chat-divider) !important;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 6px 12px;
}
html body .fh-chat-titlebar > button {
  width: 28px;
  height: 36px;
  flex: 0 0 auto;
  justify-content: center;
  padding: 0 !important;
}
html body .fh-chat-titlebar > div:nth-child(2) > div:first-child {
  width: 36px !important;
  height: 36px !important;
  border-color: var(--support-chat-surface) !important;
}
html body .fh-chat-titlebar > button svg path {stroke:#3b3354 !important}
html body .fh-chat-titlebar > button svg circle {fill:#3b3354 !important}
html body .fh-chat-titlebar > div:nth-child(3) > div:first-child {color:#242032 !important; font-weight:600}
.fh-agent-presence {position:absolute; right:0; bottom:0; width:10px; height:10px; border:2px solid var(--support-chat-surface,#fff); box-sizing:border-box; border-radius:50%; background:#949ba5}
.fh-agent-presence.is-online {background:#209c5a}

/* 气泡：对方白色玻璃，自己紫色渐变；小尾巴角 */
html body.zk-page-chat .zk-chat-shell .zk-bub-other,
html body.zk-page-chat .zk-chat-shell [style*="border-radius: 4px 16px"]{
  background:rgba(255,255,255,.88) !important;
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
  border:.5px solid rgba(255,255,255,.95) !important;
  border-radius:20px 20px 20px 6px !important;
  box-shadow:0 2px 10px rgba(124,58,237,.07) !important;color:#1f1b2e !important;
  transition:transform .18s ease;transform-origin:bottom left;
}
html body.zk-page-chat .zk-chat-shell .zk-bub-self,
html body.zk-page-chat .zk-chat-shell [style*="border-radius: 16px 4px"]{
  background:linear-gradient(135deg,#B57BFF 0%,#8B5CF6 45%,#7C3AED 100%) !important;color:#fff !important;
  border:none !important;border-radius:20px 20px 6px 20px !important;
  box-shadow:0 6px 16px rgba(124,58,237,.28) !important;
  transition:transform .18s ease;transform-origin:bottom right;
}
html body.zk-page-chat .zk-bub-other:active{transform:scale(.97)}
html body.zk-page-chat .zk-bub-self:active{transform:scale(.97)}
html body.zk-page-chat .zk-bub-other.zk-pop{animation:zkPopL .42s cubic-bezier(.34,1.56,.64,1) both}
html body.zk-page-chat .zk-bub-self.zk-pop{animation:zkPopR .42s cubic-bezier(.34,1.56,.64,1) both}
html body.zk-page-chat .zk-chat-shell img[alt="在线客服"],
html body.zk-page-chat .zk-chat-body [style*="width: 34px"][style*="border-radius: 50%"]{
  border-color:#fff !important;box-shadow:0 2px 8px rgba(124,58,237,.16) !important;
}

/* 文件输入与消息输入同属客服会话，样式随输入栏一起就绪。 */
html body .fh-chat-titlebar ~ input[type="file"] + div {
  border-top: 1px solid var(--support-chat-divider) !important;
  min-height: 58px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  position: relative;
  z-index: 6;
}
html body .fh-chat-titlebar ~ input[type="file"] + div > div:nth-child(2) {
  min-width: 0;
  min-height: 40px;
  background: #fff !important;
  border: 1px solid var(--support-chat-divider) !important;
  box-shadow: none !important;
  transition: border-color .2s, box-shadow .2s;
}
html body .fh-chat-titlebar ~ input[type="file"] + div > div:nth-child(2):focus-within {
  border-color: #9d7cd5 !important;
  box-shadow: 0 0 0 2px #eee7fa !important;
}
html body .fh-chat-titlebar ~ input[type="file"] + div > div:nth-child(3) > div {
  box-sizing: border-box;
  max-width: calc(100vw - 70px);
}
html body.zk-page-chat .zk-chat-foot > button{transition:transform .15s ease,background .2s}
html body.zk-page-chat .zk-chat-foot > button:active{transform:scale(.88)}
html body.zk-page-chat .zk-chat-foot > button:not(:last-child) svg path,
html body.zk-page-chat .zk-chat-foot > button:not(:last-child) svg circle,
html body.zk-page-chat .zk-chat-foot > button:not(:last-child) svg rect{stroke:#7c6aa8 !important}
/* 发送按钮：没字时淡紫，有字时紫色渐变 + 弹一下 */
html body.zk-page-chat .zk-chat-foot > button:last-child.zk-send-idle{
  background:rgba(124,58,237,.12) !important;background-image:none !important;box-shadow:none !important;
}
html body.zk-page-chat .zk-chat-foot > button:last-child.zk-send-idle svg path{stroke:#9b8fc2 !important}
html body.zk-page-chat .zk-chat-foot > button:last-child:not(.zk-send-idle){
  background:linear-gradient(135deg,#A855F7,#7C3AED) !important;
  box-shadow:0 4px 12px rgba(124,58,237,.35) !important;
  animation:zkSendOn .35s cubic-bezier(.34,1.56,.64,1);
}

/* 客服中心卡片 */
html body .zk-kf-agent,html body .zk-kf-card{
  background:rgba(255,255,255,.72) !important;
  -webkit-backdrop-filter:blur(18px) saturate(170%);backdrop-filter:blur(18px) saturate(170%);
  border:.5px solid rgba(255,255,255,.95) !important;border-radius:20px !important;
  box-shadow:0 8px 24px rgba(124,58,237,.10) !important;
}
html body .zk-kf-agent:active{transform:scale(.98) !important}

/* 问鼎版客服名片和常见问题 */
html body .jd-support-card,
html body .jd-support-faq {
  background: #fff !important;
  border: 1px solid #e2e5ef !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 7px rgba(45, 52, 85, .06) !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html body.zk-page-chat .zk-chat-shell {
  background:linear-gradient(160deg,#edf0fa,#f7f7fc 58%,#eeedf7) !important;
}
html body .fh-chat-titlebar,html body.zk-page-chat .zk-chat-shell > .fh-chat-titlebar,
html body .fh-chat-titlebar ~ input[type="file"] + div {
  background:linear-gradient(135deg,#fff,#eff1fa) !important;
  border-color:#dce0ef !important; box-shadow:0 1px 5px #38477814 !important;
}
html body .fh-chat-titlebar > button {
  border:1px solid white !important; border-radius:10px !important; background:linear-gradient(#fff,#ebe8f8) !important;
  box-shadow:0 2px 4px #4033581e !important;
}
html body.zk-page-chat .zk-chat-shell .zk-bub-other {background:#fff !important;box-shadow:0 2px 7px #4c547a1c !important}
html body.zk-page-chat .zk-chat-shell .zk-bub-self,
html body.zk-page-chat .zk-chat-shell [style*="border-radius: 16px 4px"] {
  background:linear-gradient(145deg,#ae63ef,#8740d4) !important;
}
html body.zk-page-chat .zk-chat-foot > button:last-child:not(.zk-send-idle) {
  background:linear-gradient(155deg,#cd86fc,#a855eb 50%,#8540d5 51%,#aa65f0) !important;
}

/* Match the Android system bars to the conversation surfaces. */
html.jd-native body .fh-chat-titlebar,
html.jd-native body.zk-page-chat .zk-chat-shell > .fh-chat-titlebar,
html.jd-native body .fh-chat-titlebar ~ input[type="file"] + div {
  --support-chat-surface:#fff;
  background:#fff!important;
}
html.jd-native #root .wendingKefuTabWrap .fh-tab-header118 {
  background:#fff!important;
  color:#17213a!important;
}
html.jd-native #root .wendingKefuTabWrap .fh-tab-header118 .head_text {
  color:#17213a!important;
}
