/* 永乐在线客服 - 前台样式（爱番番风格） */
.ylcs-widget{position:fixed;right:20px;bottom:22px;z-index:99999;font-family:-apple-system,"Microsoft YaHei",Arial,sans-serif;font-size:14px;line-height:1.5}

/* ===== 悬浮接待头像 ===== */
.ylcs-bubble{position:relative;width:60px;cursor:pointer;user-select:none;display:flex;flex-direction:column;align-items:center;animation:ylcs-float 3.2s ease-in-out infinite}
@keyframes ylcs-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
.ylcs-avatar{position:relative;display:block;width:58px;height:58px;border-radius:50%;background:#fff;padding:3px;box-shadow:0 6px 18px rgba(0,0,0,.25);box-sizing:border-box}
.ylcs-avatar img{width:100%;height:100%;border-radius:50%;display:block;object-fit:cover;background:#d7e6f2}
.ylcs-float-ring{position:absolute;top:2px;left:50%;width:62px;height:62px;margin-left:-31px;border-radius:50%;border:2px solid rgba(200,22,29,.35);animation:ylcs-pulse-ring 2.4s ease-out infinite;pointer-events:none}
@keyframes ylcs-pulse-ring{0%{transform:scale(.9);opacity:.8}100%{transform:scale(1.35);opacity:0}}
.ylcs-online-dot{position:absolute;right:1px;bottom:3px;width:13px;height:13px;border-radius:50%;background:#37d67a;border:2px solid #fff;box-shadow:0 0 0 0 rgba(55,214,122,.6);animation:ylcs-pulse-dot 2s infinite}
@keyframes ylcs-pulse-dot{0%{box-shadow:0 0 0 0 rgba(55,214,122,.55)}70%{box-shadow:0 0 0 8px rgba(55,214,122,0)}100%{box-shadow:0 0 0 0 rgba(55,214,122,0)}}
.ylcs-bubble-txt{margin-top:5px;background:#c8161d;color:#fff;font-size:11px;line-height:1;padding:4px 9px;border-radius:10px;white-space:nowrap;box-shadow:0 3px 8px rgba(200,22,29,.3)}
.ylcs-badge{position:absolute;top:-2px;right:0;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#ff5722;color:#fff;font-size:11px;line-height:18px;text-align:center;box-shadow:0 2px 6px rgba(0,0,0,.2);z-index:2;animation:none}

/* ===== 首次欢迎气泡 ===== */
.ylcs-hello{position:absolute;right:74px;bottom:8px;width:258px;background:#fff;border-radius:12px;box-shadow:0 10px 34px rgba(0,0,0,.18);padding:14px 14px 10px;border:1px solid #f0f0f0;animation:ylcs-hello-in .4s ease-out}
@keyframes ylcs-hello-in{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:translateX(0)}}
.ylcs-hello-arrow{position:absolute;right:-7px;bottom:26px;width:14px;height:14px;background:#fff;border-top:1px solid #f0f0f0;border-right:1px solid #f0f0f0;transform:rotate(45deg)}
.ylcs-hello-close{position:absolute;top:6px;right:9px;color:#bbb;font-size:20px;line-height:1;text-decoration:none}
.ylcs-hello-close:hover{color:#666}
.ylcs-hello-row{display:flex;align-items:flex-start;gap:10px}
.ylcs-hello-avatar{width:40px;height:40px;border-radius:50%;object-fit:cover;flex-shrink:0;background:#d7e6f2}
.ylcs-hello-txt{display:flex;flex-direction:column;gap:3px;padding-right:12px}
.ylcs-hello-txt strong{font-size:13px;color:#333}
.ylcs-hello-txt span{font-size:13px;color:#666;line-height:1.5}
.ylcs-hello-go{display:block;text-align:right;color:#c8161d;font-size:12px;text-decoration:none;margin-top:6px;font-weight:600}
.ylcs-hello-go:hover{text-decoration:underline}

/* ===== 客服名片 ===== */
.ylcs-card{position:absolute;right:0;bottom:0;width:290px;background:#fff;border-radius:14px;box-shadow:0 14px 44px rgba(0,0,0,.22);overflow:hidden;border:1px solid #ececec;animation:ylcs-card-in .28s ease-out}
@keyframes ylcs-card-in{from{opacity:0;transform:translateY(14px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
.ylcs-card-hd{background:linear-gradient(135deg,#c8161d,#a30f15);padding:18px 16px 16px;color:#fff;display:flex;align-items:center;gap:12px;position:relative}
.ylcs-card-avatar{position:relative;width:56px;height:56px;flex-shrink:0}
.ylcs-card-avatar img{width:56px;height:56px;border-radius:50%;object-fit:cover;border:2px solid rgba(255,255,255,.9);background:#d7e6f2}
.ylcs-card-avatar .ylcs-online-dot{right:0;bottom:1px}
.ylcs-card-meta{min-width:0;flex:1}
.ylcs-card-name{font-size:15px;font-weight:600;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ylcs-card-status{font-size:12px;opacity:.9}
.ylcs-card-close{position:absolute;top:8px;right:11px;color:#fff;font-size:22px;line-height:1;text-decoration:none;opacity:.8}
.ylcs-card-close:hover{opacity:1}
.ylcs-card-channels{padding:8px 0}
.ylcs-ch{display:flex;align-items:center;gap:11px;padding:11px 18px;text-decoration:none;color:#333;transition:background .15s}
.ylcs-ch:hover{background:#faf7f7}
.ylcs-ch-ico{width:30px;height:30px;border-radius:8px;flex-shrink:0;background:#fdecec;position:relative}
.ylcs-ch-ico::before{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:16px;height:16px;background:#c8161d}
.ylcs-ico-tel::before{clip-path:polygon(0 0,38% 0,50% 30%,38% 45%,60% 70%,75% 58%,100% 88%,88% 100%,55% 78%,20% 42%,0 30%)}
.ylcs-ico-wx::before{clip-path:polygon(20% 35%,45% 12%,78% 20%,88% 42%,80% 68%,55% 88%,30% 82%,18% 62%);border-radius:4px}
.ylcs-ico-mail::before{clip-path:polygon(0 20%,50% 55%,100% 20%,100% 80%,0 80%)}
.ylcs-ch-label{font-size:14px;color:#333;flex-shrink:0}
.ylcs-ch-val{font-size:12px;color:#999;margin-left:auto;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ylcs-wx-panel{text-align:center;padding:6px 18px 12px;border-top:1px dashed #eee}
.ylcs-wx-panel img{width:132px;height:132px;border:1px solid #eee;border-radius:6px;background:#fff}
.ylcs-wx-panel p{font-size:12px;color:#888;margin:6px 0 0}
.ylcs-card-chat{display:block;width:calc(100% - 32px);margin:6px 16px 12px;padding:11px;background:#c8161d;color:#fff;text-align:center;border-radius:8px;font-size:15px;font-weight:600;text-decoration:none;transition:background .15s}
.ylcs-card-chat:hover{background:#a30f15}
.ylcs-card-foot{text-align:center;font-size:11px;color:#bbb;padding:0 0 12px}

/* ===== 聊天窗 ===== */
.ylcs-panel{position:absolute;right:0;bottom:0;width:340px;height:480px;background:#fff;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.22);display:flex;flex-direction:column;overflow:hidden;border:1px solid #ececec;animation:ylcs-card-in .28s ease-out}
.ylcs-head{height:60px;background:linear-gradient(135deg,#c8161d,#a30f15);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 14px;flex-shrink:0}
.ylcs-head-left{display:flex;align-items:center;gap:9px;min-width:0}
.ylcs-head-avatar{width:36px;height:36px;border-radius:50%;object-fit:cover;border:2px solid rgba(255,255,255,.85);background:#d7e6f2}
.ylcs-head-title{font-size:15px;font-weight:600;display:flex;align-items:center;gap:7px;white-space:nowrap}
.ylcs-dot{width:8px;height:8px;border-radius:50%;background:#5be07a;box-shadow:0 0 0 3px rgba(91,224,122,.3);display:inline-block}
.ylcs-dot.off{background:#ccc;box-shadow:none}
.ylcs-head-actions{display:flex;align-items:center;gap:12px}
.ylcs-head-actions a{color:#fff;text-decoration:none;opacity:.9}
.ylcs-head-actions a:hover{opacity:1}
.ylcs-head-tel{font-size:17px}
.ylcs-back{font-size:24px;line-height:1}
.ylcs-close{font-size:26px;line-height:1}
.ylcs-status{padding:8px 14px;background:#fff8e6;color:#8a6d1f;font-size:12px;border-bottom:1px solid #f2e6c8;flex-shrink:0}
.ylcs-log{flex:1;overflow-y:auto;padding:14px;background:#f5f6f8}
.ylcs-msg{margin-bottom:14px;display:flex;flex-direction:column}
.ylcs-msg .bubble{max-width:82%;padding:9px 12px;border-radius:10px;font-size:14px;line-height:1.6;word-break:break-word;white-space:pre-wrap}
.ylcs-msg.agent{align-items:flex-start}
.ylcs-msg.agent .bubble{background:#fff;color:#333;border:1px solid #e6e6e6;border-top-left-radius:2px}
.ylcs-msg.visitor{align-items:flex-end}
.ylcs-msg.visitor .bubble{background:#c8161d;color:#fff;border-top-right-radius:2px}
.ylcs-msg.system{align-items:center}
.ylcs-msg.system .bubble{background:transparent;color:#999;font-size:12px;padding:2px 8px;text-align:center}
.ylcs-msg .time{font-size:11px;color:#bbb;margin-top:4px}
.ylcs-namebar{padding:0 12px 6px;flex-shrink:0}
.ylcs-namebar input{width:100%;box-sizing:border-box;border:1px solid #e2e2e2;border-radius:6px;padding:7px 10px;font-size:13px;outline:none}
.ylcs-namebar input:focus{border-color:#c8161d}
.ylcs-inputbar{display:flex;gap:8px;padding:8px 12px;border-top:1px solid #eee;flex-shrink:0}
.ylcs-inputbar textarea{flex:1;resize:none;border:1px solid #e2e2e2;border-radius:6px;padding:8px 10px;font-size:14px;font-family:inherit;outline:none;line-height:1.5}
.ylcs-inputbar textarea:focus{border-color:#c8161d}
.ylcs-inputbar button{width:62px;border:none;background:#c8161d;color:#fff;border-radius:6px;cursor:pointer;font-size:14px;font-weight:600;flex-shrink:0}
.ylcs-inputbar button:hover{background:#a30f15}
.ylcs-inputbar button:disabled{background:#d8d8d8;cursor:not-allowed}
.ylcs-foot{text-align:center;font-size:11px;color:#bbb;padding:0 0 8px;flex-shrink:0}

/* ===== 智能接待引导 + 留言表单（离线时） ===== */
.ylcs-smart{flex:1;overflow-y:auto;background:#f5f6f8;padding:14px}
.ylcs-smart-tip{background:#fff;border:1px solid #ececec;border-radius:10px;padding:12px 13px;margin-bottom:12px;position:relative}
.ylcs-smart-badge{display:inline-block;background:linear-gradient(135deg,#c8161d,#a30f15);color:#fff;font-size:11px;padding:2px 9px;border-radius:9px;margin-bottom:7px}
.ylcs-smart-tip p{margin:0;font-size:13px;color:#555;line-height:1.7}
.ylcs-lead-form{display:flex;flex-direction:column;gap:8px}
.ylcs-lead-form .ylcs-hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
.ylcs-lead-form input[type=text],.ylcs-lead-form input[type=tel],.ylcs-lead-form input[type=email],.ylcs-lead-form textarea{width:100%;box-sizing:border-box;border:1px solid #e2e2e2;border-radius:7px;padding:9px 11px;font-size:13px;font-family:inherit;outline:none;background:#fff;transition:border-color .15s}
.ylcs-lead-form input:focus,.ylcs-lead-form textarea:focus{border-color:#c8161d}
.ylcs-lead-form textarea{resize:vertical;min-height:66px;line-height:1.5}
.ylcs-lead-form button{border:none;background:#c8161d;color:#fff;border-radius:7px;padding:11px;font-size:14px;font-weight:600;cursor:pointer;transition:background .15s}
.ylcs-lead-form button:hover{background:#a30f15}
.ylcs-lead-form button:disabled{background:#d8d8d8;cursor:not-allowed}
.ylcs-lead-msg{font-size:12px;line-height:1.5;min-height:0}
.ylcs-lead-msg.ok{color:#2a9d55;padding:6px 0}
.ylcs-lead-msg.err{color:#d0021b;padding:6px 0}
@media(max-width:600px){
  .ylcs-widget{right:12px;bottom:14px}
  .ylcs-panel{width:calc(100vw - 24px);height:70vh;max-height:520px}
  .ylcs-card{width:calc(100vw - 24px);max-width:290px}
  .ylcs-hello{width:calc(100vw - 90px);max-width:258px}
}
