.aiwoo-handoff{
    display:flex;
    gap:.5rem;
    align-items:center;
    padding:.5rem .75rem;
    border-top:1px solid #eee;
}
.aiwoo-handoff .handoff-label{
    font-size:.9rem;
    color:#666;
    margin-right:.25rem;
}
.aiwoo-handoff .handoff-btn{
    padding:.35rem .6rem;
    border:1px solid #ddd;
    border-radius:6px;
    background:#fff;
    cursor:pointer;
    color:#000 !important;      /* 固定黑色文字 */
    font-weight:700;            /* 加粗 */
}
.aiwoo-handoff .handoff-btn:hover{
    background:#f6f6f6;
}
.handoff-wa{
    border-color:#25D366;
}
.handoff-messenger{
    border-color:#0084FF;
}

/* Floating button */
#aiwoo-float-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0073aa;
    color: #fff;
    text-align: center;
    line-height: 60px;
    font-weight: bold;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Chat window – 默认隐藏，用 .aiwoo-open 控制显示 */
#aiwoo-chat {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 800px;
    height: 600px;
    border: 2px solid #0073aa;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    z-index: 99999;
    font-family: Arial, sans-serif;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    display: none; /* 默认不显示 */
}

/* 打开状态：flex 布局 */
#aiwoo-chat.aiwoo-open {
    display: flex;
    flex-direction: column;
}

/* header */
.aiwoo-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:10px 12px;
    background:#0073aa;
    color:#fff;
}
.aiwoo-title {
    font-weight:700;
}
#aiwoo-close {
    background:transparent;
    border:none;
    color:#fff;
    font-size:16px;
    cursor:pointer;
}

/* Messages area */
#aiwoo-answer {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f9f9f9;
    display:flex;
    flex-direction:column;
    gap:10px;
}

/* product grid inside messages */
.ai-product-grid {
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap:10px;
    width:100%;
}

/* product card */
.ai-product-card {
    border:1px solid #eee;
    border-radius:8px;
    overflow:hidden;
    background:#fff;
    display:flex;
    flex-direction:column;
}
.ai-product-card .thumb {
    width:100%;
    height:140px;
    object-fit:cover;
    background:#fafafa;
}
.ai-product-card .card-body {
    padding:8px 10px;
    display:flex;
    flex-direction:column;
    gap:6px;
}
.ai-product-card .title {
    font-size:14px;
    font-weight:600;
    color:#0b4a84;
    text-decoration:none;
}
.ai-product-card .price {
    color:#0b4a84;
    font-weight:700;
}

/* Input area */
#aiwoo-input {
    display:flex;
    padding:10px;
    border-top:1px solid #ddd;
    background:#fff;
}
#aiwoo-question {
    flex:1;
    padding:10px;
    border-radius:6px;
    border:1px solid #ccc;
    font-size:14px;
}
#aiwoo-send {
    margin-left:8px;
    padding:10px 16px;
    background:#0073aa;
    color:#fff;
    border:none;
    border-radius:6px;
    cursor:pointer;
}

/* message bubbles */
.aiwoo-msg {
    padding:10px;
    border-radius:8px;
    line-height:1.4;
}
.user-msg {
    background:#d9edf7;
    align-self:flex-end;
    max-width:75%;
}
.bot-msg {
    background:#e2f0d9;
    align-self:flex-start;
    max-width:75%;
}

/* links inside messages */
.aiwoo-msg a {
    color:#0073aa;
    text-decoration:underline;
}

/* mobile responsiveness */
@media (max-width:900px) {
    #aiwoo-chat {
        right: 2.5%;
        left: 2.5%;
        width: auto;
        height: 70vh;
        bottom: 20px;
    }
    .ai-product-card .thumb {
        height:100px;
    }
}
