/* 我的一生页面样式 */

/* 页面头部 */
.major h2 {
    color: #333;
    margin-bottom: 0.5em;
}

.major p {
    color: #666;
    font-size: 1.1em;
}

/* 发布动态区域 */
.post-form {
    background: #fff;
    border-radius: 15px;
    padding: 2em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2em;
}

.form-header h3 {
    color: #333;
    margin-bottom: 1.5em;
    text-align: center;
    font-size: 1.5em;
}

.form-group textarea {
    width: 100%;
    padding: 1em;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

/* 媒体上传区域 */
.media-upload {
    margin: 1.5em 0;
}

.upload-buttons {
    display: flex;
    gap: 1em;
    margin-bottom: 1em;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.8em 1.5em;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    color: #666;
}

.upload-btn:hover {
    border-color: #4CAF50;
    background: #e8f5e8;
    color: #4CAF50;
}

.upload-btn .icon {
    font-size: 1.2em;
}

.media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-top: 1em;
}

.preview-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.preview-item img,
.preview-item video {
    width: 150px;
    height: 150px;
    object-fit: cover;
    display: block;
}

.preview-item button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-item button:hover {
    background: rgba(255, 0, 0, 1);
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 1em;
    justify-content: flex-end;
    margin-top: 1.5em;
}

.form-actions .button {
    padding: 0.8em 2em;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-actions .button.special {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    color: white;
}

.form-actions .button.special:hover {
    background: linear-gradient(45deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* 时间线区域 */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2em;
    flex-wrap: wrap;
    gap: 1em;
}

.timeline-header h2 {
    color: #333;
    margin: 0;
}

.filter-buttons {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5em 1em;
    border: 2px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    color: #666;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: #4CAF50;
    background: #4CAF50;
    color: white;
}

/* 动态列表 */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.post-item {
    background: #fff;
    border-radius: 15px;
    padding: 1.5em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

/* 动态头部 */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1em;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0f0;
}

.user-details h4 {
    margin: 0;
    color: #333;
    font-size: 1.1em;
}

.post-time {
    color: #999;
    font-size: 0.9em;
}

.post-actions {
    display: flex;
    gap: 1em;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em 1em;
    border: 2px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    color: #666;
}

.action-btn:hover {
    border-color: #4CAF50;
    background: #e8f5e8;
    color: #4CAF50;
}

.action-btn.liked {
    border-color: #ff6b6b;
    background: #ffe8e8;
    color: #ff6b6b;
}

.action-btn .icon {
    font-size: 1.1em;
}

.action-btn .count {
    font-weight: 500;
}

/* 动态内容 */
.post-content {
    margin-bottom: 1em;
}

.post-content p {
    color: #333;
    line-height: 1.6;
    margin: 0 0 1em 0;
    font-size: 1em;
}

.post-media {
    margin-top: 1em;
}

.post-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.post-video {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 评论区域 */
.post-comments {
    border-top: 1px solid #e0e0e0;
    padding-top: 1em;
    margin-top: 1em;
}

.comment {
    display: flex;
    gap: 0.8em;
    margin-bottom: 1em;
}

.comment-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.comment-content {
    flex: 1;
    background: #f8f9fa;
    padding: 0.8em;
    border-radius: 15px;
}

.comment-author {
    font-weight: 600;
    color: #333;
    margin-right: 0.5em;
}

.comment-text {
    color: #666;
}

/* 删除评论按钮 */
.delete-comment-btn {
    background: transparent;
    border: none;
    color: #ff9eb5;
    font-size: 1.2em;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    padding: 0 8px;
    line-height: 1;
}

.comment:hover .delete-comment-btn {
    opacity: 1;
}

.delete-comment-btn:hover {
    color: #ff6b9d;
    transform: scale(1.2);
}

.comment-form {
    display: flex;
    gap: 0.5em;
    margin-top: 1em;
}

.comment-input {
    flex: 1;
    padding: 0.8em;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.3s ease;
}

.comment-input:focus {
    border-color: #4CAF50;
}

.comment-submit {
    padding: 0.8em 1.5em;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

.comment-submit:hover {
    background: #45a049;
}

/* 加载更多按钮 */
#loadMore {
    display: block;
    margin: 2em auto;
    padding: 1em 3em;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

#loadMore:hover {
    background: linear-gradient(45deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .post-form {
        padding: 1.5em;
        margin: 1em;
    }
    
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .post-item {
        margin: 0 1em;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1em;
    }
    
    .post-actions {
        width: 100%;
        justify-content: space-around;
    }
    
    .upload-buttons {
        flex-direction: column;
    }
    
    .upload-btn {
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .comment-form {
        flex-direction: column;
    }
    
    .comment-submit {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .post-form {
        padding: 1em;
        margin: 0.5em;
    }
    
    .post-item {
        margin: 0 0.5em;
        padding: 1em;
    }
    
    .preview-item img,
    .preview-item video {
        width: 120px;
        height: 120px;
    }
    
    .user-info {
        gap: 0.8em;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
    }
    
    .comment-avatar {
        width: 30px;
        height: 30px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-item {
    animation: fadeInUp 0.5s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}
