/* PC端样式 */

/* 主容器 */
.im-container {
    display: flex;
    height: 100vh;
    background-color: var(--white);
    overflow: hidden;
}

/* 左侧面板 */
.left-panel {
    width: 300px;
    height: 100%;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background-color: var(--white);
}

/* 顶部搜索栏 */
.top-bar {
    padding: 10px 16px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
    margin-right: 12px;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--gray);
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    font-size: 14px;
    background-color: var(--bg-color);
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--primary-color);
    background-color: var(--white);
}

.top-actions {
    display: flex;
    align-items: center;
}

.top-actions i {
    margin-left: 16px;
    font-size: 20px;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.nav-item {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-dark);
    position: relative;
    transition: all 0.3s ease;
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

/* 聊天列表 */
.chat-list {
    flex: 1;
    overflow-y: auto;
    background-color: var(--white);
}

/* 中间聊天面板 */
.middle-panel {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--chat-bg);
    min-width: 0;
}

/* 聊天头部 */
.chat-header {
    padding: 10px 16px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left .avatar {
    margin-right: 12px;
}

.header-info {
    display: flex;
    flex-direction: column;
}

.header-info .nickname {
    font-size: 16px;
    font-weight: 500;
    color: var(--dark-color);
}

.header-info .status {
    font-size: 12px;
    color: var(--primary-color);
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-right i {
    margin-left: 20px;
    font-size: 20px;
}

/* 聊天内容区域 */
.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--chat-bg);
    background-image: url('/static/images/chat-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* 消息项 */
.message-item {
    display: flex;
    margin-bottom: 15px;
    animation: messageSlide 0.3s ease-out;
}

.message-item.me {
    justify-content: flex-end;
}

.message-item.other {
    justify-content: flex-start;
}

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

/* 消息发送者信息 */
.message-sender {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
    margin-left: 55px;
}

.message-item.me .message-sender {
    margin-left: 0;
    margin-right: 55px;
    text-align: right;
}

/* 消息内容 */
.message-content {
    display: flex;
    align-items: flex-end;
}

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

.message-item .avatar {
    margin: 0 10px;
}

/* 消息气泡 */
.message-bubble {
    max-width: 60%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-item.me .message-bubble {
    background-color: var(--message-me);
    border-bottom-right-radius: 4px;
}

.message-item.other .message-bubble {
    background-color: var(--message-other);
    border-bottom-left-radius: 4px;
}

/* 消息时间 */
.message-time {
    font-size: 11px;
    color: var(--gray);
    margin: 0 10px;
    align-self: flex-end;
    margin-bottom: 5px;
}

/* 聊天输入区域 */
.chat-input-area {
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 输入工具栏 */
.input-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px 0;
}

.input-toolbar i {
    font-size: 24px;
    color: var(--gray-dark);
    cursor: pointer;
    transition: color 0.3s ease;
}

.input-toolbar i:hover {
    color: var(--primary-color);
}

/* 输入框 */
.input-box {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    background-color: var(--bg-color);
    border-radius: 20px;
    padding: 8px 15px;
    overflow: hidden;
}

.input-box textarea {
    width: 100%;
    height: 100%;
    background-color: transparent;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
}

/* 发送区域 */
.send-area {
    display: flex;
    justify-content: flex-end;
    padding: 5px 0;
}

.send-btn {
    padding: 8px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.send-btn:hover {
    background-color: var(--primary-hover);
}

.send-btn:disabled {
    background-color: var(--gray-light);
    cursor: not-allowed;
}

/* 右侧信息面板 */
.right-panel {
    width: 300px;
    height: 100%;
    background-color: var(--white);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 100;
}

.right-panel.show {
    transform: translateX(0);
}

/* 信息面板头部 */
.info-header {
    padding: 10px 16px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.info-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--dark-color);
    margin: 0;
}

.info-header i {
    font-size: 20px;
    cursor: pointer;
}

/* 信息内容 */
.info-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 群成员列表 */
.group-members {
    margin-top: 20px;
}

.group-members h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 12px;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 4px;
    padding: 8px 12px;
}

.member-item:hover {
    background-color: var(--bg-color);
}

.member-item .avatar {
    margin-right: 12px;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 14px;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-role {
    font-size: 12px;
    color: var(--primary-color);
    margin-top: 2px;
}

/* 群设置项 */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item:hover {
    background-color: var(--bg-color);
}

.setting-label {
    font-size: 14px;
    color: var(--dark-color);
}

.setting-value {
    font-size: 14px;
    color: var(--gray);
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .right-panel {
        width: 280px;
    }
}

@media (max-width: 1024px) {
    .left-panel {
        width: 260px;
    }
    
    .right-panel {
        width: 260px;
    }
}

@media (max-width: 768px) {
    /* 在小屏幕上隐藏右侧面板 */
    .right-panel {
        position: fixed;
        right: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    /* 在小屏幕上可以折叠左侧面板 */
    .left-panel.collapsed {
        width: 0;
        overflow: hidden;
    }
    
    /* 聊天内容区域占满屏幕 */
    .left-panel.collapsed + .middle-panel {
        flex: 1 1 100%;
    }
}
