/* ======================================================================
   MASS 客服组件 v5 —— 照抄 kkidc.com 原版设计
   图标资源 /landing-assets/kf/（取自 kkidc 原版）
   ====================================================================== */
.kf-side {
  position: fixed;
  bottom: 23px;
  right: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.kf-side ul { list-style: none; margin: 0; padding: 0; }

/* ---- 通用白塔 ---- */
.kf-wrap {
  position: relative;
  background: #fff;
  border-radius: 30px;
  box-shadow: 0 0 20px rgba(114, 157, 216, .2);
}

/* 售前咨询：渐变竖排胶囊（去 kkidc 底图，纯 CSS 重绘） */
.kf-tall {
  margin-bottom: 10px;
  width: 62px;
  height: 148px;
  background: linear-gradient(170deg, #2981ff 0%, #2563eb 55%, #1d4ed8 100%);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 0 10px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .32);
  transition: transform .25s cubic-bezier(.34, 1.35, .64, 1), box-shadow .25s;
  overflow: hidden;
}
.kf-tall::before {
  content: "";
  position: absolute;
  top: -20px;
  right: -24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  pointer-events: none;
}
.kf-tall::after {
  content: "";
  position: absolute;
  bottom: -26px;
  left: -18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(129, 154, 255, .26);
  pointer-events: none;
}
.kf-tall:hover {
  transform: translateX(-4px) scale(1.04);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .45);
}
.kf-tall:hover .kf-tall-btn { opacity: 1; }
.kf-tall .kf-tall-icon {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kf-tall .kf-tall-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
}
.kf-tall .kf-tall-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: #fff;
  writing-mode: vertical-rl;
  font-size: 15px;
  letter-spacing: 6px;
  font-weight: 600;
  line-height: 1;
  opacity: .95;
  transition: opacity .2s ease;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.kf-tall:hover .kf-tall-btn,
.kf-tall.on .kf-tall-btn { opacity: .9; }
/* 三点动画气泡 */
.kf-bubble-anim {
  position: absolute;
  right: 4px;
  top: 12px;
  display: block;
  width: 20px;
  height: 8px;
  pointer-events: none;
}
.kf-bubble-anim i {
  width: 2px;
  height: 2px;
  border-radius: 2px;
  display: block;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  animation: kf-dot 3s infinite;
}
.kf-bubble-anim i:nth-child(1) { left: 4px; animation-duration: 1s; }
.kf-bubble-anim i:nth-child(2) { left: 9px; animation-delay: .3s; animation-duration: 1.2s; }
.kf-bubble-anim i:nth-child(3) { left: 14px; animation-delay: .6s; animation-duration: 1.4s; }
@keyframes kf-dot {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

/* 白色工具塔： hotline / 售后 */
.kf-tower {
  width: 62px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 0 22px rgba(114, 157, 216, .22), 0 2px 6px rgba(15, 23, 42, .04);
  overflow: visible;
  isolation: isolate;
}
.kf-li {
  position: relative;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  cursor: pointer;
  color: #323235;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.1;
  box-sizing: border-box;
  border-radius: inherit;
  transition: background .18s ease, color .18s ease;
  will-change: background-color;
}
.kf-li + .kf-li { border-top: 1px solid #f2f5f9; }
.kf-li:hover {
  background: linear-gradient(135deg, #eef5ff, #f4f8ff);
  color: #1d4ed8;
  border-radius: 18px;
}
.kf-a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 500;
}
.kf-a > span { display: block; letter-spacing: .5px; }

/* 图标芯片（内部为 kkidc 原版 sprite） */
.kf-a .sp {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #eef5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease, transform .18s ease;
}
.kf-li:hover .kf-a .sp { background: #fff; transform: translateY(-1px); }
.sp {
  display: inline-block;
  width: 24px;
  height: 24px;
  position: relative;
}
.sp::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-image: url(/landing-assets/kf/slide-icons_24_24.png);
  background-position: 0 0;
  transition: background-position .18s ease;
}
.kf-li:hover .sp::before { background-position-y: -24px; }
.sp-tel::before { background-position: -48px 0; }
.kf-li:hover .sp-tel::before { background-position-y: -24px; }
.sp-sale::before { background-position: 0 0; }
.kf-li:hover .sp-sale::before { background-position-y: -24px; }
.sp.sm { transform: scale(.7); }

/* 悬停气泡（kkidc 同款左侧弹出） */
.kf-pop, .kf-tower .kf-pop {
  position: absolute;
  right: 74px;
  top: 50%;
  margin-top: -14px;
  background: #fff;
  padding: 12px 18px 6px 14px;
  white-space: nowrap;
  border-radius: 12px;
  color: #1c1d1f;
  box-shadow: 0 0 22px rgba(114, 157, 216, .28), 0 8px 20px rgba(15, 23, 42, .06);
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: opacity .25s ease, transform .25s cubic-bezier(.34, 1.3, .64, 1), visibility .25s;
  text-align: left;
  z-index: 30;
  font-size: 12.5px;
}
.kf-pop::before {
  border: 5px solid transparent;
  border-left-color: #fff;
  content: " ";
  height: 0;
  width: 0;
  left: 100%;
  margin-top: -5px;
  position: absolute;
  top: 22px;
}
.kf-pop b { color: #2981ff; }
.kf-li:hover .kf-pop, .kf-pop.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}
.kf-li::after {
  content: "";
  width: 16px;
  height: 100%;
  position: absolute;
  left: 100%;
  top: 0;
}

.kf-choice { padding: 14px 20px 4px 14px; }
.kf-choice a {
  display: block;
  position: relative;
  padding-left: 40px;
  line-height: 24px;
  margin-bottom: 10px;
  text-decoration: none;
  color: #1c1d1f;
}
.kf-choice a p { margin: 0; color: #1c1d1f; font-size: 13px; }
.kf-choice a p:hover { color: #2981ff; }
.kf-choice a div { font-size: 12px; color: #626266; }
.kf-choice a i {
  position: absolute;
  width: 28px;
  height: 28px;
  left: 0;
  top: -2px;
  background: #f1f4f7;
  border-radius: 50%;
  text-align: center;
}
.kf-choice a i::before { transform: scale(.83); top: 2px; }
.qq-ico {
  background: url(/landing-assets/kf/qidian-qq-consult.png) center center / 17px 17px no-repeat !important;
  display: inline-block;
  width: 17px;
  height: 17px;
  background-color: transparent;
  position: absolute;
  left: 5px;
  top: 3px;
}

/* AI 助理卡片：渐变底 + 动画背景 + 呼吸光环 */
.kf-ai-card {
  width: 60px;
  box-sizing: border-box;
  padding: 32px 12px 12px;
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  line-height: 15px;
  border-radius: 30px;
  color: #fff;
  background: linear-gradient(180deg, #34389c 0%, #4144ff 100%);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.34, 1.35, .64, 1), box-shadow .25s;
}
.kf-ai-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url(/landing-assets/kf/nkf_ai_bgg.jpg) center / 100% 100%;
  opacity: .45;
  animation: kf-movebg 5s linear infinite;
  pointer-events: none;
}
.kf-ai-card::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 44px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(147, 150, 255, .55);
  animation: kf-ring 2.2s infinite;
  pointer-events: none;
}
@keyframes kf-ring {
  0% { box-shadow: 0 0 0 0 rgba(147, 150, 255, .5); }
  70% { box-shadow: 0 0 0 10px rgba(147, 150, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(147, 150, 255, 0); }
}
.kf-ai-card:hover { transform: translateX(-4px) scale(1.04); box-shadow: 0 10px 22px rgba(65, 68, 255, .35); }
.kf-ai-card em { font-style: normal; position: relative; z-index: 1; }
@keyframes kf-movebg {
  0% { background-position: -45px -45px; }
  25% { background-position: -45px -60px; }
  50% { background-position: -70px -60px; }
  75% { background-position: -60px -45px; }
  100% { background-position: -45px -45px; }
}
.kf-ai-avatar {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 3px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #7ee0ff 0 22%, transparent 24%),
    radial-gradient(circle at 66% 55%, #4144ff 0 30%, transparent 32%),
    radial-gradient(circle at 46% 46%, #8f5bff 0 44%, transparent 46%),
    linear-gradient(135deg, #4144ff, #8f5bff);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
  overflow: hidden;
}
.kf-ai-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .06);
}
.kf-ai-avatar.small { display: inline-block; width: 20px; height: 20px; margin: 0; vertical-align: -5px; }

/* 置顶（toTop 圆卡） */
.kf-totop {
  width: 56px;
  height: 56px;
  border: 0;
  text-align: center;
  background: #fff;
  border-radius: 50%;
  margin-top: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 11px;
  color: #323235;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(114, 157, 216, .2);
  font-family: inherit;
  padding: 0;
}
.kf-totop.show { display: flex; }
.kf-totop img { width: 16px; margin-bottom: 3px; filter: grayscale(1) brightness(1.1); }
.kf-totop:hover { color: #2981ff; box-shadow: 0 0 22px rgba(41, 129, 255, .3); transform: translateY(-3px); }
.kf-totop { transition: color .18s ease, box-shadow .18s ease, transform .18s ease; }
.kf-totop img { transition: filter .18s ease; }
.kf-totop:hover img { filter: hue-rotate(200deg) saturate(3) brightness(.9); }

/* 售前咨询弹出面板（kkidc kf 弹层：fixed right74 bottom80 宽面板） */
.kf-fly {
  position: fixed;
  left: auto;
  right: 74px;
  bottom: 80px;
  width: 300px;
  z-index: 99;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 7px 24px rgba(125, 131, 137, .12), 0 0 0 1px #f0f3f7;
  overflow: hidden;
  transform-origin: right bottom;
  animation: kf-rise .3s cubic-bezier(.34, 1.3, .64, 1);
}
@keyframes kf-rise {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.kf-fly { animation-name: kf-rise; }
.kf-fly .kf-panel { position: static; opacity: 1; visibility: visible; transform: none; width: auto; }

.kf-panel-head {
  background: linear-gradient(135deg, #2981ff, #4f46e5);
  color: #fff;
  padding: 14px 18px;
}
.kf-panel-head b { display: block; font-size: 15px; font-weight: 700; }
.kf-panel-head span { display: block; font-size: 12px; opacity: .85; margin-top: 2px; }
.kf-panel-body { padding: 10px 12px 0; }
.kf-item { margin: 0; }
.kf-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  color: #323235;
  font-size: 13.5px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.kf-item a:hover { background: #eef5ff; color: #2981ff; }
.kf-item .kf-ico {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef5ff;
}
.kf-item .kf-ico svg { width: 16px; height: 16px; color: #2981ff; }
.kf-item.type-wechat .kf-ico { background: #effbf1; }
.kf-item.type-wechat .kf-ico svg { color: #26ad5c; }
.kf-item.type-qq .kf-ico { background: #e9f6ff; }
.kf-item.type-qq .kf-ico svg { color: #2981ff; }
.kf-item.type-tel .kf-ico { background: #fff6ec; }
.kf-item.type-tel .kf-ico svg { color: #f49f1a; }
.kf-item .kf-dot {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #26ad5c;
  opacity: .9;
}
.kf-panel-foot {
  margin-top: 8px;
  border-top: 1px solid #f0f3f7;
  background: #fafbfc;
  padding: 11px 18px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #6a6a6f;
  font-size: 12.5px;
  text-decoration: none;
}
.kf-panel-foot svg { width: 14px; height: 14px; color: #2981ff; flex-shrink: 0; }
.kf-panel-foot b { color: #2981ff; font-weight: 700; white-space: nowrap; }
.kf-empty { padding: 20px 8px; text-align: center; color: #93939a; font-size: 12.5px; }
.kf-empty p { margin: 0; }

/* 键盘可达性焦点 */
.kf-btn:focus-visible, .kf-a:focus-visible, .kf-m-item:focus-visible, .kf-tall-btn:focus-visible {
  outline: 2px solid #2981ff;
  outline-offset: 2px;
  border-radius: 8px;
}

/* 微信二维码浮层 */
.kf-qr-float {
  position: fixed;
  z-index: 1000;
  width: 208px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(114, 157, 216, .3);
  padding: 14px 14px 12px;
  text-align: center;
  animation: kf-pop .2s;
}
.kf-qr-float__head { font-size: 13.5px; font-weight: 700; color: #1c1d1f; margin-bottom: 8px; }
.kf-qr-float img { width: 176px; height: 176px; border-radius: 8px; border: 1px solid #f0f3f7; }
.kf-qr-float__tip { font-size: 11.5px; color: #93939a; margin-top: 7px; }
@keyframes kf-pop {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; }
}

/* ================= AI 聊天窗（kkidc nkf-service-ai-assistant 同款布局） ================= */
.kf-chat {
  position: fixed;
  right: 73px;
  bottom: 20px;
  z-index: 950;
  width: 460px;
  height: 704px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background-color: #fff;
  background-image: url(/landing-assets/kf/ai-assistant-bg.jpg);
  background-size: 100% 100%;
  border-radius: 20px;
  box-shadow: 0 4px 18px rgba(31, 71, 186, .15);
  overflow: hidden;
  color: #323235;
  animation: kf-pop .22s;
}
.kf-chat.is-full {
  top: 0;
  bottom: 0;
  right: 0;
  width: 100vw;
  height: auto;
  max-height: none;
  border-radius: 20px 0 0 20px;
}
.kf-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  color: #323235;
}
.kf-chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  user-select: none;
}
.kf-chat-head .kf-ai-avatar { width: 34px; height: 34px; margin: 0; box-shadow: 0 0 0 2px #fff; }
.kf-chat-tools { display: flex; gap: 4px; }
.kf-chat-tool {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #262626;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.kf-chat-tool:hover { background: rgba(220, 225, 245, .6); }
.kf-chat-tool svg { width: 18px; height: 18px; }
.kf-chat-close svg { width: 16px; height: 16px; }

/* 欢迎区（首条消息后淡出） */
.kf-chat-hero {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 30px 8px;
  transition: opacity .3s ease, max-height .4s ease, padding .3s ease, margin .3s ease;
  max-height: 340px;
}
.kf-chat-hero.hide { opacity: 0; max-height: 0; padding: 0; margin: 0; overflow: hidden; }
.kf-chat-hero .kf-ai-avatar {
  width: 88px;
  height: 88px;
  border-radius: 26px;
  margin-bottom: 12px;
  box-shadow: inset 0 3px 6px rgba(66, 63, 255, .25), 0 0 0 3px rgba(255, 255, 255, .9), 0 10px 26px rgba(31, 71, 186, .18);
}
.kf-chat-hero .kf-ai-avatar img { border-radius: 22px; box-shadow: none; }
.kf-chat-hero b { font-size: 16px; color: #1c1d1f; margin-bottom: 4px; }
.kf-chat-hero p { margin: 0; font-size: 12.5px; color: #6a85b5; line-height: 1.6; }

.kf-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 8px;
  scrollbar-width: none;
}
.kf-chat-log::-webkit-scrollbar { display: none; }
.kf-row { display: flex; align-items: flex-start; margin: 0 0 12px; }
.kf-row .kf-ai-avatar { width: 30px; height: 30px; margin: 2px 8px 0 0; flex-shrink: 0; }
.kf-row.user { justify-content: flex-end; }
.kf-chat .msg {
  max-width: 78%;
  margin: 0;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.kf-chat .msg.ai {
  background: rgba(255, 255, 255, .95);
  color: #1c1d1f;
  border: 1px solid rgba(226, 232, 240, .8);
  border-top-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(31, 71, 186, .06);
}
.kf-chat .msg.loading { color: #93939a; font-style: italic; }
.kf-chat .msg.user {
  background: #2981ff;
  color: #fff;
  border-top-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(41, 129, 255, .2);
}
.kf-chips {
  display: flex;
  gap: 8px;
  padding: 6px 20px 8px;
  background: transparent;
  overflow-x: auto;
}
.kf-chips button {
  flex-shrink: 0;
  padding: 5px 12px;
  border: 1px solid rgba(65, 68, 255, .35);
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  color: #4144ff;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.kf-chips button:hover { background: #e5edff; transform: translateY(-1px); }
.kf-chat-input { display: flex; gap: 8px; align-items: flex-end; padding: 6px 16px 10px; }
.kf-chat-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid #dfe4f2;
  background: rgba(255, 255, 255, .92);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  font-size: 13.5px;
  max-height: 96px;
  outline: none;
  box-shadow: 0 2px 10px rgba(31, 71, 186, .06);
}
.kf-chat-input textarea:focus { border-color: #4144ff; }
.kf-chat-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2981ff, #4144ff);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(41, 129, 255, .3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kf-chat-send svg { width: 17px; height: 17px; }
.kf-chat-send:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(41, 129, 255, .4); }
.kf-chat-foot {
  padding: 0 0 10px;
  text-align: center;
  font-size: 11px;
  color: #93a1c1;
}

/* AI 消息 Markdown 样式 */

/* ================= 移动端 ================= */
/* 右下角小型按钮塔（与 PC 塔同构、尺寸缩小） */
.kf-m { display: none; }
/* 移动端：按钮逐个分离（独立圆形卡，间距 stagger） */
.kf-tower-m {
  position: fixed;
  right: 8px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 910;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: auto;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.kf-tower-m .kf-li {
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid rgba(240, 243, 247, .9);
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(15, 23, 42, .08), 0 5px 16px rgba(114, 157, 216, .16);
  transition: transform .2s cubic-bezier(.34,1.4,.64,1);
}
.kf-tower-m .kf-li:active { transform: scale(.9); }
.kf-tower-m .kf-a { gap: 2px; }
.kf-tower-m .kf-a svg { width: 14px; height: 14px; }
.kf-tower-m .kf-a > span { font-size: 8px; margin-top: 0; letter-spacing: 0; }
.kf-tower-m .kf-m-ava { width: 16px; height: 16px; }
.kf-tower-m .kf-m-ava { width: 16px; height: 16px; }
.kf-m-ava {
  display: inline-flex;
  width: 20px; height: 20px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px #ddd;
}
.kf-m-ava img { width: 100%; height: 100%; object-fit: cover; }
.kf-li-ai .kf-a:hover, .kf-li-ai .kf-a:active { color: #7c3aed; background: #f5f3ff; }

/* 抽屉（保留原样式） */
.kf-m-mask {
  position: fixed;
  inset: 0;
  z-index: 920;
  background: rgba(30, 32, 36, .48);
  opacity: 0;
  transition: opacity .22s ease;
}
.kf-m-mask.show { opacity: 1; }
.kf-m-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 930;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -7px 24px rgba(15, 23, 42, .16);
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.32, .72, 0, 1);
  max-height: 74vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.kf-m-sheet.show { transform: translateY(0); }
.kf-m-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 11px;
  border-bottom: 1px solid #f0f3f7;
}
.kf-m-head b { font-size: 15.5px; color: #1c1d1f; font-weight: 700; }
.kf-m-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f5f6f8;
  color: #6a6a6f;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kf-m-body { padding: 10px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
.kf-m-body .kf-item a { padding: 12px 10px; font-size: 14.5px; border-radius: 12px; }
.kf-m-body .kf-item .kf-ico { width: 40px; height: 40px; }
.kf-m-body .kf-item .kf-ico svg { width: 19px; height: 19px; }
.kf-m-body .kf-panel-foot { font-size: 13px; margin-top: 12px; border-radius: 10px; }
.kf-m-body .kf-empty { padding: 24px 8px; }

@media (max-width: 768px) {
  .kf-side { display: none; }
  .kf-m { display: block; }
  .kf-chat { right: 0; left: 0; bottom: 0; width: 100vw; height: calc(100dvh - env(safe-area-inset-top, 0px)); border-radius: 0; transform: translateX(0); }
  .kf-chat-head { border-radius: 0; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
}

@media (max-width: 768px) {
  .kf-side { display: none; }
  .kf-m { display: block; }
  .kf-chat {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    height: calc(100dvh - env(safe-area-inset-top, 0px));
    border-radius: 0;
    transform: translateX(0);
  }
  .kf-chat-head { border-radius: 0; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .kf-m-pill { transition: transform .3s ease, opacity .25s ease; }
  .kf-sheet-open .kf-m-pill { opacity: 0; pointer-events: none; transform: translateY(10px); }
}

/* AI 消息 Markdown 样式 */
.kf-chat .msg.ai strong { font-weight: 700; }
.kf-chat .msg.ai .kf-md-h {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin: 6px 0 2px;
}
.kf-chat .msg.ai .kf-md-ul { margin: 2px 0 4px; padding-left: 16px; }
.kf-chat .msg.ai .kf-md-ul li { margin: 2px 0; }
.kf-chat .msg.ai .kf-md-inline {
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.kf-chat .msg.ai .kf-md-code {
  margin: 6px 0;
  padding: 8px 10px;
  background: #0f172a;
  border-radius: 8px;
  overflow-x: auto;
}
.kf-chat .msg.ai .kf-md-code code {
  font-size: 11.5px;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre;
}
.kf-chat .msg.ai a { color: #2981ff; text-decoration: underline; }
/* 流式输出光标 */
.kf-caret {
  display: inline-block;
  width: 2px;
  height: 14px;
  margin-left: 2px;
  vertical-align: -2px;
  background: #2981ff;
  animation: kf-caret .9s steps(1) infinite;
}
@keyframes kf-caret { 50% { opacity: 0; } }
