/* 整体布局 */
.page-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content { 
    flex: 1;
    display: flex;
    height: calc(100vh - 100px); /* 减去头部高度 */
}

/* 左侧输入区域 */
.left-panel {
    width: 60%;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    padding: 15px; /* 减少内边距 */
    position: relative; /* 添加相对定位以支持绝对定位的提示消息 */
}

.input-header {
    background-color: #007bff;
    color: white;
    padding: 10px; /* 减少内边距 */ 
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.input-header h3 {
    margin: 0;
    font-size: 16px; /* 减小字体 */
}

.dialog-input-container {
    flex: 1;
    background-color: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px; 
    display: flex;
    flex-direction: column;
}  

.dialog-textarea {
    flex: 1;   
    border: none;
    outline: none; 
    padding: 15px; /* 减少内边距 */
    font-size: 14px;
    line-height: 1.6;
    resize: none; 
    font-family: 'Courier New', monospace;
}
 
.dialog-textarea:focus {
    box-shadow: none; 
}

.input-controls {
    padding: 10px; /* 减少内边距 */
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6; 
    display: flex;
    gap: 10px;
} 

.generate-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.generate-btn:hover {
    background-color: #218838;
} 
  
.ai-generate-btn {
    background-color: #6f42c1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.ai-generate-btn:hover {
    background-color: #5a32a3;
}

.ai-generate-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.clear-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.clear-btn:hover {
    background-color: #c82333;
}

.screenshot-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;   
    font-size: 14px;
}

.screenshot-btn:hover { 
    background-color: #138496;
}

.legal-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.legal-btn:hover {
    background-color: #5a6268;
}

/* 右侧展示区域 */
.right-panel {
    width: 40%;
    background-color: transparent; /* 移除背景色 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 改为顶部对齐 */
    padding: 0; /* 移除内边距 */
    overflow-y: auto; /* 如果整个面板内容过多，允许滚动 */
}

.wechat-container {
    max-width: 600px;
    width: 100%;
    background-color: transparent; /* 移除背景色，让原图效果更自然 */
    border-radius: 0; /* 移除圆角 */
    box-shadow: none; /* 移除阴影 */
    overflow: visible; /* 改为visible，允许内容溢出 */
    height: auto;  /* 改为auto，让高度根据内容自动调整 */
    min-height: 800px;  /* 设置合适的最小高度，确保手机截屏效果 */
    /* 移除flex布局，使用正常文档流 */
}

.chat-header-img {
    width: 100%; 
    height: auto;
    display: block;
    border-radius: 0; /* 移除圆角 */
    object-fit: cover; /* 保持图片比例 */
    position: relative; /* 添加相对定位 */
}

/* 时间显示样式 */
.header-time {
    position: absolute;
    top: 32px;
    left: 45px;
    color: #000; /* 黑色文字 */
    font-size: 27px;
    font-weight: bold;
    font-family: "SimHei", "黑体", sans-serif; /* 使用黑体字 */
    z-index: 10;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); /* 添加白色阴影提高可读性 */
}

/* 随机数字显示样式 */
.header-number {
    position: absolute;
    top: 92px; /* 更往下，从30px改为45px */
    left: 60px; /* 更往右，从15px改为25px */
    color: #000; /* 黑色文字 */
    font-size: 22px; /* 字体更大，从14px改为18px */ 
    font-weight: bold;
    font-family: "SimHei", "黑体", sans-serif; /* 使用黑体字 */
    z-index: 10;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); /* 添加白色阴影提高可读性 */
}
 
/* 昵称显示样式 */
.header-nickname {
    position: absolute;
    bottom: 20px; /* 在图片底部 */
    left: 50%;
    transform: translateX(-50%); /* 水平居中 */
    color: #000; /* 黑色文字 */
    font-size: 25px;
    font-family: "SimHei", "黑体", sans-serif; /* 使用黑体字 */
    z-index: 10;
}

.chat-footer-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0; /* 移除圆角 */
    object-fit: cover; /* 保持图片比例 */
}

.chat-messages {
    background-color: #f0f0f0;
    padding: 20px 20px 20px 20px; /* 减少底部内边距 */
    min-height: 600px; /* 增加最小高度，确保即使只有1-2条消息也有合适的手机截屏效果 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 消息从顶部开始排列 */
    /* 移除flex相关样式 */
}

/* 空消息区域样式 */
.chat-messages:empty::before {
    content: '';
    display: block;
    height: 600px; /* 空状态时保持最小高度 */
}

/* 移除自定义滚动条样式 */

/* 头像样式调整 */
.avatar-img {
    width: 48px;
    height: 48px;
    margin: 0;
    object-fit: cover;
    flex-shrink: 0; /* 防止头像被压缩 */
    margin-top: 0; /* 移除顶部边距，与消息气泡对齐 */
} 

 
/* 消息布局调整 */
.message {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start; /* 顶部对齐 */
    gap: 8px;
    font-size: 1.4vw;
    width: 100%; /* 确保消息占满宽度 */
}

