/* 基础样式 */
.moments-container {
    max-width: 680px;
    margin: 0 auto;
    background: #f5f5f5;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: #333;
    line-height: 1.6;
    padding-bottom: 40px;
}

/* 封面区域 - 微信风格 */
.moments-cover {
    position: relative;
    height: 320px;
    overflow: hidden;
    background: #2c3e50;
}

.cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}

.cover-user {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 20px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    color: #fff;
}

.user-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.stat-num {
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

.user-info {
    flex: 1;
    text-align: right;
    margin-right: 16px;
    margin-bottom: 10px;
}

.user-info h2 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.user-info p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.user-avatar {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    object-fit: cover;
    background: #07c160;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
}

.user-avatar.guest {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 登录栏 */
.moments-login-bar {
    background: #fff;
    margin: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.moments-login-bar p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.btn-login {
    padding: 8px 20px;
    background: #07c160;
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-login:hover {
    background: #06ad56;
}

/* 发布器 - 微信风格 */
.moments-publisher {
    padding: 12px;
}

.publisher-box {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.publisher-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.publisher-avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.publisher-title {
    color: #999;
    font-size: 14px;
}

#moment-content {
    width: 100%;
    min-height: 80px;
    border: none;
    resize: none;
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    font-family: inherit;
    padding: 0;
}

#moment-content::placeholder {
    color: #bbb;
}

.media-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 12px 0;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    background: #f0f0f0;
}

.preview-item img,
.preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item.video-item {
    grid-column: span 2;
    aspect-ratio: 16/9;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-cover-setting {
    background: #f8f8f8;
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 13px;
}

.video-cover-setting label {
    display: block;
    margin-bottom: 8px;
    color: #666;
}

.cover-preview {
    width: 120px;
    height: 68px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-select-cover {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.publisher-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.publisher-tools {
    display: flex;
    gap: 8px;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: #576b95;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #f0f2f5;
}

.tool-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.publisher-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.location-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f0f2f5;
    color: #576b95;
    border-radius: 12px;
    font-size: 12px;
}

.location-tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    font-size: 14px;
}

.btn-publish {
    padding: 8px 24px;
    background: #07c160;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-publish:hover {
    background: #06ad56;
}

.btn-publish:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 筛选 */
.moments-filter {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
}

.filter-btn {
    padding: 6px 16px;
    background: #fff;
    border: none;
    border-radius: 16px;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.filter-btn.active {
    background: #07c160;
    color: #fff;
}

.filter-btn:hover:not(.active) {
    background: #e8e8e8;
}

/* 动态列表 */
.moments-feed {
    padding: 0 12px;
}

.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #07c160;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 动态卡片 - 微信风格 */
.moment-card {
    background: #fff;
    margin-bottom: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.moment-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.moment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.moment-meta {
    flex: 1;
    min-width: 0;
}

.moment-author {
    font-size: 16px;
    font-weight: 600;
    color: #576b95;
    margin-bottom: 2px;
}

.moment-time {
    font-size: 12px;
    color: #999;
}

.moment-top {
    padding: 2px 8px;
    background: #fff3e0;
    color: #ff9800;
    font-size: 11px;
    border-radius: 8px;
    margin-left: 8px;
    flex-shrink: 0;
}

.moment-delete {
    color: #999;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.moment-card:hover .moment-delete {
    opacity: 1;
}

.moment-delete:hover {
    color: #ff5252;
}

.moment-content {
    margin-bottom: 12px;
    padding-left: 54px;
}

.moment-text {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.moment-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #576b95;
    margin-bottom: 8px;
}

/* 媒体网格 */
.moment-media {
    margin-bottom: 12px;
    padding-left: 54px;
}

.media-grid {
    display: grid;
    gap: 4px;
    max-width: 300px;
}

.media-grid-1 { grid-template-columns: 1fr; max-width: 180px; }
.media-grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 240px; }
.media-grid-3 { grid-template-columns: repeat(3, 1fr); }
.media-grid-4 { grid-template-columns: repeat(2, 1fr); max-width: 240px; }
.media-grid-5,
.media-grid-6,
.media-grid-7,
.media-grid-8,
.media-grid-9 { grid-template-columns: repeat(3, 1fr); }

.media-item {
    position: relative;
    aspect-ratio: 1;
    background: #f0f0f0;
    overflow: hidden;
    cursor: pointer;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item.video {
    grid-column: span 2;
    aspect-ratio: 16/9;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

/* 互动区 - 仅评论 */
.moment-interaction {
    padding-left: 54px;
}

.interaction-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.interaction-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    background: transparent;
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.interaction-btn:hover {
    color: #333;
}

.interaction-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* 评论区域 */
.comments-box {
    background: #f7f7f7;
    border-radius: 4px;
    padding: 10px 12px;
}

.comment-item {
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.5;
    border-bottom: 1px solid #eee;
}

.comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comment-item:first-child {
    padding-top: 0;
}

.comment-author {
    color: #576b95;
    font-weight: 500;
}

.comment-content {
    color: #333;
}

.comment-reply-btn {
    color: #999;
    font-size: 12px;
    margin-left: 6px;
    cursor: pointer;
}

.comment-reply-btn:hover {
    color: #576b95;
}

.comment-replies {
    margin-top: 6px;
    padding-left: 10px;
    border-left: 2px solid #ddd;
}

.reply-item {
    padding: 4px 0;
    font-size: 13px;
}

/* 加载更多 */
.load-more-wrap {
    padding: 20px;
    text-align: center;
}

.btn-load-more {
    padding: 10px 32px;
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-more:hover {
    border-color: #07c160;
    color: #07c160;
}

/* 媒体模态框 */
.media-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
}

.modal-body img,
.modal-body video {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

/* 评论抽屉 */
.comment-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
}

.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.drawer-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.drawer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.btn-close-drawer {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.guest-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.guest-form input {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.guest-form input:focus {
    border-color: #07c160;
}

#comment-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    resize: none;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 12px;
    outline: none;
}

#comment-input:focus {
    border-color: #07c160;
}

.btn-send {
    width: 100%;
    padding: 12px;
    background: #07c160;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.btn-send:hover {
    background: #06ad56;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* 响应式 */
@media (max-width: 480px) {
    .moments-container {
        max-width: 100%;
    }
    
    .cover-user {
        padding: 0 16px;
    }
    
    .user-avatar {
        width: 64px;
        height: 64px;
    }
    
    .moment-content,
    .moment-media,
    .moment-interaction {
        padding-left: 0;
    }
    
    .media-grid {
        max-width: 100%;
    }
}