@charset "utf-8";

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Segoe UI, Arial, Roboto, "PingFang SC", "miui", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
    background-color: #fff;
    color: #000;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: #576b95;
}

img {
    border: 0;
    vertical-align: middle;
}

ul, li {
    list-style: none;
}

/* Layout Container */
.moment-body {
    max-width: 640px; /* Limit width on desktop */
    margin: 0 auto;
    background-color: #fff;
    border-left: 1px solid #f2f2f2;
    border-right: 1px solid #f2f2f2;
    min-height: 100vh;
}

/* PC Optimization */
@media screen and (min-width: 1024px) {
    html {
        overflow-y: scroll;
    }
    
    body {
        background-color: #f5f5f5;
        min-height: 100vh;
    }

    .app-wrapper {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        max-width: 1200px;
        margin: 20px auto;
        gap: 20px;
        padding: 0 20px;
    }

    /* Left Sidebar */
    .app-sidebar-left {
        width: 200px;
        position: sticky;
        top: 20px;
        background: #fff;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 0 20px rgba(0,0,0,0.05);
        display: block !important;
    }

    .app-logo {
        font-size: 20px;
        font-weight: bold;
        margin-bottom: 20px;
        text-align: center;
    }

    .app-logo a {
        color: #333;
    }

    .moment-nav-menu ul {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .moment-nav-item a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 15px;
        color: #666;
        border-radius: 6px;
        transition: all 0.2s;
    }

    .moment-nav-item.active a,
    .moment-nav-item a:hover {
        background-color: #f2f2f2;
        color: #576b95;
    }
    
    .moment-nav-item i {
        font-size: 18px;
    }
    
    .sub-nav {
        display: none;
    }

    /* Center Content */
    .app-content {
        flex: 1;
        max-width: 640px; /* Keep the feed width constrained */
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 0 20px rgba(0,0,0,0.05);
        overflow: hidden;
    }
    
    .moment-body {
        max-width: none;
        box-shadow: none;
        border: none;
        margin: 0;
        background: transparent;
        min-height: auto;
    }

    .moment-header-cover img {
        border-radius: 8px 8px 0 0;
    }

    /* Right Sidebar */
    .app-sidebar-right {
        width: 260px;
        position: sticky;
        top: 20px;
        display: block !important;
    }
    
    .moment-sidebar .widget {
        background: #fff;
        border-radius: 8px;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 0 20px rgba(0,0,0,0.05);
    }
    
    .moment-sidebar .widget h3 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 15px;
        color: #333;
        border-left: 4px solid #576b95;
        padding-left: 10px;
    }
    
    .moment-sidebar .widget ul li {
        margin-bottom: 10px;
        font-size: 14px;
    }
    
    .moment-sidebar .widget ul li a {
        color: #666;
    }
    
    .moment-sidebar .widget ul li a:hover {
        color: #576b95;
    }
}

/* Mobile Default Hidden Sidebars */
.app-sidebar-left,
.app-sidebar-right {
    display: none;
}


/* Header Section */
.moment-header {
    position: relative;
    margin-bottom: 30px;
    background-color: #fff;
}

.moment-header-cover {
    width: 100%;
    position: relative;
    margin-bottom: 20px; /* Space for the avatar sticking out */
    background-color: #333;
}

.moment-header-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80vh; /* Prevent extremely tall images */
    object-fit: cover;
}

.moment-header-inner {
    position: absolute;
    bottom: -20px;
    right: 20px;
    display: flex;
    align-items: center; /* Name aligned with center of avatar roughly? No, usually baseline or custom */
    gap: 20px;
}

.moment-header-name {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    margin-bottom: 10px; /* Adjust to align with avatar center/top */
}

.moment-header-avatar {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f2f2f2;
    border: 2px solid #fff; /* White border */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.moment-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moment-signature {
    text-align: right;
    padding: 0 20px;
    font-size: 14px;
    color: #888;
    margin-top: -10px; /* Pull up closer to avatar area */
    margin-bottom: 20px;
}

/* Main Feed */
.moment-main {
    padding: 0;
}

.moment-feed {
    padding-bottom: 40px;
}

.moment-item {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid #f7f7f7;
}

.moment-item:last-child {
    border-bottom: none;
}

/* Avatar Column */
.moment-item-avatar-col {
    width: 42px;
    flex-shrink: 0;
}

.moment-item-avatar {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background-color: #f2f2f2;
    overflow: hidden;
}

.moment-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Column */
.moment-item-body {
    flex: 1;
    min-width: 0; /* Fix flex text overflow */
}

.moment-item-author {
    font-size: 16px;
    font-weight: 600;
    color: #576b95;
    margin-bottom: 4px;
    line-height: 1.4;
    cursor: pointer;
}

.moment-item-content {
    font-size: 15px;
    color: #000;
    line-height: 1.5;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.moment-item-fulltext {
    color: #576b95;
    font-size: 15px;
    margin-top: 2px;
    display: inline-block;
    cursor: pointer;
}

/* Images Grid */
.moment-item-images {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    max-width: 300px;
}

.moment-item-images a {
    display: block;
    cursor: zoom-in;
}

.moment-item-images.single-image a {
    max-width: 180px;
    max-height: 180px;
}

.moment-item-images.single-image img {
    width: 100%;
    height: 100%;
    max-width: 180px;
    max-height: 180px;
    object-fit: cover;
}

.moment-item-images.multi-images a {
    width: 90px;
    height: 90px;
}

.moment-item-images.multi-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Footer: Time & Action */
.moment-item-footer {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 24px;
    position: relative;
}

.moment-item-time {
    font-size: 12px;
    color: #b2b2b2;
}

.moment-action-btn {
    width: 32px;
    height: 20px;
    background-color: #f7f7f7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #576b95;
    font-size: 16px;
    cursor: pointer;
}

/* Likes & Comments Bubble */
.moment-likes-comments {
    background-color: #f7f7f7;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
    position: relative;
}

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

/* Likes Row */
.moment-likes {
    padding: 6px 10px;
    color: #576b95;
    border-bottom: 1px solid #ececec;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.4;
}

.moment-likes i {
    font-size: 14px;
    color: #576b95;
}

/* Comments List */
.moment-comments {
    padding: 4px 10px 6px;
}

.moment-comment-item {
    padding: 1px 0;
    line-height: 1.45;
    color: #000;
}

.moment-comment-user {
    color: #576b95;
    font-weight: 500;
    cursor: pointer;
}

/* Pagination */
.moment-pagination {
    margin: 30px 0;
    text-align: center;
    padding: 20px;
    border-top: 1px solid #f2f2f2;
}

.moment-pagination a {
    color: #576b95;
    margin: 0 10px;
}

.moment-pagination span {
    color: #999;
    margin: 0 10px;
}

/* Footer */
.moment-footer {
    text-align: center;
    padding: 30px 0;
    color: #d5d5d5;
    font-size: 12px;
}

/* Detail Page Override */
.moment-detail {
    padding: 20px;
}

.moment-detail-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.moment-detail-info {
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}

.moment-detail-content {
    font-size: 17px;
    line-height: 1.7;
    color: #333;
}

.moment-detail-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 640px) {
    .moment-body {
        border: none;
    }
}
