* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #eef0f3;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 16px 12px 40px;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* 用户栏 */
.user-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    background: white;
    padding: 8px 16px;
    border-radius: 40px;
    flex-wrap: wrap;
}
#userInfo {
    font-size: 14px;
    font-weight: bold;
    margin-right: auto;
}
.user-bar button,
.user-bar .login-btn {
    background: #2c5a6e;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.user-bar button:hover,
.user-bar .login-btn:hover {
    background: #1e3f4f;
}
.user-bar #adminBtn {
    background: #9b59b6;
}
.user-bar #adminBtn:hover {
    background: #7d3c98;
}
.user-bar #logoutBtn {
    background: #7f8c8d;
}
.user-bar #logoutBtn:hover {
    background: #5d6d7e;
}

/* 朋友圈卡片 */
.post-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.1s ease;
    cursor: pointer;
}
.screenshot-area {
    padding: 20px 20px 16px;
}
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(145deg, #c0dbea, #9ab3c5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.3rem;
    color: #2c3e2f;
    flex-shrink: 0;
}
.info {
    flex: 1;
}
.name {
    font-weight: 630;
    font-size: 1rem;
    color: #1f2e3a;
    margin-bottom: 4px;
}
.time {
    font-size: 0.7rem;
    color: #9aaebf;
}
.post-text {
    font-size: 0.95rem;
    line-height: 1.45;
    color: #1f2f3a;
    margin-bottom: 14px;
    word-break: break-word;
    white-space: pre-wrap;
}
.images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.images-grid.single-col {
    grid-template-columns: 1fr;
}
.images-grid.two-cols {
    grid-template-columns: repeat(2, 1fr);
}
.grid-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 16px;
    background-color: #f0f2f5;
    cursor: pointer;
}
.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.external-link {
    background-color: #f5f7fa;
    border-radius: 14px;
    padding: 10px 14px;
    margin: 8px 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0.5px solid #e9edf2;
}
.link-icon {
    font-size: 1.25rem;
}
.link-url {
    font-size: 0.75rem;
    color: #3b7cbf;
    word-break: break-all;
    text-decoration: none;
}
.link-url:hover {
    text-decoration: underline;
}
.link-label {
    font-size: 0.7rem;
    color: #8f9eae;
    margin-bottom: 2px;
}

/* 操作按钮组 */
.post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 14px;
    border-top: 1px solid #eff3f6;
    background: #fefefe;
}
.like-btn,
.comment-btn,
.share-link-btn,
.save-img-btn,
.delete-post-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #5b6e8c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.like-btn:hover,
.comment-btn:hover,
.share-link-btn:hover,
.save-img-btn:hover {
    background: #f0f2f6;
}
.like-btn:active,
.comment-btn:active,
.share-link-btn:active,
.save-img-btn:active {
    transform: scale(0.96);
}
.delete-post-btn {
    color: #e74c3c;
    margin-left: auto;
}
.delete-post-btn:hover {
    background: #fee;
}

/* 评论输入区（顶层） */
.comment-input-area {
    padding: 6px 20px 16px;
    display: flex;
    gap: 8px;
    background: #fff;
}
.comment-input-area input {
    flex: 1;
    padding: 8px 14px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
    transition: 0.2s;
}
.comment-input-area input:focus {
    outline: none;
    border-color: #2c5a6e;
    box-shadow: 0 0 0 2px rgba(44,90,110,0.1);
}
.comment-input-area button {
    background: #2c5a6e;
    border: none;
    padding: 0 16px;
    border-radius: 30px;
    color: white;
    font-weight: 500;
    cursor: pointer;
}

/* 查看全部按钮 */
.view-all-btn {
    background: transparent;
    border: 1px solid #cddfe7;
    border-radius: 60px;
    padding: 12px;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 500;
    color: #2b6a7a;
    margin-top: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    text-align: center;
}
.view-all-btn:hover {
    background-color: #fff;
    border-color: #a0c0cf;
}

