/* Hublog Moments Template - 朋友圈风格 */
:root {
    --primary: #07c160;
    --primary-dark: #06ad56;
    --bg: #ededed;
    --card-bg: #fff;
    --text: #333;
    --text-secondary: #999;
    --border: #e5e5e5;
    --link: #576b95;
    --danger: #fa5151;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* 移动端优先 */
.app-container {
    max-width: 680px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--card-bg);
    position: relative;
}

@media (min-width: 681px) {
    .app-container {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

/* 顶部封面 - 微信朋友圈风格 */
.profile-header {
    position: relative;
    height: 320px;
    overflow: hidden;
    background: #9ca3af;
}

.profile-header .cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(to bottom, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0.02) 40%, rgba(0,0,0,0.35) 100%),
        linear-gradient(160deg, #f6d365 0%, #fda085 45%, #f5576c 100%);
    background-size: cover;
    background-position: center;
}

.profile-header .cover::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.profile-header .cover::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(0,0,0,0.35), transparent);
    pointer-events: none;
}

/* 悬浮导航栏（覆盖在封面上） */
.header-navbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    z-index: 10;
    color: #fff;
}

.header-navbar .title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 17px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.header-navbar .actions {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-left: auto;
}

.header-navbar .btn-icon {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    padding: 4px;
    line-height: 1;
}

.header-navbar .btn-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.profile-info {
    position: absolute;
    top: 266px;
    right: 16px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    z-index: 2;
}

.profile-info .nickname {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-info .avatar {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.95);
    background: var(--bg);
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

/* 导航栏 */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .title {
    font-size: 17px;
    font-weight: 600;
}

.navbar .actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}

/* 动态列表 */
.moments-list {
    position: relative;
    z-index: 1;
    padding-top: 46px;
    background: var(--card-bg);
}

.moment-item {
    display: flex;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.moment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
    cursor: pointer;
}

.moment-content {
    flex: 1;
    min-width: 0;
}

.moment-author {
    font-size: 15px;
    color: var(--link);
    font-weight: 600;
    margin-bottom: 4px;
    cursor: pointer;
}

.moment-text {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 8px;
    word-break: break-word;
}

/* 纯文字少文字：视觉上更舒展 */
.moment-item.text-only .moment-text {
    font-size: 16px;
    line-height: 1.7;
}

/* 有图片时，文字与图片间距更自然 */
.moment-item.has-images .moment-text,
.moment-item.mixed .moment-text {
    margin-bottom: 10px;
}

.moment-images {
    display: grid;
    gap: 2px;
    margin-bottom: 8px;
}

/* 图文 + 附件混合时，图片与附件之间留出清晰间隔 */
.moment-item.mixed .moment-images {
    margin-bottom: 10px;
}

.moment-images.img-1 { grid-template-columns: 1fr; max-width: 70%; }
.moment-images.img-2 { grid-template-columns: repeat(2, 1fr); max-width: 70%; }
.moment-images.img-3 { grid-template-columns: repeat(3, 1fr); }
.moment-images.img-4 { grid-template-columns: repeat(2, 1fr); max-width: 70%; }
.moment-images.img-5, .moment-images.img-6, .moment-images.img-7, .moment-images.img-8, .moment-images.img-9 {
    grid-template-columns: repeat(3, 1fr);
}

.moment-images img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    background: var(--bg);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.moment-images img:hover {
    opacity: 0.92;
    transform: scale(1.02);
}

.moment-images.img-1 img {
    aspect-ratio: 16/10;
    border-radius: 8px;
}

.moment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.moment-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 微信朋友圈风格删除按钮（小垃圾桶图标） */
.moment-delete-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #b2b2b2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.moment-delete-btn svg {
    width: 16px;
    height: 16px;
}

.moment-delete-btn:hover {
    color: #ff4d4f;
}

.moment-actions-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-like, .btn-comment {
    background: none;
    border: none;
    color: var(--link);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-like.liked { color: var(--danger); }

/* 点赞评论区 */
.moment-social {
    background: #f7f7f7;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    position: relative;
}

.moment-social::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #f7f7f7;
}

.likes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    color: var(--link);
    font-size: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 6px;
}

.likes-list:empty { display: none; border: none; margin: 0; padding: 0; }

.likes-list .like-name {
    cursor: pointer;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comment-item {
    font-size: 14px;
    line-height: 1.5;
}

.comment-item .comment-author {
    color: var(--link);
    cursor: pointer;
}

.comment-item .comment-reply {
    color: var(--text);
}

/* 发布框 */
.publish-modal, .modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.publish-modal.active, .modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    outline: none;
    resize: vertical;
    font-size: 15px;
    font-family: inherit;
}

.upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 12px;
}

.image-preview .preview-image {
    position: relative;
}

.image-preview img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg);
}

.image-preview .preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
}

.attachment-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.attachment-preview .attachment-item,
.moment-attachments .attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f7f7f7;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
}

