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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background-color: #f9f5f8;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.1);
    background-image: linear-gradient(135deg, #fff, #fef7fb);
}

.header h1 {
    font-size: 36px;
    color: #ff6b9d;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(255, 107, 157, 0.1);
}

.header p {
    font-size: 18px;
    color: #8a5a7a;
    font-weight: 400;
}

/* 聊天容器样式 */
.chat-container {
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.1);
    overflow: hidden;
    background-image: linear-gradient(135deg, #fff, #fef7fb);
}

/* 聊天头部样式 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #fef2f7;
    border-bottom: 1px solid #fdd9eb;
}

.chat-header h2 {
    font-size: 20px;
    color: #8a5a7a;
    font-weight: 600;
}

.role-selector select {
    padding: 10px 16px;
    border: 1px solid #ffb6d1;
    border-radius: 20px;
    font-size: 14px;
    background-color: #fff;
    color: #8a5a7a;
    font-weight: 400;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.1);
    transition: all 0.3s ease;
}

.role-selector select:hover {
    border-color: #ff6b9d;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.15);
}

/* 聊天消息区域样式 */
.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    margin-left: auto;
    text-align: right;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    display: inline-block;
}

.ai-message .message-content {
    background-color: #f8e8f0;
    border-bottom-left-radius: 4px;
    color: #6a4a6a;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.1);
}

.user-message .message-content {
    background-color: #ff85b3;
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(255, 133, 179, 0.2);
}

/* 聊天输入区域样式 */
.chat-input {
    display: flex;
    padding: 20px;
    border-top: 1px solid #fdd9eb;
    background-color: #fef2f7;
}

.chat-input input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid #ffb6d1;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.1);
    background-color: #fff;
}

.chat-input input:focus {
    border-color: #ff6b9d;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.15);
}

.chat-input button {
    margin-left: 12px;
    padding: 14px 28px;
    background-color: #ff6b9d;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.2);
}

.chat-input button:hover {
    background-color: #ff4b8a;
    box-shadow: 0 6px 16px rgba(255, 75, 138, 0.3);
    transform: translateY(-1px);
}

/* 底部样式 */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.1);
    background-image: linear-gradient(135deg, #fff, #fef7fb);
}

.footer p {
    font-size: 14px;
    color: #8a5a7a;
    font-weight: 400;
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .header h1 {
        font-size: 28px;
    }
    
    .header p {
        font-size: 16px;
    }
}
