/* Ice Card 站内聊天浮窗 v7.0（前台） */
#ic-chat-widget {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#ic-chat-widget.ic-chat-hidden { display: none; }

#ic-chat-fab {
    width: 58px;
    height: 58px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(16, 185, 129, .45);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease;
}
#ic-chat-fab:hover { transform: scale(1.06); }
.ic-chat-fab-icon { display: flex; align-items: center; justify-content: center; line-height: 0; }
.ic-chat-fab-icon svg { display: block; }
.ic-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    padding: 0 5px;
    font-weight: 700;
}

.ic-chat-panel[hidden] {
    display: none !important;
}

.ic-chat-panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 70vh;
    min-height: 420px;
    max-height: 720px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ic-chat-header {
    background: #10b981;
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ic-chat-header-info { display: flex; flex-direction: column; line-height: 1.25; }
.ic-chat-header-info span { font-size: 12px; opacity: .9; }
#ic-chat-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.ic-chat-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f8fafc;
}

.ic-msg { margin-bottom: 10px; max-width: 82%; }
.ic-msg-text, .ic-msg-img img {
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}
.ic-msg-me { margin-left: auto; }
.ic-msg-me .ic-msg-text { background: #10b981; color: #fff; border-bottom-right-radius: 3px; }
.ic-msg-them { margin-right: auto; }
.ic-msg-them .ic-msg-text { background: #fff; color: #1e293b; border: 1px solid #e2e8f0; border-bottom-left-radius: 3px; }
.ic-msg-time { font-size: 10px; color: #94a3b8; margin-top: 3px; }
.ic-msg-me .ic-msg-time { text-align: right; }
.ic-msg-img img {
    padding: 0;
    display: block;
    max-width: 220px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.ic-chat-contact { padding: 8px 12px 0; }
.ic-chat-contact input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
}

.ic-chat-composer { border-top: 1px solid #e2e8f0; background: #fff; }
.ic-chat-preview {
    padding: 8px 12px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ic-chat-thumb {
    position: relative;
    width: 60px;
    height: 60px;
}
.ic-chat-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: block;
}
.ic-chat-thumb-x {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    padding: 0;
    box-sizing: border-box;
    background: rgba(0,0,0,.65) !important;
    color: #fff !important;
    border: none;
    border-radius: 50%;
    line-height: 1;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ic-chat-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
}
.ic-chat-attach-btn {
    font-size: 20px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
#ic-chat-text {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
}
#ic-chat-send {
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s, background .15s;
}
#ic-chat-send:disabled, #ic-chat-send.ic-sending {
    background: #6ee7b7;
    cursor: default;
    opacity: .7;
}

@media (max-width: 480px) {
    .ic-chat-panel {
        right: -8px;
        width: calc(100vw - 24px);
        height: 85vh;
        max-height: none;
    }
}
