﻿/* 页面整体布局 */
.page {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background-color: #f5f5f5;
    box-sizing: border-box;
}

/* 顶部平台条 */
.platform-bar {
    position: relative;
    height: 44px;
    padding: 0 0;
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
    z-index: 10;
    overflow: visible;
}

.platform-scroll {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    padding: 0 8px;
}

.platform-scroll::-webkit-scrollbar {
    display: none; /* Chrome Safari */
}

.platform-tab {
    display: inline-block;
    padding: 8px 18px;
    margin: 0 4px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    background-color: #f7f7f7;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.platform-tab:active {
    transform: scale(0.95);
}

.platform-tab.active {
    color: #ffffff;
    background-color: #07c160;
}

/* 群列表条 */
.group-bar {
    position: relative;
    height: 35px;
    padding: 0 0;
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
    z-index: 9;
}

.group-scroll {
    white-space: nowrap;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    display: flex;
    align-items: center;
}

.group-scroll::-webkit-scrollbar {
    display: none;
}

.group-tab {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    margin: 0 2px;
    border-radius: 7px;
    font-size: 14px;
    color: #555;
    background-color: #f7f7f7;
    cursor: pointer;
    transition: all 0.3s ease;
}

.group-name {
    flex: 1;
}

.group-favorite {
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    background-color: #1890ff;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
}

.group-favorite:hover {
    background-color: #40a9ff;
}

.group-tab.active {
    color: #ffffff;
    background-color: #1890ff;
}

.group-tab.active .group-favorite {
    background-color: #fff;
    color: #1890ff;
}

.group-tab.active .group-favorite:hover {
    background-color: #f0f0f0;
}

/* 聊天区域 */
.chat-scroll {
    position: absolute;
    left: 0;
    right: 0;
    top: 63px; /* 上面两行：44 + 19 */
    bottom: 48px;
    background-color: #f5f5f5;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* 单条消息 */
.msg-item {
    display: flex;
    padding: 5px 8px;
    margin-bottom: 8px;
}

/* 头像 */
.avatar-wrap {
    width: 36px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #ffecec;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* 消息气泡区域 */
.bubble-wrap {
    flex: 1;
    margin-left: 8px;
}

.nickname {
    font-size: 10px;
    color: #333 !important;
    margin-bottom: 2px;
}

/* 消息气泡 */
.bubble {
    max-width: 70%;
    padding: 6px 10px;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.bubble-text {
    word-wrap: break-word;
}

.msg-text {
    font-size: 19.2px;
    line-height: 1.4;
    color: #333;
}

.msg-link {
    color: #1890ff;
    text-decoration: none;
}

/* 拼多多链接样式 */
.pdd-link {
    color: #667eea;
}

/* 京东链接样式 */
.jd-link {
    color: #e4393c;
}

/* 淘宝链接样式 */
.taobao-link {
    color: #ff5722;
}

/* 图片消息 */
.bubble-image {
    padding: 3px;
    max-width: 100%;
}

.bubble.bubble-image {
    max-width: none;
    width: fit-content;
}

.msg-image {
    width: 100%;
    max-width: 100px;
    max-height: 150px;
    border-radius: 6px;
    display: block;
    object-fit: cover;
}

/* 视频消息 */
.msg-video {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* 音频消息 */
.msg-audio {
    max-width: 200px;
    height: 32px;
}

/* 表情消息 */
.bubble-emotion {
    padding: 4px;
}

.bubble.bubble-emotion {
    max-width: none;
    width: fit-content;
}

.msg-emotion {
    width: 60px;
    height: 60px;
    border-radius: 4px;
}

/* 其他类型消息 */
.bubble-other {
    background-color: #f0f0f0;
}

/* 操作按钮 */
.msg-actions {
    display: flex;
    margin-top: 4px;
    gap: 8px;
}

.action-item {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #999;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.action-item:hover {
    background-color: #f0f0f0;
}

.action-icon {
    margin-right: 2px;
}

.action-text {
    font-size: 15px;
}

/* 底部导航栏 */
.bottom-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    height: 48px;
    background-color: #ffffff;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-sizing: border-box;
    z-index: 100;
    transition: transform 0.3s ease;
}

.bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.3s;
    padding: 4px;
}

.bottom-item.active {
    color: #07c160;
}

.bottom-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.bottom-text {
    font-size: 10px;
}

/* 空状态 */
.empty-tip {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 40px 20px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #07c160;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.loading-text {
    color: #666;
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误状态 */
.error-tip {
    text-align: center;
    color: #ff4d4f;
    font-size: 14px;
    padding: 40px 20px;
    background-color: #fff2f0;
    border-radius: 8px;
    margin: 20px;
    border: 1px solid #ffccc7;
}

/* 拼多多加载遮罩 */
.pdd-loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.loading-content image {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .msg-text {
        font-size: 18px;
    }

    .msg-image {
        max-width: 200px;
    }
}