/* 中仪友信 · AI 对话式选品搜索样式 (与 zyx-aichat.js 配套, 2026-11) */

/* ---- 搜索表单内的 AI 按钮 ---- */
.zyx-ai-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: linear-gradient(135deg, #6a3df5, #3b82f6);
    color: #fff !important; border: 0; border-radius: 4px;
    padding: 0 14px; height: 34px; line-height: 34px;
    font-size: 14px; cursor: pointer; white-space: nowrap;
    transition: opacity .2s;
}
.zyx-ai-btn:hover { opacity: .88; }
.zyx-ai-ico { font-style: normal; }

/* ---- 对话抽屉 ---- */
.zyx-aichat {
    position: fixed; right: 24px; bottom: 24px; z-index: 99999;
    width: 420px; max-width: calc(100vw - 48px); height: 580px; max-height: calc(100vh - 48px);
    background: #fff; border-radius: 14px; box-shadow: 0 12px 48px rgba(15, 23, 42, .28);
    display: none; flex-direction: column; overflow: hidden;
    font-size: 14px; color: #1f2937;
}
.zyx-aichat.show { display: flex; }

.zyx-ah {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; color: #fff; font-weight: 600; font-size: 15px;
    background: linear-gradient(135deg, #5b2ee0, #2f7cf6);
}
.zyx-ah-close {
    background: rgba(255, 255, 255, .18); color: #fff; border: 0;
    width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 13px;
}
.zyx-ah-close:hover { background: rgba(255, 255, 255, .32); }

.zyx-abody { flex: 1; overflow-y: auto; padding: 14px 14px 6px; background: #f6f8fb; }

.zyx-msg { margin-bottom: 12px; }
.zyx-mname { font-size: 11px; color: #94a3b8; margin-bottom: 3px; }
.zyx-mbody {
    background: #fff; border-radius: 10px; padding: 10px 12px; line-height: 1.65;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06); word-break: break-word;
}
.zyx-user .zyx-mbody { background: #dbeafe; }
.zyx-user { text-align: left; }
.zyx-ref { color: #5b2ee0; font-weight: 600; font-size: 11px; }

/* 产品卡片 */
.zyx-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.zyx-card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid #e5e9f0;
    border-radius: 8px; padding: 8px; text-decoration: none !important; color: inherit !important;
    transition: border-color .15s, box-shadow .15s;
}
.zyx-card:hover { border-color: #6a3df5; box-shadow: 0 3px 10px rgba(90, 60, 220, .12); }
.zyx-card img { width: 100%; height: 84px; object-fit: contain; background: #f8fafc; border-radius: 4px; }
.zyx-noimg {
    width: 100%; height: 84px; display: flex; align-items: center; justify-content: center;
    background: #f1f5f9; color: #b6c2d2; border-radius: 4px;
}
.zyx-cm { font-weight: 700; font-size: 13px; margin-top: 6px; color: #111827; }
.zyx-cn { font-size: 12px; color: #6b7280; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.zyx-links { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.zyx-links a { font-size: 12px; color: #2f6bdb; text-decoration: none !important; }
.zyx-links a:hover { text-decoration: underline !important; }

/* 加载动画 */
.zyx-dots i {
    display: inline-block; width: 4px; height: 4px; border-radius: 50%;
    background: #6a3df5; margin: 0 2px 2px; animation: zyxBlink 1.2s infinite;
}
.zyx-dots i:nth-child(2) { animation-delay: .2s; }
.zyx-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes zyxBlink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.zyx-err { color: #d33; font-size: 13px; }

/* 快捷词 */
.zyx-afast { display: flex; gap: 6px; padding: 8px 12px 0; background: #fff; flex-wrap: wrap; }
.zyx-chip {
    background: #f1f3fe; color: #5b2ee0; border: 1px solid #ddd8fb;
    border-radius: 20px; padding: 3px 12px; font-size: 12px; cursor: pointer;
}
.zyx-chip:hover { background: #e4e2fd; }

/* 输入行 */
.zyx-ain { display: flex; gap: 8px; padding: 10px 12px; background: #fff; }
.zyx-ain input {
    flex: 1; border: 1px solid #dbe1ea; border-radius: 8px; height: 38px;
    padding: 0 12px; font-size: 14px; outline: none;
}
.zyx-ain input:focus { border-color: #6a3df5; }
.zyx-asend {
    background: linear-gradient(135deg, #6a3df5, #3b82f6); color: #fff; border: 0;
    border-radius: 8px; padding: 0 18px; font-size: 14px; cursor: pointer;
}
.zyx-apow { font-size: 11px; color: #9aa6b5; text-align: center; padding: 0 12px 10px; background: #fff; }

body.zyx-noscroll { overflow: hidden; }

/* ---- 手机端: 全屏 ---- */
@media (max-width: 768px) {
    .zyx-ai-btn { padding: 0 10px; height: 32px; line-height: 32px; font-size: 13px; }
    .zyx-aichat {
        right: 0; bottom: 0; left: 0; top: 0;
        width: 100%; max-width: 100%; height: 100%; max-height: 100%;
        border-radius: 0;
    }
    .zyx-cards { grid-template-columns: 1fr 1fr; }
}
