 * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
        
            color: #333;
            line-height: 1.6;
            min-height: 100vh;
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
       
        .container1 {
            max-width: 900px;
            width: 100%;
            background: white;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            margin: 50px 0px 100px ;
        }
       
        header {
            text-align: center;
            padding: 25px 20px;
            background: linear-gradient(to right, #3498db, #2c3e50);
            color: white;
            position: relative;
            overflow: hidden;
        }
        
        header h1 {
            font-size: 2.2rem;
            margin-bottom: 10px;
            position: relative;
            z-index: 2;
        }
        
        header p {
            font-size: 1.1rem;
            opacity: 0.9;
            position: relative;
            z-index: 2;
        }
     
        /* 用户信息表单样式 */
        .user-info-form {
            padding: 30px;
            display: flex;
            flex-direction: column;
        }
        
        .form-group {
            margin-bottom: 25px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #555;
            font-size: 1.1rem;
        }
        
        .form-control {
            width: 100%;
            padding: 15px;
            border: 1px solid #ddd;
            border-radius: 10px;
            font-size: 16px;
            transition: all 0.3s;
            background-color: #f9f9f9;
        }
        
        .form-control:focus {
            outline: none;
            border-color: #3498db;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
            background-color: white;
        }
        
        .btn {
            display: inline-block;
            padding: 15px 25px;
            background: #b4292e;
            color: white;
            border: none;
            border-radius: 50px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
        }
        
        .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
        }
        
        .btn:active {
            transform: translateY(1px);
        }
        
        .btn-block {
            width: 100%;
        }
        
        .error-message {
            color: #e74c3c;
            font-size: 14px;
            margin-top: 8px;
            display: none;
        }
        
        /* 聊天界面样式 */
        .chat-container {
            display: none;
            flex-direction: column;
            height: 600px;
            background-color: white;
            overflow: hidden;
            position: relative;
        }
        
        .chat-header {
            padding: 15px 25px;
            background:#b7282c;
            color: white;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            position: relative;
            z-index: 10;
        }
        
        .chat-header h2 {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .chat-header h2 i {
            color: #ffde59;
        }
        
        .chat-messages {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            background-color: #f5f7fa;
            display: flex;
            flex-direction: column;
            position: relative;
        }
        
        .message {
            max-width: 80%;
            margin-bottom: 20px;
            padding: 15px 20px;
            border-radius: 18px;
            line-height: 1.5;
            position: relative;
            animation: fadeIn 0.3s ease-out;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .message.user {
            background: #ec9b9c;
            color: white;
            align-self: flex-end;
            border-bottom-right-radius: 5px;
        }
        
        .message.ai {
            background: white;
            color: #333;
            align-self: flex-start;
            border-bottom-left-radius: 5px;
            border: 1px solid #eaeaea;
        }
        
        .message .time {
            font-size: 11px;
            margin-top: 8px;
            opacity: 0.7;
            text-align: right;
        }
        
        .message .sender {
            font-weight: bold;
            font-size: 0.9rem;
            margin-bottom: 5px;
        }
        
        .chat-input-area {
            display: flex;
            padding: 15px;
            background-color: white;
            border-top: 1px solid #eee;
            gap: 10px;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        }
        
        .chat-input {
            flex: 1;
            padding: 15px 20px;
            border: 1px solid #ddd;
            border-radius: 30px;
            font-size: 16px;
            resize: none;
            height: 60px;
            transition: all 0.3s;
            background-color: #f9f9f9;
        }
        
        .chat-input:focus {
            outline: none;
            border-color: #3498db;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
            background-color: white;
        }
        
        .send-btn {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: #b7282c;
            color: white;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
            box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
        }
        
        .send-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
        }
        
        .send-btn:active {
            transform: scale(0.98);
        }
        
        .send-btn i {
            font-size: 1.2rem;
        }
        
        /* 对方输入中效果 - 固定在左下角 */
        .typing-indicator {
            background-color: white;
            border: 1px solid #eaeaea;
            border-radius: 18px;
            padding: 15px 20px;
            align-self: flex-start;
            margin-bottom: 15px;
            display: none;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
            max-width: 120px;
            position: absolute;
            bottom: 10px;
            left: 20px;
            z-index: 5;
        }
        
        .typing-indicator span {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background-color: #7f8c8d;
            margin: 0 3px;
            animation: bounce 1.4s infinite ease-in-out both;
        }
        
        .typing-indicator span:nth-child(1) {
            animation-delay: -0.32s;
        }
        
        .typing-indicator span:nth-child(2) {
            animation-delay: -0.16s;
        }
        
        @keyframes bounce {
            0%, 80%, 100% {
                transform: translateY(0);
            }
            40% {
                transform: translateY(-8px);
            }
        }
        
        /* 自动识别的链接样式 */
        .auto-link {
            text-decoration: underline;
            transition: color 0.2s;
        }
        
        /* 网址链接样式 */
        .url-link {
            color: #2563eb;
        }
        
        .url-link:hover {
            color: #1d4ed8;
        }
        
        /* 电话链接样式 */
        .phone-link {
            color: #10b981;
        }
        
        .phone-link:hover {
            color: #059669;
        }
        
        /* 邮箱链接样式 */
        .email-link {
            color: #f97316;
        }
        
        .email-link:hover {
            color: #ea580c;
        }
        
        /* 历史记录按钮 */
        .history-btn {
            position: absolute;
            top: 15px;
            right: 120px;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s;
            z-index: 11;
        }
        
        .history-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: rotate(20deg);
        }
        
        /* 历史记录面板 */
        .history-panel {
            position: absolute;
            top: 0;
            right: -350px;
            width: 320px;
            height: 100%;
            background: white;
            box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
            transition: transform 0.4s ease;
            z-index: 100;
            padding: 20px;
            overflow-y: auto;
        }
        
        .history-panel.active {
            transform: translateX(-350px);
        }
        
        .history-panel h3 {
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #3498db;
            color: #2c3e50;
        }
        
        .history-item {
            padding: 12px;
            margin-bottom: 10px;
            background: #f5f7fa;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            border-left: 3px solid #3498db;
        }
        
        .history-item:hover {
            background: #e3f2fd;
            transform: translateX(5px);
        }
        
        .history-item .time {
            font-size: 0.8rem;
            color: #7f8c8d;
            margin-top: 5px;
        }
        
        .overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 90;
            display: none;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .container1 {
                max-width: 95%;
            }
            
            .message {
                max-width: 90%;
            }
            
            .user-info-form {
                padding: 20px;
            }
            
            .chat-header {
                padding: 15px;
            }
            
            .history-panel {
                width: 280px;
            }
            
            .history-panel.active {
                transform: translateX(-280px);
            }
        }
        
        @media (max-width: 480px) {
            header h1 {
                font-size: 1.8rem;
            }
            
            .chat-input-area {
                padding: 10px;
            }
            
            .chat-input {
                padding: 12px 15px;
                height: 50px;
            }
            
            .send-btn {
                width: 50px;
                height: 50px;
            }
            
            .typing-indicator {
               bottom: 70px; /* 小屏幕输入框高度略小，调整距离 */
        left: 15px;
      
            }
        }

.chat-input-area {
    position: relative; /* 关键：让子元素基于输入区域定位 */
    padding-top: 40px; /* 预留指示器空间，避免遮挡 */
}

/* 对方输入中效果 - 固定在输入框上方，与输入区域绑定 */
.typing-indicator {
    background-color: white;
    border: 1px solid #eaeaea;
    border-radius: 18px;
    padding: 10px 15px;
    display: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    max-width: 120px;
    /* 相对于输入区域定位，固定在输入框正上方 */
    position: absolute;
    bottom: 150px;
    left: 20px; /* 与输入框左侧对齐 */
    z-index: 10; /* 确保在所有消息上方 */
    margin: 0;
}

/* 输入框样式微调（确保与指示器间距合理） */
.chat-input {
    margin-top: 5px; /* 与指示器保持微小间距 */
}


