/* 聊天按钮样式 - 目标渐变色 */


/* 弹窗遮罩层 */
.chat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* 聊天窗口主体 - 支持拖动+拉伸 */
.chat-modal {
    width: 500px;
    height: 450px;
    min-width: 320px; /* 最小宽度限制 */
    min-height: 300px; /* 最小高度限制 */
    background-color: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: absolute;
    cursor: default;
    resize: both;
    overflow: auto;
}

/* 拉伸手柄（右下角）- 增强视觉提示 */
.chat-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: transparent;
    cursor: se-resize; /* 右下拉伸光标 */
    z-index: 10;
}

/* 聊天窗口头部 */
.chat-header {
    padding: 12px 16px;
    background: linear-gradient(90deg, #0a2afa 0%, #0398f3 100%);
    color: white;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
    flex-shrink: 0; /* 头部不被压缩 */
}

.chat-header-dragging {
    background: linear-gradient(90deg, #0a2afa 0%, #0398f3 100%);
}

.close-chat-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
}

.close-chat-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 聊天内容区域 - 核心修改：取消居中，改为左上角对齐 */
.chat-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #f9fafb;
    /* 移除居中的flex属性，改为默认块级布局 */
    display: block;
}

/* 产品卡片默认样式（80px核心尺寸） */
.default-product-card {
    width: 100%;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: white;
    /* 可选：给产品卡片加一点上边距，避免贴顶太近 */
    margin-top: 8px;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #f3f4f6;
}

.product-info {
    flex: 1;
}

.product-title {
    font-size: 14px;
    color: #111827;
    margin-bottom: 6px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 16px;
    color: #dc2626;
    font-weight: 600;
    margin-bottom: 4px;
}

.product-moq {
    font-size: 12px;
    color: #6b7280;
}

/* 表单区域 */
.chat-form {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0; /* 表单不被压缩 */
}

.contact-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.contact-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.contact-input:focus {
    outline: none;
    border-color: #8729F9;
    box-shadow: 0 0 0 2px rgba(135, 41, 249, 0.2);
}

.message-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    resize: none;
    height: 60px;
    font-size: 14px;
    margin-bottom: 12px;
}

.message-input:focus {
    outline: none;
    border-color: #8729F9;
    box-shadow: 0 0 0 2px rgba(135, 41, 249, 0.2);
}

/* 发送按钮 - 目标渐变色 */
.submit-chat-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(90deg, #8729F9 0%, #D71919 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.submit-chat-btn:hover {
    background: linear-gradient(90deg, #7522d8 0%, #b91616 100%);
}

.submit-chat-btn:disabled {
    background: linear-gradient(90deg, #a070d9 0%, #c76666 100%);
    cursor: not-allowed;
}

/* 错误提示 */
.error-tip {
    color: #dc2626;
    font-size: 12px;
    margin-bottom: 8px;
    display: none;
}





/* 新增：遮罩层样式 */
.in-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* 初始隐藏 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* 新增：弹窗显示时的遮罩层状态 */
.in-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 弹窗容器 */
.in-open-btn,.chat-trigger-btn{
    cursor: pointer;
}
.in-popup {
    display: none;
    width: 600px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
    padding: 16px;
    position: relative;
    background: white;
    /* 新增：弹出动画初始状态 */
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}

/* 新增：弹窗显示时的动画状态 */
.in-overlay.active .in-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 关闭按钮 */
.in-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    line-height: 1;
    z-index: 10; /* 新增：确保关闭按钮在最上层 */
}

/* 公司信息栏 */
.in-company-info {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.in-company-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: inline-block;
    margin-right: 8px;
}

.in-verification-badges {
    display: inline-block;
    font-size: 12px;
}

.in-standard-badge {
    background: #f5f5f5;
    color: #666;
    padding: 2px 6px;
    border-radius: 2px;
    margin-right: 4px;
}

.in-year-badge {
    color: #999;
    margin-right: 4px;
}

.in-verified-badge {
    color: #0088ff;
    font-weight: 600;
}

/* 消息输入区域 */
.in-message-section {
    margin-bottom: 0px;
}

.in-quick-message-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.in-quick-message-select {
    padding: 6px 30px 6px 8px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.in-help-icon {
    position: absolute;
    left: 120px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    cursor: help;
}

.in-message-textarea {
    width: 100%;
    height: 120px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    color: #333;
    resize: none;
    box-sizing: border-box;
    line-height: 1.5;
}

.in-message-textarea::placeholder {
    color: #999;
}

.in-char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* 邮箱输入区域 */
.in-email-section {
    margin-bottom: 16px;
}

.in-email-label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.in-required {
    color: red;
}

.in-email-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.in-email-input::placeholder {
    color: #999;
}

/* 上传区域 */
.in-upload-section {
    margin-bottom: 20px;
}

.in-upload-link {
    color: #0088ff;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.in-upload-link::before {
    content: "↑";
    margin-right: 4px;
    font-size: 12px;
}

/* 提交按钮 */
.in-submit-btn {
    background: #f5222d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.in-submit-btn:hover {
    background: #d91622;
}

