/* AI 客服悬浮窗 —— 主色 #0a4da6（与全站品牌色一致），z-index 高于 back-to-top */
#syChatFab {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1200;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0a4da6;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    box-shadow: 0 6px 16px rgba(10, 77, 166, .35);
    transition: transform .15s ease, background .15s ease;
}
#syChatFab:hover {
    background: #083f88;
    transform: translateY(-2px);
}

#syChatPanel {
    position: fixed;
    right: 1.5rem;
    bottom: 5.5rem;
    z-index: 1200;
    width: 360px;
    max-width: calc(100vw - 2rem);
    height: 480px;
    max-height: calc(100vh - 8rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, .18);
    overflow: hidden;
}
/* hidden 属性必须压过上面的 display:flex，否则面板永远显示 */
#syChatPanel[hidden] { display: none !important; }

.sy-chat-head {
    background: #0a4da6;
    color: #fff;
    padding: .8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.sy-chat-head button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .2rem;
}

.sy-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f6f8fb;
}
.sy-msg {
    max-width: 82%;
    margin-bottom: .7rem;
    padding: .6rem .8rem;
    border-radius: 10px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .9rem;
    line-height: 1.5;
}
.sy-msg-ai {
    background: #fff;
    color: #16233a;
    border: 1px solid #e6ebf2;
}
.sy-msg-user {
    margin-left: auto;
    background: #0a4da6;
    color: #fff;
}

.sy-chat-error {
    padding: .4rem .8rem;
    background: #fde8e8;
    color: #a51e1e;
    font-size: .8rem;
}

.sy-chat-input {
    display: flex;
    gap: .5rem;
    padding: .7rem;
    border-top: 1px solid #e6ebf2;
    background: #fff;
}
.sy-chat-input input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: .5rem .7rem;
    font-size: .9rem;
}
.sy-chat-input button {
    background: #0a4da6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .5rem 1rem;
    cursor: pointer;
}
.sy-chat-input button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    #syChatPanel { right: .75rem; bottom: 5rem; width: calc(100vw - 1.5rem); }
}
