/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #FAF7F2;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(255, 240, 220, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(210, 235, 230, 0.3) 0%, transparent 60%);
    color: #2E3A3C;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ========== 公共卡片样式 ========== */
.user-card {
    background: rgba(255, 245, 235, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 24px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 12px -6px rgba(100, 80, 70, 0.1);
    transition: transform 0.2s, background 0.2s;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
}

.user-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 245, 235, 0.95);
}

/* 卡片头部：头像 + 昵称 + 称号 */
.user-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(180, 150, 130, 0.3);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #9BB0A0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    border: 2px solid rgba(155, 176, 160, 0.3);
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar i {
    font-size: 1.2rem;
}

.user-info {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.user-nickname {
    font-weight: 600;
    font-size: 1rem;
    color: #2E3A3C;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
}

.user-nickname:hover {
    color: #C97C5D;
}

.user-title {
    font-size: 0.7rem;
    color: #C97C5D;
    background: rgba(201, 124, 93, 0.1);
    padding: 2px 8px;
    border-radius: 30px;
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 卡片中间内容区域（帖子正文、统计、操作） */
.user-card-content {
    margin: 0 0 8px;
    color: #3f5248;
    line-height: 1.5;
    font-size: 0.9rem;
    word-wrap: break-word;
}

.post-content {
    margin-bottom: 10px;
    color: #3f332b;
    line-height: 1.6;
    word-break: break-word;
    padding: 0 2px;
}

.post-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    color: #7b6553;
    font-size: 0.85rem;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px dashed #dac2ab;
}

.like-btn, .reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 225, 210, 0.7);
    border: 1px solid #edd2bc;
    border-radius: 40px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    color: #5f4b3a;
}

.like-btn:hover, .reply-btn:hover {
    background: #ffe7d6;
    color: #b35c3b;
}

.like-btn.liked {
    color: #b35c3b;
    background: #ffefe2;
    border-color: #e3b38c;
}

.time-stamp {
    background: rgba(240, 225, 210, 0.5);
    border-radius: 40px;
    padding: 4px 12px;
    font-size: 0.8rem;
    color: #6f5b4b;
}

/* 卡片底部按钮区（关注/私信） */
.user-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px dashed rgba(180, 150, 130, 0.3);
}

.follow-btn, .message-btn {
    background: #9BB0A0;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.follow-btn i, .message-btn i {
    font-size: 0.8rem;
}

.follow-btn:hover, .message-btn:hover {
    background: #C97C5D;
}

.follow-btn.following {
    background: #d9c7b5;
    color: #5f4b3a;
}

/* 网格布局 */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

/* 移动端优化 */
@media (max-width: 600px) {
    .user-card {
        padding: 12px;
        border-radius: 20px;
    }
    .user-avatar {
        width: 36px;
        height: 36px;
    }
    .user-nickname {
        font-size: 0.95rem;
    }
    .post-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    .like-btn, .reply-btn {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
    .time-stamp {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    .user-card-footer {
        justify-content: space-around;
    }
    .follow-btn, .message-btn {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
}

/* ===== 发布模态框（全局） ===== */
.post-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.post-modal.show {
    display: flex;
}
.post-modal-content {
    background: rgba(255, 245, 235, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 48px;
    padding: 30px 30px 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 30px 50px -20px rgba(100, 70, 50, 0.3);
    position: relative;
}
.post-modal-content .close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2.2rem;
    color: #b58f6e;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
    opacity: 0.7;
}
.post-modal-content .close-modal:hover {
    opacity: 1;
    color: #8b5e42;
}
.post-modal-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: #9BB0A0;
    margin-bottom: 20px;
    padding-right: 40px;
    font-weight: 400;
}

/* 模态框内的表单项直接复用现有 .form-group 样式（已在 friends.html 中定义） */
/* 但确保按钮在模态框内也好看 */
.post-modal-content .form-actions {
    justify-content: flex-end;
    margin-top: 10px;
}
.post-modal-content .submit-btn {
    width: auto;
    min-width: 160px;
}

/* 移动端适配 */
@media (max-width: 700px) {
    .post-modal-content {
        padding: 20px 20px 30px;
        border-radius: 36px;
    }
    .post-modal-content h2 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    .post-modal-content .close-modal {
        top: 15px;
        right: 18px;
        font-size: 2rem;
    }
}