/* 朋友圈系统 - 高仿微信朋友圈样式 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Source Han Sans CN", sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    background: #ffffff;
    line-height: 1.5;
}

a { color: #576b95; text-decoration: none; }
a:active { opacity: .6; }

img { display: block; max-width: 100%; }

/* ============ 顶部封面（仿微信朋友圈封面） ============ */
.moments-header {
    position: relative;
    height: 280px;
    background: linear-gradient(135deg, #4a4a4a, #1a1a1a);
    overflow: hidden;
}
.cover-bg {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23333'/%3E%3Cstop offset='1' stop-color='%23000'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='800' height='400' fill='url(%23g)'/%3E%3C/svg%3E") center/cover;
    opacity: .8;
}
.cover-info {
    position: absolute;
    right: 16px;
    bottom: -28px;
    text-align: right;
    color: #fff;
    z-index: 2;
}
.me-avatar {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    margin-left: auto;
    background: #ddd;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-name {
    margin-top: 8px;
    font-size: 17px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.cover-login {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,.3);
    color: #fff;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 13px;
}

/* ============ 顶栏 ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 12px;
    background: #f7f7f7;
    border-bottom: 1px solid #e5e5e5;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; gap: 4px; }
.icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #333;
    font-size: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
}
.icon-btn:hover, .icon-btn:active { background: #e5e5e5; }
.icon-btn.back { font-size: 24px; }

/* ============ 朋友圈列表 ============ */
.moments-list {
    background: #fff;
    padding: 0 14px;
    margin-top: 28px;
}

.moment-item {
    display: flex;
    gap: 10px;
    padding: 14px 0 8px;
    border-bottom: 1px solid #f0f0f0;
}
.moment-item:last-child { border-bottom: none; }

.moment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #ddd;
}
.moment-avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-default {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #07c160;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
}
.avatar-default.small { font-size: 14px; }
.avatar-default.big { width: 80px; height: 80px; font-size: 32px; border-radius: 50%; }
.avatar-default.xsmall { width: 30px; height: 30px; font-size: 12px; border-radius: 50%; }

