/* ═══════════════════════════════════════════════════════════════
   client/chat.css — 客服對話 Widget 樣式
   從 index.html 內嵌 <style> 抽出（原 3369-3581 行）
   包含：.chat-fab / .chat-panel / .chat-header / .chat-body /
         .chat-footer / .chat-message / .chat-input 等 + @media 覆寫
   ═══════════════════════════════════════════════════════════════ */

/* ===== 客服對話 ===== */
.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-dark);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.chat-fab .chat-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
    box-sizing: content-box;
    font-size: 0;        /* 僅顯示紅點，不顯示數字 */
    line-height: 0;
}
.chat-panel {
    display: none;
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 340px;
    max-height: 480px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 9001;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.25s ease-out;
}
.chat-panel.open { display: flex; }
@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-header {
    padding: 8px 12px;
    background: var(--bg-dark);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
}
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-header-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}
.chat-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-close:hover { color: #fff; }
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 340px;
    min-height: 200px;
    background: #f8fafc;
}
.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.chat-msg.customer {
    align-self: flex-end;
    background: var(--bg-dark);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.admin {
    align-self: flex-start;
    background: #e2e8f0;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}
.chat-msg .chat-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}
.chat-msg.customer .chat-time { text-align: right; }
.chat-msg.admin .chat-time { text-align: left; }
.chat-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    padding: 40px 20px;
}
.chat-shortcuts {
    padding: 8px 12px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
    background: #f8fafc;
}
.chat-shortcut-chip {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.chat-shortcut-chip:hover {
    background: var(--bg-dark);
    color: #fff;
    border-color: var(--bg-dark);
}
.chat-footer {
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    background: #fff;
}
.chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--bg-dark); }
.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-dark);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-img-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.chat-img-btn:hover { color: var(--bg-dark); }
.chat-phone-prompt {
    padding: 24px 20px;
    background: #f8fafc;
    text-align: center;
}
.chat-msg img.chat-image {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
}

@media (max-width: 480px) {
    .chat-panel {
        right: 8px;
        left: 8px;
        bottom: 80px;
        width: auto;
        max-height: 60vh;
    }
    .chat-fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}
