/* ============================================================
   AI 智能客服抽屉面板（zykf-）
   ============================================================ */

/* ---- 遮罩 ---- */
.zykf-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  z-index: 2990;
  display: none;
}
.zykf-mask.zykf-show {
  display: block;
}

/* ---- 面板 ---- */
.zykf-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 400px;
  max-width: 94vw;
  background: #fff;
  z-index: 3000;
  display: none;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(15, 23, 42, .15);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  transform: translateX(100%);
  transition: transform .28s ease;
}
.zykf-panel.zykf-show {
  display: flex;
  transform: translateX(0);
}

/* ---- 头部 ---- */
.zykf-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #2358fe, #6b8cff);
  color: #fff;
  flex-shrink: 0;
}
.zykf-head-face {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.zykf-head-face .zykf-face-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #8ec5ff, #fff 55%, #dce8ff);
  opacity: .95;
}
.zykf-head-face .zykf-face-inner {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 4px;
  bottom: 4px;
  border-radius: 50%;
  background: linear-gradient(145deg, #206be7, #4d7fe8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.zykf-head-face .zykf-face-eye {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: zykf-blink 3.5s infinite;
}
@keyframes zykf-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(.1); }
}
.zykf-head-info {
  flex: 1;
  min-width: 0;
}
.zykf-head-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}
.zykf-head-sub {
  font-size: 12px;
  opacity: .85;
  line-height: 1.4;
}
.zykf-close {
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s ease;
}
.zykf-close:hover {
  background: rgba(255, 255, 255, .35);
}

/* ---- 消息区 ---- */
.zykf-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: #f7f9fc;
}
.zykf-msg {
  display: flex;
  margin-bottom: 12px;
}
.zykf-msg.zykf-msg-user {
  justify-content: flex-end;
}
.zykf-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
}
.zykf-msg-assistant .zykf-bubble {
  background: #fff;
  color: #2d3037;
  border: 1px solid #e8edf5;
  border-top-left-radius: 2px;
}
.zykf-msg-user .zykf-bubble {
  background: linear-gradient(135deg, #2358fe, #5b84ff);
  color: #fff;
  border-top-right-radius: 2px;
}
.zykf-bubble.zykf-empty::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  margin-left: 2px;
  background: #2358fe;
  vertical-align: -2px;
  animation: zykf-cursor .8s infinite;
}
@keyframes zykf-cursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
/* 等待动画(三个点) */
.zykf-wait {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 18px;
}
.zykf-wait i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9fb4d8;
  animation: zykf-bounce 1.2s infinite;
}
.zykf-wait i:nth-child(2) { animation-delay: .15s; }
.zykf-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes zykf-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-5px); opacity: 1; }
}
.zykf-err {
  color: #e05252;
  font-size: 13px;
}

/* ---- 欢迎语 + 预设问题 ---- */
.zykf-hello {
  text-align: center;
  font-size: 13px;
  color: #8b95a7;
  margin-bottom: 14px;
}
.zykf-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 6px;
}
.zykf-preset {
  border: 1px solid #d8e3fb;
  background: #fff;
  color: #2358fe;
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all .2s ease;
}
.zykf-preset:hover {
  background: #2358fe;
  color: #fff;
}

/* ---- 登录占位 ---- */
.zykf-login {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  text-align: center;
  padding: 20px;
}
.zykf-body.zykf-need-login .zykf-chatlist { display: none; }
.zykf-body.zykf-need-login .zykf-login { display: flex; }
.zykf-login-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, #206be7, #6b8cff);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.zykf-login-icon i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}
.zykf-login-title {
  font-size: 15px;
  font-weight: 600;
  color: #2d3037;
}
.zykf-login-desc {
  font-size: 13px;
  color: #8b95a7;
  line-height: 1.6;
}
.zykf-login-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 26px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2358fe, #5b84ff);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  transition: opacity .2s ease;
}
.zykf-login-btn:hover {
  opacity: .88;
  color: #fff;
}

/* ---- 底部输入区 ---- */
.zykf-foot {
  flex-shrink: 0;
  padding: 10px 12px 8px;
  background: #fff;
  border-top: 1px solid #eef1f5;
}
.zykf-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.zykf-input {
  flex: 1;
  resize: none;
  border: 1px solid #dde4ee;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.5;
  max-height: 96px;
  min-height: 38px;
  outline: none;
  font-family: inherit;
  transition: border-color .2s ease;
  box-sizing: border-box;
}
.zykf-input:focus {
  border-color: #2358fe;
}
.zykf-send {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #2358fe, #5b84ff);
  cursor: pointer;
  transition: opacity .2s ease;
  height: 38px;
  box-sizing: border-box;
}
.zykf-send:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.zykf-meta {
  margin-top: 6px;
  font-size: 11.5px;
  color: #a0a9b8;
  text-align: center;
}
.zykf-meta b {
  color: #2358fe;
  font-weight: 600;
}

/* ---- 悬浮栏 AI 入口(仿观星云小圆脸) ---- */
.zykf-bar-host {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid #eef1f5;
}
.zykf-bar-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 2px 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.zykf-bar-face {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
}
.zykf-bar-face .zykf-bar-halo {
  position: absolute;
  left: -4px;
  right: -4px;
  top: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(32, 107, 231, .2) 0%, transparent 72%);
  pointer-events: none;
}
.zykf-bar-face .zykf-bar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #8ec5ff, #206be7 55%, #6b8cff);
}
.zykf-bar-face .zykf-bar-inner {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 4px;
  bottom: 4px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 50%;
  background: #fff;
}
.zykf-bar-face .zykf-bar-eye {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1e293b;
}
.zykf-bar-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: #4d7fe8;
  font-weight: 600;
  line-height: 1;
}
.zykf-bar-label-ai {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.1;
  white-space: nowrap;
}
.zykf-bar-label-cn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-top: 1px;
}
.zykf-bar-label-cn i {
  font-style: normal;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 600;
}
.zykf-bar-entry:hover .zykf-bar-label-ai,
.zykf-bar-entry:hover .zykf-bar-label-cn i {
  color: #2358fe;
}
.zykf-bar-bubble {
  display: none;
  position: absolute;
  right: 64px;
  top: 50%;
  transform: translateY(-50%);
  width: 170px;
  min-height: 72px;
  padding: 10px 0 0 16px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 8px 40px 0 rgba(30, 35, 45, .08);
  box-sizing: border-box;
}
.zykf-bar-bubble::before {
  content: "";
  position: absolute;
  left: 100%;
  top: 0;
  width: 18px;
  height: 100%;
}
.zykf-bar-bubble::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: #fff;
}
.zykf-bar-host:hover .zykf-bar-bubble {
  display: block;
}
.zykf-bar-bubble .zykf-b-title {
  line-height: 26px;
  font-size: 16px;
  color: #2d3037;
}
.zykf-bar-bubble .zykf-b-text {
  line-height: 26px;
  font-size: 14px;
  color: #2358fe;
  margin-top: 2px;
}
