/* ============================================
   專題頁：在線諮詢（統一 zt_zx / zx- 命名空間）
   ============================================ */

.zt_zx {
    --zx_green: #388c57;
    --zx_orange: #f0a63c;
    --zx_orange_dark: #e08f27;
    --zx_text: #333333;
    --zx_chat_bg: #f0f0f0;
    --zx_bubble: #ffffff;
    --zx_max_width: 720px;
}

/* ---------- 板塊一：在線諮詢對話 ---------- */
.zx-chat {
    width: 100%;
    padding: 40px 16px 56px;
    background: var(--zx_chat_bg);
    box-sizing: border-box;
}

.zx-chat-inner {
    width: 100%;
    max-width: var(--zx_max_width);
    margin: 0 auto;
}

/* 頂部狀態條 */
.zx-chat-status {
    padding: 10px 16px;
    margin-bottom: 30px;
    border-radius: 6px;
    background: #e2e2e2;
    color: #9b9b9b;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    letter-spacing: .5px;
}

/* 單條消息 */
.zx-msg {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 30px;
}

.zx-msg:last-child {
    margin-bottom: 0;
}

/* 諮詢師頭像 */
.zx-msg-avatar {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
}

.zx-msg-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zx-msg-body {
    flex: 1 1 auto;
    min-width: 0;
}

.zx-msg-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.zx-msg-name {
    color: #8c8c8c;
}

.zx-msg-time {
    color: #b3b3b3;
}

/* 對話氣泡 */
.zx-bubble {
    display: block;
    width: 100%;
    padding: 14px 18px;
    border-radius: 6px;
    background: var(--zx_bubble);
    color: var(--zx_text);
    font-size: 16px;
    line-height: 1.7;
    word-break: break-word;
}

/* 諮詢師名片 */
.zx-card {
    width: 100%;
    padding: 20px;
    border-radius: 6px;
    background: var(--zx_bubble);
    box-sizing: border-box;
}

.zx-card-title {
    margin-bottom: 10px;
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.zx-card-desc {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
}

.zx-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.zx-card-tag {
    padding: 4px 14px;
    border-radius: 999px;
    background: #f0f0f0;
    color: #8a8a8a;
    font-size: 13px;
    line-height: 1.6;
}

.zx-card-divider {
    height: 1px;
    margin-top: 18px;
    background: #ececec;
}

.zx-card-secure {
    padding-top: 18px;
    color: #222;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

/* ---------- 板塊二：門店資訊與諮詢入口 ---------- */
.zx-contact {
    width: 100%;
    padding: 44px 16px 60px;
    background: #fff;
    text-align: center;
    box-sizing: border-box;
}

.zx-contact-privacy {
    margin-bottom: 10px;
    color: #999;
    font-size: 14px;
    line-height: 1.8;
}

.zx-contact-privacy a {
    color: inherit;
    transition: color .2s;
}

.zx-contact-privacy a:hover {
    color: var(--zx_green);
}

.zx-contact-info {
    color: var(--zx_text);
    font-size: 16px;
    line-height: 2;
}

.zx-contact-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.zx-contact-btn {
    display: flex;
    flex: 0 1 280px;
    align-items: center;
    justify-content: center;
    height: 56px;
    border-radius: 8px;
    background: var(--zx_orange);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .5px;
    transition: background .25s;
}

.zx-contact-btn:hover {
    background: var(--zx_orange_dark);
    color: #fff;
}

/* ---------- 模擬對話動畫 ---------- */
.zx-msg[hidden] {
    display: none;
}

.zx-msg-real[hidden] {
    display: none;
}

/* 「正在輸入」指示器 */
.zx-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
    border-radius: 6px;
    background: var(--zx_bubble);
}

.zx-typing.is-done {
    display: none;
}

.zx-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c6c6c6;
    animation: zxTypingBounce 1.1s infinite ease-in-out;
}

.zx-typing span:nth-child(2) {
    animation-delay: .18s;
}

.zx-typing span:nth-child(3) {
    animation-delay: .36s;
}

@keyframes zxTypingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .45;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* 消息逐條進場 */
.zx-msg {
    animation: zxMsgIn .4s ease both;
}

@keyframes zxMsgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.zx-msg-real {
    animation: zxMsgReveal .35s ease both;
}

@keyframes zxMsgReveal {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* 移動端 ---------- */
@media (max-width: 768px) {
    .zx-chat {
        padding: 24px 12px 36px;
    }

    .zx-chat-status {
        margin-bottom: 22px;
        font-size: 13px;
    }

    .zx-msg {
        gap: 10px;
        margin-bottom: 22px;
    }

    .zx-msg-avatar {
        width: 48px;
        height: 48px;
    }

    .zx-bubble {
        padding: 12px 14px;
        font-size: 15px;
    }

    .zx-card {
        padding: 16px;
    }

    .zx-card-title {
        font-size: 18px;
    }

    .zx-card-secure {
        font-size: 16px;
    }

    .zx-contact {
        padding: 32px 16px 44px;
    }

    .zx-contact-privacy {
        font-size: 13px;
    }

    .zx-contact-info {
        font-size: 14px;
    }

    .zx-contact-actions {
        gap: 12px;
        margin-top: 24px;
    }

    .zx-contact-btn {
        flex: 1 1 0;
        height: 50px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .zx-card-title {
        font-size: 17px;
    }

    .zx-card-tag {
        padding: 3px 12px;
        font-size: 12px;
    }

    .zx-contact-btn {
        height: 48px;
        font-size: 15px;
    }
}

/* 尊重「減少動態效果」系統偏好 */
@media (prefers-reduced-motion: reduce) {
    .zx-msg,
    .zx-msg-real {
        animation: none;
    }

    .zx-typing span {
        animation: none;
        opacity: .6;
    }
}

/* ==================== 在線諮詢頁專屬：隱藏全局底部漂浮導航，
   並將本頁「門店資訊 / 諮詢入口」的按鈕浮動固定在視口底部 ==================== */
.public-swt {
    display: none !important;
}

.zx-contact-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
}

.zx-contact-actions .zx-contact-btn {
    flex: 1 1 0;
    max-width: 280px;
}

/* 為浮動底部欄預留空間，避免遮擋門店資訊 */
.zx-contact {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
