
/* ===== 客服悬浮按钮 ===== */
.m-chat-toggle {
    position: fixed;
    right: 28px;
    bottom: 90px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #84c225, #5a9a10);
    color: #fff;
    border: none;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 22px rgba(132, 194, 37, 0.55), 0 0 0 6px rgba(132, 194, 37, 0.1);
    cursor: pointer;
    z-index: 99999;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}
.m-chat-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 28px rgba(132, 194, 37, 0.7), 0 0 0 8px rgba(132, 194, 37, 0.15);
}
.m-chat-toggle:active { transform: scale(0.95); }
.m-chat-toggle .m-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #ff3b30;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 0 2px #fff;
    animation: mBadgePulse 1.6s ease-in-out infinite;
}
@keyframes mBadgePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

/* ===== 聊天主窗口（PC） ===== */
.m-chat-panel {
    position: fixed;
    right: 28px;
    bottom: 168px;
    width: 400px;
    height: 640px;
    max-height: calc(100vh - 200px);
    background: #0d1117;
    border: 1px solid rgba(132, 194, 37, 0.35);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(132, 194, 37, 0.1);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}
.m-chat-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* 头部 */
.m-chat-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, #161b22, #0d1117);
    border-bottom: 1px solid rgba(132, 194, 37, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.m-chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #84c225, #5a9a10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(132, 194, 37, 0.5);
}
.m-chat-header-info { flex: 1; min-width: 0; }
.m-chat-header-info h4 {
    font-size: 15px;
    color: #fff;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.m-chat-header-info p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin: 3px 0 0;
    display: flex;
    align-items: center;
    gap: 5px;
}
.m-chat-header-info p::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #84c225;
    box-shadow: 0 0 8px #84c225;
    animation: mDotPulse 1.5s ease-in-out infinite;
}
@keyframes mDotPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}
.m-chat-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 10px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}
.m-chat-close:hover { color: #fff; }

/* 消息滚动区 */
.m-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0a0e13;
    scrollbar-width: thin;
    scrollbar-color: rgba(132, 194, 37, 0.35) transparent;
}
.m-chat-messages::-webkit-scrollbar { width: 6px; }
.m-chat-messages::-webkit-scrollbar-track { background: transparent; }
.m-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(132, 194, 37, 0.35);
    border-radius: 3px;
}
.m-chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(132, 194, 37, 0.6); }

.m-chat-msg {
    max-width: 86%;
    padding: 11px 15px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.7;
    word-break: break-word;
    animation: mMsgIn 0.28s ease;
}
@keyframes mMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.m-chat-msg.bot {
    align-self: flex-start;
    background: #161b22;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(132, 194, 37, 0.18);
    border-bottom-left-radius: 4px;
}
.m-chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #84c225, #6aa818);
    color: #fff;
    border-bottom-right-radius: 4px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(132, 194, 37, 0.25);
}
.m-chat-msg .m-msg-phone {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 14px;
    background: rgba(132, 194, 37, 0.15);
    border: 1px solid rgba(132, 194, 37, 0.45);
    border-radius: 15px;
    color: #84c225;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    letter-spacing: 0.6px;
    transition: all 0.25s;
}
.m-chat-msg .m-msg-phone:hover {
    background: rgba(132, 194, 37, 0.3);
    box-shadow: 0 0 15px rgba(132, 194, 37, 0.5);
}

/* 快捷分类标签区 */
.m-chat-cats {
    flex-shrink: 0;
    border-top: 1px solid rgba(132, 194, 37, 0.15);
    background: #0d1117;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.m-chat-cats.open {
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(132, 194, 37, 0.35) transparent;
}
.m-chat-cats::-webkit-scrollbar { width: 6px; }
.m-chat-cats::-webkit-scrollbar-thumb {
    background: rgba(132, 194, 37, 0.35);
    border-radius: 3px;
}
.m-chat-cat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 12px 6px;
}
.m-chat-cat-btn {
    padding: 7px 15px;
    border-radius: 18px;
    border: 1px solid rgba(132, 194, 37, 0.3);
    background: rgba(132, 194, 37, 0.05);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.22s;
    white-space: nowrap;
}
.m-chat-cat-btn:hover {
    background: rgba(132, 194, 37, 0.15);
    border-color: rgba(132, 194, 37, 0.6);
    color: #fff;
}
.m-chat-cat-btn.active {
    background: #84c225;
    color: #0d1117;
    font-weight: 700;
    border-color: #84c225;
    box-shadow: 0 0 15px rgba(132, 194, 37, 0.4);
}

/* 子问题列表 */
.m-chat-sub-list {
    padding: 4px 12px 14px;
    display: none;
    flex-wrap: wrap;
    gap: 7px;
}
.m-chat-sub-list.show { display: flex; }
.m-chat-sub-btn {
    padding: 7px 14px;
    border-radius: 14px;
    border: 1px solid rgba(132, 194, 37, 0.22);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    cursor: pointer;
    line-height: 1.5;
    text-align: left;
    transition: all 0.2s;
}
.m-chat-sub-btn:hover {
    background: rgba(132, 194, 37, 0.18);
    border-color: rgba(132, 194, 37, 0.55);
    color: #fff;
    transform: translateY(-1px);
}

/* 输入区 */
.m-chat-input-area {
    flex-shrink: 0;
    padding: 11px 12px;
    background: #0d1117;
    border-top: 1px solid rgba(132, 194, 37, 0.15);
    display: flex;
    gap: 10px;
    align-items: center;
}
.m-chat-input-area input {
    flex: 1;
    padding: 11px 16px;
    border-radius: 22px;
    border: 1px solid rgba(132, 194, 37, 0.28);
    background: #161b22;
    color: #fff;
    font-size: 13px;
    outline: none;
    min-width: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.m-chat-input-area input::placeholder { color: rgba(255, 255, 255, 0.35); }
.m-chat-input-area input:focus {
    border-color: #84c225;
    box-shadow: 0 0 12px rgba(132, 194, 37, 0.25);
}
.m-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #84c225, #5a9a10);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(132, 194, 37, 0.4);
}
.m-chat-send:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(132, 194, 37, 0.6);
}
.m-chat-send:active { transform: scale(0.92); }

/* 切换分类按钮 */
.m-chat-cats-toggle {
    flex-shrink: 0;
    padding: 8px 12px;
    background: #161b22;
    border-top: 1px solid rgba(132, 194, 37, 0.12);
    text-align: center;
}
.m-chat-cats-toggle button {
    background: none;
    border: none;
    color: #84c225;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 14px;
    letter-spacing: 0.6px;
    font-weight: 500;
    transition: color 0.2s;
}
.m-chat-cats-toggle button:hover { color: #a6e049; }

