* {
    margin: 0;
    padding: 0;
    /* css3盒子模型 */
    box-sizing: border-box;
}

em,
i {
    font-style: normal
}



li {
    list-style: none
}

img {
    /* border 0 照顾低版本浏览器 如果 图片外面包含了链接会有边框的问题 */
    border: 0;

    vertical-align: middle
}

button {

    cursor: pointer
}

a {
    color: #666;
    text-decoration: none
}

button,
input {
    font-family: Microsoft YaHei, Heiti SC, tahoma, arial, Hiragino Sans GB, "\5B8B\4F53", sans-serif;
    border: 0;
    outline: none;
}

body {
    -webkit-font-smoothing: antialiased;
    background-color: #f8f8f8;
    font: 14px/1.5 Microsoft YaHei, Heiti SC, tahoma, arial, Hiragino Sans GB, "\5B8B\4F53", sans-serif;
}

.hide,
.none {
    display: none
}

.notice {
    display: none;
}

/* 聊天弹窗样式 */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-overlay.show {
    display: flex;
    opacity: 1;
}

.chat-container {
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.chat-overlay.show .chat-container {
    transform: scale(1);
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    font-weight: 600;
    font-size: 18px;
    position: relative;
}

.close-button {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.connection-status {
    display: inline-block;
    top: 20px;
    left: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ff4444;
    transition: background-color 0.3s ease;
}

.connection-status.connected {
    background-color: #44ff44;
}

/* 用户信息表单 */
.user-form-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-form-container h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.user-form-container p {
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.6;
}

.chatform-group {
    margin-bottom: 20px;
}

.chatform-group label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.chatform-group label .required {
    color: #ff4444;
    margin-left: 2px;
}

.chatform-group input,
.chatform-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.chatform-group input:focus,
.chatform-group textarea:focus {
    border-color: #667eea;
}

.chatform-group textarea {
    resize: vertical;
    min-height: 100px;
}

.chatform-group .input-hint {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.submit-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.submit-button:hover {
    transform: translateY(-2px);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 聊天界面 */
.chat-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.chat-content.active {
    display: flex;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #fafafa;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.3s ease-in;
}

.message.user {
    justify-content: flex-end;
}

.message.agent {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.agent .message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin: 0 8px;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: #667eea;
}

.send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.send-button:hover {
    transform: scale(1.05);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    padding: 10px 20px;
    color: #999;
    font-style: italic;
    font-size: 14px;
    display: none;
}

.typing-indicator.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
}

@media (max-width: 768px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
}