/* 官网实时在线客服 */

.live-chat-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9998;
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #1e6fd6, #0f766e);
    color: #fff;
    box-shadow: 0 10px 30px rgba(30, 111, 214, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

.live-chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(30, 111, 214, 0.42);
}

.live-chat-fab svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
}

.live-chat-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
    display: none;
}

.live-chat-panel {
    position: fixed;
    right: 1.25rem;
    bottom: 5.25rem;
    z-index: 9999;
    width: min(360px, calc(100vw - 1.5rem));
    height: min(520px, calc(100vh - 6.5rem));
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.live-chat-panel.open {
    display: flex;
}

.live-chat-panel.inline {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 640px;
    height: 480px;
    margin: 0 auto;
    display: flex;
}

.live-chat-header {
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #1e6fd6, #0f766e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.live-chat-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.live-chat-header p {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    opacity: 0.9;
}

.live-chat-close {
    border: none;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.live-chat-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.live-chat-intro {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.live-chat-intro label {
    font-size: 0.8rem;
    color: #475569;
    font-weight: 500;
}

.live-chat-intro input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.875rem;
}

.live-chat-start-btn {
    margin-top: 0.35rem;
    padding: 0.65rem;
    border: none;
    border-radius: 8px;
    background: #1e6fd6;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.live-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem;
    display: none;
    flex-direction: column;
    gap: 0.55rem;
}

.live-chat-messages.active {
    display: flex;
}

.live-chat-msg {
    max-width: 86%;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}

.live-chat-msg.visitor {
    align-self: flex-end;
    background: #1e6fd6;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.live-chat-msg.admin {
    align-self: flex-start;
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.live-chat-msg-meta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.68rem;
    opacity: 0.72;
}

.live-chat-footer {
    padding: 0.65rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    display: none;
    gap: 0.45rem;
}

.live-chat-footer.active {
    display: flex;
}

.live-chat-footer input {
    flex: 1;
    padding: 0.55rem 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.875rem;
}

.live-chat-send {
    padding: 0.55rem 0.85rem;
    border: none;
    border-radius: 8px;
    background: #0f766e;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.live-chat-status {
    padding: 0 1rem 0.65rem;
    font-size: 0.75rem;
    color: #64748b;
    min-height: 1rem;
}

.live-chat-status.err {
    color: #dc2626;
}

.live-chat-trial-note {
    margin: 0;
    padding: 0.65rem 1rem 0;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
}

.live-chat-trial-note a {
    color: #1e6fd6;
}

@media (max-width: 480px) {
    .live-chat-panel:not(.inline) {
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        bottom: 5rem;
    }
}
