/* css/moments.css */
.moments-page .page-header {
    position: relative; /* 为发布按钮定位 */
}

/* !! 新增 !! 发布按钮样式 */
#publish-moment-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px; /* 调整图标大小 */
}

.moments-container {
    flex-grow: 1;
    overflow-y: auto;
    background-color: var(--screen-bg);
    padding: 0 15px;
}

.moment-post {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--soft-border);
}
.moment-post:last-child {
    border-bottom: none;
}

.moment-post .avatar {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    flex-shrink: 0;
    margin-right: 12px;
    overflow: hidden;
    background-color: var(--page-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: var(--secondary-text);
}
.moment-post .avatar img {
    width: 100%; height: 100%; object-fit: cover;
}

.moment-post .post-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-main .author-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--highlight-color);
}

.post-main .post-content {
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.post-attachment {
    margin-top: 8px;
}

/* 附件通用样式 */
.attachment-placeholder, .attachment-card {
    border-radius: 8px;
    overflow: hidden;
}

/* 图片/视频占位符 */
.attachment-placeholder {
    width: 120px;
    height: 120px;
    background-color: var(--page-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: var(--secondary-text);
    border: 1px dashed var(--soft-border);
}
.attachment-placeholder i {
    font-size: 32px;
}
.attachment-placeholder.video {
    width: 150px; /* 视频占位符更宽 */
    height: 100px;
}

/* 音乐/链接/位置卡片 */
.attachment-card {
    display: flex;
    align-items: center;
    background-color: var(--page-bg);
    padding: 10px;
    max-width: 80%;
}
.attachment-card-icon {
    font-size: 24px;
    margin-right: 12px;
    color: var(--secondary-text);
}
.attachment-card-details {
    overflow: hidden;
}
.attachment-card-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attachment-card-subtitle {
    font-size: 13px;
    color: var(--secondary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 发布的真实图片 */
.post-images {
    display: grid;
    gap: 5px;
    margin-top: 8px;
}
.post-images.image-count-1 {
    max-width: 65%;
    display: block;
}
.post-images.image-count-1 .image-item {
    width: 100%;
    padding-top: 75%;
}
.image-item {
    width: 100%;
    padding-top: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background-color: var(--page-bg);
}
.image-item img {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; object-fit: cover;
}

.post-main .post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--secondary-text);
    margin-top: 5px;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}
.action-button {
    background-color: var(--page-bg);
    border: 1px solid var(--soft-border);
    border-radius: 15px;
    padding: 4px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--primary-text);
}
.action-button .fa-heart.active { color: #e5245e; }

.post-interactions {
    margin-top: 10px;
    background-color: var(--page-bg);
    border-radius: 4px;
    font-size: 14px;
    overflow: hidden;
}
.likes-section, .comments-section { padding: 8px 12px; }
.likes-section {
    display: flex; align-items: center; gap: 8px;
    color: var(--highlight-color);
    border-bottom: 1px solid var(--soft-border);
}
.likes-section.no-comments { border-bottom: none; }

.comment-item { margin-bottom: 4px; line-height: 1.5; }
.comment-item:last-child { margin-bottom: 0; }
.commenter-name { font-weight: 600; color: var(--highlight-color); margin-right: 5px; }

.comment-input-area {
    display: none;
    padding: 10px 0 0 0;
    margin-top: 10px;
}
.comment-input-area.visible { display: flex; gap: 8px; }
.comment-input-area input {
    flex-grow: 1; border: 1px solid var(--soft-border);
    background-color: var(--screen-bg); border-radius: 5px;
    padding: 8px 10px; font-size: 14px; outline: none;
}
.comment-input-area input:focus { border-color: var(--highlight-color); }
.comment-input-area button {
    flex-shrink: 0; border: none; background-color: var(--highlight-color);
    color: white; padding: 0 15px; border-radius: 5px; cursor: pointer;
}

/* !! 新增 !! 发布页样式 */
.create-moment-page {
    background-color: var(--page-bg);
}
.create-moment-page .page-header {
    justify-content: space-between;
}
.create-moment-page .header-button {
    background: none; border: none; font-size: 16px;
    color: var(--primary-text); cursor: pointer;
}
#publish-button {
    background-color: var(--highlight-color);
    color: white;
    padding: 6px 15px;
    border-radius: 5px;
    font-weight: 600;
}
#publish-button:disabled {
    background-color: var(--soft-border);
    color: var(--secondary-text);
}

.create-moment-form {
    padding: 15px;
    display: flex; flex-direction: column;
    gap: 15px;
    height: 100%;
}
#moment-text-input {
    width: 100%;
    min-height: 120px;
    border: none;
    background: none;
    resize: none;
    font-size: 16px;
    font-family: inherit;
    outline: none;
}

.attachment-section {
    border: 1px dashed var(--soft-border);
    border-radius: 8px;
    padding: 15px;
}
.attachment-section .modal-input {
    width: 100%;
    box-sizing: border-box;
}
.attachment-section .input-group {
    display: flex; flex-direction: column;
    gap: 10px;
}

.attachment-options {
    margin-top: auto; /* 将选项推到底部 */
    padding-top: 15px;
    border-top: 1px solid var(--soft-border);
    display: flex;
    justify-content: space-around;
}
.attachment-options .icon-button {
    font-size: 24px;
    color: var(--secondary-text);
}
.attachment-options .icon-button.active {
    color: var(--highlight-color);
}