/* PC 端客服聊天页面样式 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* PC 端主容器 */
.pc-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fa;
}

/* 头部 */
.pc-header {
    height: 60px;
    background-color: #2c3e50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pc-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.pc-header .header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 主内容区 */
.pc-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧用户列表 */
.pc-sidebar {
    width: 320px;
    background-color: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.user-item, .user-list {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f5f7fa;
    border: 1px solid transparent;
}

.user-item:hover, .user-list:hover {
    background-color: #e0e6ed;
    border-color: #d0d9e1;
}

.user-item img, .user-list img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.user-status {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右侧聊天区域 */
.pc-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    margin: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 确保 MessageList 正确显示 */
.MessageList {
    margin-bottom: 16px;
}

.Message {
    margin-bottom: 16px;
}

.Message-main {
    display: flex;
    align-items: flex-start;
}

.Message.left .Message-main {
    flex-direction: row;
}

.Message.right .Message-main {
    flex-direction: row-reverse;
}

.Avatar {
    margin-right: 12px;
}

.Message-inner {
    flex: 1;
}

.Message-content {
    max-width: 65%;
}

.Bubble {
    padding: 12px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.Message.left .Bubble {
    background-color: #fff;
    border: 1px solid #f1eded;
}

.Message.right .Bubble {
    background-color: #95ec69;
    border: 1px solid #84e051;
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.chat-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f3f3f3;
}

/* 聊天气泡保持原有样式 */
.msg {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
}

.msg .img1 {
    width: 45px;
    height: 45px;
    margin-right: 12px;
    flex-shrink: 0;
}

.msg .img2 {
    display: none;
}

.msg .content {
    max-width: 65%;
    border: 1px solid #f1eded;
    border-radius: 8px;
    background-color: #fff;
    padding: 12px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.msg.on {
    flex-direction: row-reverse;
}

.msg.on .img1 {
    display: none;
}

.msg.on .img2 {
    display: block;
    width: 45px;
    height: 45px;
    margin-left: 12px;
    flex-shrink: 0;
}

.msg.on .content {
    background-color: #95ec69;
    border-color: #84e051;
}

/* 底部输入区域 */
.chat-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-container textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    resize: none;
    font-size: 14px;
    min-height: 48px;
    max-height: 120px;
    transition: all 0.3s ease;
}

.input-container textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

.input-container label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background-color: #fff;
    border: 1px solid #ced4da;
    cursor: pointer;
    transition: all 0.3s ease;
}

.input-container label:hover {
    background-color: #e3f2fd;
    border-color: #3498db;
}

.input-container input[type="file"] {
    display: none;
}

.input-container input[type="button"] {
    padding: 0 24px;
    height: 48px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.input-container input[type="button"]:hover {
    background-color: #2980b9;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.input-container input[type="button"]:active {
    transform: translateY(1px);
}

/* 图片缩略图样式 */
.image-container {
    position: relative;
    display: inline-block;
    max-width: 200px;
    max-height: 200px;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-container:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.thumbnail {
    max-width: 100%;
    max-height: 200px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.thumbnail:hover {
    transform: scale(1.02);
}

/* 大图显示样式 */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.image-container-large {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.large-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.close-button {
    position: absolute;
    top: -40px;
    right: -10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* 时间戳样式 */
.time-stamp {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #999;
    margin: 15px 0;
    padding: 2px 0;
}

.time-stamp:before, .time-stamp:after {
    content: '';
    display: inline-block;
    width: 20%;
    height: 1px;
    background-color: #e0e0e0;
    vertical-align: middle;
    margin: 0 15px;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .pc-sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .pc-container {
        display: none;
    }
}
