/* 朋友圈样式 */

/* 朋友圈入口样式 */
.moments-entry {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.moments-entry:hover {
    background: rgba(255, 255, 255, 0.1);
}

.moments-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 18px;
}

.moments-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* 朋友圈主页面 */
.moments-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    z-index: 2000;
    display: none;
    overflow-y: auto;
}

.moments-page.show {
    display: block;
}

/* 朋友圈头部 */
.moments-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.moments-header-left {
    display: flex;
    align-items: center;
}

.moments-back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    margin-right: 15px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.moments-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.moments-title {
    font-size: 18px;
    font-weight: bold;
}

.moments-camera-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.moments-camera-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* 朋友圈内容区域 */
.moments-content {
    padding: 20px 15px;
    max-width: 600px;
    margin: 0 auto;
}

/* 朋友圈帖子卡片 */
.moment-card {
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.moment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* 朋友圈图片网格 */
.moment-images {
    position: relative;
    width: 100%;
    background: #f8f8f8;
}

.moment-image-grid {
    display: grid;
    gap: 2px;
}

/* 单张图片 */
.moment-image-grid.single {
    grid-template-columns: 1fr;
}

.moment-image-grid.single .moment-image {
    aspect-ratio: 4/3;
    max-height: 400px;
}

/* 两张图片 */
.moment-image-grid.double {
    grid-template-columns: 1fr 1fr;
}

.moment-image-grid.double .moment-image {
    aspect-ratio: 1;
}

/* 三张图片 */
.moment-image-grid.triple {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.moment-image-grid.triple .moment-image:first-child {
    grid-row: 1 / 3;
    aspect-ratio: 1;
}

.moment-image-grid.triple .moment-image:not(:first-child) {
    aspect-ratio: 1;
}

/* 四张及以上图片 */
.moment-image-grid.multiple {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.moment-image-grid.multiple .moment-image {
    aspect-ratio: 1;
}

.moment-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.moment-image:hover {
    transform: scale(1.02);
}

/* 更多图片指示器 */
.more-images-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

/* 朋友圈文本内容 */
.moment-text {
    padding: 15px 20px;
}

.moment-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.moment-content-text {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.moment-location {
    color: #999;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 朋友圈用户信息和操作 */
.moment-footer {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.moment-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.moment-user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.moment-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.moment-time {
    font-size: 12px;
    color: #999;
}

.moment-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.moment-like-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
    color: #666;
}

.moment-like-btn:hover {
    background: #f0f0f0;
}

.moment-like-btn.liked {
    color: #ff4757;
}

.moment-like-count {
    font-size: 14px;
    font-weight: 500;
}

/* 发布朋友圈页面 */
.publish-moment-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2001;
    display: none;
    overflow-y: auto;
}

.publish-moment-page.show {
    display: block;
}

.publish-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.publish-back-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
}

.publish-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.publish-submit-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.publish-submit-btn:hover {
    background: #5a67d8;
}

.publish-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 发布内容区域 */
.publish-content {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.publish-images-section {
    margin-bottom: 20px;
}

.publish-images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.publish-image-item {
    position: relative;
    aspect-ratio: 1;
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
}

.publish-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.publish-image-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.publish-add-image {
    aspect-ratio: 1;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #999;
    font-size: 24px;
}

.publish-add-image:hover {
    border-color: #667eea;
    color: #667eea;
}

.publish-text-section {
    margin-bottom: 20px;
}

.publish-title-input {
    width: 100%;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
}

.publish-title-input:focus {
    border-color: #667eea;
}

.publish-content-input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
}

.publish-content-input:focus {
    border-color: #667eea;
}

/* 位置选择 */
.publish-location-section {
    margin-bottom: 20px;
}

.publish-location-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    background: #f8f8f8;
}

.publish-location-input:focus {
    border-color: #667eea;
    background: white;
}

/* 隐私设置 */
.publish-privacy-section {
    margin-bottom: 20px;
}

.privacy-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.privacy-option {
    padding: 8px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.privacy-option.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 空状态 */
.moments-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.moments-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.moments-empty-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.moments-empty-desc {
    font-size: 14px;
    opacity: 0.7;
}

/* 加载状态 */
.moments-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .moments-content {
        padding: 15px 10px;
    }
    
    .moment-card {
        margin-bottom: 15px;
    }
    
    .publish-content {
        padding: 15px;
    }
    
    .publish-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 图片预览弹窗 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-preview-modal.show {
    display: flex;
}

.image-preview-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.image-preview-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* 为图片添加长按提示样式 */
.moment-images img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    transition: opacity 0.2s ease;
}

.moment-images img:active {
    opacity: 0.7;
}
