#tpai-btn{position:fixed;right:22px;bottom:168px;z-index:99990;width:76px;height:76px;border-radius:50%;background:#fff;border:3px solid #62BB46;box-shadow:0 6px 20px rgba(37,53,142,.25);cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;transition:transform .2s}
#tpai-btn:hover{transform:scale(1.06)}
#tpai-btn img{width:66px;height:66px;animation:tpai-bob 2.4s ease-in-out infinite}
#tpai-hi{position:fixed;right:108px;bottom:186px;z-index:99990;background:#25358E;color:#fff;font:600 15px/1.35 'Open Sans',Arial,sans-serif;padding:10px 14px;border-radius:14px 14px 4px 14px;box-shadow:0 6px 18px rgba(0,0,0,.15);max-width:220px;cursor:pointer}
#tpai-hi b{color:#9be27f}
#tpai-x-hi{position:absolute;top:-8px;left:-8px;width:22px;height:22px;border-radius:50%;border:0;background:#fff;color:#25358E;font-weight:700;cursor:pointer;line-height:22px;padding:0;box-shadow:0 2px 6px rgba(0,0,0,.2)}
#tpai-win{position:fixed;right:22px;bottom:22px;z-index:99995;width:380px;max-width:calc(100vw - 24px);height:560px;max-height:calc(100vh - 40px);background:#fff;border-radius:20px;box-shadow:0 18px 50px rgba(20,30,90,.3);display:none;flex-direction:column;overflow:hidden;font-family:'Open Sans',Arial,sans-serif}
#tpai-win.open{display:flex}
.tpai-head{background:#25358E;color:#fff;padding:12px 14px;display:flex;align-items:center;gap:10px}
.tpai-av{width:52px;height:52px;border-radius:50%;background:#fff;flex:none;display:flex;align-items:center;justify-content:center;overflow:hidden}
.tpai-av img{width:48px;height:48px}
.tpai-av.talk img{animation:tpai-talk .35s ease-in-out infinite alternate}
.tpai-t{flex:1;min-width:0}
.tpai-t b{display:block;font-size:17px}
.tpai-t span{font-size:12.5px;opacity:.85}
.tpai-hb{background:rgba(255,255,255,.14);border:0;color:#fff;width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:17px;line-height:36px;padding:0}
.tpai-hb[aria-pressed=true]{background:#62BB46}
.tpai-log{flex:1;overflow-y:auto;padding:14px;background:#f4f7fb;display:flex;flex-direction:column;gap:10px}
.tpai-m{max-width:86%;padding:10px 13px;border-radius:16px;font-size:15px;line-height:1.45;white-space:pre-wrap;word-wrap:break-word}
.tpai-m.b{background:#fff;color:#1f2a5a;border:1px solid #e3e8f2;border-bottom-left-radius:4px;align-self:flex-start}
.tpai-m.u{background:#25358E;color:#fff;border-bottom-right-radius:4px;align-self:flex-end}
.tpai-m a{color:#3f8a2a;font-weight:600}
.tpai-m.u a{color:#c8f0b8}
.tpai-dots span{display:inline-block;width:8px;height:8px;margin:0 2px;border-radius:50%;background:#7EBEC5;animation:tpai-dot 1s infinite}
.tpai-dots span:nth-child(2){animation-delay:.15s}.tpai-dots span:nth-child(3){animation-delay:.3s}
.tpai-sug{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 8px;background:#f4f7fb}
.tpai-sug button{background:#fff;border:1.5px solid #62BB46;color:#25358E;border-radius:999px;padding:6px 11px;font-size:13px;font-weight:600;cursor:pointer}
.tpai-form{display:flex;gap:8px;padding:10px;border-top:1px solid #e3e8f2;background:#fff}
.tpai-form input{flex:1;border:1.5px solid #cfd6e6;border-radius:999px;padding:10px 14px;font-size:15px;min-width:0}
.tpai-form input:focus{outline:none;border-color:#25358E}
.tpai-form button{background:#62BB46;border:0;color:#fff;border-radius:999px;padding:0 16px;font-weight:700;font-size:15px;cursor:pointer}
.tpai-foot{font-size:11px;color:#6b7593;text-align:center;padding:0 10px 8px;background:#fff}
@keyframes tpai-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
@keyframes tpai-talk{from{transform:translateY(0) rotate(-3deg)}to{transform:translateY(-3px) rotate(3deg)}}
@keyframes tpai-dot{0%,100%{opacity:.3;transform:translateY(0)}50%{opacity:1;transform:translateY(-4px)}}
@media(max-width:780px){#tpai-btn{bottom:150px;right:14px;width:64px;height:64px}#tpai-btn img{width:56px;height:56px}#tpai-hi{right:86px;bottom:160px;font-size:14px;max-width:190px}#tpai-win{right:0;bottom:0;width:100vw;max-width:100vw;height:100%;max-height:100%;border-radius:0}}
@media(prefers-reduced-motion:reduce){#tpai-btn img,.tpai-av.talk img,.tpai-dots span{animation:none}}
