/* 用户页面 - 朋友圈风格统一设计 */
.user-page-content {
    background-color: var(--background-color);
    min-height: calc(100vh - 44px);
    padding-bottom: env(safe-area-inset-bottom);
}

/* 用户头部卡片 */
.user-profile-card {
    margin-bottom: 8px;
    overflow: hidden;
}

.user-profile-background {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    background-size: cover;
    background-position: center;
    position: relative;
}

/* 用户资料区域 */
.user-profile-header {
    padding: 12px 16px 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.user-avatar-wrap {
    flex-shrink: 0;
}

.user-avatar-wrap .avatar {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

/* 统计和操作按钮同一排 */
.user-stats-actions-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 16px;
}

.user-stats-actions-row .user-stats-row {
    flex: 1;
    display: flex;
    padding: 0;
}

.user-stats-actions-row .user-stat-item {
    flex: 1;
    text-align: center;
}

.user-stats-actions-row .user-action-btns {
    flex-shrink: 0;
    gap: 8px;
    padding: 0;
}

.user-stats-actions-row .user-action-btn {
    white-space: nowrap;
    min-width: 80px;
}

.post-header-avatar.avatar {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.user-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.user-label {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-nickname {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-bio-label {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-bio-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 2px;
}

.user-bio-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
    flex: 1;
    word-break: break-all;
}

.user-bio-empty {
    color: var(--text-secondary);
    font-style: italic;
}

.user-vip-badge {
    display: inline-block;
    font-size: 9px;
    padding: 1px 4px;
    background: linear-gradient(135deg, var(--accent-color), #ffcc00);
    color: var(--text-color);
    border-radius: 3px;
    font-weight: 500;
}

/* 用户在线状态徽章 */
.user-online-badge {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--success-color);
    border-radius: 50%;
    margin-left: 3px;
    vertical-align: middle;
    flex-shrink: 0;
    box-shadow: 0 0 2px rgba(52, 199, 89, 0.5);
}

.user-online-badge.offline {
    background: var(--text-secondary);
    box-shadow: none;
}

/* 帖子列表中的在线状态徽章 */
.post-header-username .online-badge,
.post-header-username .user-online-badge {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--success-color);
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
    flex-shrink: 0;
    box-shadow: 0 0 2px rgba(52, 199, 89, 0.5);
}

.post-header-username .online-badge.offline,
.post-header-username .user-online-badge.offline {
    background: #d9d9d9;
    box-shadow: none;
}

.user-meta {
    font-size: 11px;
    color: #999;
}

/* 用户统计 */
.user-stats-row {
    display: flex;
    padding: 10px 0;
}

.user-stat-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    display: block;
}

.user-stat-item:not(:last-child) {
    border-right: none;
}

.user-stat-num {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 1px;
}

.user-stat-label {
    font-size: 10px;
    color: #999;
}

/* 操作按钮 */
.user-action-btns {
    display: flex;
    gap: 8px;
    padding: 10px 16px 10px;
}

.user-action-btn {
    flex: 1;
    padding: 7px 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.user-action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    border: none;
}

.user-action-btn.primary:active {
    opacity: 0.85;
}

.user-action-btn.secondary {
    background: var(--card-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.user-action-btn.secondary:active {
    background: rgba(0, 122, 255, 0.1);
}

.user-action-btn.followed {
    background: var(--card-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* 内容标签切换 */
.content-tab-nav {
    display: flex;
    background: var(--card-color);
    margin-bottom: 1px;
}

.content-tab-link {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    font-size: 15px;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    transition: color 0.2s;
}

.content-tab-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

.content-tab-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 3px;
}

/* 加载动画 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    background: var(--card-color);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    background: var(--card-color);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 响应式 */
@media (max-width: 320px) {
    .user-profile-header {
        padding: 16px 12px 14px;
    }
    
    .user-avatar {
        width: 52px;
        height: 52px;
    }
    
    .user-nickname {
        font-size: 15px;
        max-width: 130px;
    }
    
    .user-action-btns {
        padding: 0 12px 12px;
        gap: 8px;
    }
    
    .user-action-btn {
        padding: 8px 0;
        font-size: 13px;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .user-page-content {
        background-color: var(--background-color);
    }
    .user-profile-card,
    .post-card {
        background-color: var(--card-color);
    }
    .user-nickname,
    .user-stat-num {
        color: var(--text-color);
    }
    .user-bio-text {
        color: var(--text-secondary);
    }
    
    .user-bio-empty {
        color: var(--text-secondary);
    }
    .user-meta {
        color: var(--text-secondary);
    }
    .user-stats-row,
    .user-action-btns,
    .content-tab-nav,
    .post-footer {
        border-top-color: var(--border-color);
    }
    .user-stat-item {
        border-right-color: var(--border-color);
    }
    .user-action-btn.secondary {
        background: var(--card-color);
        color: var(--primary-color);
        border-color: var(--border-color);
    }
    .user-action-btn.followed {
        background: var(--card-color);
        color: var(--text-secondary);
        border-color: var(--border-color);
    }
    .post-header-username {
        color: var(--primary-color);
    }
    .post-body {
        color: var(--text-color);
    }
    .post-img {
        background-color: var(--border-color);
    }
    .post-footer {
        border-top-color: var(--border-color);
    }
    .content-tab-link {
        color: var(--text-secondary);
    }
    .content-tab-link.active {
        color: var(--primary-color);
    }
    .content-tab-link.active::after {
        background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    }
    .empty-state {
        background-color: var(--card-color);
    }
    .empty-title {
        color: var(--text-color);
    }
    .empty-desc {
        color: #888;
    }
    
    /* 回复卡片的引用样式 */
    .post-card div[style*="background: #f8f8f8"] {
        background-color: #333 !important;
    }
}