.message:last-child {
    margin-bottom: 20px; /* 最后一条消息增加底部间距 */
}

.message.user {
    justify-content: flex-end;
}  

.message.other {
    justify-content: flex-start;
} 

/* 消息气泡调整 */  
.message-content {
    max-width: calc(85% - 30px); /* 从90%改为70%，让用户消息更短 */
    padding: 8px 12px;
    border-radius: 6px;
    word-wrap: break-word; 
	position: relative;
    margin-top: 0; /* 移除顶部边距，与头像对齐 */
    line-height: 1.4; /* 调整行高使文字垂直居中 */
    min-height: 48px; /* 设置最小高度与头像一致 */
    display: flex; 
    align-items: center; /* 文字垂直居中 */
    line-height: 1.5; /* 增加行间距 */
    white-space: normal;  /* 改为normal让浏览器自动处理空白 */
    line-height: 1.4;     /* 调整合适的行高 */
}

/* 用户消息气泡样式 */
.message.user .message-content {
    background-color: #95ec69;
    color: #000;
    margin-left: 8px; /* 为三角形留出空间 */
}

/* 对方消息气泡样式 */
.message.other .message-content {
    background-color: white;
    color: #000;
    border: none; /* 移除边框，更符合微信效果 */
    margin-right: 8px; /* 为三角形留出空间 */
}

/* 用户消息气泡三角形（右侧） */
.message.user .message-content::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 10px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-left-color: #95ec69;
    border-right: 0;
}

/* 对方消息气泡三角形（左侧） */
.message.other .message-content::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 10px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-right-color: white; /* 与气泡背景色相同 */
    border-left: 0;
}

/* 对方消息气泡三角形边框（解决边框问题） */
.message.other .message-content::after {
    content: '';
    position: absolute;
    left: -7px;
    top: 10px;
	z-index: 1; /* 确保白色三角形在边框上层 */
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-right-color: white; /* 与气泡边框色相同 */
    border-left: 0;
}

/* 图片消息样式 */
.message-content img.dialog-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 2px; /* 细微的圆角，更符合微信效果 */
    display: block;
    margin: 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
    border: none; /* 移除边框 */
    box-shadow: none; /* 移除阴影 */
}

.message-content img.dialog-image:hover {
    opacity: 0.8;
}

/* 图片消息气泡特殊样式 */
.message-content.has-image {
    padding: 4px;
    min-height: auto;
    align-items: flex-start;
}

.message-content.has-image::after,
.message-content.has-image::before {
    top: 8px;
}

.message.other .message-content.has-image::after,
.message.other .message-content.has-image::before {
    top: 8px;
}

.message-time {
    font-size: 12px;
    color: #666; 
    margin: 15px 0 10px 0;
    text-align: center;
    padding: 8px 15px;
    border-radius: 15px;
    display: inline-block;
    margin-left: 50%;
    transform: translateX(-50%);
    font-weight: 500;
    width: auto; 
    position: relative;
}

 
.message-time span {
    background-color: #f0f0f0;
    padding: 0 10px;
    position: relative;
    z-index: 2;
}

/* 昵称输入框样式 */
.nickname-input-container {
    margin-bottom: 15px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
}

.nickname-input-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.nickname-input {
    width: 150px; /* 进一步缩短宽度 */
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.nickname-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 生成对话时间勾选项样式 */
.generate-time-option {
    display: inline-block;
    margin-left: 15px;
    vertical-align: middle;
}

.generate-time-option label {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    margin: 0;
}

.generate-time-option input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        width: 100%;
    }
    
    .left-panel {
        height: 50%;
    }
    
    .right-panel {
        height: 50%;
    }
}

