/**
 * 合并消息样式（类似微信/QQ聊天记录）
 * 用于抖音图集等多图片展示
 */

/* 合并消息容器 */
.merged-message {
    max-width: 100%;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin: 8px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.merged-message:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* 合并消息头部 */
.merged-header {
    display: flex;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border-bottom: 1px solid #e0e0e0;
}

.merged-icon {
    font-size: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

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

.merged-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.merged-desc {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 预览缩略图区域 */
.merged-preview {
    display: flex;
    gap: 4px;
    padding: 12px;
    background: #fafafa;
    justify-content: center;
}

.merged-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.merged-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 底部信息栏 */
.merged-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.merged-count {
    font-size: 13px;
    color: #888;
}

.merged-view-btn {
    padding: 6px 16px;
    background: linear-gradient(135deg, #07c160 0%, #05a850 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.merged-view-btn:hover {
    background: linear-gradient(135deg, #06ad56 0%, #049645 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(7, 193, 96, 0.3);
}

.merged-view-btn:active {
    transform: translateY(0);
}

/* 展开的图集区域 */
.merged-gallery {
    background: #f8f9fa;
    border-top: 2px solid #e0e0e0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

/* 图集头部 */
.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.gallery-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.gallery-close-btn {
    padding: 4px 12px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* 图片网格布局 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
    max-height: 600px;
    overflow-y: auto;
}

.gallery-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* 滚动条美化 */
.gallery-grid::-webkit-scrollbar {
    width: 6px;
}

.gallery-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* 暗色主题适配 */
[data-theme="dark"] .merged-message {
    background: #2a2a2a;
    border-color: #404040;
}

[data-theme="dark"] .merged-header {
    background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
    border-bottom-color: #404040;
}

[data-theme="dark"] .merged-title {
    color: #e0e0e0;
}

[data-theme="dark"] .merged-desc {
    color: #999;
}

[data-theme="dark"] .merged-preview {
    background: #1a1a1a;
}

[data-theme="dark"] .merged-thumb {
    border-color: #404040;
}

[data-theme="dark"] .merged-footer {
    background: #2a2a2a;
    border-top-color: #404040;
}

[data-theme="dark"] .merged-count {
    color: #999;
}

[data-theme="dark"] .merged-gallery {
    background: #1a1a1a;
    border-top-color: #404040;
}

[data-theme="dark"] .gallery-header {
    background: #2a2a2a;
    border-bottom-color: #404040;
}

[data-theme="dark"] .gallery-title {
    color: #e0e0e0;
}

[data-theme="dark"] .gallery-close-btn {
    background: #404040;
    color: #999;
}

[data-theme="dark"] .gallery-close-btn:hover {
    background: #4a4a4a;
    color: #e0e0e0;
}

[data-theme="dark"] .gallery-image {
    border-color: #404040;
}

[data-theme="dark"] .gallery-grid::-webkit-scrollbar-track {
    background: #2a2a2a;
}

[data-theme="dark"] .gallery-grid::-webkit-scrollbar-thumb {
    background: #505050;
}

[data-theme="dark"] .gallery-grid::-webkit-scrollbar-thumb:hover {
    background: #606060;
}

/* 移动端优化 */
@media (max-width: 600px) {
    .merged-header {
        padding: 10px;
    }
    
    .merged-icon {
        font-size: 20px;
        margin-right: 10px;
    }
    
    .merged-title {
        font-size: 13px;
    }
    
    .merged-desc {
        font-size: 11px;
    }
    
    .merged-preview {
        padding: 10px;
        gap: 3px;
    }
    
    .merged-thumb {
        width: 50px;
        height: 50px;
    }
    
    .merged-footer {
        padding: 8px 10px;
    }
    
    .merged-count {
        font-size: 12px;
    }
    
    .merged-view-btn {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 10px;
        max-height: 400px;
    }
    
    .gallery-header {
        padding: 10px;
    }
    
    .gallery-title {
        font-size: 13px;
    }
}

/* 超小屏幕 */
@media (max-width: 400px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