footer {
    text-align: center;
    font-size: 0.7rem;
    color: #bbccdd;
    margin-top: 32px;
}

/* 模态框通用 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}
.modal.show {
    display: flex;
}
.modal-content {
    background: white;
    padding: 24px;
    border-radius: 28px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.2s ease;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.modal-content h3 {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 20px;
    color: #1f2e3a;
}
.modal-content input,
.modal-content textarea {
    width: 100%;
    margin: 10px 0;
    padding: 12px 16px;
    border-radius: 44px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 1rem;
    transition: 0.2s;
}
.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #2c5a6e;
    background: white;
    box-shadow: 0 0 0 3px rgba(44,90,110,0.1);
}
.modal-content button {
    width: 100%;
    padding: 12px;
    background-color: #2c5a6e;
    color: white;
    border: none;
    border-radius: 44px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 16px;
    cursor: pointer;
    transition: 0.2s;
}
.modal-content button:hover {
    background-color: #1e3f4f;
}
.close-modal {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 32px;
    font-weight: 300;
    color: #94a3b8;
    cursor: pointer;
    transition: 0.2s;
}
.close-modal:hover {
    color: #1e293b;
}

/* 图片预览模态框 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.image-modal.show {
    display: flex;
}
.modal-img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 12px;
}
.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

/* 详情页评论区域 */
.comments-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.comment-item {
    margin-bottom: 16px;
    transition: background 0.2s;
}
.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.comment-author .comment-time {
    font-weight: normal;
    font-size: 0.7rem;
    color: #9aaebf;
    margin-left: 8px;
}
.comment-content {
    font-size: 0.9rem;
    color: #1f2f3a;
    margin: 6px 0 8px 0;
    line-height: 1.4;
    word-break: break-word;
}
.comment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 6px;
}
.comment-actions button {
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #5b6e8c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: 0.2s;
}
.comment-actions button:hover {
    background: #f0f2f5;
}
.comment-actions .like-comment-btn {
    color: #e74c3c;
}
.comment-actions .like-comment-btn:hover {
    background: #fee;
}
.comment-actions .reply-comment-btn {
    color: #2c5a6e;
}
.comment-actions .delete-comment-btn {
    color: #e74c3c;
}
.comment-actions .pin-comment-btn {
    color: #f39c12;
}
.comment-actions .pin-comment-btn:hover {
    background: #fef5e7;
}
.pinned-badge {
    display: inline-block;
    background: #fef5e7;
    color: #e67e22;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
}
.reply-input-area {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}
.reply-input-area input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
}
.reply-input-area button {
    background: #2c5a6e;
    color: white;
    border: none;
    padding: 0 16px;
    border-radius: 30px;
    cursor: pointer;
}

/* 查看回复的展开/收起按钮 */
.see-more-btn,
.see-less-btn {
    color: #2c5a6e;
    font-size: 0.75rem;
    cursor: pointer;
    margin-top: 8px;
    display: inline-block;
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 20px;
}
.see-more-btn:hover,
.see-less-btn:hover {
    background: #f0f2f5;
}

/* 所有回复（第二级）统一缩进 24px，避免深层叠加 */
.comment-item.reply-item {
    margin-left: 0px !important;
}
.comment-children .reply-item {
    margin-left: 0px !important;
}
/* 移除多层嵌套可能产生的多余左边框 */
.comment-item .comment-children .comment-item {
    border-left: none !important;
}

/* 手机端适配 */
@media (max-width: 550px) {
    .post-actions {
        gap: 6px;
    }
    .like-btn, .comment-btn, .share-link-btn, .save-img-btn, .delete-post-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    .user-bar {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .user-bar button,
    .user-bar .login-btn {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
    .modal-content {
        width: 92%;
        padding: 20px;
    }
    .modal-content h3 {
        font-size: 1.4rem;
    }
    .comment-item.reply-item {
        margin-left: 0px !important;
    }
    .comment-children .reply-item {
        margin-left: 0px !important;
    }
}

