* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; height: 100vh; background: #f5f5f5; }

.app { display: flex; height: 100vh; }

/* 侧边栏 */
.sidebar { width: 280px; background: #fff; border-right: 1px solid #e0e0e0; display: flex; flex-direction: column; }
.user-info { padding: 16px; background: #128C7E; color: #fff; display: flex; align-items: center; gap: 12px; }
.avatar { width: 48px; height: 48px; background: #fff; color: #128C7E; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 20px; }
.info .username { font-size: 16px; font-weight: 500; }
.info .peer-id { font-size: 11px; opacity: 0.8; word-break: break-all; }

.tabs { display: flex; border-bottom: 1px solid #e0e0e0; }
.tab { flex: 1; padding: 12px; background: none; border: none; cursor: pointer; font-size: 14px; color: #666; }
.tab.active { color: #128C7E; border-bottom: 2px solid #128C7E; }

.actions { padding: 12px; display: flex; gap: 8px; }
.actions button { flex: 1; padding: 10px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; background: #f0f0f0; color: #333; }
.actions button:hover { background: #e0e0e0; }

.session-list { flex: 1; overflow-y: auto; }
.session-item { padding: 14px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer; display: flex; align-items: center; }
.session-item:hover { background: #f9f9f9; }
.session-item.active { background: #e8f5e9; }
.session-name { font-size: 14px; color: #333; }
.group-list { flex: 1; overflow-y: auto; }
.group-item { padding: 14px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.group-item:hover { background: #f9f9f9; }
.group-item.active { background: #e8f5e9; }
.group-name { font-size: 14px; color: #333; }
.group-count { font-size: 12px; color: #999; }

.empty-hint { padding: 20px; text-align: center; color: #999; font-size: 13px; }

/* 主聊天区 */
.chat-area { flex: 1; display: flex; flex-direction: column; background: #fff; }
.chat-header { padding: 16px 20px; background: #f5f5f5; border-bottom: 1px solid #e0e0e0; }
.chat-title { font-size: 16px; font-weight: 500; color: #333; }

.chat-messages { flex: 1; overflow-y: auto; padding: 20px; }
.empty-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #999; }
.lock-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 18px; }
.empty-state .subtitle { font-size: 13px; margin-top: 8px; }

.message { margin-bottom: 12px; display: flex; }
.message.mine { justify-content: flex-end; }
.message-content { max-width: 70%; padding: 10px 14px; border-radius: 12px; background: #f0f0f0; font-size: 14px; line-height: 1.4; word-break: break-word; }
.message.mine .message-content { background: #dcf8c6; }
.msg-sender { display: block; font-size: 11px; color: #128C7E; margin-bottom: 4px; font-weight: 500; }

.chat-input-area { padding: 12px 16px; border-top: 1px solid #e0e0e0; display: flex; gap: 10px; }
#chat-input { flex: 1; padding: 10px 14px; border: 1px solid #ddd; border-radius: 20px; font-size: 14px; outline: none; }
#chat-input:focus { border-color: #128C7E; }
#btn-send { padding: 10px 20px; background: #128C7E; color: #fff; border: none; border-radius: 20px; cursor: pointer; font-size: 14px; }
#btn-send:hover { background: #0d7a6a; }
#btn-attach { padding: 8px 12px; background: #f0f0f0; color: #666; border: none; border-radius: 20px; cursor: pointer; font-size: 16px; }
#btn-attach:hover { background: #e0e0e0; }

/* 文件消息样式 */
.file-message { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f5f5f5; border-radius: 8px; text-decoration: none; color: #333; }
.file-message:hover { background: #e8e8e8; }
.file-message .file-icon { font-size: 20px; }
.file-message .file-info { display: flex; flex-direction: column; }
.file-message .file-name { font-size: 13px; font-weight: 500; color: #128C7E; }
.file-message .file-size { font-size: 11px; color: #999; }

/* 模态框 */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; border-radius: 12px; width: 90%; max-width: 400px; overflow: hidden; }
.modal-header { padding: 16px 20px; background: #f5f5f5; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e0e0e0; }
.modal-title { font-size: 16px; font-weight: 500; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }
.modal-body { padding: 20px; }
.modal-buttons { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.modal-btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.modal-btn:first-child { background: #f0f0f0; color: #333; }
.modal-btn:last-child { background: #128C7E; color: #fff; }
.modal-input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }

/* Toast */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 14px; z-index: 2000; }
