/* 在线客服悬浮窗 —— 官网 / 客户后台共用一份（由 deploy/stamp-assets.sh 复制到两个站）。
   所有类名带 mkc- 前缀，颜色写死成站点 B 方案的取值，不依赖各站自己的 CSS 变量名（两站变量名不一样）。
   层级：弹窗 100 之下、时区横幅 90 之上。 */
.mkc-root { --mkc-blue: #0867f5; --mkc-blue-deep: #0b5ed7; --mkc-ink: #1a2338; --mkc-muted: #6b778a; --mkc-line: #e3e9f2; --mkc-bg: #f7f9fc; --mkc-danger: #d93025; --mkc-ok: #1f9d55;
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif; font-size: 13px; line-height: 1.5; color: var(--mkc-ink); }
.mkc-root *, .mkc-root *::before, .mkc-root *::after { box-sizing: border-box; }
.mkc-root button { font-family: inherit; cursor: pointer; }

/* 悬浮按钮 */
.mkc-fab { position: fixed; right: 22px; bottom: 22px; z-index: 95; width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--mkc-blue); color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 24px -8px rgba(8, 103, 245, .7), 0 0 0 4px #fff; transition: transform .15s ease, box-shadow .15s ease; }
.mkc-fab:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(8, 103, 245, .8), 0 0 0 4px #fff; }
.mkc-fab:focus-visible { outline: 3px solid rgba(8, 103, 245, .35); outline-offset: 2px; }
.mkc-fab svg { width: 26px; height: 26px; }
.mkc-fab .mkc-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--mkc-danger); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.mkc-fab .mkc-badge[hidden] { display: none; }
.mkc-tip { position: fixed; right: 88px; bottom: 34px; z-index: 95; background: #fff; border: 1px solid var(--mkc-line); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--mkc-ink); box-shadow: 0 8px 20px -10px rgba(15, 23, 42, .25); white-space: nowrap; cursor: pointer; }
.mkc-tip::before { content: "●"; color: var(--mkc-ok); margin-right: 6px; font-size: 10px; }

/* 面板 */
.mkc-panel { position: fixed; right: 22px; bottom: 22px; z-index: 96; width: 380px; height: min(600px, calc(100vh - 44px)); background: #fff; border: 1px solid var(--mkc-line); border-radius: 16px;
  box-shadow: 0 24px 60px -24px rgba(15, 23, 42, .35); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right; animation: mkc-in .18s ease; }
/* 关闭靠 hidden 属性；上面的 display:flex 会压过浏览器默认的 [hidden]，必须显式写一条 */
.mkc-panel[hidden] { display: none; }
@keyframes mkc-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mkc-panel { animation: none; } }
.mkc-head { background: linear-gradient(135deg, #0867f5, #2b8cff); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; flex: none; }
.mkc-logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: var(--mkc-blue); font-weight: 900; font-size: 16px; flex: none; overflow: hidden; }
.mkc-logo.has-img img, .mkc-av.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mkc-av-wrap { display: contents; }
.mkc-av.has-img { overflow: hidden; background: #fff; }
.mkc-head-t { flex: 1; min-width: 0; }
.mkc-head-t b { display: block; font-size: 14px; }
.mkc-head-t small { display: block; font-size: 11.5px; opacity: .92; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #7cf29a; vertical-align: middle; margin-right: 5px; box-shadow: 0 0 0 3px rgba(124, 242, 154, .25); }
.mkc-dot.off { background: #c9d2e0; box-shadow: none; }
.mkc-x { width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .18); color: #fff; font-size: 18px; line-height: 1; display: grid; place-items: center; }
.mkc-x:hover { background: rgba(255, 255, 255, .3); }

.mkc-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--mkc-bg); scroll-behavior: smooth; }
.mkc-sys { text-align: center; font-size: 11px; color: #8a95a5; }
.mkc-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.mkc-msg.me { margin-left: auto; flex-direction: row-reverse; }
.mkc-av { width: 26px; height: 26px; border-radius: 8px; background: #e7f0ff; color: var(--mkc-blue); font-weight: 800; font-size: 11px; display: grid; place-items: center; flex: none; }
.mkc-msg.me .mkc-av { background: #dfe6f1; color: #3d4a60; }
.mkc-bub { background: #fff; border: 1px solid var(--mkc-line); border-radius: 12px; padding: 9px 12px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; min-width: 0; }
.mkc-msg.me .mkc-bub { background: var(--mkc-blue); color: #fff; border-color: var(--mkc-blue); }
.mkc-msg.pending .mkc-bub { opacity: .7; }
.mkc-msg.failed .mkc-bub { border-color: var(--mkc-danger); background: #fdecec; color: var(--mkc-danger); }
.mkc-meta { display: block; font-size: 10.5px; color: #98a2b3; margin-top: 4px; white-space: nowrap; }
.mkc-msg.me .mkc-meta { color: rgba(255, 255, 255, .78); }
.mkc-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.mkc-imgs:first-child { margin-top: 0; }
.mkc-imgs img { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .08); background: #fff; cursor: zoom-in; }
.mkc-msg.me .mkc-bub:has(.mkc-imgs) { padding: 6px; }
.mkc-quick { display: grid; gap: 6px; }
.mkc-quick small { font-size: 11px; color: #8a95a5; }
.mkc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mkc-chip { border: 1px solid #dfe6f1; background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 12.5px; color: var(--mkc-ink); text-align: left; }
.mkc-chip::before { content: "⚡"; color: var(--mkc-blue); font-size: 11px; margin-right: 5px; }
.mkc-chip:hover { border-color: var(--mkc-blue); color: var(--mkc-blue); }
.mkc-typing { font-size: 11.5px; color: #8a95a5; }
.mkc-typing i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #b7c2d3; margin-right: 2px; animation: mkc-blink 1.2s infinite; }
.mkc-typing i:nth-child(2) { animation-delay: .2s; } .mkc-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes mkc-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.mkc-note { background: #fff8e6; border: 1px solid #f4d9a0; color: #7a4e00; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.55; }
.mkc-field { display: flex; gap: 8px; }
.mkc-field input { flex: 1; min-width: 0; border: 1px solid #dfe6f1; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.mkc-field input:focus { outline: 2px solid rgba(8, 103, 245, .25); border-color: var(--mkc-blue); }
.mkc-field button { background: var(--mkc-blue); color: #fff; border: 0; border-radius: 8px; padding: 0 12px; font-size: 13px; }
.mkc-error { color: var(--mkc-danger); font-size: 12px; text-align: center; }

.mkc-foot { border-top: 1px solid var(--mkc-line); background: #fff; padding: 10px 12px; display: grid; gap: 6px; flex: none; }
.mkc-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.mkc-thumbs:empty { display: none; }
.mkc-thumb { position: relative; width: 48px; height: 48px; border-radius: 6px; border: 1px solid #dfe6f1; overflow: hidden; background: #eef2f8; }
.mkc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mkc-thumb button { position: absolute; top: -1px; right: -1px; width: 18px; height: 18px; border: 0; border-radius: 0 6px 0 6px; background: var(--mkc-ink); color: #fff; font-size: 11px; line-height: 1; padding: 0; }
.mkc-in { display: flex; align-items: flex-end; gap: 8px; border: 1px solid #dfe6f1; border-radius: 10px; padding: 6px 8px 6px 10px; background: #fff; }
.mkc-in:focus-within { border-color: var(--mkc-blue); box-shadow: 0 0 0 3px rgba(8, 103, 245, .12); }
.mkc-in.drag { border-style: dashed; border-color: var(--mkc-blue); background: #f0f5ff; }
.mkc-in textarea { flex: 1; min-width: 0; border: 0; resize: none; font: inherit; font-size: 13px; line-height: 1.45; padding: 4px 0; max-height: 120px; outline: none; background: transparent; color: var(--mkc-ink); }
.mkc-in textarea::placeholder { color: #98a2b3; }
.mkc-attach { width: 30px; height: 30px; border: 0; background: transparent; color: var(--mkc-muted); border-radius: 8px; display: grid; place-items: center; flex: none; }
.mkc-attach:hover { background: #eef2f8; color: var(--mkc-blue); }
.mkc-attach svg { width: 18px; height: 18px; }
.mkc-send { width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--mkc-blue); color: #fff; display: grid; place-items: center; flex: none; }
.mkc-send:disabled { background: #c9d2e0; cursor: default; }
.mkc-send svg { width: 16px; height: 16px; }
.mkc-hint { font-size: 10.5px; color: #98a2b3; text-align: center; }
.mkc-root input[type="file"] { display: none; }

/* 大图 */
.mkc-lightbox { position: fixed; inset: 0; z-index: 99; background: rgba(10, 19, 34, .82); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.mkc-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }

/* 手机：面板全屏，按钮收起 */
@media (max-width: 640px) {
  .mkc-fab { right: 16px; bottom: 16px; }
  .mkc-tip { right: 82px; bottom: 28px; max-width: calc(100vw - 100px); white-space: normal; }
  .mkc-panel { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; animation: none; }
  .mkc-root.open .mkc-fab, .mkc-root.open .mkc-tip { display: none; }
  .mkc-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .mkc-head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
}