.attachment-preview .attachment-item .attachment-name,
.moment-attachments .attachment-item .attachment-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-preview .attachment-item .attachment-size,
.moment-attachments .attachment-item .attachment-size {
    color: var(--text-secondary);
    font-size: 12px;
}

.attachment-preview .attachment-item .attachment-remove {
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.15);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
}

.moment-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.moment-attachments .attachment-item.blocked {
    color: var(--text-secondary);
    cursor: not-allowed;
}

.moment-attachments .attachment-item.blocked .attachment-status {
    color: #ff4d4f;
    font-size: 12px;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-default {
    background: #f2f2f2;
    color: var(--text);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 图片查看器 */
.image-viewer {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 300;
    align-items: center;
    justify-content: center;
}

.image-viewer.active { display: flex; }

.image-viewer img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
}

.image-viewer .close-viewer {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 32px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 301;
}

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    font-size: 40px;
    width: 50px;
    height: 80px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.2s;
    z-index: 301;
}

.viewer-nav:hover { background: rgba(255,255,255,0.3); }

.viewer-prev { left: 10px; }
.viewer-next { right: 10px; }

/* 登录注册模态框 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-tab {
    border-bottom: 2px solid transparent !important;
}

.auth-tab.active {
    border-bottom-color: var(--primary) !important;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    color: var(--text-secondary);
}

.form-input {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--primary);
}

.field-hint {
    font-size: 12px;
    min-height: 16px;
}

.field-hint.ok {
    color: #07c160;
}

.field-hint.error {
    color: #ff4d4f;
}

.word-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    margin-bottom: 8px;
}

.word-count.over-limit {
    color: #ff4d4f;
    font-weight: 600;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 用户主页 */
.user-header {
    padding: 20px 16px 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
}

.user-header .avatar-large {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
    margin-bottom: 12px;
}

.user-header .user-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-header .user-bio {
    font-size: 14px;
    opacity: 0.9;
}

.user-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.user-stats .stat {
    text-align: center;
}

.user-stats .stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.user-stats .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.toast.show { opacity: 1; }

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
    display: flex;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    cursor: pointer;
    border: none;
    background: none;
}

.nav-item.active { color: var(--primary); }

.nav-item .icon { display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.nav-item .icon svg { width: 22px; height: 22px; display: block; }

/* 未登录页脚 */
.site-footer {
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.8;
    background: var(--bg);
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

.footer-friend-links {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.footer-label { color: var(--text-secondary); margin-right: 4px; }

.footer-friend-links a {
    color: var(--primary);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.footer-friend-links a:hover { background: rgba(7, 193, 96, 0.08); }

.footer-dot {
    width: 3px;
    height: 3px;
    background: var(--border);
    border-radius: 50%;
    display: inline-block;
    margin: 0 4px;
    vertical-align: middle;
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.footer-separator { color: var(--border); }

.footer-meta a { color: var(--text-secondary); text-decoration: none; }
.footer-meta a:hover { text-decoration: underline; }

@media (max-width: 400px) {
    .footer-meta { flex-direction: column; gap: 2px; }
    .footer-separator { display: none; }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .icon { font-size: 64px; margin-bottom: 16px; }

/* 评论输入框 */
.comment-input-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    align-items: center;
    gap: 8px;
    z-index: 150;
}

.comment-input-bar.active { display: flex; }

/* 评论输入激活时隐藏底部导航，避免两层工具条堆叠 */
.app-container.comment-active .bottom-nav {
    display: none;
}

/* 预留输入框高度，防止最后一条动态被遮挡 */
.app-container.comment-active {
    padding-bottom: 60px;
}

.comment-input-bar input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

/* 评论图片上传按钮（复刻微信朋友圈） */
.btn-comment-image {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f2f2f2;
    color: #7f7f7f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
}

.btn-comment-image svg {
    width: 20px;
    height: 20px;
}

/* 评论图片预览（输入栏内） */
.comment-image-preview {
    position: relative;
    flex-shrink: 0;
}

.comment-image-preview-item {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    background: var(--bg);
}

.comment-image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-image-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
}

/* 评论列表中的图片展示：保持与文字行高接近的小缩略图 */
.comment-image {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    overflow: hidden;
    margin-left: 4px;
    vertical-align: middle;
    background: var(--bg);
}

.comment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* 通知角标 */
.notify-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ff3b30;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    display: none;
}

.notify-badge.active {
    display: block;
}

.btn-icon {
    position: relative;
}

/* 通知面板 */
.notification-modal-content {
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.notification-list {
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.notification-item:hover {
    background: var(--bg);
}

.notification-item.unread {
    background: rgba(7, 193, 96, 0.05);
}

.notification-item.unread .notification-dot {
    display: block;
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.notification-body {
    flex: 1;
    min-width: 0;
}

.notification-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    word-break: break-word;
}

.notification-text strong {
    color: var(--primary);
    font-weight: 500;
}

.notification-content {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 6px 10px;
    border-radius: 6px;
    word-break: break-word;
}

.notification-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    display: none;
    flex-shrink: 0;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.notification-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
}

.notification-actions button:hover {
    background: var(--border);
}

/* 动态时间链接 */
.moment-time {
    color: var(--text-secondary);
    text-decoration: none;
}
.moment-time:hover {
    text-decoration: underline;
}

/* 微信朋友圈风格操作菜单 */
.moment-actions {
    position: relative;
}

.btn-more {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    letter-spacing: 1px;
    padding: 2px 6px;
    cursor: pointer;
    line-height: 1;
}

.action-menu {
    display: none;
    position: fixed;
    z-index: 120;
    background: #4c4c4c;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: #fff;
}

.action-menu.active {
    display: flex;
    animation: menuIn 0.15s ease;
}

@keyframes menuIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.action-menu::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #4c4c4c;
}

.action-menu button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    color: #fff;
    padding: 10px 18px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.15);
}

.action-menu button:last-child {
    border-right: none;
}

.action-menu button svg {
    width: 18px;
    height: 18px;
}

.action-menu button.liked svg {
    fill: #fa5151;
    stroke: #fa5151;
}

/* 长动态折叠 */
.btn-expand {
    background: none;
    border: none;
    color: var(--link);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-top: 4px;
}

/* 评论项可点击回复 */
.comment-item {
    cursor: pointer;
}

/* 表情选择器 */
.btn-emoji,
.btn-emoji-toggle {
    background: #f2f2f2;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-emoji {
    padding: 8px 14px;
}

.btn-emoji-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.emoji-panel {
    display: none;
    position: fixed;
    z-index: 250;
    background: #fff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 680px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    max-height: 42vh;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

.emoji-panel.active {
    display: block;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    justify-items: center;
}

.emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
    user-select: none;
}

.emoji-item:hover {
    background: #f2f2f2;
}

/* 顶部刷新按钮红点提示 */
.refresh-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ff3b30;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    display: none;
    font-weight: 600;
}

