/* chat.css —— 在线客服：气泡（客户窗口、客服工作台共用）＋客户右下角按钮与对话窗。 */
.cw-m { display: flex; flex-direction: column; margin: 0 0 12px; max-width: 82%; }
.cw-m.me { margin-left: auto; align-items: flex-end; }
.cw-m.them { align-items: flex-start; }
.cw-who { font-size: 12px; color: var(--mute); margin: 0 4px 2px; }
.cw-b { padding: 8px 12px; font-size: 15px; line-height: 1.7; border: 1px solid var(--line); background: #fff; border-radius: 2px 10px 10px 10px; word-break: break-word; white-space: normal; }
.cw-m.me .cw-b { background: var(--zhu); border-color: var(--zhu); color: #fff; border-radius: 10px 2px 10px 10px; }
.cw-time { font-size: 11px; color: var(--mute); margin: 2px 4px 0; font-family: var(--num); }

/* 右下角按钮 */
.cw-btn { position: fixed; right: 22px; bottom: 22px; z-index: 70; display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; border: 1px solid var(--zhu); background: #fff; color: var(--ink); font-family: var(--kai); font-size: 16px; letter-spacing: .1em; border-radius: 26px; box-shadow: 0 8px 24px rgba(0,0,0,.14); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.cw-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.cw-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--zhu); color: #fff; display: grid; place-items: center; font-size: 18px; letter-spacing: 0; }
.cw-n { position: absolute; top: -6px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--zhu); color: #fff; font-family: var(--num); font-weight: normal; font-size: 13px; display: grid; place-items: center; border: 2px solid #fff; letter-spacing: 0; }
.cw-btn.has { animation: cw-pulse 1.6s ease-in-out infinite; }
.cw-btn.on { background: var(--zhu-soft); }
@keyframes cw-pulse { 0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,.14), 0 0 0 0 rgba(179,38,30,.35); } 50% { box-shadow: 0 8px 24px rgba(0,0,0,.14), 0 0 0 10px rgba(179,38,30,0); } }

/* 对话窗 */
.cw { position: fixed; right: 22px; bottom: 84px; z-index: 71; width: min(380px, calc(100vw - 24px)); height: min(540px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--zhu); box-shadow: 0 18px 48px rgba(0,0,0,.18); animation: th-rise .25s ease both; }
.cw-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse 70% 120% at 0% 0%, var(--zhu-soft), transparent 70%), #fff; }
.cw-h b { display: block; font-weight: normal; font-size: 18px; letter-spacing: .2em; }
.cw-h span { font-size: 12px; color: var(--mute); }
.cw-x { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--mute); cursor: pointer; padding: 0 4px; }
.cw-x:hover { color: var(--ink); }
.cw-list { flex: 1; overflow-y: auto; padding: 14px 14px 4px; background: #fbfbf9; }
.cw-load { color: var(--mute); text-align: center; font-size: 14px; }
.cw-f { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); align-items: end; }
.cw-f textarea { resize: none; border: 1px solid var(--line2); padding: 6px 8px; font-family: var(--kai); font-size: 15px; line-height: 1.6; outline: none; }
.cw-f textarea:focus { border-color: var(--ink); }
.cw-err { margin: 0; padding: 0 12px 8px; font-size: 13px; color: #8a1c1c; }

/* 客服回复提示 */
.cw-toast { position: fixed; right: 22px; bottom: 84px; z-index: 72; max-width: 300px; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--zhu); padding: 10px 14px; box-shadow: 0 10px 28px rgba(0,0,0,.16); font-family: var(--kai); cursor: pointer; animation: th-rise .3s ease both; }
.cw-toast b { display: block; font-weight: normal; color: var(--zhu); }
.cw-toast span { font-size: 14px; color: var(--ink2); }
@media (max-width: 600px) { .cw-btn .cw-t { display: none; } .cw-btn { padding: 6px; } .cw { right: 12px; bottom: 74px; } }
@media print { .cw-btn, .cw, .cw-toast { display: none !important; } }

/* 图片消息 */
.cw-m.pic .cw-b { padding: 4px; background: #fff !important; border-color: var(--line) !important; }
.cw-m.me.pic .cw-b { border-color: var(--zhu) !important; }
.cw-imgl { display: block; line-height: 0; }
.cw-img { display: block; max-width: 220px; max-height: 260px; width: auto; height: auto; border-radius: 6px; cursor: zoom-in; background: var(--soft); }
.cw-up { display: inline-block; padding: 6px 10px; font-size: 14px; color: var(--ink2); line-height: 1.5; }
.cw-up i { font-style: normal; font-family: var(--num); color: var(--zhu); }
.cw-acts { display: flex; flex-direction: column; gap: 6px; }
.cw-pic { cursor: pointer; text-align: center; font-size: 14px; padding: 2px 10px; }

/* 访客：称呼、联系方式（选填） */
.cw-who-f { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.4fr; gap: 6px; }
.cw-who-f input { border: 0; border-bottom: 1px solid var(--line2); font-family: var(--kai); font-size: 14px; padding: 4px 2px; outline: none; background: transparent; min-width: 0; }
.cw-who-f input:focus { border-bottom-color: var(--ink); }
