/* ========================================
   峰仔博客 - 朋友圈样式 (搜索框、回复缩进等)
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f0f0; color: #333; -webkit-font-smoothing: antialiased;
    max-width: 640px; margin: 0 auto; overflow-x: hidden;
}
a { color: #576b95; text-decoration: none; }

/* ---------- 顶部封面 ---------- */
.cover-section { background: #fff; }
.cover-bg {
    width: 100%; height: 260px; background-size: cover; background-position: center;
    background-color: #2c3e50; position: relative;
}
.cover-icons {
    position: absolute; top: 10px; right: 15px; z-index: 10; display: flex; gap: 12px; font-size: 18px;
}
.cover-icons a { color: rgba(255,255,255,0.8); text-decoration: none; transition: color 0.2s; }
.cover-icons a:hover { color: #fff; }
.cover-info {
    display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-end;
    padding: 0 16px 16px; margin-top: -46px; position: relative; z-index: 2;
}
.cover-avatar {
    order: 2; width: 68px !important; height: 68px !important; min-width: 68px; min-height: 68px;
    max-width: 68px; max-height: 68px; border-radius: 10px; border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12); object-fit: cover; background: #eee; flex-shrink: 0;
}
.cover-name {
    order: 1; font-size: 19px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 12px; margin-bottom: 0; align-self: flex-start;
}
.cover-bio {
    order: 3; width: 100%; text-align: right; margin-top: 4px; font-size: 13px; color: #999999;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.category-nav { display: none; }

/* ---------- 搜索框 ---------- */
.search-container {
    display: none; position: absolute; top: 10px; right: 15px; z-index: 11;
    background: rgba(255,255,255,0.9); border-radius: 20px; padding: 2px 4px 2px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.search-container.show { display: flex; align-items: center; }
.search-input { border: none; background: transparent; padding: 6px 8px; font-size: 14px; outline: none; width: 150px; }
.search-submit { background: #07c160; color: #fff; border: none; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }

/* ---------- 动态卡片 ---------- */
.moments-list { padding: 0; }
.moment-card { background: #fff; margin-bottom: 8px; padding: 16px; overflow: hidden; }
.moment-header { display: flex; align-items: flex-start; margin-bottom: 12px; }
.moment-avatar {
    width: 40px !important; height: 40px !important; min-width: 40px; min-height: 40px;
    max-width: 40px; max-height: 40px; border-radius: 6px; object-fit: cover; margin-right: 10px; flex-shrink: 0; background: #eee;
}
.moment-user-info { flex: 1; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; }
.moment-nickname { font-size: 15px; font-weight: 600; color: #576b95; display: inline-block; margin-right: 8px; }
.moment-time-header { font-size: 12px; color: #b0b0b0; display: inline-block; margin-top: 0; }
.moment-body { margin-bottom: 8px; overflow: hidden; }
.moment-text { font-size: 15px; line-height: 1.7; color: #333; word-break: break-all; }
.moment-text.collapsed { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.toggle-text { color: #576b95; font-size: 14px; cursor: pointer; display: inline-block; margin-bottom: 8px; }

/* 段落缩进与间距控制 */
.moment-text p {
    text-indent: 2em;
    margin: 0 !important;
    padding: 0 !important;
    line-height: inherit;
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
}

/* 清除不需要缩进的元素 */
.moment-text h1, .moment-text h2, .moment-text h3,
.moment-text h4, .moment-text h5, .moment-text h6,
.moment-text ul, .moment-text ol, .moment-text li,
.moment-text blockquote, .moment-text pre, .moment-text code,
.moment-text hr, .moment-text table {
    text-indent: 0;
}

/* 图片网格 */
.moment-images { display: grid; gap: 4px; margin: 8px 0; border-radius: 6px; overflow: hidden; max-width: 100%; }
.grid-1 { grid-template-columns: 1fr; max-width: 240px; }
.grid-2 { grid-template-columns: 1fr 1fr; max-width: 320px; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; max-width: 100%; }
.grid-4 { grid-template-columns: 1fr 1fr; max-width: 100%; }
.grid-5, .grid-6 { grid-template-columns: 1fr 1fr 1fr; max-width: 100%; }
.grid-7, .grid-8, .grid-9 { grid-template-columns: 1fr 1fr 1fr; max-width: 100%; }
.grid-item { cursor: pointer; background: #f5f5f5; position: relative; padding-bottom: 100%; overflow: hidden; }
.grid-1 .grid-item { padding-bottom: 56%; }
.grid-item img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* 图片剩余数量遮罩 */
.grid-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    pointer-events: none;
}

/* ---------- 底部操作栏 ---------- */
.moment-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid #f0f0f0; margin-top: 8px; }
.moment-footer-left { display: flex; align-items: baseline; gap: 10px; font-size: 12px; color: #b0b0b0; }
.moment-date { flex-shrink: 0; }
.moment-actions { display: flex; gap: 16px; }
.action-btn { font-size: 14px; color: #999; cursor: pointer; user-select: none; }
.action-btn.liked { color: #e74c3c; }

/* 点赞列表 */
.likes-bar { margin-top: 8px; padding: 6px 8px; background: #f8f8f8; border-radius: 4px; font-size: 13px; color: #576b95; }

/* 评论区 */
.comments-box { margin-top: 10px; padding-top: 8px; border-top: 1px solid #f0f0f0; }
.comments-list { margin-bottom: 8px; }
.comment-item { font-size: 13px; padding: 4px 0; line-height: 1.6; }
.comment-user { color: #576b95; font-weight: 500; margin-right: 6px; }
.comment-content { color: #333; }

/* 回复评论缩进 */
.comment-reply { margin-left: 24px; padding-left: 12px; border-left: 2px solid #e0e0e0; }
.reply-tag { color: #576b95; font-size: 12px; margin-right: 4px; }

/* 评论操作按钮 */
.comment-actions { display: inline-flex; gap: 8px; margin-left: 10px; font-size: 12px; }
.reply-btn, .delete-btn { color: #888; cursor: pointer; text-decoration: none; }
.reply-btn:hover { color: #576b95; }
.delete-btn:hover { color: #e74c3c; }

/* 评论输入框 */
.comment-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.comment-input { flex: 1; padding: 6px 12px; border: 1px solid #e8e8e8; border-radius: 20px; font-size: 13px; background: #f5f5f5; outline: none; }
.comment-input:focus { border-color: #07c160; background: #fff; }
.comment-send-btn { padding: 6px 16px; background: #07c160; color: #fff; border: none; border-radius: 20px; font-size: 13px; cursor: pointer; flex-shrink: 0; }
.comment-send-btn:hover { background: #06ad56; }
.comment-login-tip { font-size: 12px; color: #999; padding: 8px 0; }
.comment-login-tip a { color: #576b95; cursor: pointer; }

.reply-indicator { font-size: 12px; color: #888; margin-bottom: 4px; }
.reply-indicator a { margin-left: 6px; color: #e74c3c; cursor: pointer; }

/* 空状态、加载更多、页脚 */
.empty-state { text-align: center; padding: 60px 20px; background: #fff; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.load-more { text-align: center; padding: 20px; }
.load-more-btn { padding: 10px 30px; background: #fff; border: 1px solid #e0e0e0; border-radius: 24px; font-size: 14px; color: #666; cursor: pointer; }
.site-footer { text-align: center; padding: 24px; font-size: 13px; color: #bbb; line-height: 1.8; }
.site-footer a { color: #bbb; text-decoration: none; }
.site-footer a:hover { color: #666; }

/* 图片预览 */
.image-preview-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; }
.image-preview-modal.show { display: flex; }
.image-preview-modal img { max-width: 95%; max-height: 90vh; object-fit: contain; }
.preview-close { position: absolute; top: 20px; right: 24px; color: #fff; font-size: 28px; cursor: pointer; z-index: 10000; }

/* 模态框 */
.modal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); justify-content: center; align-items: center; }
.modal-content { background: #fff; border-radius: 16px; padding: 30px 24px; width: 360px; max-width: 90%; box-shadow: 0 20px 40px rgba(0,0,0,0.2); position: relative; animation: modalIn 0.3s ease; }
@keyframes modalIn { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close-btn { position: absolute; top: 12px; right: 16px; font-size: 24px; color: #aaa; cursor: pointer; }
.close-btn:hover { color: #333; }
.tab-header { display: flex; margin-bottom: 20px; border-bottom: 2px solid #f0f0f0; }
.tablinks { flex: 1; padding: 12px 0; border: none; background: none; font-size: 16px; font-weight: 600; color: #888; cursor: pointer; transition: all 0.2s; }
.tablinks.active { color: #07c160; border-bottom: 2px solid #07c160; margin-bottom: -2px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.auth-form input { width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 15px; outline: none; transition: border 0.2s; }
.auth-form input:focus { border-color: #07c160; }
.auth-btn { width: 100%; padding: 12px; background: #07c160; color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.auth-btn:hover { background: #06ad56; }
.auth-error { color: #e74c3c; font-size: 13px; margin-top: 8px; display: none; }
.auth-success { color: #2e7d32; font-size: 13px; margin-top: 8px; display: none; }

@media (max-width: 640px) {
    .cover-bg { height: 220px; }
    .cover-avatar { width: 60px !important; height: 60px !important; min-width: 60px; min-height: 60px; max-width: 60px; max-height: 60px; }
    .cover-name { font-size: 17px; margin-right: 8px; }
    .moment-footer-left { gap: 6px; }
    .cover-icons { top: 8px; right: 10px; font-size: 16px; }
}
img { max-width: 100%; height: auto; }