/* ========== 在线客服 v3 ========== */
.cs-fab{position:fixed;right:22px;bottom:92px;z-index:70;display:flex;
flex-direction:column;align-items:center;gap:9px;background:none;border:0;
padding:0;cursor:pointer;font-family:inherit;animation:csFloat 3.2s ease-in-out infinite}
@keyframes csFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
.cs-fab .cs-ic{position:relative;width:64px;height:64px;border-radius:50%;
background:linear-gradient(145deg,#f0d79a,#d9b877 42%,#b8935a);
display:flex;align-items:center;justify-content:center;color:#1e1809;
box-shadow:0 10px 30px rgba(217,184,119,.42);transition:.28s}
.cs-fab .cs-ic svg{width:30px;height:30px;stroke-width:2}
.cs-fab .cs-ic::before{content:"";position:absolute;inset:-6px;border-radius:50%;
border:2px solid rgba(217,184,119,.55);animation:csPulse 2.4s ease-out infinite}
@keyframes csPulse{0%{transform:scale(.92);opacity:.9}70%,100%{transform:scale(1.28);opacity:0}}
.cs-fab .cs-tx{font-size:12.5px;font-weight:700;color:#1e1809;
background:linear-gradient(145deg,#f0d79a,#d9b877);padding:3px 12px;
border-radius:999px;box-shadow:0 4px 14px rgba(217,184,119,.4);white-space:nowrap}

/* 面板 */
.cs-panel{position:fixed;right:22px;bottom:92px;z-index:80;
width:370px;max-width:calc(100vw - 28px);height:min(600px,calc(100vh - 130px));
background:#0c0c0e;border:1px solid #232326;border-radius:18px;overflow:hidden;
box-shadow:0 28px 70px rgba(0,0,0,.82);display:none;flex-direction:column;
transform:translateY(12px) scale(.98);opacity:0;transition:.3s cubic-bezier(.2,.7,.2,1)}
.cs-panel.on{display:flex;transform:none;opacity:1}

/* 头部 */
.cs-head{display:flex;align-items:center;gap:10px;padding:12px 14px;
background:#111113;border-bottom:1px solid #232326;flex:0 0 auto}
.cs-av{width:38px;height:38px;border-radius:50%;flex:0 0 auto;
background:linear-gradient(145deg,#3a3222,#221d12);border:1px solid #4a3f28;
display:flex;align-items:center;justify-content:center;color:#d9b877}
.cs-av svg{width:21px;height:21px}
.cs-hd{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.cs-hd b{font-size:14.5px;font-weight:600;color:#f2ede1;letter-spacing:.01em}
.cs-hd i{font-size:11.5px;color:#7d786e;font-style:normal}
.cs-bell,.cs-x{width:30px;height:30px;border-radius:8px;background:none;border:0;
color:#8d8880;display:flex;align-items:center;justify-content:center;
cursor:pointer;transition:.2s;flex:0 0 auto}
.cs-bell svg,.cs-x svg{width:17px;height:17px}
.cs-bell:hover,.cs-x:hover{background:#1e1e22;color:#d9b877}

/* 消息区 */
.cs-body{flex:1;min-height:0;overflow-y:auto;padding:16px 14px;
display:flex;flex-direction:column;gap:12px;background:#0c0c0e;
scrollbar-width:thin;scrollbar-color:#2a2a2e transparent}
.cs-body::-webkit-scrollbar{width:5px}
.cs-body::-webkit-scrollbar-thumb{background:#2a2a2e;border-radius:3px}

/* 欢迎卡片 */
.cs-welcome{display:flex;gap:8px;align-items:flex-start}
.cs-wav{width:28px;height:28px;border-radius:50%;flex:0 0 auto;margin-top:2px;
background:linear-gradient(145deg,#3a3222,#221d12);border:1px solid #4a3f28;
display:flex;align-items:center;justify-content:center;color:#d9b877}
.cs-wav svg{width:15px;height:15px}
.cs-card{background:#fff;color:#1a1a1a;border-radius:14px;border-top-left-radius:4px;
padding:13px 15px;font-size:13px;line-height:1.7;max-width:calc(100% - 40px);
box-shadow:0 4px 16px rgba(0,0,0,.28)}
.cs-card p{margin:0 0 8px;font-weight:600;color:#111}
.cs-card b{color:#a67c1a}
.cs-card ul{margin:0;padding-left:15px;display:flex;flex-direction:column;gap:5px}
.cs-card li{color:#333;list-style:disc}

/* 时间戳 */
.cs-timeline{text-align:center;font-size:11px;color:#5c5850;padding:2px 0}
.cs-timeline span{background:#16161a;padding:3px 10px;border-radius:999px}

/* 气泡 */
.cs-msg{max-width:78%;padding:10px 13px;border-radius:14px;font-size:13.5px;
line-height:1.65;word-break:break-word;position:relative}
.cs-me{align-self:flex-end;
background:linear-gradient(135deg,#e8c98a,#d9b877);color:#1a1408;
border-bottom-right-radius:4px;font-weight:500}
.cs-you{align-self:flex-start;background:#1a1a1e;color:#e8e3d8;
border:1px solid #26262b;border-bottom-left-radius:4px}
.cs-sys{align-self:flex-start;background:#1a1a1e;color:#c9c4b8;
border:1px solid #26262b;font-size:12.5px}
.cs-msg .cs-t{display:block;font-size:10.5px;opacity:.5;margin-top:4px;text-align:right}

/* 消息内媒体：严格限制 */
.cs-msg img.cs-m{display:block;width:auto;max-width:100%;max-height:180px;
object-fit:cover;border-radius:10px;margin-bottom:6px;background:#000;
cursor:zoom-in}
.cs-msg video.cs-m{display:block;width:100%;max-width:100%;max-height:180px;
border-radius:10px;margin-bottom:6px;background:#000}

/* 附件预览 */
.cs-attach-bar{padding:10px 14px 0;background:#0c0c0e;border-top:1px solid #1c1c20;flex:0 0 auto}
.cs-prev{display:flex;gap:8px;flex-wrap:wrap}
.cs-thumb{position:relative;width:56px;height:56px;border-radius:9px;overflow:hidden;
border:1px solid #2a2a2e;background:#16161a;flex:0 0 auto}
.cs-thumb img,.cs-thumb video{width:100%;height:100%;object-fit:cover;display:block}
.cs-thumb .del{position:absolute;top:2px;right:2px;width:16px;height:16px;border-radius:50%;
background:rgba(0,0,0,.8);color:#fff;border:0;font-size:11px;line-height:1;
cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.cs-thumb .vt{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
width:20px;height:20px;border-radius:50%;background:rgba(0,0,0,.65);
display:flex;align-items:center;justify-content:center;color:#fff;
font-size:8px;pointer-events:none}

/* 输入区 */
.cs-foot{display:flex;align-items:center;gap:7px;padding:10px 12px;
background:#111113;border-top:1px solid #232326;flex:0 0 auto}
.cs-att{flex:0 0 auto;width:34px;height:34px;border-radius:9px;background:#1a1a1e;
border:1px solid #2a2a2e;color:#a8a29a;display:flex;align-items:center;
justify-content:center;cursor:pointer;transition:.2s;padding:0}
.cs-att svg{width:17px;height:17px}
.cs-att:hover{background:#22222a;color:#d9b877;border-color:#3a3a40}
.cs-att.has{background:linear-gradient(135deg,#e8c98a,#d9b877);color:#1a1408;border-color:transparent}
.cs-foot input[type=text]{flex:1;min-width:0;background:#16161a;border:1px solid #2a2a2e;
border-radius:10px;padding:9px 12px;color:#f0ead9;font-size:13.5px;
font-family:inherit;outline:none;transition:.2s}
.cs-foot input[type=text]:focus{border-color:#6b5a32;background:#1a1a1f}
.cs-foot input[type=text]::placeholder{color:#5c5850}
.cs-emo{flex:0 0 auto;width:34px;height:34px;border-radius:9px;background:none;
border:0;color:#8d8880;display:flex;align-items:center;justify-content:center;
cursor:pointer;padding:0}
.cs-emo svg{width:19px;height:19px}
.cs-emo:hover{color:#d9b877}
.cs-send{flex:0 0 auto;background:linear-gradient(135deg,#e8c98a,#c9a86e);
border:0;border-radius:10px;padding:9px 16px;font-size:13.5px;font-weight:700;
color:#1a1408;cursor:pointer;font-family:inherit;transition:.2s}
.cs-send:hover{filter:brightness(1.07)}
.cs-send:active{transform:scale(.97)}

/* 常用语 */
.cs-quick{padding:0 12px 11px;background:#111113;display:flex;gap:7px;
flex-wrap:wrap;flex:0 0 auto}
.cs-quick[hidden]{display:none}
.cs-quick button{background:#1a1a1e;border:1px solid #2a2a2e;color:#b8b2a8;
font-size:12px;padding:6px 11px;border-radius:999px;cursor:pointer;
font-family:inherit;transition:.2s}
.cs-quick button:hover{background:#22222a;color:#e8c98a;border-color:#4a3f28}

/* 灯箱 */
.cs-lightbox{position:fixed;inset:0;z-index:200;background:rgba(0,0,0,.94);
display:none;align-items:center;justify-content:center;padding:22px;cursor:zoom-out}
.cs-lightbox.on{display:flex}
.cs-lightbox img,.cs-lightbox video{max-width:92vw;max-height:88vh;
border-radius:10px;box-shadow:0 20px 70px rgba(0,0,0,.85)}
.cs-lightbox .lb-x{position:absolute;top:16px;right:20px;width:40px;height:40px;
border-radius:50%;background:rgba(255,255,255,.12);color:#fff;border:0;
font-size:24px;line-height:1;cursor:pointer}

@media(max-width:640px){
.cs-fab{right:14px;bottom:84px;gap:7px}
.cs-fab .cs-ic{width:56px;height:56px}
.cs-fab .cs-ic svg{width:26px;height:26px}
.cs-fab .cs-tx{font-size:11.5px;padding:2px 10px}
.cs-panel{right:8px;left:8px;width:auto;bottom:8px;
height:calc(100vh - 16px);max-height:none;border-radius:16px}
.cs-body{padding:14px 12px}
.cs-msg{max-width:82%}
}
@media (prefers-reduced-motion: reduce){
.cs-fab{animation:none}
.cs-fab .cs-ic::before{animation:none;opacity:0}
}

/* ===== 多图并排 ===== */
.cs-medias{
  display:grid;gap:3px;margin-bottom:6px;
  grid-template-columns:repeat(2,1fr);
  max-width:240px;
}
.cs-medias.n1{grid-template-columns:1fr;max-width:200px}
.cs-medias.n3,.cs-medias.n4{grid-template-columns:repeat(2,1fr);max-width:220px}
.cs-medias.n5,.cs-medias.n6{grid-template-columns:repeat(3,1fr);max-width:240px}

.cs-medias .m-item{
  position:relative;overflow:hidden;border-radius:8px;
  background:#000;aspect-ratio:1/1;cursor:zoom-in;
}
.cs-medias .m-item img,
.cs-medias .m-item video{
  width:100%;height:100%;object-fit:cover;display:block;
  max-width:none !important;max-height:none !important;
}
.cs-medias .m-item .play{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:26px;height:26px;border-radius:50%;background:rgba(0,0,0,.6);
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:10px;pointer-events:none;
}
/* 单图模式（不是并排时）保持原样式 */
.cs-msg > img.cs-m,
.cs-msg > video.cs-m{
  display:block;width:auto;max-width:100%;max-height:180px;
  object-fit:cover;border-radius:10px;margin-bottom:6px;
  background:#000;cursor:zoom-in;
}

/* ===== 欢迎卡片可读性优化 ===== */
.cs-card{
  background:#fff !important;
  color:#141414 !important;
  padding:14px 16px !important;
  font-size:13.5px !important;
  line-height:1.85 !important;
}
.cs-card p{
  color:#0a0a0a !important;
  font-size:14px !important;
  font-weight:700 !important;
  margin:0 0 10px !important;
  line-height:1.7 !important;
}
.cs-card p b{
  color:#8a6414 !important;
  font-weight:700;
}
.cs-card ul{
  margin:0 !important;
  padding-left:17px !important;
  display:flex;
  flex-direction:column;
  gap:7px;
}
.cs-card li{
  color:#242424 !important;
  font-size:13px !important;
  line-height:1.8 !important;
  list-style:disc;
}
.cs-card li::marker{
  color:#a67c1a;
}

/* 客服气泡文字也提亮一档 */
.cs-you{color:#f0ece4 !important}
.cs-sys{color:#ddd8cd !important}

/* 时间戳略提亮 */
.cs-timeline{color:#7a746a !important}
.cs-msg .cs-t{color:#000;opacity:.42}
.cs-you .cs-t,.cs-sys .cs-t{color:#fff;opacity:.35}


/* ===== 包养站粉色覆盖 ===== */
.cs-fab .cs-ic{
  background:linear-gradient(145deg,#ff7da8,#ff2d6f 45%,#d4175a) !important;
  color:#fff !important;
  box-shadow:0 10px 30px rgba(255,45,111,.45) !important;
}
.cs-fab .cs-ic::before{border-color:rgba(255,45,111,.6) !important}
.cs-fab .cs-tx{
  background:linear-gradient(145deg,#ff7da8,#ff2d6f) !important;
  color:#fff !important;
  box-shadow:0 4px 14px rgba(255,45,111,.45) !important;
}
.cs-head{background:#16100f !important;border-bottom-color:#2a1a20 !important}
.cs-av{background:linear-gradient(145deg,#4a1a28,#2a0f18) !important;
  border-color:#5a2030 !important;color:#ff7da8 !important}
.cs-wav{background:linear-gradient(145deg,#4a1a28,#2a0f18) !important;
  border-color:#5a2030 !important;color:#ff7da8 !important}
.cs-card p b{color:#c2185b !important}
.cs-card li::marker{color:#ff2d6f !important}
.cs-me{background:linear-gradient(135deg,#ff7da8,#e11d63) !important;color:#fff !important}
.cs-me .cs-t{color:#fff !important;opacity:.5 !important}
.cs-send{background:linear-gradient(135deg,#ff7da8,#e11d63) !important;color:#fff !important}
.cs-foot input[type=text]:focus{border-color:#ff2d6f !important}
.cs-att:hover{color:#ff7da8 !important}
.cs-emo:hover{color:#ff7da8 !important}
.cs-panel{border-color:#2a1a20 !important}
.cs-msg img.cs-m{cursor:zoom-in}
