/* 微信群聊样式 - 完全模仿微信 */

/* 手机端布局 */
html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: #ededed;
    font-family: UKIJ Tor, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
}

/* 主容器 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
}

/* 顶部导航栏 */
.chat-header {
    display: flex;
    align-items: center;
    height: 50px;
    padding: 0 15px;
    background: #ededed;
    border-bottom: 1px solid #dcdcdc;
}

.chat-header-back {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
}

.chat-header-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.chat-header-action {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* 群聊信息头部 */
.chat-group-info {
    background: #ededed;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-group-avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: #07c160;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

.chat-group-details h4 {
    font-size: 14px;
    color: #333;
}

.chat-group-details p {
    font-size: 12px;
    color: #999;
}

/* 消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    background: #ededed;
}

/* 消息时间戳 */
.message-time {
    text-align: center;
    padding: 10px 0;
    font-size: 12px;
    color: #999;
}

/* 消息气泡容器 */
.message-item {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease-out;
}

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

.message-item.self {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: #07c160;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.message-content-wrapper {
    max-width: 70%;
    margin: 0 8px;
}

/* 消息气泡 */
.message-bubble {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
}

/* 对方气泡 - 绿色 */
.message-bubble.other {
    background: #fff;
    border: 1px solid #fff;
}

.message-bubble.other::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid #fff;
}

/* 自己气泡 - 白色 */
.message-bubble.self {
    background: #95ec69;
    border: 1px solid #95ec69;
}

.message-bubble.self::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #95ec69;
}

/* 消息昵称 */
.message-nickname {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

/* 图片消息 */
.message-image {
    max-width: 200px;
    border-radius: 8px;
    cursor: pointer;
}

/* 表情消息 */
.message-emoji {
    font-size: 40px;
    line-height: 1;
}

/* 退群通知 */
.quit-notice {
    text-align: center;
    padding: 8px 0;
    font-size: 12px;
    color: #999;
    background: #ededed;
    margin: 10px 0;
}

.quit-notice::before,
.quit-notice::after {
    content: ' — ';
}

/* 输入区域 */
.chat-input-area {
    background: #f5f5f5;
    border-top: 1px solid #dcdcdc;
    padding: 8px 10px;
}

.chat-input-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input {
    flex: 1;
    min-height: 36px;
    max-height: 100px;
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    resize: none;
    font-size: 15px;
    line-height: 1.4;
    font-family: inherit;
    background: #fff;
}

.chat-input:focus {
    outline: none;
    border-color: #07c160;
}

.chat-send-btn {
    padding: 8px 16px;
    background: #07c160;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

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

/* 工具栏按钮 */
.chat-toolbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chat-toolbar-btn:hover {
    background: #e5e5e5;
    color: #666;
}

/* 表情选择器 */
.emoji-picker {
    display: none;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    background: #f5f5f5;
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.emoji-picker.show {
    display: flex;
}

.emoji-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border-radius: 4px;
}

.emoji-item:hover {
    background: #f0f0f0;
}

/* 图片预览 */
.image-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.image-preview-modal.show {
    display: flex;
}

.image-preview-modal img {
    max-width: 90%;
    max-height: 90%;
}

/* 滚动条美化 */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

/* 响应式适配 */
@media (max-width: 768px) {
    .chat-container {
        max-width: 100%;
    }
    
    .message-content-wrapper {
        max-width: 80%;
    }
}