.moment-body { flex: 1; min-width: 0; }
.moment-author { color: #576b95; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.moment-content {
    color: #1a1a1a;
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.moment-images { margin-top: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.moment-images.single { grid-template-columns: 1fr; max-width: 70%; }
.moment-images.single .img-cell { aspect-ratio: auto; max-height: 280px; }
.img-cell {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 2px;
}
.img-cell img { width: 100%; height: 100%; object-fit: cover; }

.moment-meta {
    margin-top: 6px;
    color: #b8b8b8;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.moment-meta .time { color: #999; }
.moment-meta .share-link { color: #576b95; }
.moment-meta .views { color: #bbb; }
.moment-meta .views.views-tag {
    background: #f0f5ff;
    color: #576b95;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* ============ 访问统计卡片（公开访客数） ============ */
.views-card {
    margin: 12px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f7f9fc 0%, #eef2f8 100%);
    border: 1px solid #e4e9f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    position: relative;
}
.views-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: #07c160;
}
.views-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #07c160;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(7,193,96,.3);
}
.views-info { flex-shrink: 0; }
.views-num {
    font-size: 22px;
    font-weight: 700;
    color: #07c160;
    line-height: 1.1;
}
.views-num #viewsNum {
    display: inline-block;
    transition: transform .3s ease;
}
.views-num.bump #viewsNum {
    transform: scale(1.25);
}
.views-label {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}
.views-tip {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    text-align: right;
    padding-left: 10px;
}
.views-card.empty .views-icon { background: #bbb; box-shadow: none; }
.views-card.empty .views-num { color: #999; }
.views-card.empty::before { background: #bbb; }

/* ============ 互动栏 ============ */
.moment-actions {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #576b95;
    font-size: 13px;
}
.like-btn, .comment-toggle, .share-btn {
    background: transparent;
    border: none;
    color: #576b95;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
}
.like-btn .ico { font-size: 16px; }
.like-btn.liked { color: #fa5151; }
.like-btn:disabled, .comment-toggle:disabled { color: #bbb; cursor: not-allowed; }
.share-btn { color: #576b95; }

/* ============ 评论区 ============ */
.comment-box {
    margin-top: 6px;
    background: #f7f7f7;
    border-radius: 4px;
    padding: 8px 10px;
}
.comment-list { font-size: 13px; line-height: 1.7; }
.comment-item { word-break: break-word; }
.c-name { color: #576b95; font-weight: 500; }
.c-text { color: #333; }
.comment-form {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.comment-form input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    background: #fff;
}
.comment-form input:focus { outline: none; border-color: #07c160; }
.comment-form button {
    background: #07c160;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}
.comment-tip { color: #999; font-size: 12px; padding: 4px 0; }

/* ============ 浮动按钮 ============ */
.fab {
    position: fixed;
    right: 18px;
    bottom: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #07c160;
    color: #fff;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(7,193,96,.4);
    z-index: 50;
}
.fab:active { transform: scale(.94); }

/* ============ 空状态 ============ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}
.empty-icon { font-size: 50px; margin-bottom: 12px; }
.empty-state p { margin-bottom: 14px; }

/* ============ 分页 ============ */
.pager {
    text-align: center;
    padding: 16px 0 30px;
    color: #576b95;
}
.pager a, .pager-cur {
    display: inline-block;
    padding: 6px 14px;
    margin: 0 4px;
    border-radius: 4px;
}
.pager a { background: #f0f0f0; color: #576b95; }
.pager-cur { color: #999; }

/* ============ 表单与按钮 ============ */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all .15s;
}
.btn-primary { background: #07c160; color: #fff; }
.btn-primary:hover { background: #06ad56; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-warn { background: #ff976a; color: #fff; }
.btn-danger { background: #fa5151; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}
.form-group input[type=text],
.form-group input[type=password],
.form-group input[type=email],
.form-group input[type=number],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #07c160;
}
.form-group textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.tip { color: #999; font-size: 12px; margin-top: 4px; }

/* ============ 提示框 ============ */
.alert {
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
}
.alert-err { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.alert-ok  { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }

/* ============ 登录/注册/找回 ============ */
.auth-body {
    background: #ededed;
    min-height: 100vh;
    padding: 40px 16px;
}
.auth-wrap { max-width: 380px; margin: 0 auto; }
.auth-logo {
    text-align: center;
    font-size: 26px;
    font-weight: 600;
    color: #07c160;
    margin-bottom: 22px;
    letter-spacing: 2px;
}
.auth-card {
    background: #fff;
    border-radius: 10px;
    padding: 26px 22px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.auth-card h2 {
    font-size: 19px;
    margin-bottom: 18px;
    text-align: center;
    color: #333;
}
.auth-card .btn { width: 100%; margin-top: 6px; }
.auth-foot {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: #888;
}

/* ============ 发表页 ============ */
.post-wrap { padding: 16px; }
.post-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #576b95;
    font-weight: 500;
}
.post-avatar { width: 38px; height: 38px; border-radius: 4px; object-fit: cover; }

/* ============ 详情页 ============ */
.moment-item.detail {
    padding: 16px 14px;
    margin-top: 0;
}

/* ============ 个人中心 ============ */
.profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 16px;
    background: #fff;
}
.profile-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    overflow: hidden; background: #ddd;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; }
.profile-name { font-size: 17px; font-weight: 600; }
.profile-sub { color: #888; font-size: 13px; margin-top: 2px; }
.profile-stats {
    display: flex;
    background: #fff;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.profile-stats .stat {
    flex: 1;
    text-align: center;
}
.profile-stats .n { display: block; font-size: 18px; font-weight: 600; color: #07c160; }
.profile-stats .l { display: block; font-size: 12px; color: #999; margin-top: 2px; }
.profile-actions {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 8px solid #ededed;
    flex-wrap: wrap;
}
.profile-actions .btn { flex: 1; min-width: 90px; }

/* ============ 我的列表 ============ */
.my-item {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
.my-item .moment-body { margin-left: 0; }
.my-item-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px dashed #f0f0f0;
}
.my-item-actions form { display: inline; margin: 0; }
.my-item-actions .btn-danger { margin-left: auto; }

/* ============ 徽标 ============ */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.5;
}
.badge-wait { background: #fff7e6; color: #d46b08; }
.badge-ok { background: #f6ffed; color: #389e0d; }
.badge-reject { background: #fff1f0; color: #cf1322; }

/* ============ 图片查看器 ============ */
.img-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}
.img-viewer.active { display: flex; }
.img-viewer img { max-width: 95%; max-height: 90%; }

/* ============ 分享卡片 ============ */
.share-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    background: #fafafa;
}
.share-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.share-avatar { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; }
.share-card-name { font-weight: 600; font-size: 14px; color: #576b95; }
.share-card-time { font-size: 11px; color: #999; margin-top: 2px; }
.share-card-content { font-size: 14px; line-height: 1.6; color: #333; word-break: break-word; white-space: pre-wrap; }
.share-card-img { margin-top: 8px; }
.share-card-img img { width: 100%; border-radius: 4px; }

/* ============ 微信风格分享卡片模态框 ============ */
.share-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.share-modal.active { display: flex; }
.share-modal-box {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    padding: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,.2);
    animation: shareModalIn .22s ease;
}
@keyframes shareModalIn {
    from { transform: translateY(20px) scale(.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.share-modal-title {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    color: #333;
}
/* 微信卡片预览（高仿微信分享链接卡片） */
.wx-card {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 10px;
}
.wx-card-thumb {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}
.wx-card-thumb-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}
.wx-card-body { flex: 1; min-width: 0; }
.wx-card-title {
    font-size: 15px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.wx-card-desc {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wx-card-source {
    font-size: 11px;
    color: #b0b0b0;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.wx-card-source-icon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: #07c160;
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.share-modal-tip {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin: 14px 0 10px;
    line-height: 1.6;
}
.share-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}
.share-modal-actions .btn { flex: 1; }
.share-modal-close {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
}
.share-modal-close:active { background: #eee; }
/* 微信内引导浮层 */
.wx-guide {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    font-size: 12px;
    color: #8d6e00;
    line-height: 1.6;
}
.wx-guide.show { display: block; }
.wx-guide b { color: #e65100; }

/* ============ 表单下拉 ============ */
.form-select {
    -webkit-appearance: none;
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23999'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 10px center;
    padding-right: 30px !important;
}

/* ============ 移动端响应 ============ */
@media (max-width: 414px) {
    .auth-card { padding: 22px 16px; }
    .moment-images { gap: 3px; }
    .fab { right: 14px; bottom: 22px; }
}
