* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
}

.editor-panel {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.preview-panel {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    text-align: center;
    margin-bottom: 40px;
    color: #07C160;
    font-size: 28px;
}

h2 {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-size: 22px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 16px;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 16px;
}

textarea {
    height: 120px;
    resize: vertical;
}

.file-input {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px dashed #ddd;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.file-input:hover {
    border-color: #07C160;
    background: #f0fff7;
}

.image-preview {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

button {
    background: #07C160;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

button:hover {
    background: #06ae56;
}

.clear-all-btn {
    background: #ff6b6b;
    margin-top: 15px;
}

.clear-all-btn:hover {
    background: #ff5252;
}

.clear-images-btn {
    background: #ff4757;
    margin-top: 10px;
}

.clear-images-btn:hover {
    background: #ff3742;
}

/* 评论编辑器样式 */
.comments-editor {
    margin-top: 10px;
}

.comment-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.comment-nickname-input {
    flex: 1;
    min-width: 120px;
}

.comment-content-input {
    flex: 2;
}

.add-comment-btn {
    background: #07C160;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    width: auto;
}

.add-comment-btn:hover {
    background: #06ae56;
}

.comments-preview {
    background: #f9f9f9;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
}

.comments-preview:empty::before {
    content: "暂无评论";
    color: #999;
    font-style: italic;
}

.preview-comment-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    padding: 5px;
    background: white;
    border-radius: 3px;
    border: 1px solid #eee;
}

.preview-comment-nickname {
    color: #576b95;
    font-weight: bold;
    font-size: 14px;
    min-width: 60px;
}

.preview-comment-content {
    color: #333;
    font-size: 14px;
    flex: 1;
}

.preview-comment-remove {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 3px;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-comments-btn {
    background: #ff4757;
    margin-top: 10px;
}

.clear-comments-btn:hover {
    background: #ff3742;
}

/* 点赞编辑器样式 */
.likes-editor {
    margin-top: 10px;
}

.like-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.like-nickname-input {
    flex: 1;
}

.add-like-btn {
    background: #07C160;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    width: auto;
}

.add-like-btn:hover {
    background: #06ae56;
}

.likes-preview {
    background: #f9f9f9;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
}

.likes-preview:empty::before {
    content: "暂无点赞";
    color: #999;
    font-style: italic;
}

.preview-like-item {
    display: inline-block;
    margin: 2px 5px 2px 0;
    padding: 3px 8px;
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    font-size: 14px;
    position: relative;
}

.preview-like-nickname {
    color: #576b95;
    font-weight: bold;
    margin-right: 5px;
}

.preview-like-remove {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

.clear-likes-btn {
    background: #ff4757;
    margin-top: 10px;
}

.clear-likes-btn:hover {
    background: #ff3742;
}

/* 时间设置样式 */
.time-setting {
    display: flex;
    gap: 10px;
    align-items: center;
}

.time-value-input {
    width: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 16px;
}

.time-unit-select {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

/* 朋友圈预览样式 */
.wechat-moment {
    width: 420px;
    background: white;
    box-shadow: 0 0 15px rgba(0,0,0,0.15);
    border-radius: 10px;
    overflow: hidden;
    position: relative; /* 为绝对定位的子元素提供参考 */
}

/* 头部按钮样式 */
.header-btn {
    position: absolute;
    top: 20px;
    width: 40px;
    height: 40px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    z-index: 30;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.back-btn {
    left: 20px;
}

.camera-btn {
    right: 20px;
}

.camera-btn img {
    width: 24px;
    height: 24px;
    filter: drop-shadow(1px 1px 3px rgba(0,0,0,0.8));
}

/* 用户信息区域 */
.user-header {
    position: relative;
    height: 200px;
    background: linear-gradient(45deg, #7bb0ff, #5ce1e6);
    overflow: hidden;
}

/* 修复背景图显示问题 - 使用CSS背景而非img元素 */
.cover-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 用户信息容器 - 作为一个整体，透明背景，覆盖在背景图和信息流之上 */
.user-info-container {
    position: absolute;
    top: 135px;
    /*bottom: -30px;  部分延伸到信息流区域 */
    right: 20px;    
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 20; /* 确保在最上层 */
}

/* 昵称和头像的水平排列 - 透明背景 */
.user-main-info {
    display: flex;
    align-items: center;
    gap: 12px;
    /* 移除背景色，使其透明 */
}

/* 昵称容器 - 透明背景 */
.nickname-container {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.user-nickname {
    color: white; /* 使用白色文字，在深色背景上更明显 */
    font-weight: bold;
    font-size: 24px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4); /* 添加阴影增强可读性 */
}

/* 头像样式 */
.user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24); /* 保留轻微阴影增强立体感 */
}

/* 个性签名样式 - 透明背景 */
.user-signature {
    color: rgba(0, 0, 0, 0.723);
    font-size: 16px;
    /* 移除背景色，使其透明 */
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
}

.moment-content {
    padding: 25px 18px;
    padding-top: 20px; /* 减少顶部内边距，因为移除了状态栏和导航栏 */
    position: relative;
    z-index: 10; /* 确保在用户信息下方 */
}

.moment-item {
    display: flex;
    gap: 15px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 6px;
}

.content-main {
    flex: 1;
}

.author-name {
    color: #576b95;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* 朋友圈内容文字调小 */
.moment-text {
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 15px;
    word-break: break-word;
    color: #333;
    white-space: pre-wrap;
}

/* 文字收起功能 */
.moment-text.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.collapse-btn {
    color: #576b95;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 15px;
    margin-top: 5px;
    display: block;
}

.collapse-btn:hover {
    text-decoration: underline;
}

.moment-images {
    margin-bottom: 15px;
}

/* 朋友圈互动区域样式 */
.moment-interactions {
    margin-bottom: 15px;
    background: #f7f7f7;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.4;
}

.moment-interactions:empty {
    display: none;
}

/* 朋友圈点赞样式 */
.moment-likes {
    padding: 8px 12px 0 12px;
}

.moment-likes:empty {
    display: none;
}

.likes-icon {
    width: 15px;
    height: 14px;
    margin-right: 3px;
    vertical-align: middle;
    display: inline-block;
}

.like-nickname {
    color: #576b95;
    font-weight: bold;
    font-size: 14px;
}

.like-separator {
    color: #999;
}

/* 分隔线样式 */
.interaction-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 8px 0;
}

.interaction-divider:empty {
    display: none;
}

/* 朋友圈评论样式 */
.moment-comments {
    padding: 0 12px 8px 12px;
}

.moment-comments:empty {
    display: none;
}

.moment-comment {
    margin-bottom: 6px;
}

.moment-comment:last-child {
    margin-bottom: 0;
}

.comment-nickname {
    color: #576b95;
    font-weight: bold;
}

.comment-content {
    color: #333;
}

/* 图片网格布局 */
.images-grid {
    display: grid;
    gap: 5px;
}

/* 单张图片 - 按原比例显示 */
.image-single {
    max-width: 100%;
    max-height: 300px;
    border-radius: 5px;
    object-fit: contain; /* 保持原比例，不裁剪 */
}

/* 多张图片 - 使用背景图方式确保截图时正确显示 */
.grid-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1; /* 强制1:1比例 */
    border-radius: 5px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 2张图片布局 */
.grid-2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 240px;
}

/* 3张图片布局 */
.grid-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 360px;
}

/* 4张图片布局 - 2x2 */
.grid-4 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 240px;
}

/* 5-9张图片布局 - 3列 */
.grid-5-9 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 360px;
}

.moment-meta {
    font-size: 13px;
    color: #999;
    display: flex;
    gap: 18px;
}

.location {
    color: #576b95;
}

.location:empty {
    display: none;
}

.instructions {
    margin-top: 25px;
    padding: 18px;
    background: #f9f9f9;
    border-radius: 5px;
    font-size: 15px;
    color: #666;
}

.instructions h3 {
    margin-bottom: 12px;
    color: #333;
    font-size: 18px;
}

.instructions ul {
    padding-left: 25px;
}

.instructions li {
    margin-bottom: 8px;
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }
    
    .preview-panel {
        order: -1;
    }
}