/* 全站站内信浮动入口 — AIHFABS 主站风格 */
.aihfabs-message-hub {
    position: fixed;
    right: 24px;
    bottom: 88px;
    z-index: 750;
    font-family: inherit;
}

.aihfabs-message-hub-fab {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.38);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
    position: relative;
    padding: 0;
}

.aihfabs-message-hub-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(233, 69, 96, 0.48);
    background: linear-gradient(135deg, #c73650 0%, #e94560 100%);
}

.aihfabs-message-hub-fab:active {
    transform: translateY(-1px);
}

.aihfabs-message-hub-fab .bi {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.aihfabs-message-hub-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #1a1a2e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border: 2px solid #fff;
}

.aihfabs-message-hub-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 14px);
    width: min(400px, calc(100vw - 32px));
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(26, 26, 46, 0.2);
    overflow: hidden;
    border: 1px solid rgba(233, 69, 96, 0.12);
    display: flex;
    flex-direction: column;
    max-height: min(560px, calc(100vh - 120px));
}

.aihfabs-message-hub-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4a 100%);
    color: #fff;
}

.aihfabs-message-hub-panel-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.aihfabs-message-hub-close {
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.aihfabs-message-hub-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.aihfabs-message-hub-panel-body {
    padding: 20px 18px 22px;
    background: #fff;
}

.aihfabs-message-hub-guest-text,
.aihfabs-message-hub-logged-text {
    margin: 0 0 16px;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
}

.aihfabs-message-hub-guest-text strong {
    color: #e94560;
    font-weight: 700;
}

.aihfabs-message-hub-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aihfabs-message-hub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.aihfabs-message-hub-btn-block {
    width: 100%;
}

.aihfabs-message-hub-btn-primary {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

.aihfabs-message-hub-btn-primary:hover {
    background: linear-gradient(135deg, #c73650 0%, #e94560 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(233, 69, 96, 0.38);
}

.aihfabs-message-hub-btn-outline {
    background: #fff;
    border-color: #ced4da;
    color: #1a1a2e;
}

.aihfabs-message-hub-btn-outline:hover {
    border-color: #e94560;
    color: #e94560;
    background: #fff5f7;
}

.aihfabs-message-hub-link-all {
    display: block;
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #e94560;
    text-decoration: none;
}

.aihfabs-message-hub-link-all:hover {
    text-decoration: underline;
}

/* 已登录 Service Chat 对话框 */
.aihfabs-message-hub-chat {
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 360px;
    max-height: min(500px, calc(100vh - 180px));
    background: #f8f9fa;
}

.aihfabs-message-hub-chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 280px;
    color: #6c757d;
    font-size: 14px;
}

.aihfabs-message-hub-chat-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.aihfabs-message-hub-history {
    flex: 1;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 12px;
    background: #f8f9fa;
}

.aihfabs-message-hub-history .li {
    float: left;
    clear: both;
    width: 88%;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    margin-bottom: 14px;
}

.aihfabs-message-hub-history .li .avatar {
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    background: #dee2e6;
    font-size: 14px;
    flex-shrink: 0;
}

.aihfabs-message-hub-history .li .msg {
    flex: 1;
    min-width: 0;
    padding: 0 0 0 8px;
}

.aihfabs-message-hub-history .li .msg .ti {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 2px;
}

.aihfabs-message-hub-history .li .msg .time {
    font-size: 11px;
    color: #adb5bd;
    margin-bottom: 4px;
}

.aihfabs-message-hub-history .li .msg .content {
    background: #fff;
    padding: 10px 12px;
    border-radius: 0 10px 10px 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    word-break: break-word;
}

.aihfabs-message-hub-history .li.r {
    float: right;
    flex-direction: row-reverse;
}

.aihfabs-message-hub-history .li.r .msg {
    padding: 0 8px 0 0;
    text-align: right;
}

.aihfabs-message-hub-history .li.r .msg .content {
    background: #fff5f7;
    border-radius: 10px 0 10px 10px;
}

.aihfabs-message-hub-chat-empty {
    margin: 0;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #868e96;
    text-align: center;
    background: #f8f9fa;
}

.aihfabs-message-hub-chat-empty[hidden] {
    display: none !important;
}

.aihfabs-message-hub-compose {
    padding: 10px 12px 0;
    background: #fff;
    border-top: 1px solid #eee;
}

.aihfabs-message-hub-compose-zone {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafbfc;
    overflow: hidden;
}

.aihfabs-message-hub-compose .aihfabs-msg-editor-wrap {
    position: relative;
    background: #fff;
}

.aihfabs-message-hub-compose .aihfabs-msg-editor-wrap textarea {
    width: 100%;
    min-height: 96px;
    max-height: 140px;
    padding: 10px 12px 42px;
    border: 0;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
    background: transparent;
}

.aihfabs-message-hub-compose .aihfabs-msg-editor-wrap textarea:focus {
    outline: none;
    box-shadow: none;
}

.aihfabs-message-hub-compose .aihfabs-msg-editor-wrap textarea:disabled {
    background: #f1f3f5;
    cursor: not-allowed;
}

.aihfabs-message-hub-compose .aihfabs-msg-editor-hint {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.aihfabs-message-hub-compose-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid #eee;
    background: #fff;
}

.aihfabs-message-hub-compose-toolbar .aihfabs-msg-attach-preview {
    flex: 1 1 100%;
    margin: 0;
}

.aihfabs-message-hub-compose-toolbar .aihfabs-message-hub-send-btn {
    margin-left: auto;
}

.aihfabs-message-hub-compose.aihfabs-msg-drop-root.is-dragover .aihfabs-message-hub-compose-zone {
    border-color: #e94560;
    box-shadow: inset 0 0 0 1px rgba(233, 69, 96, 0.15);
}

.aihfabs-message-hub-compose.aihfabs-msg-drop-root.is-dragover .aihfabs-msg-editor-hint {
    opacity: 1;
    color: #e94560;
}

.aihfabs-message-hub-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.aihfabs-message-hub-attach-btn:hover:not(:disabled) {
    border-color: #e94560;
    color: #e94560;
}

.aihfabs-message-hub-attach-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.aihfabs-message-hub-compose-actions {
    display: none;
}

.aihfabs-message-hub-send-btn {
    border: 0;
    border-radius: 50px;
    padding: 8px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.aihfabs-message-hub-send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #c73650 0%, #e94560 100%);
    transform: translateY(-1px);
}

.aihfabs-message-hub-send-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.aihfabs-message-hub-chat .aihfabs-message-hub-link-all {
    padding: 10px 12px 14px;
    margin-top: 0;
    background: #fff;
    border-top: 1px solid #f1f3f5;
}

@media (max-width: 576px) {
    .aihfabs-message-hub {
        right: 16px;
        bottom: 76px;
    }

    .aihfabs-message-hub-fab {
        width: 54px;
        height: 54px;
        font-size: 22px;
    }
}
