/* 表单提交状态提示（联系表单与留言浮窗共用） */
.form-status {
    min-height: 0;
    font-size: 14px;
    margin-bottom: 12px;
}
.form-status:empty {
    display: none;
}
.form-status.is-ok {
    color: #2e7d32;
}
.form-status.is-error {
    color: #d32f2f;
}

/* 蜜罐字段：移出可视区域（不用 display:none，部分机器人会跳过隐藏字段） */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* 页脚微信图标：悬停弹出二维码 */
.social-link.has-qr {
    position: relative;
}
.social-link .qr-pop {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    line-height: 0;
}
.social-link .qr-pop img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}
.social-link.has-qr:hover .qr-pop,
.social-link.has-qr:focus .qr-pop {
    display: block;
}
.wechat-qr {
    margin-top: 8px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    object-fit: contain;
}

/* ===== 商务咨询聊天窗口 ===== */
.consult {
    font-size: 14px;
}
.consult-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 0;
    border-radius: 28px;
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(13, 71, 161, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.consult-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(13, 71, 161, 0.4);
}
.consult-toggle i {
    font-size: 18px;
}
.consult.is-open .consult-toggle {
    display: none;
}
.consult-dialog[hidden],
.consult-quick[hidden] {
    display: none;
}
/* 桌面：右下角浮动聊天窗，不遮挡页面 */
.consult-dialog {
    position: fixed;
    z-index: 1300;
    right: 24px;
    bottom: 24px;
    width: 370px;
    height: 540px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #f1f4f8;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    animation: consult-pop 0.22s ease;
    transform-origin: bottom right;
}
.consult-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
    color: #fff;
    flex-shrink: 0;
}
.consult-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 17px;
}
.consult-who {
    flex: 1;
    min-width: 0;
}
.consult-who strong {
    display: block;
    font-size: 15px;
}
.consult-who small {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
    font-size: 12px;
}
.consult-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #69db7c;
    box-shadow: 0 0 0 2px rgba(105, 219, 124, 0.3);
}
.consult-close {
    background: none;
    border: 0;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.85;
    padding: 4px;
}
.consult-close:hover {
    opacity: 1;
}
/* 消息区 */
.consult-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overscroll-behavior: contain;
}
.consult-msg {
    max-width: 84%;
    padding: 9px 13px;
    background: #fff;
    border-radius: 4px 12px 12px 12px;
    color: #334155;
    line-height: 1.65;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    word-break: break-word;
    animation: consult-in 0.18s ease;
    align-self: flex-start;
}
.consult-msg b {
    color: #0d47a1;
}
.consult-msg small {
    color: #8a96a3;
}
.consult-msg-me {
    align-self: flex-end;
    background: #95ec69; /* 与常见聊天软件「自己发出的消息」同色系 */
    color: #1f2933;
    border-radius: 12px 4px 12px 12px;
    white-space: pre-wrap;
}
.consult-typing {
    display: flex;
    gap: 4px;
    padding: 13px 14px;
}
.consult-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: consult-blink 1s infinite;
}
.consult-typing i:nth-child(2) { animation-delay: 0.15s; }
.consult-typing i:nth-child(3) { animation-delay: 0.3s; }
.consult-wechat {
    font-size: 16px;
    letter-spacing: 0.5px;
    user-select: all;
}
.consult-qr {
    margin-top: 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    object-fit: contain;
}
.consult-again {
    align-self: center;
    padding: 5px 16px;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}
.consult-again:hover {
    border-color: #1e88e5;
    color: #0d47a1;
}
/* 快捷回复 */
.consult-quick {
    display: flex;
    gap: 8px;
    padding: 4px 14px 10px;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.consult-quick button {
    flex-shrink: 0;
    padding: 5px 12px;
    border: 1px solid #bbdefb;
    border-radius: 16px;
    background: #fff;
    color: #1565c0;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.consult-quick button:hover,
.consult-quick button:focus-visible {
    background: #e3f2fd;
    outline: none;
}
/* 输入栏 */
.consult-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.consult-bar input[name="say"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #dbe2ea;
    border-radius: 20px;
    font: inherit;
    font-size: 15px;
    background: #f8fafc;
}
.consult-bar input[name="say"]:focus {
    outline: none;
    border-color: #1e88e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.12);
}
.consult-bar input:disabled {
    color: #94a3b8;
}
.consult-bar button {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: #1e88e5;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.consult-bar button:hover {
    background: #1565c0;
}
.consult-bar button:disabled {
    background: #cbd5e1;
    cursor: default;
}
.consult-privacy {
    padding: 0 12px 8px;
    background: #fff;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
}
@keyframes consult-pop {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
}
@keyframes consult-in {
    from { opacity: 0; transform: translateY(6px); }
}
@keyframes consult-blink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* 手机：底部弹出面板，打开时锁定页面滚动 */
@media (max-width: 560px) {
    .consult-toggle {
        right: 16px;
        bottom: 16px;
        padding: 14px;
    }
    .consult-toggle span {
        display: none;
    }
    .consult-dialog {
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: 80vh;
        max-height: none;
        border-radius: 16px 16px 0 0;
        animation: consult-up 0.25s ease;
    }
    body.consult-open {
        overflow: hidden;
    }
    @keyframes consult-up {
        from { transform: translateY(100%); }
    }
}
@media (prefers-reduced-motion: reduce) {
    .consult-dialog, .consult-msg { animation: none; }
}

/* ---------- live chat ---------- */
.consult-toggle { position: fixed; }
.consult-unread {
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e03131;
    color: #fff;
    font-size: 12px;
    font-style: normal;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}
.consult-dot.is-away {
    background: #adb5bd;
    box-shadow: 0 0 0 2px rgba(173, 181, 189, 0.3);
}
.consult-msg { white-space: pre-wrap; }
.consult-msg.is-html { white-space: normal; }
.consult-msg-agent { background: #fff; border-left: 3px solid #1e88e5; }
.consult-name { display: block; font-size: 11px; color: #8a96a3; margin-bottom: 2px; }
.consult-msg-sys {
    align-self: center;
    max-width: 92%;
    background: none;
    box-shadow: none;
    color: #8a96a3;
    font-size: 12px;
    padding: 2px 8px;
    text-align: center;
}
.consult-msg-me.is-pending { opacity: 0.6; }
.consult-read {
    align-self: flex-end;
    margin-top: -6px;
    font-size: 11px;
    color: #8a96a3;
}
.consult-leave {
    margin: 0 12px 8px;
    padding: 8px 12px;
    border: 1px dashed #90caf9;
    border-radius: 8px;
    background: #f1f8ff;
    color: #0d47a1;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}
.consult-leave:hover, .consult-leave:focus-visible { background: #e3f2fd; }
.consult-leave[hidden] { display: none; }
.consult-bar textarea[name="say"] {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    max-height: 110px;
    padding: 9px 14px;
    border: 1px solid #dbe2ea;
    border-radius: 20px;
    font: inherit;
    resize: none;
    outline: none;
    line-height: 1.45;
}
.consult-bar textarea[name="say"]:focus { border-color: #1e88e5; box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15); }
.consult-bar.is-contact textarea[name="say"] { border-color: #1e88e5; background: #f8fbff; }
