/* ✅ 整個對話框外層容器 <div id="smartchat-wrapper" class="chat-fixed-wrapper"> */
.chat-fixed-wrapper {
    pointer-events: auto;
    position: fixed;
    bottom: 10px;
    /* 距離底部 */
    right: 20px;
    /* 距離右側 */
    width: 550px;
    /* 對話框寬度 */
    max-height: 1000px;
    /* 最大高度限制 */
    z-index: 99999;
    /* 確保蓋過右下角按鈕 */
    font-family: "Arial", sans-serif;
}

/* ✅ 對話框主體盒子 <div class="chat-box"> */
.chat-box {
    width: 100%;
    height: 700px;
    /* 對話框高度 */
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #ccc;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* ✅ 頂部 header 區塊 <div class="chat-header"> */
.chat-header {
    background-color: #0080c0;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

/* ✅ header 裡的吉祥物圖示 <img class="mascot"> */
.chat-header img.mascot {
    width: 65px;
    height: 65px;
    margin-right: 10px;
}

/* ✅ header 裡的文字<p class="header-name">桃捷智能客服</p> */
.header-name {
    font-size: 20px;
    margin-top: 10px;
}

/* 機器人訊息 */
.system-message {
    display: flex;
    /* ✅ 改為橫向排列 */
    align-items: flex-start;
    /* ✅ 與頂對齊 */
    margin-bottom: 12px;
}

/* 機器人訊息圖示 */
.system-message .mascot {
    width: 34px;
    /* ✅ 小一點的機器人頭像 */
    height: 34px;
    margin-right: 10px;
    flex-shrink: 0;
}

.system-message .message-content {
    background: #eee;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    font-size: 16px;
    /* ✅ 加大文字 */
    font-weight: bold;
    /* ✅ 加粗文字 */
    max-width: 90%;
}

/* ✅ 訊息顯示區 <div class="chat-messages" id="chatMessages"> */
.chat-messages {
    padding: 10px;
    height: 600px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

/* ✅ 每一則訊息的外層容器 */
.system-message,
.user-message {
    margin-bottom: 12px;
}

/* ✅ 系統訊息（左側）結構 */
.system-message {
    display: flex;
    align-items: flex-start;
}

/* ✅ 系統訊息圖示 */
.system-message .mascot {
    width: 34px;
    height: 34px;
    margin-right: 10px;
    flex-shrink: 0;
}

/* ✅ 系統訊息泡泡內容 */
.system-message .message-content {
    font-size: 16px;
    /* ✅ 加大 */
    font-weight: bold;
    /* ✅ 加粗 */
    line-height: 1.5;
    background: #eee;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    max-width: 75%;
    /* ✅ 避免太長拉爆整排 */
    word-break: break-word;
}

/* ✅ 系統訊息時間（顯示在左下角） */
.system-message .system-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    margin-left: 44px;
    /* ✅ 對齊文字區塊左緣 */
}

/* ✅ 使用者發出的訊息：右側淺藍色泡泡 */
.user-message {
    display: flex;
    justify-content: flex-end;
}

/* ✅ 使用者泡泡樣式 */
.user-message .message-content {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.5;
    background-color: #d1eaff;
    padding: 8px 12px;
    border-radius: 8px;
    word-break: break-word;
    max-width: 100%;       /* ✅ 限制不超過整體 */
    text-align: left;
}

/* ✅ 使用者訊息時間（在泡泡右側） */
.user-message .message-time {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    align-self: flex-end;
}

/* ✅ 輸入欄與送出按鈕區塊 <div class="chat-footer"> */
.chat-footer {
    display: flex;
    padding: 8px;
    border-top: 1px solid #ddd;
    background-color: #fff;
    align-items: center;
    /* ✅ 垂直置中 */
    position: relative;
    bottom: 0;
}

/* ✅ 輸入欄 <textarea id="chatInput"> */
.chat-input {
    flex: 1;
    min-height: 36px;
    max-height: 150px;
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    line-height: 1.4;
    overflow-y: hidden;
    resize: none;
    /* ✅ 禁止拖拉手動調整 */
    color: #000;
    /* ✅ 文字顏色改為黑色 */
}

/* ✅ 送出按鈕 <button class="send-btn"> */
.send-btn {
    background-color: #4200ad;
    /* ✅ 背景紫色 */
    border: none;
    padding: 6px;
    margin-left: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* ✅ 圓形 */
    width: 40px;
    /* ✅ 固定寬高製造圓 */
    height: 40px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    /* 陰影（可選） */
}

.send-icon {
    width: 18px;
    /* ✅ 圖片小一點 */
    height: 18px;
    object-fit: contain;
}

/* ✅ 關閉按鈕（叉叉） <button class="close-btn"> */
.close-btn {
    background: transparent;
    /* ✅ 無底色 */
    border: none;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 8px;
    margin: 0;
    line-height: 1;
}