/* 头像选择区域样式 */
.avatar-selection {
    margin-bottom: 15px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

.avatar-selection h5 {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.avatar-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.avatar-option {
    display: inline-block;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.avatar-option:hover {
    border-color: #007bff;
}

.avatar-option input[type="radio"] {
    display: none;
}

.avatar-option input[type="radio"]:checked + img {
    border: 2px solid #007bff;
    border-radius: 4px;
}

.avatar-option img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    transition: border-color 0.2s;
}

/* 文件上传样式 */
.avatar-upload {
    display: inline-block;
    cursor: pointer;
    border: 2px dashed #ccc;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    transition: border-color 0.2s;
    position: relative;
}

.avatar-upload:hover {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.avatar-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.avatar-upload-icon {
    font-size: 16px;
    color: #666;
}

.avatar-upload:hover .avatar-upload-icon {
    color: #007bff;
}

/* 上传后的头像样式 */
.avatar-option.uploaded {
    position: relative;
}

.avatar-option.uploaded .remove-avatar {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.avatar-option.uploaded:hover .remove-avatar {
    opacity: 1;
}

/* 自定义输入框样式 */
.custom-input-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.custom-input-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 300px;
}

.custom-input-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.custom-input-field {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.custom-input-field:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.custom-input-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.custom-input-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.custom-input-btn.cancel {
    background-color: #6c757d;
    color: white;
}

.custom-input-btn.cancel:hover {
    background-color: #5a6268;
}

.custom-input-btn.confirm {
    background-color: #007bff;
    color: white;
}

.custom-input-btn.confirm:hover {
    background-color: #0056b3;
}

/* 左侧提示样式 */
.left-panel-message {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    padding: 8px 12px;
    z-index: 1000; /* 确保在其他内容之上 */
    display: none; /* 默认隐藏 */
    border-radius: 4px;
    margin: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.left-panel-message-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.left-panel-message-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.left-panel-message-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.left-panel-message-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.left-panel-message-content {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.left-panel-message-content .message-text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.left-panel-message-content i {
    font-size: 14px;
    flex-shrink: 0;
}

.left-panel-message-content span {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}

.left-panel-message-close {
    cursor: pointer;
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.left-panel-message-close:hover {
    opacity: 1;
}

/* 图片预览模态框样式 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-container {
    background-color: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.image-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
}

.image-preview-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.image-preview-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.image-preview-close:hover {
    background-color: #e9ecef;
    color: #333;
}

.image-preview-content {
    padding: 20px;
    text-align: center;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
 
.insert-image-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
    margin-left: 5px;
}

.insert-image-btn:hover {
    background-color: #218838;
}

/* 插入图片模态框样式 */
.custom-input-modal#insertImageModal {
    display: none;
}

.custom-input-container#insertImageModal {
    max-width: 600px;
}

.custom-input-title#insertImageModal {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

/* 顶部信息flex布局 */
@media (max-width: 768px) {
    .chat-header-img {
        width: 100%;
        height: auto;
    }
    .header-time,
    .header-number,
    .header-nickname {
        position: static !important; /* 取消绝对定位，改为流式 */
        display: inline-block;
        font-size: 12px; 
        margin: 0 4px;
        vertical-align: middle;
    }
    .wechat-container > div[style*="position: relative"] {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 8px;
        position: relative;
    }
    .header-nickname {
        flex: 1;
        text-align: center;
        font-weight: bold;
        font-size: 14px;
    }
    .header-time, .header-number {
        min-width: 40px;
        text-align: center;
    }
} 

/* 语音消息样式 */
.message-content.has-voice {
    background-color: #95ec69;
    border-radius: 18px;
    padding: 8px 12px;
    min-width: 80px;
    max-width: 200px;
    position: relative;
}

.message.other .message-content.has-voice {
    background-color: white;
}

.voice-message {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.voice-icon {
    color: #333;
    font-size: 16px;
    animation: voice-pulse 1.5s ease-in-out infinite;
}

.voice-duration {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    min-width: 30px;
}

.voice-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
}

.voice-bar {
    width: 2px;
    background-color: #333;
    border-radius: 1px;
    animation: voice-wave 1.5s ease-in-out infinite;
}

.voice-bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.voice-bar:nth-child(2) { height: 12px; animation-delay: 0.1s; }
.voice-bar:nth-child(3) { height: 16px; animation-delay: 0.2s; }
.voice-bar:nth-child(4) { height: 12px; animation-delay: 0.3s; }
.voice-bar:nth-child(5) { height: 8px; animation-delay: 0.4s; }

@keyframes voice-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes voice-wave {
    0%, 100% { 
        transform: scaleY(1);
        opacity: 0.6;
    }
    50% { 
        transform: scaleY(1.5);
        opacity: 1;
    }
}

/* 语音消息气泡样式 */
.message.user .message-content.has-voice::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid #95ec69;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.message.other .message-content.has-voice::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-right: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

/* 语音消息悬停效果 */
.voice-message:hover {
    opacity: 0.8;
}

.voice-message:hover .voice-icon {
    animation-duration: 0.8s;
}

.voice-message:hover .voice-bar {
    animation-duration: 0.8s;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .voice-message {
        gap: 6px;
    }
    
    .voice-duration {
        font-size: 13px;
    }
    
    .voice-icon {
        font-size: 14px;
    }
    
    .voice-bar {
        width: 1.5px;
    }
    
    .voice-bar:nth-child(1) { height: 6px; }
    .voice-bar:nth-child(2) { height: 10px; }
    .voice-bar:nth-child(3) { height: 14px; }
    .voice-bar:nth-child(4) { height: 10px; }
    .voice-bar:nth-child(5) { height: 6px; }
} / *   ��mo`7h_  * / 
 
 . m e s s a g e - c o n t e n t . h a s - v o i c e   {  
 