.refresh-badge.active { display: block; }

/* 管理员标识 */
.admin-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 6px;
    background: rgba(7, 193, 96, 0.12);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
    line-height: 1.4;
}

/* 置顶标识 */
.pinned-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 6px;
    background: #fff1f0;
    color: #ff4d4f;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
    line-height: 1.4;
}

.moment-pinned {
    background: linear-gradient(to right, rgba(255, 241, 240, 0.5), transparent 40%);
}

/* 全站置顶动态专区（>=2 条时 1:1 复刻微信朋友圈置顶网格样式） */
.pinned-section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.pinned-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pinned-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.pinned-title svg {
    width: 18px;
    height: 18px;
    color: #ff4d4f;
}

.pinned-view-all {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

.pinned-view-all:hover {
    text-decoration: underline;
}

.pinned-carousel {
    position: relative;
    overflow: hidden;
}

.pinned-track {
    display: flex;
    transition: transform 0.3s ease;
}

.pinned-page {
    width: 100%;
    flex-shrink: 0;
    padding: 0 2px;
    box-sizing: border-box;
}

.pinned-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px;
}

.pinned-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    border-radius: 8px;
    background: #f7f7f7;
    text-decoration: none;
    color: var(--text);
    border: 1px solid #f0f0f0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.pinned-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.pinned-text {
    font-size: 14px;
    line-height: 1.45;
    height: calc(14px * 1.45 * 3);
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.pinned-label {
    margin-top: auto;
    padding-top: 8px;
    font-size: 11px;
    color: #ff4d4f;
    font-weight: 600;
}

.pinned-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pinned-nav:hover {
    background: rgba(0,0,0,0.6);
}

.pinned-prev { left: 4px; }
.pinned-next { right: 4px; }

.pinned-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.pinned-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
}

.pinned-dot.active {
    background: #ff4d4f;
}

/* 文本中的链接与话题 */
.moment-text a.text-link,
.moment-text a.topic-link {
    color: var(--primary);
    text-decoration: none;
}

.moment-text a.text-link:hover,
.moment-text a.topic-link:hover {
    text-decoration: underline;
}

/* 外站跳转提示页 */
.go-warning {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    min-height: 60vh;
}

.go-warning .go-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.go-warning h2 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text);
}

.go-warning p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.go-warning .go-url {
    max-width: 100%;
    padding: 12px 16px;
    background: #f7f7f7;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    word-break: break-all;
    margin-bottom: 24px;
}

.go-warning .go-actions {
    display: flex;
    gap: 12px;
}

/* 响应式适配 */
@media (max-width: 480px) {
    .profile-header { height: 280px; }
    .profile-info { top: 232px; right: 12px; gap: 8px; }
    .profile-info .avatar { width: 62px; height: 62px; border-radius: 6px; border-width: 2px; }
    .profile-info .nickname { font-size: 15px; margin-bottom: 10px; max-width: 160px; }
    .moments-list { padding-top: 34px; }
    .moment-images.img-1 { max-width: 80%; }
}
