/* Shortcuts Store - 在线客服聊天组件 */
#sc-chat-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: transform 0.2s, box-shadow 0.2s;
}
#sc-chat-btn:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(37, 99, 235, 0.5); }
#sc-chat-btn .sc-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    padding: 0 5px;
    box-sizing: border-box;
    display: none;
}
#sc-chat-btn .sc-badge.show { display: block; }

#sc-chat-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#sc-chat-panel.open { display: flex; }

.sc-chat-head {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.sc-chat-head .sc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.sc-chat-head .sc-title { flex: 1; }
.sc-chat-head .sc-title b { font-size: 15px; display: block; }
.sc-chat-head .sc-title span { font-size: 12px; opacity: 0.85; }
.sc-chat-head .sc-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.sc-chat-head .sc-close:hover { background: rgba(255, 255, 255, 0.15); }

#sc-chat-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sc-msg {
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}
.sc-msg.sc-visitor {
    align-self: flex-end;
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.sc-msg.sc-admin {
    align-self: flex-start;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}
.sc-msg .sc-time {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}
.sc-chat-sys {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    padding: 4px 0;
}

#sc-chat-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}
#sc-chat-form .sc-attach-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#sc-chat-form .sc-attach-btn:hover { background: #f1f5f9; color: #1e293b; }
#sc-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    resize: none;
    font-family: inherit;
    max-height: 90px;
}
#sc-chat-input:focus { border-color: #2563eb; }
#sc-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#sc-chat-send:hover { background: #1d4ed8; }
#sc-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* 首次留言表单 */
.sc-chat-greet {
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.sc-chat-greet input {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
}
.sc-chat-greet input:focus { border-color: #2563eb; }
.sc-chat-greet button {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.sc-chat-greet button:hover { background: #1d4ed8; }

@media (max-width: 768px) {
    #sc-chat-btn { right: 16px; bottom: 16px; width: 54px; height: 54px; font-size: 24px; }
    #sc-chat-panel { right: 8px; bottom: 80px; width: calc(100vw - 16px); height: 70vh; }
}


/* 聊天图片样式 */
.sc-chat-img { max-width: 100%; border-radius: 8px; margin-top: 4px; cursor: pointer; display: block; }
