/* AI 客服窗口 */
.ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ai-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1A1A1A, #383431);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: transform 0.3s;
}

.ai-chat-button:hover {
    transform: scale(1.1);
}

.ai-chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 360px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-window.active {
    display: flex;
}

.ai-chat-header {
    background: linear-gradient(135deg, #1A1A1A, #383431);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header h4 {
    margin: 0;
    font-size: 16px;
}

.ai-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}

.ai-message {
    background: white;
    padding: 10px 15px;
    border-radius: 15px 15px 15px 5px;
    margin-bottom: 10px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user-message {
    background: #1A1A1A;
    color: white;
    margin-left: auto;
    border-radius: 15px 15px 5px 15px;
}

.ai-typing {
    color: #999;
    font-size: 13px;
    padding: 10px;
}

.ai-chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
    background: white;
}

.ai-chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.ai-chat-input input:focus {
    border-color: #1A1A1A;
}

.ai-chat-input button {
    margin-left: 8px;
    padding: 10px 18px;
    background: #1A1A1A;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

.ai-chat-transfer {
    padding: 10px 0 11px 0;
    text-align: center;
    flex: none;
    background: white;
    border-radius: 0 0 15px 15px;
}

.ai-chat-transfer button {
    background: none;
    border: 1px solid #1A1A1A;
    color: #1A1A1A;
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
}

/* 人工客服面板 */
.human-support-panel {
    padding: 15px;
}

.human-support-panel h5 {
    margin: 0 0 10px 0;
    font-size: 15px;
}

.whatsapp-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #25D366;
    color: white;
    padding: 12px 15px;
    border-radius: 10px;
    text-decoration: none;
    margin-bottom: 15px;
    font-size: 14px;
}

.whatsapp-link:hover {
    background: #128C7E;
}

.message-form input,
.message-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    box-sizing: border-box;
}

.message-form textarea {
    height: 80px;
    resize: none;
}

.message-form button {
    width: 100%;
    padding: 10px;
    background: #1A1A1A;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 40px);
        height: 60vh;
    }
}

/* 图片上传按钮 */
.ai-chat-upload {
    cursor: pointer;
    font-size: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
}
.ai-chat-upload:hover {
    opacity: 0.7;
}
/* ===== 淘寶風格卡片（商品/訂單） ===== */
.ai-product-card,
.ai-order-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e8e6e3;
    border-radius: 10px;
    padding: 8px;
    margin: 8px 0;
    text-decoration: none;
    color: #1A1B1C;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
    max-width: 100%;
    box-sizing: border-box;
}
.ai-product-card:hover,
.ai-order-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.14);
    transform: translateY(-1px);
}
.ai-card-img {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3efe9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ai-card-noimg {
    font-size: 24px;
    color: #bbb;
}
.ai-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ai-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1A1B1C;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-card-name-en {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-card-sub {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-card-price {
    font-size: 15px;
    font-weight: 700;
    color: #c0392b;
}
.ai-card-go {
    flex: 0 0 auto;
    font-size: 12px;
    color: #8b8b8b;
    white-space: nowrap;
}
.ai-message a {
    color: #1a73e8;
    word-break: break-all;
}
