/* 聊天容器 */
.chat-container {
    display: flex;
    height: 100vh;
    margin: 0;
    background-color: #f5f5f5;
}

/* 用户列表样式 */
.users-list {
    width: 300px;
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.list-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.list-header h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.admin-selector {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.back-btn {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background: #e0e0e0;
}

.search-box {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.search-box input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.users {
    flex: 1;
    overflow-y: auto;
}

.user-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-item:hover {
    background-color: #f5f5f5;
}

.user-item.active {
    background-color: #e3f2fd;
}

.user-item .username {
    font-weight: bold;
    margin-bottom: 5px;
}

.user-item .last-message {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 聊天区域样式 */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #ddd;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f5f5f5;
}

.message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-start;
}

.message.admin {
    align-items: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 5px;
}

.message.user .message-content {
    background-color: white;
}

.message.admin .message-content {
    background-color: #007bff;
    color: white;
}

.message-time {
    font-size: 12px;
    color: #666;
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    cursor: pointer;
}

/* 输入区域样式 */
.chat-input-area {
    background: white;
    padding: 20px;
    border-top: 1px solid #ddd;
}

.image-preview {
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 4px;
}

.remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    cursor: pointer;
    font-size: 12px;
}

.input-container {
    display: flex;
    align-items: flex-end;
}

textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    height: 60px;
    margin-right: 10px;
    font-family: inherit;
}

.input-actions {
    display: flex;
    gap: 10px;
}

.upload-btn, .send-btn {
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #007bff;
    color: white;
    transition: background-color 0.2s;
}

.upload-btn:hover, .send-btn:hover {
    background: #0056b3;
}

.upload-btn:disabled, .send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 图片查看器 */
.image-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.image-viewer.active {
    display: flex;
}

.viewer-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.viewer-content img {
    max-width: 100%;
    max-height: 90vh;
}

.close-viewer {
    position: absolute;
    top: -30px;
    right: 0;
    color: white;
    font-size: 24px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    
    .users-list {
        width: 100%;
        height: 200px;
    }
    
    .message-content {
        max-width: 90%;
    }
} 