/* 朋友圈样式 */
.moments-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* 页头区域 */
.moments-header {
    position: relative;
    height: 280px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 40px 20px;
    margin-bottom: 20px;
}

.moments-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    min-height: 280px; /* 确保在小屏幕上也有足够的显示高度 */
}

.moments-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.5));
    z-index: 1;
}

.moments-header-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.moments-header h1 {
    margin: 0 0 10px 0;
    font-size: 36px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.moments-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 发表按钮 */
.publish-button {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    border: none;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.publish-button:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

/* 瀑布流布局 - 优化为PC端每行仅显示一条内容 */
.moments-masonry {
    column-count: 1;
    column-gap: 20px;
}

/* 优化内容区域布局 */
@media (min-width: 768px) {
    /* 保持单列布局，确保每行只显示一条内容 */
    .moments-masonry {
        column-count: 1;
        max-width: 800px;
        margin: 0 auto;
    }
    
    /* 为内容区域添加居中容器 */
    .moments-container > div[style*="padding"] {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* 朋友圈卡片 */
.moment-card {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.moment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 卡片头部 */
.moment-header {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
}

/* 操作按钮容器 - 固定在右上角 */
.moment-actions {
    position: absolute;
    top: 0px; /* 往下位移10px */
    right: 70px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

/* 互动栏样式 - 点赞和评论按钮 */
.interaction-actions {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    justify-content: center;
    align-items: center;
}

/* 置顶标签样式优化 */
.sticky-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    background: linear-gradient(135deg, #ff9966 0%, #ff5e62 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.3);
    z-index: 12;
    letter-spacing: 0.5px;
}

/* 美化按钮样式 */
.edit-btn,
.delete-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.edit-btn:hover,
.delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.delete-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

/* 置顶标签样式（统一与优化） */
.sticky-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    background: linear-gradient(135deg, #ff9966 0%, #ff5e62 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.3);
    z-index: 12;
    letter-spacing: 0.5px;
}

/* 置顶标签样式（右上角醒目显示） */
.sticky-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.3);
    z-index: 12;
    letter-spacing: 0.5px;
}

/* 确保置顶标签和操作按钮不重叠 */
.moment-card {
    position: relative;
   /* padding-top: 30px; /* 为置顶标签和操作按钮留出空间 */
}

/* 有置顶徽标的卡片：为顶部覆盖元素预留空间，避免重叠 */
.moment-card.has-sticky {
    /* 为顶部覆盖元素（置顶徽标、操作按钮）预留空间，避免重叠 */
    padding-top: 0px;
}

/* 当存在置顶徽标时，将操作按钮下移，避免与徽标重叠 */
.moment-card.has-sticky .moment-actions {
    top: 0px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.post-time {
    font-size: 12px;
    color: #999;
    margin: 0;
}

/* 卡片内容 */
.moment-content {
    padding: 15px;
    word-wrap: break-word;
    line-height: 1.6;
    position: relative;
}

/* 置顶标识样式 */
.top-badge {
    display: inline-block;
    background-color: #dc3545;
    color: white;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 10px;
    margin-right: 5px;
    margin-bottom: 5px;
    font-weight: 500;
}

/* 图片网格 */
.image-grid {
    display: grid;
    gap: 2px;
    margin-bottom: 10px;
}

.image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.image-grid img:hover {
    transform: scale(1.02);
}

/* 图片布局 */
.image-grid-1 { grid-template-columns: 1fr; }
.image-grid-2 { grid-template-columns: 1fr 1fr; }
.image-grid-3 { 
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "a a"
        "b c";
}
.image-grid-3 img:nth-child(1) { grid-area: a; }
.image-grid-3 img:nth-child(2) { grid-area: b; }
.image-grid-3 img:nth-child(3) { grid-area: c; }
.image-grid-4 { grid-template-columns: 1fr 1fr; }
.image-grid-5,
.image-grid-6 { grid-template-columns: 1fr 1fr 1fr; }
.image-grid-7,
.image-grid-8,
.image-grid-9 { grid-template-columns: 1fr 1fr 1fr; }

/* 位置信息 */
.location-info {
    font-size: 13px;
    color: #666;
    margin: 10px 0;
    display: flex;
    align-items: center;
    padding-left: 15px; /* 将定位图标和内容整体向右移动10px */
}

.location-info i {
    margin-right: 5px;
    color: #007bff;
}

/* 互动栏 */
.moment-actions {
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
}

.action-btn {
    background: none;
    border: none;
    color: #666;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.action-btn:hover {
    color: #007bff;
}

.action-btn i {
    margin-right: 5px;
}

.action-btn.liked {
    color: #ff4757;
}

/* 点赞用户列表 */
.likes-list {
    padding: 0 15px 10px;
    font-size: 13px;
    color: #666;
}

.likes-list a {
    color: #007bff;
    text-decoration: none;
}

.likes-list a:hover {
    text-decoration: underline;
}

/* 评论区 */
.comments-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-top: 1px solid #f0f0f0;
}

.comment-item {
    margin-bottom: 10px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    font-size: 14px;
}

.comment-user {
    font-weight: 600;
    color: #333;
    margin-right: 5px;
}

.comment-content {
    color: #555;
}

.comment-time {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.reply-btn {
    font-size: 12px;
    color: #007bff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

/* 评论输入框 */
.comment-input-container {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    transition: border-color 0.2s ease;
}

.comment-input:focus {
    border-color: #007bff;
}

.comment-submit {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.comment-submit:hover {
    background-color: #0056b3;
}

/* 发表弹窗 */
.publish-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 15px;
}

/* 文本输入区域 */
.content-textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
}

.content-textarea:focus {
    border-color: #007bff;
}

/* 图片上传区域 */
.image-upload-area {
    margin: 15px 0;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.upload-item {
    position: relative;
    aspect-ratio: 1;
    background-color: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

/* 拖拽排序视觉反馈 */
.upload-item.dragging {
    opacity: 0.85;
}
.upload-item.drag-over {
    outline: 2px dashed #007bff;
    outline-offset: -4px;
}

.upload-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 2px dashed #ddd;
    border-radius: 6px;
    color: #999;
    font-size: 24px;
    transition: all 0.2s ease;
}

.upload-placeholder:hover {
    border-color: #007bff;
    color: #007bff;
}

.upload-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

/* 隐私设置 */
.privacy-settings {
    margin: 15px 0;
}

.privacy-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}

/* 位置选择 */
.location-select {
    margin: 15px 0;
}

.location-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}

/* 提交按钮 */
.modal-footer {
    padding: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

.publish-submit {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.publish-submit:hover {
    background-color: #0056b3;
}

.publish-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 表情选择器 */
.emoji-picker {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 15px;
    display: none;
    z-index: 2500; /* 置于发表/编辑弹窗(2000)之上，低于图片查看器(3000) */
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.emoji-item {
    font-size: 20px;
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.emoji-item:hover {
    background-color: #f0f0f0;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
}

.load-more-btn {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background-color: #e9ecef;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

/* 未登录提示 */
.login-prompt {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 30px;
}

.login-prompt h3 {
    margin-bottom: 20px;
}

.login-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.login-btn:hover {
    background-color: #0056b3;
    color: white;
}

/* 图片查看器 */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
}

.image-viewer-container {
    position: relative;
    max-width: 100%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewer-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.viewer-close:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.viewer-prev,
.viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.viewer-prev {
    left: 20px;
}

.viewer-next {
    right: 20px;
}

.viewer-prev:hover,
.viewer-next:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.viewer-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

/* 表情按钮 */
.emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.2s ease;
}

.emoji-btn:hover {
    color: #007bff;
}