/* AI 智能选款 - 聊天页面样式 */
.ai-chat-wrapper {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: #f8f8f8;
    position: relative;
    z-index: 1100;
    padding-bottom: 55px;
}

/* 头部 */
.ai-chat-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.ai-chat-back {
    color: #db3846;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}
.ai-chat-title { display: flex; align-items: center; gap: 10px; }
.ai-chat-title h1 { font-size: 16px; margin: 0; color: #333; }
.ai-chat-title p { font-size: 12px; color: #999; margin: 2px 0 0; }
.ai-chat-avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #db3846, #f097a0);
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 16px; flex-shrink: 0;
}

/* 消息区 */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ai-msg { display: flex; max-width: 85%; }
.ai-msg-user { align-self: flex-end; }
.ai-msg-bot { align-self: flex-start; }
.ai-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.ai-msg-user .ai-msg-bubble {
    background: #db3846;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ai-msg-bot .ai-msg-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #eee;
    border-bottom-left-radius: 4px;
}
.ai-msg-bot .ai-msg-bubble a {
    color: #1a73e8;
    text-decoration: underline;
}
.ai-example {
    display: inline-block;
    background: #fff3f4;
    color: #db3846;
    padding: 2px 8px;
    border-radius: 10px;
    margin: 2px 0;
    font-size: 13px;
    cursor: pointer;
}

/* 商品推荐区 */
.ai-chat-products {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 12px 16px;
    flex-shrink: 0;
}
.ai-products-title {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}
.ai-products-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.ai-product-card {
    min-width: 140px;
    max-width: 140px;
    text-decoration: none;
    color: #333;
    flex-shrink: 0;
}
.ai-product-card img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    background: #f0f0f0;
}
.ai-product-info { padding: 6px 0; }
.ai-product-info h3 {
    font-size: 13px;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ai-product-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.ai-product-tags span {
    font-size: 11px;
    background: #fff3f4;
    color: #db3846;
    padding: 1px 6px;
    border-radius: 6px;
}
.ai-product-price { font-size: 14px; color: #db3846; font-weight: bold; }

/* 操作提示条 */
.ai-chat-hint {
    text-align: center;
    font-size: 11px;
    color: #bbb;
    padding: 6px 16px;
    flex-shrink: 0;
    background: #f8f8f8;
}

/* 输入区 */
.ai-chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    position: relative;
    z-index: 1101;
}
.ai-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background: #f5f5f5;
}
.ai-chat-input:focus { border-color: #db3846; background: #fff; }
.ai-chat-send {
    background: #db3846;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
.ai-chat-send:disabled { background: #ccc; cursor: not-allowed; }

/* 响应式 */
@media (min-width: 768px) {
    .ai-chat-wrapper {
        max-width: 500px;
        height: 85vh;
        height: 85dvh;
        margin: 30px auto;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        overflow: hidden;
    }
    .ai-chat-header { border-radius: 12px 12px 0 0; }
}
