/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* 状态栏 */
.status-bar {
    background: #f8f9fa;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e9ecef;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffc107;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: #28a745;
    animation: none;
}

.status-dot.offline {
    background: #dc3545;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 14px;
    color: #6c757d;
}

/* 聊天区域 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

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

.message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

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

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

.user-message .message-content {
    background: #667eea;
    color: white;
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    max-width: 70%;
    word-wrap: break-word;
}

.assistant-message {
    display: flex;
    justify-content: flex-start;
}

.assistant-message .message-content {
    background: white;
    color: #333;
    padding: 12px 18px;
    border-radius: 18px 18px 18px 4px;
    max-width: 85%;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    line-height: 1.6;
}

.assistant-message .message-content ul {
    margin-left: 20px;
    margin-top: 10px;
}

.assistant-message .message-content li {
    margin: 5px 0;
}

/* 房源信息样式 */
.villa-info {
    background: #f0f7ff;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.villa-info p {
    margin: 5px 0;
    font-size: 14px;
}

.villa-info strong {
    color: #667eea;
}

.villa-divider {
    border-top: 1px dashed #667eea;
    margin: 15px 0;
}

/* 输入区域 */
.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

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

.send-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    min-width: 80px;
}

.send-button:hover {
    background: #5568d3;
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 快捷操作 */
.quick-actions {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.quick-button {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-button:hover {
    background: #667eea;
    color: white;
}

/* 底部 */
.footer {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.footer p {
    color: #6c757d;
    font-size: 13px;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 5px;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
        height: 100vh;
        max-width: 100%;
    }

    .header {
        padding: 20px;
    }

    .title {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    .chat-container {
        height: calc(100vh - 350px);
    }

    .user-message .message-content,
    .assistant-message .message-content {
        max-width: 85%;
    }

    .quick-actions {
        padding: 15px;
    }

    .quick-button {
        font-size: 13px;
        padding: 8px 16px;
    }
}
