/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #333;
}

#app-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    max-height: 800px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* 聊天窗口 */
#chat-window {
    flex: 3;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
}

#messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

#input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
}

#message-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 16px;
}

#upload-btn {
    padding: 10px 15px;
    border: none;
    background-color: #6c757d;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px;
    transition: background-color 0.3s;
}

#upload-btn:hover {
    background-color: #5a6268;
}

#send-btn {
    padding: 10px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

#send-btn:hover {
    background-color: #0056b3;
}

/* 用户设置面板 */
#user-panel {
    flex: 1;
    padding: 20px;
    background-color: #fdfdfd;
}

#user-panel h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    color: #007bff;
}

.setting {
    margin-bottom: 20px;
}

.setting label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

#nickname-input, #avatar-input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-top: 10px;
    object-fit: cover;
    border: 2px solid #eee;
}

#save-settings-btn {
    width: 100%;
    padding: 12px;
    border: none;
    background-color: #28a745;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

#save-settings-btn:hover {
    background-color: #218838;
}

/* 响应式布局 */
/* 消息样式 */
.message {
    display: flex;
    margin-bottom: 15px;
}

.message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.message .content {
    display: flex;
    flex-direction: column;
}

.message .nickname {
    font-weight: bold;
    color: #007bff;
    margin-right: 8px;
}

.message .timestamp {
    font-size: 12px;
    color: #999;
}

.message p {
    margin: 5px 0 0 0;
    background-color: #e9ecef;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 100%;
    word-wrap: break-word;
}

.message .message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message .message-image:hover {
    transform: scale(1.05);
}


/* 响应式布局 */
@media (max-width: 768px) {
    #app-container {
        flex-direction: column;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    #chat-window {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    #user-panel {
        flex: none;
        height: auto;
    }
}